MK25-RAMBo10a_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 7f 51 jmp 0xa2fe ; 0xa2fe <__dtors_end> 4: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 8: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> c: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 10: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 14: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 18: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 1c: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 20: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 24: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 28: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 2c: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 30: 0c 94 62 85 jmp 0x10ac4 ; 0x10ac4 <__vector_12> 34: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 38: 0d 94 5a 10 jmp 0x220b4 ; 0x220b4 <__vector_14> 3c: 0d 94 9e 0d jmp 0x21b3c ; 0x21b3c <__vector_15> 40: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 44: 0d 94 c1 18 jmp 0x23182 ; 0x23182 <__vector_17> 48: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 4c: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 50: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 54: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 58: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 5c: 0c 94 3e 77 jmp 0xee7c ; 0xee7c <__vector_23> 60: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 64: 0c 94 bd 63 jmp 0xc77a ; 0xc77a <__vector_25> 68: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 6c: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 70: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 74: 0c 94 3d ba jmp 0x1747a ; 0x1747a <__vector_29> 78: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 7c: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 80: 0d 94 a4 12 jmp 0x22548 ; 0x22548 <__vector_32> 84: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 88: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 8c: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 90: 0c 94 79 63 jmp 0xc6f2 ; 0xc6f2 <__vector_36> 94: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 98: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 9c: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> a0: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> a4: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> a8: 0d 94 c3 0a jmp 0x21586 ; 0x21586 <__vector_42> ac: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> b0: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> b4: 0d 94 b8 0a jmp 0x21570 ; 0x21570 <__vector_45> b8: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> bc: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> c0: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> c4: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> c8: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> cc: 0d 94 78 0a jmp 0x214f0 ; 0x214f0 <__vector_51> d0: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> d4: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> d8: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> dc: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> e0: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__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 20 43 6f 6e 74 69 6e 75 65 3f level. Continue? ... 000036b5 : 36b5: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 36c5: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 36d5: 6c 65 76 65 6c 2e 20 50 6c 65 61 73 65 20 72 65 level. Please re 36e5: 2d 73 6c 69 63 65 20 74 68 65 20 6d 6f 64 65 6c -slice the model 36f5: 20 61 67 61 69 6e 2e 20 50 72 69 6e 74 20 63 61 again. Print ca 3705: 6e 63 65 6c 6c 65 64 2e 00 ncelled.. 0000370e : 370e: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 371e: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 372e: 77 61 72 65 2e 20 43 6f 6e 74 69 6e 75 65 3f 00 ware. Continue?. 0000373e : 373e: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 374e: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 375e: 77 61 72 65 2e 20 50 6c 65 61 73 65 20 75 70 64 ware. Please upd 376e: 61 74 65 20 74 68 65 20 66 69 72 6d 77 61 72 65 ate the firmware 377e: 2e 20 50 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 . Print cancelle 378e: 64 2e 00 d.. 00003791 : 3791: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 37a1: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 37b1: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 20 43 6f printer type. Co 37c1: 6e 74 69 6e 75 65 3f 00 ntinue?. 000037c9 : 37c9: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 37d9: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 37e9: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 20 50 6c printer type. Pl 37f9: 65 61 73 65 20 72 65 2d 73 6c 69 63 65 20 74 68 ease re-slice th 3809: 65 20 6d 6f 64 65 6c 20 61 67 61 69 6e 2e 20 50 e model again. P 3819: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 00003829 : 3829: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob 3839: 20 74 6f 20 70 72 65 68 65 61 74 20 6e 6f 7a 7a to preheat nozz 3849: 6c 65 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 2e le and continue. ... 0000385a : 385a: ff ff 50 6c 65 61 73 65 20 70 72 65 73 73 20 74 ..Please press t 386a: 68 65 20 6b 6e 6f 62 20 74 6f 20 75 6e 6c 6f 61 he knob to unloa 387a: 64 20 66 69 6c 61 6d 65 6e 74 00 d filament. 00003885 : 3885: ff ff 61 6e 64 20 70 72 65 73 73 20 74 68 65 20 ..and press the 3895: 6b 6e 6f 62 00 knob. 0000389a : 389a: ff ff 49 6e 73 65 72 74 20 66 69 6c 61 6d 65 6e ..Insert filamen 38aa: 74 00 t. 000038ac : 38ac: ff ff 43 6f 6c 6f 72 20 6e 6f 74 20 63 6f 72 72 ..Color not corr 38bc: 65 63 74 00 ect. 000038c0 : 38c0: ff ff 46 69 6c 61 6d 65 6e 74 20 6e 6f 74 20 6c ..Filament not l 38d0: 6f 61 64 65 64 00 oaded. 000038d6 : 38d6: ff ff 43 68 61 6e 67 65 64 20 63 6f 72 72 65 63 ..Changed correc 38e6: 74 6c 79 00 tly. 000038ea : 38ea: ff ff 4c 6f 61 64 69 6e 67 20 63 6f 6c 6f 72 00 ..Loading color. 000038fa : 38fa: ff ff 43 68 61 6e 67 65 20 73 75 63 63 65 73 73 ..Change success 390a: 21 00 !. 0000390c : 390c: ff ff 50 6c 65 61 73 65 20 6f 70 65 6e 20 69 64 ..Please open id 391c: 6c 65 72 20 61 6e 64 20 72 65 6d 6f 76 65 20 66 ler and remove f 392c: 69 6c 61 6d 65 6e 74 20 6d 61 6e 75 61 6c 6c 79 ilament manually 393c: 2e 00 .. 0000393e : 393e: ff ff 57 61 73 20 66 69 6c 61 6d 65 6e 74 20 75 ..Was filament u 394e: 6e 6c 6f 61 64 20 73 75 63 63 65 73 73 66 75 6c nload successful 395e: 3f 00 ?. 00003960 : 3960: ff ff 50 6c 65 61 73 65 20 75 70 67 72 61 64 65 ..Please upgrade 3970: 2e 00 .. 00003972 : 3972: ff ff 4e 65 77 20 66 69 72 6d 77 61 72 65 20 76 ..New firmware v 3982: 65 72 73 69 6f 6e 20 61 76 61 69 6c 61 62 6c 65 ersion available 3992: 3a 00 :. 00003994 : 3994: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 50 49 ..Waiting for PI 39a4: 4e 44 41 20 70 72 6f 62 65 20 63 6f 6f 6c 69 6e NDA probe coolin 39b4: 67 00 g. 000039b6 : 39b6: ff ff 50 6c 65 61 73 65 20 77 61 69 74 00 ..Please wait. 000039c4 : 39c4: ff ff 4e 6f 20 6d 6f 76 65 2e 00 ..No move.. 000039cf : 39cf: ff ff 57 61 69 74 20 66 6f 72 20 75 73 65 72 2e ..Wait for user. 39df: 2e 2e 00 ... 000039e2 : 39e2: ff ff 53 74 61 62 6c 65 20 61 6d 62 69 65 6e 74 ..Stable ambient 39f2: 20 74 65 6d 70 65 72 61 74 75 72 65 20 32 31 2d temperature 21- 3a02: 32 36 43 20 69 73 20 6e 65 65 64 65 64 20 61 20 26C is needed a 3a12: 72 69 67 69 64 20 73 74 61 6e 64 20 69 73 20 72 rigid stand is r 3a22: 65 71 75 69 72 65 64 2e 00 equired.. 00003a2b : 3a2b: ff ff 50 6c 65 61 73 65 20 72 75 6e 20 58 59 5a ..Please run XYZ 3a3b: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 69 72 calibration fir 3a4b: 73 74 2e 00 st.. 00003a4f : 3a4f: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 3a5f: 7a 7a 6c 65 21 00 zzle!. 00003a65 : 3a65: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 00003a6e : 3a6e: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 3a7e: 6d 20 6d 69 6e 00 m min. 00003a84 : 3a84: ff ff 4c 65 66 74 00 ..Left. 00003a8b : 3a8b: ff ff 52 69 67 68 74 00 ..Right. 00003a93 : 3a93: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 00003aa3 : 3aa3: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 00003ab1 : 3ab1: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 00003abf : 3abf: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 3acf: 66 73 65 74 00 fset. 00003ad4 : 3ad4: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 00003ae2 : 3ae2: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 00003af3 : 3af3: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 00003b04 : 3b04: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 00003b15 : 3b15: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 00003b26 : 3b26: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 3b36: 65 3a 00 e:. 00003b39 : 3b39: ff ff 41 72 65 20 6c 65 66 74 20 61 6e 64 20 72 ..Are left and r 3b49: 69 67 68 74 20 5a 2d 63 61 72 72 69 61 67 65 73 ight Z-carriages 3b59: 20 61 6c 6c 20 75 70 3f 00 all up?. 00003b62 : 3b62: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 58 59 ..Calibrating XY 3b72: 5a 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e Z. Rotate the kn 3b82: 6f 62 20 74 6f 20 6d 6f 76 65 20 74 68 65 20 5a ob to move the Z 3b92: 20 63 61 72 72 69 61 67 65 20 75 70 20 74 6f 20 carriage up to 3ba2: 74 68 65 20 65 6e 64 20 73 74 6f 70 70 65 72 73 the end stoppers 3bb2: 2e 20 43 6c 69 63 6b 20 77 68 65 6e 20 64 6f 6e . Click when don 3bc2: 65 2e 00 e.. 00003bc5 : 3bc5: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 2e ..Calibrating Z. 3bd5: 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f 62 Rotate the knob 3be5: 20 74 6f 20 6d 6f 76 65 20 74 68 65 20 5a 20 63 to move the Z c 3bf5: 61 72 72 69 61 67 65 20 75 70 20 74 6f 20 74 68 arriage up to th 3c05: 65 20 65 6e 64 20 73 74 6f 70 70 65 72 73 2e 20 e end stoppers. 3c15: 43 6c 69 63 6b 20 77 68 65 6e 20 64 6f 6e 65 2e Click when done. ... 00003c26 : 3c26: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 3c36: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 00003c41 : 3c41: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 3c51: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 3c61: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 3c71: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 3c81: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 3c91: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 00003c9d : 3c9d: ff ff 45 78 74 72 75 64 65 72 00 ..Extruder. 00003ca8 : 3ca8: ff ff 4d 6f 76 65 20 5a 00 ..Move Z. 00003cb1 : 3cb1: ff ff 4d 6f 76 65 20 59 00 ..Move Y. 00003cba : 3cba: ff ff 4d 6f 76 65 20 58 00 ..Move X. 00003cc3 : 3cc3: ff ff 53 68 65 65 74 20 25 2e 37 73 0a 5a 20 6f ..Sheet %.7s.Z o 3cd3: 66 66 73 65 74 3a 20 25 2b 31 2e 33 66 6d 6d 0a ffset: %+1.3fmm. 3ce3: 25 63 43 6f 6e 74 69 6e 75 65 0a 25 63 52 65 73 %cContinue.%cRes 3cf3: 65 74 00 et. 00003cf6 : 3cf6: ff ff 50 6c 65 61 73 65 20 6c 6f 61 64 20 66 69 ..Please load fi 3d06: 6c 61 6d 65 6e 74 20 66 69 72 73 74 2e 00 lament first.. 00003d14 : 3d14: ff ff 53 65 6c 65 63 74 20 66 69 6c 61 6d 65 6e ..Select filamen 3d24: 74 3a 00 t:. 00003d27 : 3d27: ff ff 3e 43 61 6e 63 65 6c 00 ..>Cancel. 00003d31 : 3d31: ff ff 52 75 6e 6e 69 6e 67 20 57 69 7a 61 72 64 ..Running Wizard 3d41: 20 77 69 6c 6c 20 64 65 6c 65 74 65 20 63 75 72 will delete cur 3d51: 72 65 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e rent calibration 3d61: 20 72 65 73 75 6c 74 73 20 61 6e 64 20 73 74 61 results and sta 3d71: 72 74 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 rt from the begi 3d81: 6e 6e 69 6e 67 2e 20 43 6f 6e 74 69 6e 75 65 3f nning. Continue? ... 00003d92 : 3d92: ff ff 50 72 65 68 65 61 74 69 6e 67 20 6e 6f 7a ..Preheating noz 3da2: 7a 6c 65 2e 20 50 6c 65 61 73 65 20 77 61 69 74 zle. Please wait 3db2: 2e 00 .. 00003db4 : 3db4: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 3dc4: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 3dd4: 65 20 65 78 74 72 75 64 65 72 2c 20 74 68 65 6e e extruder, then 3de4: 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 press the knob 3df4: 74 6f 20 6c 6f 61 64 20 69 74 2e 00 to load it.. 00003e00 : 3e00: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 3e10: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 3e20: 65 20 66 69 72 73 74 20 74 75 62 65 20 6f 66 20 e first tube of 3e30: 74 68 65 20 4d 4d 55 2c 20 74 68 65 6e 20 70 72 the MMU, then pr 3e40: 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 74 6f 20 ess the knob to 3e50: 6c 6f 61 64 20 69 74 2e 00 load it.. 00003e59 : 3e59: ff ff 54 68 65 20 70 72 69 6e 74 65 72 20 77 69 ..The printer wi 3e69: 6c 6c 20 73 74 61 72 74 20 70 72 69 6e 74 69 6e ll start printin 3e79: 67 20 61 20 7a 69 67 2d 7a 61 67 20 6c 69 6e 65 g a zig-zag line 3e89: 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f . Rotate the kno 3e99: 62 20 75 6e 74 69 6c 20 79 6f 75 20 72 65 61 63 b until you reac 3ea9: 68 20 74 68 65 20 6f 70 74 69 6d 61 6c 20 68 65 h the optimal he 3eb9: 69 67 68 74 2e 20 43 68 65 63 6b 20 74 68 65 20 ight. Check the 3ec9: 70 69 63 74 75 72 65 73 20 69 6e 20 74 68 65 20 pictures in the 3ed9: 68 61 6e 64 62 6f 6f 6b 20 28 43 61 6c 69 62 72 handbook (Calibr 3ee9: 61 74 69 6f 6e 20 63 68 61 70 74 65 72 29 2e 00 ation chapter).. 00003ef9 : 3ef9: ff ff 53 65 6c 65 63 74 20 74 65 6d 70 65 72 61 ..Select tempera 3f09: 74 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 ture which match 3f19: 65 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c es your material 3f29: 2e 00 .. 00003f2b : 3f2b: ff ff 53 65 6c 65 63 74 20 61 20 66 69 6c 61 6d ..Select a filam 3f3b: 65 6e 74 20 66 6f 72 20 74 68 65 20 46 69 72 73 ent for the Firs 3f4b: 74 20 4c 61 79 65 72 20 43 61 6c 69 62 72 61 74 t Layer Calibrat 3f5b: 69 6f 6e 20 61 6e 64 20 73 65 6c 65 63 74 20 69 ion and select i 3f6b: 74 20 69 6e 20 74 68 65 20 6f 6e 2d 73 63 72 65 t in the on-scre 3f7b: 65 6e 20 6d 65 6e 75 2e 00 en menu.. 00003f84 : 3f84: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 63 61 6c ..Now I will cal 3f94: 69 62 72 61 74 65 20 64 69 73 74 61 6e 63 65 20 ibrate distance 3fa4: 62 65 74 77 65 65 6e 20 74 69 70 20 6f 66 20 74 between tip of t 3fb4: 68 65 20 6e 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 he nozzle and he 3fc4: 61 74 62 65 64 20 73 75 72 66 61 63 65 2e 00 atbed surface.. 00003fd3 : 3fd3: ff ff 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 ..Z calibration 3fe3: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 52 75 6e recommended. Run 3ff3: 20 69 74 20 6e 6f 77 3f 00 it now?. 00003ffc : 3ffc: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 400c: 73 74 65 65 6c 20 73 68 65 65 74 20 66 72 6f 6d steel sheet from 401c: 20 68 65 61 74 62 65 64 2e 00 heatbed.. 00004026 : 4026: ff ff 49 73 20 73 74 65 65 6c 20 73 68 65 65 74 ..Is steel sheet 4036: 20 6f 6e 20 68 65 61 74 62 65 64 3f 00 on heatbed?. 00004043 : 4043: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 6f ..Please check o 4053: 75 72 20 68 61 6e 64 62 6f 6f 6b 20 61 6e 64 20 ur handbook and 4063: 66 69 78 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e fix the problem. 4073: 20 54 68 65 6e 20 72 65 73 75 6d 65 20 74 68 65 Then resume the 4083: 20 57 69 7a 61 72 64 20 62 79 20 72 65 62 6f 6f Wizard by reboo 4093: 74 69 6e 67 20 74 68 65 20 70 72 69 6e 74 65 72 ting the printer 40a3: 2e 00 .. 000040a5 : 40a5: ff ff 41 6c 6c 20 69 73 20 64 6f 6e 65 2e 20 48 ..All is done. H 40b5: 61 70 70 79 20 70 72 69 6e 74 69 6e 67 21 00 appy printing!. 000040c4 : 40c4: ff ff 59 6f 75 20 63 61 6e 20 61 6c 77 61 79 73 ..You can always 40d4: 20 72 65 73 75 6d 65 20 74 68 65 20 57 69 7a 61 resume the Wiza 40e4: 72 64 20 66 72 6f 6d 20 43 61 6c 69 62 72 61 74 rd from Calibrat 40f4: 69 6f 6e 20 2d 3e 20 57 69 7a 61 72 64 2e 00 ion -> Wizard.. 00004103 : 4103: ff ff 49 66 20 79 6f 75 20 68 61 76 65 20 61 64 ..If you have ad 4113: 64 69 74 69 6f 6e 61 6c 20 73 74 65 65 6c 20 73 ditional steel s 4123: 68 65 65 74 73 2c 20 63 61 6c 69 62 72 61 74 65 heets, calibrate 4133: 20 74 68 65 69 72 20 70 72 65 73 65 74 73 20 69 their presets i 4143: 6e 20 53 65 74 74 69 6e 67 73 20 2d 20 48 57 20 n Settings - HW 4153: 53 65 74 75 70 20 2d 20 53 74 65 65 6c 20 73 68 Setup - Steel sh 4163: 65 65 74 73 2e 00 eets.. 00004169 : 4169: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 68 ..Please clean h 4179: 65 61 74 62 65 64 20 61 6e 64 20 74 68 65 6e 20 eatbed and then 4189: 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 2e 00 press the knob.. 00004199 : 4199: ff ff 44 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f ..Do you want to 41a9: 20 72 65 70 65 61 74 20 6c 61 73 74 20 73 74 65 repeat last ste 41b9: 70 20 74 6f 20 72 65 61 64 6a 75 73 74 20 64 69 p to readjust di 41c9: 73 74 61 6e 63 65 20 62 65 74 77 65 65 6e 20 6e stance between n 41d9: 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 61 74 62 65 ozzle and heatbe 41e9: 64 3f 00 d?. 000041ec : 41ec: ff ff 53 65 6c 65 63 74 20 6e 6f 7a 7a 6c 65 20 ..Select nozzle 41fc: 70 72 65 68 65 61 74 20 74 65 6d 70 65 72 61 74 preheat temperat 420c: 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 65 ure which matche 421c: 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c 2e s your material. ... 0000422d : 422d: ff ff 49 73 20 66 69 6c 61 6d 65 6e 74 20 6c 6f ..Is filament lo 423d: 61 64 65 64 3f 00 aded?. 00004243 : 4243: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 70 72 65 ..Now I will pre 4253: 68 65 61 74 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 heat nozzle for 4263: 50 4c 41 2e 00 PLA.. 00004268 : 4268: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 7a 20 63 ..I will run z c 4278: 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 2e 00 alibration now.. 00004288 : 4288: ff ff 4e 6f 77 20 72 65 6d 6f 76 65 20 74 68 65 ..Now remove the 4298: 20 74 65 73 74 20 70 72 69 6e 74 20 66 72 6f 6d test print from 42a8: 20 73 74 65 65 6c 20 73 68 65 65 74 2e 00 steel sheet.. 000042b6 : 42b6: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 42c6: 73 68 69 70 70 69 6e 67 20 68 65 6c 70 65 72 73 shipping helpers 42d6: 20 66 69 72 73 74 2e 00 first.. 000042de : 42de: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 78 79 7a ..I will run xyz 42ee: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 calibration now 42fe: 2e 20 49 74 20 77 69 6c 6c 20 74 61 6b 65 20 75 . It will take u 430e: 70 20 74 6f 20 32 34 20 6d 69 6e 73 2e 00 p to 24 mins.. 0000431c : 431c: ff ff 46 69 72 73 74 2c 20 49 20 77 69 6c 6c 20 ..First, I will 432c: 72 75 6e 20 74 68 65 20 73 65 6c 66 74 65 73 74 run the selftest 433c: 20 74 6f 20 63 68 65 63 6b 20 6d 6f 73 74 20 63 to check most c 434c: 6f 6d 6d 6f 6e 20 61 73 73 65 6d 62 6c 79 20 70 ommon assembly p 435c: 72 6f 62 6c 65 6d 73 2e 00 roblems.. 00004365 : 4365: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 4375: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 4385: 33 20 70 72 69 6e 74 65 72 2e 20 57 6f 75 6c 64 3 printer. Would 4395: 20 79 6f 75 20 6c 69 6b 65 20 6d 65 20 74 6f 20 you like me to 43a5: 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f 75 67 guide you throug 43b5: 68 20 74 68 65 20 73 65 74 75 70 20 70 72 6f 63 h the setup proc 43c5: 65 73 73 3f 00 ess?. 000043ca : 43ca: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 43da: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 43ea: 33 20 70 72 69 6e 74 65 72 2e 20 49 20 77 69 6c 3 printer. I wil 43fa: 6c 20 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f l guide you thro 440a: 75 67 68 20 61 20 73 68 6f 72 74 20 73 65 74 75 ugh a short setu 441a: 70 20 70 72 6f 63 65 73 73 2c 20 69 6e 20 77 68 p process, in wh 442a: 69 63 68 20 74 68 65 20 5a 2d 61 78 69 73 20 77 ich the Z-axis w 443a: 69 6c 6c 20 62 65 20 63 61 6c 69 62 72 61 74 65 ill be calibrate 444a: 64 2e 20 54 68 65 6e 2c 20 79 6f 75 20 77 69 6c d. Then, you wil 445a: 6c 20 62 65 20 72 65 61 64 79 20 74 6f 20 70 72 l be ready to pr 446a: 69 6e 74 2e 00 int.. 0000446f : 446f: ff ff 50 61 75 73 65 00 ..Pause. 00004477 : 4477: ff ff 46 53 20 41 63 74 69 6f 6e 00 ..FS Action. 00004483 : 4483: ff ff 43 6f 6e 74 2e 00 ..Cont.. 0000448b : 448b: ff ff 46 2e 20 6a 61 6d 20 64 65 74 65 63 74 00 ..F. jam detect. 0000449b : 449b: ff ff 46 2e 20 61 75 74 6f 6c 6f 61 64 00 ..F. autoload. 000044a9 : 44a9: ff ff 46 2e 20 72 75 6e 6f 75 74 00 ..F. runout. 000044b5 : 44b5: ff ff 43 75 74 74 65 72 00 ..Cutter. 000044be : 44be: ff ff 46 61 6e 20 73 70 65 65 64 00 ..Fan speed. 000044ca : 44ca: ff ff 42 65 64 00 ..Bed. 000044d0 : 44d0: ff ff 46 61 6e 73 20 63 68 65 63 6b 00 ..Fans check. 000044dd : 44dd: ff ff 4d 6f 64 65 6c 00 ..Model. 000044e5 : 44e5: ff ff 4e 6f 7a 7a 6c 65 00 ..Nozzle. 000044ee : 44ee: ff ff 50 6c 65 61 73 65 20 75 6e 6c 6f 61 64 20 ..Please unload 44fe: 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 66 69 72 the filament fir 450e: 73 74 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 st, then repeat 451e: 74 68 69 73 20 61 63 74 69 6f 6e 2e 00 this action.. 0000452b : 452b: ff ff 43 68 65 63 6b 73 00 ..Checks. 00004534 : 4534: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 00004540 : 4540: ff ff 41 6c 70 68 61 62 65 74 00 ..Alphabet. 0000454b : 454b: ff ff 53 6f 72 74 00 ..Sort. 00004552 : 4552: ff ff 54 69 6d 65 00 ..Time. 00004559 : 4559: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 00004562 : 4562: ff ff 53 44 20 63 61 72 64 00 ..SD card. 0000456c : 456c: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 457c: 65 00 e. 0000457e : 457e: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 00 ..Nozzle change. 0000458e : 458e: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 00004599 : 4599: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 000045a8 : 45a8: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 45b8: 72 73 00 rs. 000045bb : 45bb: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 000045c7 : 45c7: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 000045d5 : 45d5: ff ff 50 49 4e 44 41 20 63 61 6c 2e 00 ..PINDA cal.. 000045e2 : 45e2: ff ff 52 65 73 65 74 20 58 59 5a 20 63 61 6c 69 ..Reset XYZ cali 45f2: 62 72 2e 00 br.. 000045f6 : 45f6: ff ff 53 68 6f 77 20 65 6e 64 20 73 74 6f 70 73 ..Show end stops ... 00004607 : 4607: ff ff 50 49 44 20 63 61 6c 69 62 72 61 74 69 6f ..PID calibratio 4617: 6e 00 n. 00004619 : 4619: ff ff 42 65 64 20 6c 65 76 65 6c 20 63 6f 72 72 ..Bed level corr 4629: 65 63 74 00 ect. 0000462d : 462d: ff ff 4d 65 73 68 20 42 65 64 20 4c 65 76 65 6c ..Mesh Bed Level 463d: 69 6e 67 00 ing. 00004641 : 4641: ff ff 43 61 6c 69 62 72 61 74 65 20 5a 00 ..Calibrate Z. 0000464f : 464f: ff ff 43 61 6c 69 62 72 61 74 65 20 58 59 5a 00 ..Calibrate XYZ. 0000465f : 465f: ff ff 53 65 6c 66 74 65 73 74 00 ..Selftest. 0000466a : 466a: ff ff 57 69 7a 61 72 64 00 ..Wizard. 00004673 : 4673: ff ff 54 65 73 74 69 6e 67 20 66 69 6c 61 6d 65 ..Testing filame 4683: 6e 74 00 nt. 00004686 : 4686: ff ff 4c 6f 61 64 20 41 6c 6c 00 ..Load All. 00004691 : 4691: ff ff 50 6c 65 61 73 65 20 70 75 6c 6c 20 6f 75 ..Please pull ou 46a1: 74 20 66 69 6c 61 6d 65 6e 74 20 69 6d 6d 65 64 t filament immed 46b1: 69 61 74 65 6c 79 00 iately. 000046b8 : 46b8: ff ff 52 65 73 65 74 00 ..Reset. 000046c0 : 46c0: ff ff 52 65 6e 61 6d 65 00 ..Rename. 000046c9 : 46c9: ff ff 46 69 72 73 74 20 6c 61 79 65 72 20 63 61 ..First layer ca 46d9: 6c 2e 00 l.. 000046dc : 46dc: ff ff 53 65 6c 65 63 74 00 ..Select. 000046e5 : 46e5: ff ff 53 74 65 65 6c 20 73 68 65 65 74 73 00 ..Steel sheets. 000046f4 : 46f4: ff ff 53 75 70 70 6f 72 74 00 ..Support. 000046fe : 46fe: ff ff 46 61 69 6c 20 73 74 61 74 73 20 4d 4d 55 ..Fail stats MMU ... 0000470f : 470f: ff ff 46 61 69 6c 20 73 74 61 74 73 00 ..Fail stats. 0000471c : 471c: ff ff 53 74 61 74 69 73 74 69 63 73 00 ..Statistics. 00004729 : 4729: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 00 ..Calibration. 00004737 : 4737: ff ff 41 75 74 6f 4c 6f 61 64 20 66 69 6c 61 6d ..AutoLoad filam 4747: 65 6e 74 00 ent. 0000474b : 474b: ff ff 4c 6f 61 64 20 66 69 6c 61 6d 65 6e 74 00 ..Load filament. 0000475b : 475b: ff ff 55 6e 6c 6f 61 64 20 66 69 6c 61 6d 65 6e ..Unload filamen 476b: 74 00 t. 0000476d : 476d: ff ff 4c 6f 61 64 20 74 6f 20 6e 6f 7a 7a 6c 65 ..Load to nozzle ... 0000477e : 477e: ff ff 50 72 65 6c 6f 61 64 20 74 6f 20 4d 4d 55 ..Preload to MMU ... 0000478f : 478f: ff ff 4e 6f 20 53 44 20 63 61 72 64 00 ..No SD card. 0000479c : 479c: ff ff 50 72 69 6e 74 20 66 72 6f 6d 20 53 44 00 ..Print from SD. 000047ac : 47ac: ff ff 52 65 73 75 6d 65 20 70 72 69 6e 74 00 ..Resume print. 000047bb : 47bb: ff ff 50 61 75 73 65 20 70 72 69 6e 74 00 ..Pause print. 000047c9 : 47c9: ff ff 53 65 74 20 52 65 61 64 79 00 ..Set Ready. 000047d5 : 47d5: ff ff 53 65 74 20 6e 6f 74 20 52 65 61 64 79 00 ..Set not Ready. 000047e5 : 47e5: ff ff 50 72 65 68 65 61 74 00 ..Preheat. 000047ef : 47ef: ff ff 54 75 6e 65 00 ..Tune. 000047f6 : 47f6: ff ff 4c 69 76 65 20 61 64 6a 75 73 74 20 5a 00 ..Live adjust Z. 00004806 : 4806: ff ff 52 65 70 72 69 6e 74 00 ..Reprint. 00004810 : 4810: ff ff 49 6e 66 6f 20 73 63 72 65 65 6e 00 ..Info screen. 0000481e : 481e: ff ff 41 73 73 69 73 74 00 ..Assist. 00004827 : 4827: ff ff 4f 6e 63 65 00 ..Once. 0000482e : 482e: ff ff 53 6f 75 6e 64 00 ..Sound. 00004836 : 4836: ff ff 4c 6f 75 64 00 ..Loud. 0000483d : 483d: ff ff 46 69 6c 2e 20 73 65 6e 73 6f 72 00 ..Fil. sensor. 0000484b : 484b: ff ff 43 68 61 6e 67 65 20 66 69 6c 61 6d 65 6e ..Change filamen 485b: 74 00 t. 0000485d : 485d: ff ff 46 6c 6f 77 00 ..Flow. 00004864 : 4864: ff ff 53 70 65 65 64 00 ..Speed. 0000486c : 486c: ff ff 4d 61 67 6e 65 74 73 20 63 6f 6d 70 2e 00 ..Magnets comp.. 0000487c : 487c: ff ff 4e 2f 41 00 ..N/A. 00004882 : 4882: ff ff 5a 2d 70 72 6f 62 65 20 6e 72 2e 00 ..Z-probe nr.. 00004890 : 4890: ff ff 4d 65 73 68 00 ..Mesh. 00004897 : 4897: ff ff 53 65 74 74 69 6e 67 73 00 ..Settings. 000048a2 : 48a2: ff ff 59 65 73 00 ..Yes. 000048a8 : 48a8: ff ff 4e 6f 00 ..No. 000048ad : 48ad: ff ff 53 74 6f 70 20 70 72 69 6e 74 00 ..Stop print. 000048ba : 48ba: ff ff 43 68 65 63 6b 69 6e 67 20 66 69 6c 65 00 ..Checking file. 000048ca : 48ca: ff ff 46 69 6c 65 20 69 6e 63 6f 6d 70 6c 65 74 ..File incomplet 48da: 65 2e 20 43 6f 6e 74 69 6e 75 65 20 61 6e 79 77 e. Continue anyw 48ea: 61 79 3f 00 ay?. 000048ee : 48ee: ff ff 84 52 65 66 72 65 73 68 00 ...Refresh. 000048f9 : 48f9: ff ff 4d 61 69 6e 00 ..Main. 00004900 : 4900: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 6e 6f ..Waiting for no 4910: 7a 7a 6c 65 20 61 6e 64 20 62 65 64 20 63 6f 6f zzle and bed coo 4920: 6c 69 6e 67 00 ling. 00004925 : 4925: ff ff 53 65 6c 66 74 65 73 74 20 4f 4b 00 ..Selftest OK. 00004933 : 4933: ff ff 53 65 6c 66 74 65 73 74 20 73 74 61 72 74 ..Selftest start ... 00004944 : 4944: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 0000494e : 494e: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 495e: 73 00 s. 00004960 : 4960: ff ff 41 78 69 73 00 ..Axis. 00004967 : 4967: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 00004975 : 4975: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 00004984 : 4984: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 4994: 74 00 t. 00004996 : 4996: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 000049a0 : 49a0: ff ff 4d 6f 74 6f 72 00 ..Motor. 000049a8 : 49a8: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 000049b3 : 49b3: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 000049c2 : 49c2: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 000049cf : 49cf: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 000049df : 49df: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 49ef: 74 6f 72 00 tor. 000049f3 : 49f3: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 00004a03 : 4a03: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 4a13: 21 00 !. 00004a15 : 4a15: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 4a25: 72 00 r. 00004a27 : 4a27: ff ff 50 72 69 6e 74 20 66 61 6e 3a 00 ..Print fan:. 00004a34 : 4a34: ff ff 48 6f 74 65 6e 64 20 66 61 6e 3a 00 ..Hotend fan:. 00004a42 : 4a42: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 68 6f ..Calibrating ho 4a52: 6d 65 00 me. 00004a55 : 4a55: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 4a65: 64 00 d. 00004a67 : 4a67: ff ff 41 6c 6c 20 63 6f 72 72 65 63 74 00 ..All correct. 00004a75 : 4a75: ff ff 43 68 65 63 6b 69 6e 67 20 73 65 6e 73 6f ..Checking senso 4a85: 72 73 00 rs. 00004a88 : 4a88: ff ff 43 68 65 63 6b 69 6e 67 20 68 6f 74 65 6e ..Checking hoten 4a98: 64 00 d. 00004a9a : 4a9a: ff ff 43 68 65 63 6b 69 6e 67 20 62 65 64 00 ..Checking bed. 00004aa9 : 4aa9: ff ff 43 68 65 63 6b 69 6e 67 20 5a 20 61 78 69 ..Checking Z axi 4ab9: 73 00 s. 00004abb : 4abb: ff ff 43 68 65 63 6b 69 6e 67 20 59 20 61 78 69 ..Checking Y axi 4acb: 73 00 s. 00004acd : 4acd: ff ff 43 68 65 63 6b 69 6e 67 20 58 20 61 78 69 ..Checking X axi 4add: 73 00 s. 00004adf : 4adf: ff ff 43 68 65 63 6b 69 6e 67 20 65 6e 64 73 74 ..Checking endst 4aef: 6f 70 73 00 ops. 00004af3 : 4af3: ff ff 43 61 72 64 20 72 65 6d 6f 76 65 64 00 ..Card removed. 00004b02 : 4b02: ff ff 42 61 63 6b 00 ..Back. 00004b09 : 4b09: ff ff 41 75 74 6f 20 70 6f 77 65 72 00 ..Auto power. 00004b16 : 4b16: ff ff 53 69 6c 65 6e 74 00 ..Silent. 00004b1f : 4b1f: ff ff 4d 6f 64 65 00 ..Mode. 00004b26 : 4b26: ff ff 48 69 67 68 20 70 6f 77 65 72 00 ..High power. 00004b33 : 4b33: ff ff 53 74 72 69 63 74 00 ..Strict. 00004b3c : 4b3c: ff ff 57 61 72 6e 00 ..Warn. 00004b43 : 4b43: ff ff 4e 6f 6e 65 00 ..None. 00004b4a : 4b4a: ff ff 48 6f 74 65 6e 64 20 61 74 20 32 38 30 43 ..Hotend at 280C 4b5a: 21 20 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ! Nozzle changed 4b6a: 20 61 6e 64 20 74 69 67 68 74 65 6e 65 64 20 74 and tightened t 4b7a: 6f 20 73 70 65 63 73 3f 00 o specs?. 00004b83 : 4b83: ff ff 46 6f 72 20 61 20 4e 6f 7a 7a 6c 65 20 63 ..For a Nozzle c 4b93: 68 61 6e 67 65 20 70 6c 65 61 73 65 20 72 65 61 hange please rea 4ba3: 64 0a 70 72 75 73 61 2e 69 6f 2f 6e 6f 7a 7a 6c d.prusa.io/nozzl 4bb3: 65 2d 6d 6b 33 73 00 e-mk3s. 00004bba : 4bba: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 4bca: 68 65 64 00 hed. 00004bce : 4bce: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 00004bd9 : 4bd9: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 00004be8 : 4be8: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 00004bf8 : 4bf8: ff ff 43 6f 70 79 20 73 65 6c 65 63 74 65 64 20 ..Copy selected 4c08: 6c 61 6e 67 75 61 67 65 3f 00 language?. 00004c12 : 4c12: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4c22: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4c32: 68 65 20 47 2d 63 6f 64 65 2e 20 43 6f 6e 74 69 he G-code. Conti 4c42: 6e 75 65 3f 00 nue?. 00004c47 : 4c47: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4c57: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4c67: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 4c77: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 4c87: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 20 50 e in settings. P 4c97: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 00004ca7 : 4ca7: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4cb7: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 43 lament loaded. C 4cc7: 6f 6e 74 69 6e 75 65 3f 00 ontinue?. 00004cd0 : 4cd0: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4ce0: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 50 lament loaded. P 4cf0: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 00004d00 : 4d00: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 4d10: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 4d20: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 4d30: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 4d40: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 4d50: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 4d60: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 4d70: 6e 20 66 6c 6f 77 2e 00 n flow.. 00004d78 : 4d78: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 4d88: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 4d98: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 4da8: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 4db8: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 4dc8: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 4dd8: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 00004de8 : 4de8: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 4df8: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 4e08: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 4e18: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 4e28: 2e 00 .. 00004e2a : 4e2a: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 4e3a: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 4e4a: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 4e5a: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 00004e66 : 4e66: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 4e76: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 4e86: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 4e96: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 00004ea1 : 4ea1: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 4eb1: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 00004ec2 : 4ec2: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 4ed2: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 4ee2: 67 65 64 2e 00 ged.. 00004ee7 : 4ee7: ff ff 53 68 65 65 74 00 ..Sheet. 00004eef : 4eef: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 4eff: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00004f0c : 4f0c: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 4f1c: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 4f2c: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 4f3c: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 4f4c: 2e 00 .. 00004f4e : 4f4e: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 4f5e: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 4f6e: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 4f7e: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00004f87 : 4f87: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 4f97: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 4fa7: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 4fb7: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 4fc7: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 4fd7: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00004fe5 : 4fe5: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 4ff5: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 5005: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 5015: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 5025: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 0000502f : 502f: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 503f: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 504f: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 505f: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 506f: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00005079 : 5079: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 5089: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 5099: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 50a9: 4d 4d 55 2e 00 MMU.. 000050ae : 50ae: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 50be: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 50ce: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 50de: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 50ee: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 50fe: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 510e: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 511e: 29 2e 00 ).. 00005121 : 5121: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 5131: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 5141: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 5151: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 5161: 69 74 20 66 69 72 73 74 2e 00 it first.. 0000516b : 516b: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 517b: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 518b: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 519b: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 000051ac : 51ac: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 51bc: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 51cc: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 51dc: 63 74 6f 72 73 2e 00 ctors.. 000051e3 : 51e3: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 51f3: 6e 6c 69 6e 65 2e 00 nline.. 000051fa : 51fa: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 520a: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 521a: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 522a: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 523a: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 00005246 : 5246: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 5256: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 00005266 : 5266: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 5276: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 5286: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 5296: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 52a6: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 000052b5 : 52b5: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 52c5: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 52d5: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 52e5: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 52f5: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 5305: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 5315: 6e 65 65 64 65 64 2e 00 needed.. 0000531d : 531d: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 532d: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 533d: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 534d: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 535d: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 536d: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 537d: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 538d: 6f 70 65 72 6c 79 2e 00 operly.. 00005395 : 5395: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 53a5: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 53b5: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 53c5: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 53d5: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 53e5: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 53f5: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 5405: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 5415: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 5425: 2e 00 .. 00005427 : 5427: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 5437: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 5447: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 5457: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 5467: 20 77 69 72 69 6e 67 2e 00 wiring.. 00005470 : 5470: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 5480: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 5490: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 54a0: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 54b0: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 54c0: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 54d0: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 000054dd : 54dd: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 54ed: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 54fd: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 550d: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 551d: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 552d: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 553d: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 554d: 61 63 68 65 64 20 69 74 2e 00 ached it.. 00005557 : 5557: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 5567: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 5577: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 5587: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 5597: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 55a7: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 55b7: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 55c7: 6f 72 6b 73 2e 00 orks.. 000055cd : 55cd: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 55dd: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 55ed: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 55fd: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 560d: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 561d: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 0000562e : 562e: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 00005638 : 5638: ff ff 53 74 6f 70 00 ..Stop. 0000563f : 563f: ff ff 4c 6f 61 64 00 ..Load. 00005646 : 5646: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 0000564f : 564f: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 0000565a : 565a: ff ff 52 65 74 72 79 00 ..Retry. 00005662 : 5662: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 5672: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 5682: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 5692: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 56a2: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 56b2: 74 2e 00 t.. 000056b5 : 56b5: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 000056c3 : 56c3: ff ff 44 6f 6e 65 00 ..Done. 000056ca : 56ca: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 000056db : 56db: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 000056eb : 56eb: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 56fb: 6e 65 00 ne. 000056fe : 56fe: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 0000570e : 570e: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 00005719 : 5719: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 00005727 : 5727: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 00005737 : 5737: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 00005741 : 5741: ff ff 54 6f 74 61 6c 00 ..Total. 00005749 : 5749: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 00005756 : 5756: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 00005762 : 5762: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 00005773 : 5773: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 5783: 73 00 s. 00005785 : 5785: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 5795: 65 73 00 es. 00005798 : 5798: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 57a8: 6c 75 72 65 73 00 lures. 000057ae : 57ae: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 000057bf : 57bf: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 000057ce : 57ce: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 000057dd : 57dd: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 000057eb : 57eb: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 000057fb : 57fb: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 580b: 6c 73 00 ls. 0000580e : 580e: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 581e: 72 3a 00 r:. 00005821 : 5821: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 0000582b : 582b: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 0000583b : 583b: ff ff 44 61 74 65 3a 00 ..Date:. 00005843 : 5843: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 5853: 6d 65 6e 74 00 ment. 00005858 : 5858: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 5868: 6e 74 00 nt. 0000586b : 586b: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 0000587c : 587c: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 588c: 63 75 74 00 cut. 00005890 : 5890: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 58a0: 65 6a 65 63 74 00 eject. 000058a6 : 58a6: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 58b6: 75 6e 6c 6f 61 64 00 unload. 000058bd : 58bd: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 58cd: 6c 6f 61 64 00 load. 000058d2 : 58d2: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 000058dd : 58dd: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 58ed: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 58fd: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 00005908 : 5908: ff ff 45 6a 65 63 74 00 ..Eject. 00005910 : 5910: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 5920: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 5930: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 5940: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 5950: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 0000595d : 595d: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 0000596e : 596e: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 597e: 6d 65 00 me. 00005981 : 5981: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 00005991 : 5991: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 0000599e : 599e: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 59ae: 6e 73 6f 72 00 nsor. 000059b3 : 59b3: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 59c3: 72 00 r. 000059c5 : 59c5: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 000059ce : 59ce: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 59de: 49 4e 44 41 00 INDA. 000059e3 : 59e3: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 59f3: 65 6e 74 00 ent. 000059f7 : 59f7: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 5a07: 6f 72 00 or. 00005a0a : 5a0a: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 5a1a: 63 74 6f 72 00 ctor. 00005a1f : 5a1f: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 00005a30 : 5a30: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 5a40: 6e 74 00 nt. 00005a43 : 5a43: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 5a53: 65 00 e. 00005a55 : 5a55: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 5a65: 20 73 6c 6f 74 00 slot. 00005a6b : 5a6b: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 5a7b: 6d 65 6e 74 00 ment. 00005a80 : 5a80: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 00005a91 : 5a91: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 5aa1: 65 6e 74 00 ent. 00005aa5 : 5aa5: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 00005ab4 : 5ab4: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 5ac4: 73 65 72 00 ser. 00005ac8 : 5ac8: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 5ad8: 6d 65 6e 74 73 00 ments. 00005ade : 5ade: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 00005aef : 5aef: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 5aff: 7a 6c 65 00 zle. 00005b03 : 5b03: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 5b13: 72 75 64 65 72 00 ruder. 00005b19 : 5b19: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 5b29: 44 41 00 DA. 00005b2c : 5b2c: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 5b3c: 75 6c 6c 65 79 00 ulley. 00005b42 : 5b42: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 5b52: 49 4e 44 41 00 INDA. 00005b57 : 5b57: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 5b67: 6c 65 72 00 ler. 00005b6b : 5b6b: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 00005b7c : 5b7c: ff ff 4f 4b 00 ..OK. 00005b81 <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.482>: 5b81: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 00005b91 <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.481>: 5b91: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 5ba1: 45 00 E. 00005ba3 <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.480>: 5ba3: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 5bb3: 45 44 00 ED. 00005bb6 <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.479>: 5bb6: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 5bc6: 59 00 Y. 00005bc8 <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.478>: 5bc8: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 5bd8: 4f 52 00 OR. 00005bdb <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.477>: 5bdb: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 5beb: 4e 45 45 44 45 44 00 NEEDED. 00005bf2 <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.476>: 5bf2: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 00005bff <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.475>: 5bff: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 00005c0e <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.474>: 5c0e: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 5c1e: 4f 41 44 45 44 00 OADED. 00005c24 <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.473>: 5c24: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 5c34: 45 52 52 4f 52 00 ERROR. 00005c3a <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.472>: 5c3a: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 5c4a: 44 49 4e 47 00 DING. 00005c4f <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.471>: 5c4f: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 00005c5f <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.470>: 5c5f: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 5c6f: 41 49 4c 45 44 00 AILED. 00005c75 <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.469>: 5c75: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 5c85: 52 54 45 44 00 RTED. 00005c8a <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.468>: 5c8a: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 5c9a: 47 45 20 45 52 52 00 GE ERR. 00005ca1 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.467>: 5ca1: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 5cb1: 45 54 00 ET. 00005cb4 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.466>: 5cb4: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 5cc4: 4f 52 00 OR. 00005cc7 <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.465>: 5cc7: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 5cd7: 52 52 4f 52 00 RROR. 00005cdc <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.464>: 5cdc: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 5cec: 4f 20 48 4f 54 00 O HOT. 00005cf2 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.463>: 5cf2: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 5d02: 4f 56 45 00 OVE. 00005d06 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.462>: 5d06: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 5d16: 4f 4d 45 00 OME. 00005d1a <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.461>: 5d1a: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5d2a: 54 20 4d 4f 56 45 00 T MOVE. 00005d31 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.460>: 5d31: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5d41: 54 20 48 4f 4d 45 00 T HOME. 00005d48 <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.459>: 5d48: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 5d58: 46 41 49 4c 45 44 00 FAILED. 00005d5f <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.458>: 5d5f: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 00005d6f <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.457>: 5d6f: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 5d7f: 52 4c 59 00 RLY. 00005d83 <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.456>: 5d83: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5d93: 4d 4f 56 45 00 MOVE. 00005d98 <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.455>: 5d98: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 5da8: 54 55 43 4b 00 TUCK. 00005dad <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.454>: 5dad: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 5dbd: 54 52 49 47 47 2e 00 TRIGG.. 00005dc4 <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.453>: 5dc4: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 5dd4: 54 55 43 4b 00 TUCK. 00005dd9 <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.452>: 5dd9: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 5de9: 49 47 47 45 52 00 IGGER. 00005def : 5def: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 00005dfe : 5dfe: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 00005e09 : 5e09: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 5e19: 6e 3f 00 n?. 00005e1c : 5e1c: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 5e2c: 6e 3f 00 n?. 00005e2f : 5e2f: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 00005e3a : 5e3a: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5e4a: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 5e5a: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 5e6a: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 5e7a: 79 2e 00 y.. 00005e7d : 5e7d: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5e8d: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 5e9d: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 5ead: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 5ebd: 6a 6f 62 21 00 job!. 00005ec2 : 5ec2: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5ed2: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 5ee2: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 5ef2: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 5f02: 73 21 00 s!. 00005f05 : 5f05: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5f15: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 5f25: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 5f35: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 5f45: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 00005f51 : 5f51: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5f61: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 5f71: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 5f81: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 5f91: 68 61 62 6c 65 2e 00 hable.. 00005f98 : 5f98: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5fa8: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 5fb8: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 5fc8: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 5fd8: 68 61 62 6c 65 2e 00 hable.. 00005fdf : 5fdf: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5fef: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 5fff: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 600f: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 601f: 2e 00 .. 00006021 : 6021: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 6031: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 6041: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 6051: 75 61 6c 2e 00 ual.. 00006056 : 6056: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 6066: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 6076: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 6086: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 00006095 : 6095: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 60a5: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 60b5: 61 74 62 65 64 2e 00 atbed.. 000060bc : 60bc: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 60cc: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 60dc: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 60ec: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 60fc: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 610c: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 611c: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 612c: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 613c: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 614c: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 0000615b : 615b: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 616b: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 617b: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 618b: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 619b: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 61ab: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 61bb: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 61cb: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 61db: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 61eb: 69 61 74 65 6c 79 2e 00 iately.. 000061f3 : 61f3: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 6203: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 6213: 74 00 t. 00006215 : 6215: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 6225: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 6235: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 6245: 74 00 t. 00006247 : 6247: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 6257: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 6267: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 6277: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 00006283 : 6283: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 0000628f : 628f: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 0000629e : 629e: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 000062af : 62af: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 62bf: 6e 74 00 nt. 000062c2 : 62c2: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 62d2: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 62e2: 72 65 2e 2e 2e 00 re.... 000062e8 : 62e8: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 000062f8 : 62f8: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 6308: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 6318: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 6328: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 6338: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 6348: 30 2e 00 0.. 0000634b : 634b: ff ff 53 54 4f 50 50 45 44 2e 00 ..STOPPED.. 00006356 : 6356: ff ff 4f 66 66 00 ..Off. 0000635c : 635c: ff ff 4f 6e 00 ..On. 00006361 <__loc_pri_end>: 6361: 65 6e ori r22, 0xE5 ; 229 6363: 71 75 andi r23, 0x51 ; 81 6365: 65 69 ori r22, 0x95 ; 149 6367: 6e 67 ori r22, 0x7E ; 126 6369: 20 22 and r2, r16 ... 0000636c : 636c: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 637c: 6c 65 00 le. 0000637f : 637f: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 638f: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 639f: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 000063a9 : 63a9: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 63b9: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 63c9: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 000063d3 : 63d3: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 63e3: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 000063f2 : 63f2: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 6402: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 6412: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 6422: 3a 20 00 : . 00006425 : 6425: 25 75 20 62 79 74 65 73 20 77 72 69 74 74 65 6e %u bytes written 6435: 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 73 to %S at addres 6445: 73 20 30 78 25 30 38 78 0a 00 s 0x%08x.. 0000644f : 644f: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 645f: 20 25 53 0a 00 %S.. 00006464 <__c.2309>: 6464: 3f 3f 00 ??. 00006467 <__c.2307>: 6467: 52 6f 6d 61 6e 61 00 Romana. 0000646e <__c.2304>: 646e: 48 72 76 61 74 73 6b 69 00 Hrvatski. 00006477 <__c.2301>: 6477: 4d 61 67 79 61 72 00 Magyar. 0000647e <__c.2298>: 647e: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 00006489 <__c.2295>: 6489: 4e 6f 72 73 6b 00 Norsk. 0000648f <__c.2292>: 648f: 53 76 65 6e 73 6b 61 00 Svenska. 00006497 <__c.2289>: 6497: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 000064a2 <__c.2286>: 64a2: 50 6f 6c 73 6b 69 00 Polski. 000064a9 <__c.2283>: 64a9: 49 74 61 6c 69 61 6e 6f 00 Italiano. 000064b2 <__c.2280>: 64b2: 46 72 61 6e 63 61 69 73 00 Francais. 000064bb <__c.2277>: 64bb: 45 73 70 61 6e 6f 6c 00 Espanol. 000064c3 <__c.2274>: 64c3: 44 65 75 74 73 63 68 00 Deutsch. 000064cb <__c.2271>: 64cb: 43 65 73 74 69 6e 61 00 Cestina. 000064d3 <__c.2268>: 64d3: 45 6e 67 6c 69 73 68 00 English. 000064db : 64db: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 000064e6 : 64e6: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 64f6: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 6506: 31 40 3a 25 75 0a 00 1@:%u.. 0000650d : 650d: 52 65 73 65 6e 64 00 Resend. 00006514 : 6514: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 00006520 : 6520: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 6530: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 0000653a : 653a: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 654a: 64 65 74 65 63 74 65 64 21 00 detected!. 00006554 : 6554: 64 69 73 61 62 6c 65 64 00 disabled. 0000655d : 655d: 65 6e 61 62 6c 65 64 00 enabled. 00006565 : 6565: 45 45 50 52 4f 4d 00 EEPROM. 0000656c : 656c: 53 52 41 4d 00 SRAM. 00006571 : 6571: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 6581: 6f 70 0a 00 op.. 00006585 : 6585: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 6595: 20 30 00 0. 00006598 : 6598: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 000065a9 : 65a9: 4d 32 32 30 20 53 25 64 00 M220 S%d. 000065b2 : 65b2: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 65c2: 20 00 . 000065c4 : 65c4: 25 75 00 %u. 000065c7 : 65c7: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 65d7: 20 22 00 ". 000065da <_ZZ16process_commandsvE3__c__57_>: 65da: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 65ea: 72 75 64 65 72 20 00 ruder . 000065f1 : 65f1: 7a 5f 6d 61 78 3a 20 00 z_max: . 000065f9 : 65f9: 7a 5f 6d 69 6e 3a 20 00 z_min: . 00006601 <_ZZ16process_commandsvE3__c__56_>: 6601: 79 5f 6d 69 6e 3a 20 00 y_min: . 00006609 : 6609: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 00006613 : 6613: 6f 70 65 6e 00 open. 00006618 <_ZZ16process_commandsvE3__c__55_>: 6618: 78 5f 6d 69 6e 3a 20 00 x_min: . 00006620 <_ZZ16process_commandsvE3__c__54_>: 6620: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 6630: 70 20 73 74 61 74 75 73 00 p status. 00006639 : 6639: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 6649: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 00006656 : 6656: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 6666: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 00006673 <_ZZ16process_commandsvE3__c__37_>: 6673: 53 49 4c 45 4e 54 00 SILENT. 0000667a <_ZZ16process_commandsvE3__c__36_>: 667a: 4e 4f 52 4d 41 4c 00 NORMAL. 00006681 <_ZZ16process_commandsvE3__c__35_>: 6681: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 6691: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 66a1: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 66b1: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 66c1: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 66d1: 64 0a 00 d.. 000066d4 <_ZZ16process_commandsvE3__c__34_>: 66d4: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 66e4: 0a 00 .. 000066e6 <_ZZ16process_commandsvE3__c__30_>: 66e6: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 000066f4 <_ZZ16process_commandsvE3__c__29_>: 66f4: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 00006704 : 6704: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 6714: 20 25 73 0a 00 %s.. 00006719 <_ZZ16process_commandsvE3__c__27_>: 6719: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 6729: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 6739: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 00006745 <_ZZ16process_commandsvE3__c__26_>: 6745: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 00006752 <_ZZ16process_commandsvE3__c__25_>: 6752: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 6762: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 6772: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 6782: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 0000678e <_ZZ16process_commandsvE3__c__24_>: 678e: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 0000679b <_ZZ16process_commandsvE3__c__23_>: 679b: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 67ab: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 000067b4 <_ZZ16process_commandsvE3__c__20_>: 67b4: 25 64 20 20 25 2e 32 66 00 %d %.2f. 000067bd <_ZZ16process_commandsvE3__c__19_>: 67bd: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 67cd: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 000067d9 <_ZZ16process_commandsvE3__c__18_>: 67d9: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 000067e2 : 67e2: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 67f2: 64 20 52 50 4d 0a 00 d RPM.. 000067f9 : 67f9: 4d 31 30 37 00 M107. 000067fe : 67fe: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 00006806 : 6806: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 00006814 : 6814: 25 33 2e 32 66 81 00 %3.2f.. 0000681b : 681b: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 682b: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 683b: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 00006848 : 6848: 20 20 30 00 0. 0000684c : 684c: 20 20 31 00 1. 00006850 : 6850: 42 3a 20 25 33 64 20 20 20 20 20 58 64 3a 25 36 B: %3d Xd:%6 6860: 64 0a 53 3a 20 25 33 64 20 20 20 20 20 59 64 3a d.S: %3d Yd: 6870: 25 36 64 00 %6d. 00006874 : 6874: 46 49 4e 44 41 00 FINDA. 0000687a : 687a: 50 49 4e 44 41 00 PINDA. 00006880 : 6880: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 6890: 3a 20 25 64 0a 00 : %d.. 00006896 : 6896: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 000068a0 : 68a0: 46 69 72 6d 77 61 72 65 00 Firmware. 000068a9 : 68a9: 53 75 70 65 72 50 49 4e 44 41 00 SuperPINDA. 000068b4 : 68b4: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 000068c1 : 68c1: 46 6c 61 73 68 41 69 72 00 FlashAir. 000068ca : 68ca: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 68da: 52 52 4f 52 00 RROR. 000068df : 68df: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 000068f0 : 68f0: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 00006900 : 6900: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 0000690f : 690f: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 691f: 64 79 00 dy. 00006922 : 6922: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 00006932 : 6932: 4f 4b 00 OK. 00006935 : 6935: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 6945: 65 64 00 ed. 00006948 <_ZZN10CardReader7releaseEvE3__c.lto_priv.493>: 6948: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 00006959 : 6959: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 00006968 : 6968: 4d 38 34 00 M84. 0000696c : 696c: 4d 37 30 32 00 M702. 00006971 : 6971: 47 32 38 20 57 00 G28 W. 00006977 : 6977: 4d 35 30 30 00 M500. 0000697c : 697c: 42 61 64 20 69 6e 74 65 72 72 75 70 74 00 Bad interrupt. 0000698a : 698a: 57 61 74 63 68 64 6f 67 20 74 69 6d 65 6f 75 74 Watchdog timeout ... 0000699b : 699b: 53 74 61 74 69 63 20 6d 65 6d 6f 72 79 20 68 61 Static memory ha 69ab: 73 0a 62 65 65 6e 20 6f 76 65 72 77 72 69 74 74 s.been overwritt 69bb: 65 6e 00 en. 000069be : 69be: 46 49 52 4d 57 41 52 45 20 43 52 41 53 48 21 0a FIRMWARE CRASH!. 69ce: 43 72 61 73 68 20 72 65 61 73 6f 6e 3a 0a 00 Crash reason:.. 000069dd : 69dd: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 69ed: 79 74 65 73 3a 20 00 ytes: . 000069f4 : 69f4: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 00006a03 : 6a03: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 00006a0f : 6a0f: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 00006a1f : 6a1f: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 00006a2f : 6a2f: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 00006a3f : 6a3f: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 00006a50 : 6a50: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 00006a60 : 6a60: 50 6f 77 65 72 55 70 00 PowerUp. 00006a68 : 6a68: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 6a78: 20 66 69 6c 65 00 file. 00006a7e : 6a7e: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 6a8e: 2e 00 .. 00006a90 : 6a90: 6f 6b 00 ok. 00006a93 : 6a93: 46 69 6c 61 6d 65 6e 74 00 Filament. 00006a9c : 6a9c: 31 2f 39 00 1/9. 00006aa0 : 6aa0: 88 00 .. 00006aa2 : 6aa2: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 6ab2: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 00006ac0 : 6ac0: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 6ad0: 70 72 65 76 65 6e 74 65 64 00 prevented. 00006ada : 6ada: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 00006ae7 : 6ae7: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 6af7: 52 4f 52 00 ROR. 00006afb : 6afb: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 00006b05 : 6b05: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 00006b0e : 6b0e: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 00006b17 : 6b17: 86 25 33 64 25 25 00 .%3d%%. 00006b1e : 6b1e: 2d 2d 2d 25 25 00 ---%%. 00006b24 : 6b24: 25 33 64 25 25 00 %3d%%. 00006b2a : 6b2a: 20 53 44 00 SD. 00006b2e : 6b2e: 20 20 20 00 . 00006b32 : 6b32: 20 48 4f 00 HO. 00006b36 : 6b36: 20 46 52 4d 20 00 FRM . 00006b3c : 6b3c: 87 2d 2d 3a 2d 2d 20 20 00 .--:-- . 00006b45 : 6b45: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006b50 : 6b50: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 00006b5f : 6b5f: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 00006b6f : 6b6f: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 00006b7e <_ZZL16lcd_support_menuvE3__c__16_>: 6b7e: 44 75 6d 70 20 74 6f 20 73 65 72 69 61 6c 00 Dump to serial. 00006b8d : 6b8d: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00006b9e : 6b9e: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 6bae: 6d 00 m. 00006bb0 : 6bb0: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00006bbc : 6bbc: 4d 37 30 31 00 M701. 00006bc1 : 6bc1: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6bd1: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 6be1: 32 64 6d 00 2dm. 00006be5 : 6be5: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6bf5: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 6c05: 32 64 73 00 2ds. 00006c09 : 6c09: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 6c19: 25 66 20 25 66 0a 00 %f %f.. 00006c20 : 6c20: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 6c30: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 6c40: 69 6c 65 64 2e 0a 00 iled... 00006c47 : 6c47: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 6c57: 65 73 73 2e 0a 00 ess... 00006c5d : 6c5d: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 6c6d: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 00006c7e : 6c7e: 31 2f 34 00 1/4. 00006c82 : 6c82: 31 2f 34 00 1/4. 00006c86 : 6c86: 31 2f 39 00 1/9. 00006c8a : 6c8a: 50 72 75 73 61 20 69 33 20 4d 4b 32 2e 35 20 4f Prusa i3 MK2.5 O 6c9a: 4b 2e 00 K.. 00006c9d : 6c9d: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 00006ca8 : 6ca8: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 00006cb8 : 6cb8: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 6cc8: 65 64 00 ed. 00006ccb : 6ccb: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 00006cd8 : 6cd8: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 6ce8: 65 3a 20 00 e: . 00006cec : 6cec: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 6cfc: 64 69 72 3a 20 00 dir: . 00006d02 : 6d02: 4d 36 30 30 00 M600. 00006d07 : 6d07: 4d 32 34 00 M24. 00006d0b : 6d0b: 4d 32 33 20 25 73 00 M23 %s. 00006d12 : 6d12: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 6d22: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 6d32: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 6d42: 72 65 64 2e 00 red.. 00006d47 : 6d47: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 00006d57 : 6d57: 4d 38 33 00 M83. 00006d5b <__noloc_end>: 6d5b: 08 4a sbci r16, 0xA8 ; 168 6d5d: d7 3b cpi r29, 0xB7 ; 183 6d5f: 3b ce rjmp .-906 ; 0x69d7 6d61: 01 6e ori r16, 0xE1 ; 225 6d63: 84 bc out 0x24, r8 ; 36 6d65: bf fd .word 0xfdbf ; ???? 6d67: c1 2f mov r28, r17 6d69: 3d 6c ori r19, 0xCD ; 205 6d6b: 74 31 cpi r23, 0x14 ; 20 6d6d: 9a bd out 0x2a, r25 ; 42 6d6f: 56 83 std Z+6, r21 ; 0x06 6d71: 3d da rcall .-2950 ; 0x61ed 6d73: 3d 00 .word 0x003d ; ???? 6d75: c7 7f andi r28, 0xF7 ; 247 6d77: 11 be out 0x31, r1 ; 49 6d79: d9 e4 ldi r29, 0x49 ; 73 6d7b: bb 4c sbci r27, 0xCB ; 203 6d7d: 3e 91 ld r19, -X 6d7f: 6b aa std Y+51, r6 ; 0x33 6d81: aa be out 0x3a, r10 ; 58 6d83: 00 00 nop 6d85: 00 80 ld r0, Z 6d87: 3f 05 cpc r19, r15 6d89: a8 4c sbci r26, 0xC8 ; 200 6d8b: cd b2 in r12, 0x1d ; 29 6d8d: d4 4e sbci r29, 0xE4 ; 228 6d8f: b9 38 cpi r27, 0x89 ; 137 6d91: 36 a9 ldd r19, Z+54 ; 0x36 6d93: 02 0c add r0, r2 6d95: 50 b9 out 0x00, r21 ; 0 6d97: 91 86 std Z+9, r9 ; 0x09 6d99: 88 08 sbc r8, r8 6d9b: 3c a6 std Y+44, r3 ; 0x2c 6d9d: aa aa std Y+50, r10 ; 0x32 6d9f: 2a be out 0x3a, r2 ; 58 6da1: 00 00 nop 6da3: 00 80 ld r0, Z 6da5: 3f 07 cpc r19, r31 6da7: 63 42 sbci r22, 0x23 ; 35 6da9: 36 b7 in r19, 0x36 ; 54 6dab: 9b d8 rcall .-3786 ; 0x5ee3 6dad: a7 1a sub r10, r23 6daf: 39 68 ori r19, 0x89 ; 137 6db1: 56 18 sub r5, r6 6db3: ae ba out 0x1e, r10 ; 30 6db5: ab 55 subi r26, 0x5B ; 91 6db7: 8c 1d adc r24, r12 6db9: 3c b7 in r19, 0x3c ; 60 6dbb: cc 57 subi r28, 0x7C ; 124 6dbd: 63 bd out 0x23, r22 ; 35 6dbf: 6d ed ldi r22, 0xDD ; 221 6dc1: fd 75 andi r31, 0x5D ; 93 6dc3: 3e f6 brtc .-114 ; 0x6d53 6dc5: 17 72 andi r17, 0x27 ; 39 6dc7: 31 bf out 0x31, r19 ; 49 6dc9: 00 00 nop 6dcb: 00 80 ld r0, Z 6dcd: 3f 08 sbc r3, r15 6dcf: 00 00 nop 6dd1: 00 be out 0x30, r0 ; 48 6dd3: 92 24 eor r9, r2 6dd5: 49 12 cpse r4, r25 6dd7: 3e ab std Y+54, r19 ; 0x36 6dd9: aa aa std Y+50, r10 ; 0x32 6ddb: 2a be out 0x3a, r2 ; 58 6ddd: cd cc rjmp .-1638 ; 0x6779 <_ZZ16process_commandsvE3__c__25_+0x27> 6ddf: cc 4c sbci r28, 0xCC ; 204 6de1: 3e 00 .word 0x003e ; ???? 6de3: 00 00 nop 6de5: 80 be out 0x30, r8 ; 48 6de7: ab aa std Y+51, r10 ; 0x33 6de9: aa aa std Y+50, r10 ; 0x32 6deb: 3e 00 .word 0x003e ; ???? 6ded: 00 00 nop 6def: 00 bf out 0x30, r16 ; 48 6df1: 00 00 nop 6df3: 00 80 ld r0, Z 6df5: 3f 00 .word 0x003f ; ???? 6df7: 00 00 nop 6df9: 00 00 nop 6dfb: 08 41 sbci r16, 0x18 ; 24 6dfd: 78 d3 rcall .+1776 ; 0x74ef 6dff: bb 43 sbci r27, 0x3B ; 59 6e01: 87 d1 rcall .+782 ; 0x7111 <__trampolines_start+0x2e9> 6e03: 13 3d cpi r17, 0xD3 ; 211 6e05: 19 0e add r1, r25 6e07: 3c c3 rjmp .+1656 ; 0x7481 6e09: bd 42 sbci r27, 0x2D ; 45 6e0b: 82 ad ldd r24, Z+58 ; 0x3a 6e0d: 2b 3e cpi r18, 0xEB ; 235 6e0f: 68 ec ldi r22, 0xC8 ; 200 6e11: 82 76 andi r24, 0x62 ; 98 6e13: be d9 rcall .-3204 ; 0x6191 6e15: 8f e1 ldi r24, 0x1F ; 31 6e17: a9 3e cpi r26, 0xE9 ; 233 6e19: 4c 80 ldd r4, Y+4 ; 0x04 6e1b: ef ff .word 0xffef ; ???? 6e1d: be 01 movw r22, r28 6e1f: c4 ff sbrs r28, 4 6e21: 7f 3f cpi r23, 0xFF ; 255 6e23: 00 00 nop 6e25: 00 00 nop ... 00006e28 <__trampolines_start>: 6e28: 0c 94 b9 ea jmp 0x1d572 ; 0x1d572 6e2c: 0c 94 57 c6 jmp 0x18cae ; 0x18cae 6e30: 0d 94 3a 04 jmp 0x20874 ; 0x20874 6e34: 0c 94 1b bb jmp 0x17636 ; 0x17636 6e38: 0c 94 d4 ce jmp 0x19da8 ; 0x19da8 6e3c: 0c 94 19 d9 jmp 0x1b232 ; 0x1b232 6e40: 0d 94 63 9d jmp 0x33ac6 ; 0x33ac6 6e44: 0c 94 b2 fc jmp 0x1f964 ; 0x1f964 6e48: 0c 94 c7 e7 jmp 0x1cf8e ; 0x1cf8e 6e4c: 0c 94 85 c1 jmp 0x1830a ; 0x1830a ()> 6e50: 0d 94 88 97 jmp 0x32f10 ; 0x32f10 6e54: 0c 94 85 ce jmp 0x19d0a ; 0x19d0a 6e58: 0c 94 90 77 jmp 0xef20 ; 0xef20 <__vector_23+0xa4> 6e5c: 0c 94 9a d8 jmp 0x1b134 ; 0x1b134 6e60: 0c 94 5d 77 jmp 0xeeba ; 0xeeba <__vector_23+0x3e> 6e64: 0d 94 e3 24 jmp 0x249c6 ; 0x249c6 6e68: 0c 94 14 ea jmp 0x1d428 ; 0x1d428 6e6c: 0c 94 37 bb jmp 0x1766e ; 0x1766e 6e70: 0c 94 9e d1 jmp 0x1a33c ; 0x1a33c 6e74: 0c 94 03 d2 jmp 0x1a406 ; 0x1a406 6e78: 0c 94 42 ce jmp 0x19c84 ; 0x19c84 6e7c: 0c 94 a6 d8 jmp 0x1b14c ; 0x1b14c 6e80: 0c 94 2c cc jmp 0x19858 ; 0x19858 6e84: 0d 94 ff 14 jmp 0x229fe ; 0x229fe 6e88: 0c 94 18 bd jmp 0x17a30 ; 0x17a30 6e8c: 0c 94 d9 ce jmp 0x19db2 ; 0x19db2 6e90: 0d 94 10 09 jmp 0x21220 ; 0x21220 6e94: 0c 94 e4 77 jmp 0xefc8 ; 0xefc8 <__vector_23+0x14c> 6e98: 0d 94 0d 0b jmp 0x2161a ; 0x2161a 6e9c: 0d 94 0b 0d jmp 0x21a16 ; 0x21a16 6ea0: 0c 94 c6 73 jmp 0xe78c ; 0xe78c 6ea4: 0d 94 94 9d jmp 0x33b28 ; 0x33b28 6ea8: 0d 94 ab 24 jmp 0x24956 ; 0x24956 6eac: 0d 94 b8 01 jmp 0x20370 ; 0x20370 6eb0: 0c 94 59 c9 jmp 0x192b2 ; 0x192b2 6eb4: 0c 94 23 bb jmp 0x17646 ; 0x17646 6eb8: 0d 94 56 24 jmp 0x248ac ; 0x248ac 6ebc: 0c 94 97 bd jmp 0x17b2e ; 0x17b2e 6ec0: 0c 94 48 cd jmp 0x19a90 ; 0x19a90 6ec4: 0d 94 14 05 jmp 0x20a28 ; 0x20a28 6ec8: 0d 94 db 24 jmp 0x249b6 ; 0x249b6 6ecc: 0c 94 d0 ea jmp 0x1d5a0 ; 0x1d5a0 6ed0: 0c 94 52 cd jmp 0x19aa4 ; 0x19aa4 6ed4: 0c 94 c6 e3 jmp 0x1c78c ; 0x1c78c 6ed8: 0c 94 cc cd jmp 0x19b98 ; 0x19b98 6edc: 0c 94 c7 c1 jmp 0x1838e ; 0x1838e 6ee0: 0c 94 ab f7 jmp 0x1ef56 ; 0x1ef56 6ee4: 0c 94 42 e7 jmp 0x1ce84 ; 0x1ce84 6ee8: 0c 94 b4 cd jmp 0x19b68 ; 0x19b68 6eec: 0c 94 43 bb jmp 0x17686 ; 0x17686 6ef0: 0d 94 2a 24 jmp 0x24854 ; 0x24854 6ef4: 0c 94 66 c2 jmp 0x184cc ; 0x184cc 6ef8: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 6efc: 0c 94 9a fc jmp 0x1f934 ; 0x1f934 6f00: 0c 94 c0 cd jmp 0x19b80 ; 0x19b80 6f04: 0c 94 4a fc jmp 0x1f894 ; 0x1f894 6f08: 0c 94 10 d9 jmp 0x1b220 ; 0x1b220 6f0c: 0c 94 9b f6 jmp 0x1ed36 ; 0x1ed36 6f10: 0d 94 7f 9d jmp 0x33afe ; 0x33afe 6f14: 0d 94 ad 23 jmp 0x2475a ; 0x2475a 6f18: 0d 94 82 9d jmp 0x33b04 ; 0x33b04 6f1c: 0c 94 50 be jmp 0x17ca0 ; 0x17ca0 6f20: 0c 94 a3 f7 jmp 0x1ef46 ; 0x1ef46 6f24: 0c 94 e8 f4 jmp 0x1e9d0 ; 0x1e9d0 6f28: 0c 94 e0 d1 jmp 0x1a3c0 ; 0x1a3c0 6f2c: 0c 94 a4 dc jmp 0x1b948 ; 0x1b948 6f30: 0c 94 0c bd jmp 0x17a18 ; 0x17a18 6f34: 0c 94 71 ce jmp 0x19ce2 ; 0x19ce2 6f38: 0c 94 c3 cd jmp 0x19b86 ; 0x19b86 6f3c: 0d 94 9e 30 jmp 0x2613c ; 0x2613c 6f40: 0c 94 cc d1 jmp 0x1a398 ; 0x1a398 6f44: 0c 94 73 be jmp 0x17ce6 ; 0x17ce6 6f48: 0c 94 3c c6 jmp 0x18c78 ; 0x18c78 6f4c: 0d 94 22 97 jmp 0x32e44 ; 0x32e44 6f50: 0c 94 61 bd jmp 0x17ac2 ; 0x17ac2 6f54: 0c 94 21 d2 jmp 0x1a442 ; 0x1a442 6f58: 0c 94 80 bd jmp 0x17b00 ; 0x17b00 6f5c: 0c 94 34 f6 jmp 0x1ec68 ; 0x1ec68 6f60: 0d 94 81 97 jmp 0x32f02 ; 0x32f02 6f64: 0d 94 69 02 jmp 0x204d2 ; 0x204d2 6f68: 0c 94 77 77 jmp 0xeeee ; 0xeeee <__vector_23+0x72> 6f6c: 0c 94 17 d2 jmp 0x1a42e ; 0x1a42e 6f70: 0c 94 4e c0 jmp 0x1809c ; 0x1809c 6f74: 0d 94 64 97 jmp 0x32ec8 ; 0x32ec8 6f78: 0d 94 cf 01 jmp 0x2039e ; 0x2039e 6f7c: 0d 94 c7 0c jmp 0x2198e ; 0x2198e 6f80: 0c 94 31 d9 jmp 0x1b262 ; 0x1b262 6f84: 0d 94 f4 23 jmp 0x247e8 ; 0x247e8 6f88: 0c 94 36 bb jmp 0x1766c ; 0x1766c 6f8c: 0d 94 eb 24 jmp 0x249d6 ; 0x249d6 6f90: 0c 94 5a ce jmp 0x19cb4 ; 0x19cb4 6f94: 0c 94 c4 d1 jmp 0x1a388 ; 0x1a388 6f98: 0c 94 7e c4 jmp 0x188fc ; 0x188fc 6f9c: 0c 94 2d dd jmp 0x1ba5a ; 0x1ba5a 6fa0: 0c 94 52 ce jmp 0x19ca4 ; 0x19ca4 6fa4: 0d 94 f5 04 jmp 0x209ea ; 0x209ea 6fa8: 0d 94 8e 04 jmp 0x2091c ; 0x2091c 6fac: 0c 94 40 ea jmp 0x1d480 ; 0x1d480 6fb0: 0c 94 4b bd jmp 0x17a96 ; 0x17a96 6fb4: 0c 94 89 c1 jmp 0x18312 ; 0x18312 6fb8: 0d 94 78 01 jmp 0x202f0 ; 0x202f0 6fbc: 0c 94 39 c9 jmp 0x19272 ; 0x19272 6fc0: 0c 94 4a ea jmp 0x1d494 ; 0x1d494 6fc4: 0c 94 31 bb jmp 0x17662 ; 0x17662 6fc8: 0d 94 6b 0c jmp 0x218d6 ; 0x218d6 6fcc: 0c 94 80 c1 jmp 0x18300 ; 0x18300 ()> 6fd0: 0d 94 c5 23 jmp 0x2478a ; 0x2478a 6fd4: 0c 94 47 bf jmp 0x17e8e ; 0x17e8e 6fd8: 0c 94 00 bb jmp 0x17600 ; 0x17600 6fdc: 0c 94 67 c1 jmp 0x182ce ; 0x182ce ()> 6fe0: 0c 94 f2 d4 jmp 0x1a9e4 ; 0x1a9e4 6fe4: 0c 94 f9 d1 jmp 0x1a3f2 ; 0x1a3f2 6fe8: 0c 94 9f f6 jmp 0x1ed3e ; 0x1ed3e 6fec: 0c 94 04 d9 jmp 0x1b208 ; 0x1b208 6ff0: 0c 94 41 bd jmp 0x17a82 ; 0x17a82 6ff4: 0c 94 ee f4 jmp 0x1e9dc ; 0x1e9dc 6ff8: 0c 94 3a be jmp 0x17c74 ; 0x17c74 6ffc: 0d 94 6f 08 jmp 0x210de ; 0x210de 7000: 0c 94 76 dc jmp 0x1b8ec ; 0x1b8ec 7004: 0c 94 10 e9 jmp 0x1d220 ; 0x1d220 7008: 0c 94 0b bb jmp 0x17616 ; 0x17616 700c: 0c 94 13 d9 jmp 0x1b226 ; 0x1b226 7010: 0d 94 cb 24 jmp 0x24996 ; 0x24996 7014: 0c 94 3f bb jmp 0x1767e ; 0x1767e 7018: 0c 94 e4 ea jmp 0x1d5c8 ; 0x1d5c8 701c: 0d 94 8a 24 jmp 0x24914 ; 0x24914 7020: 0c 94 04 bb jmp 0x17608 ; 0x17608 7024: 0c 94 4a ce jmp 0x19c94 ; 0x19c94 7028: 0d 94 1d 9d jmp 0x33a3a ; 0x33a3a 702c: 0c 94 6c c1 jmp 0x182d8 ; 0x182d8 ()> 7030: 0d 94 86 9d jmp 0x33b0c ; 0x33b0c 7034: 0c 94 c7 ea jmp 0x1d58e ; 0x1d58e 7038: 0c 94 90 dc jmp 0x1b920 ; 0x1b920 703c: 0c 94 ea d1 jmp 0x1a3d4 ; 0x1a3d4 7040: 0c 94 58 e7 jmp 0x1ceb0 ; 0x1ceb0 7044: 0c 94 b7 cd jmp 0x19b6e ; 0x19b6e 7048: 0c 94 9e ea jmp 0x1d53c ; 0x1d53c 704c: 0c 94 d2 77 jmp 0xefa4 ; 0xefa4 <__vector_23+0x128> 7050: 0c 94 11 bb jmp 0x17622 ; 0x17622 7054: 0c 94 62 c1 jmp 0x182c4 ; 0x182c4 ()> 7058: 0c 94 82 77 jmp 0xef04 ; 0xef04 <__vector_23+0x88> 705c: 0d 94 93 24 jmp 0x24926 ; 0x24926 7060: 0c 94 af ea jmp 0x1d55e ; 0x1d55e 7064: 0c 94 99 f7 jmp 0x1ef32 ; 0x1ef32 7068: 0c 94 e6 c6 jmp 0x18dcc ; 0x18dcc 706c: 0c 94 57 bd jmp 0x17aae ; 0x17aae 7070: 0c 94 b5 ea jmp 0x1d56a ; 0x1d56a 7074: 0c 94 ba cd jmp 0x19b74 ; 0x19b74 7078: 0d 94 59 24 jmp 0x248b2 ; 0x248b2 707c: 0c 94 2d bb jmp 0x1765a ; 0x1765a 7080: 0c 94 f3 bf jmp 0x17fe6 ; 0x17fe6 7084: 0d 94 a3 24 jmp 0x24946 ; 0x24946 7088: 0c 94 a6 77 jmp 0xef4c ; 0xef4c <__vector_23+0xd0> 708c: 0c 94 48 bb jmp 0x17690 ; 0x17690 7090: 0d 94 32 01 jmp 0x20264 ; 0x20264 7094: 0c 94 af bc jmp 0x1795e ; 0x1795e 7098: 0c 94 80 ce jmp 0x19d00 ; 0x19d00 709c: 0d 94 8d 24 jmp 0x2491a ; 0x2491a 70a0: 0c 94 c0 c5 jmp 0x18b80 ; 0x18b80 70a4: 0c 94 5f c2 jmp 0x184be ; 0x184be 70a8: 0c 94 1e be jmp 0x17c3c ; 0x17c3c 70ac: 0d 94 09 97 jmp 0x32e12 ; 0x32e12 70b0: 0c 94 9f f7 jmp 0x1ef3e ; 0x1ef3e 70b4: 0d 94 cd 09 jmp 0x2139a ; 0x2139a 70b8: 0d 94 9b 24 jmp 0x24936 ; 0x24936 70bc: 0c 94 2a 64 jmp 0xc854 ; 0xc854 <_GLOBAL__sub_D_card> 70c0: 0c 94 29 bb jmp 0x17652 ; 0x17652 70c4: 0c 94 2d bd jmp 0x17a5a ; 0x17a5a 70c8: 0c 94 75 bd jmp 0x17aea ; 0x17aea 70cc: 0c 94 af 77 jmp 0xef5e ; 0xef5e <__vector_23+0xe2> 70d0: 0c 94 2b d2 jmp 0x1a456 ; 0x1a456 70d4: 0d 94 f7 23 jmp 0x247ee ; 0x247ee 70d8: 0c 94 aa bd jmp 0x17b54 ; 0x17b54 70dc: 0d 94 5c 24 jmp 0x248b8 ; 0x248b8 70e0: 0c 94 24 f7 jmp 0x1ee48 ; 0x1ee48 70e4: 0d 94 84 97 jmp 0x32f08 ; 0x32f08 70e8: 0c 94 23 c6 jmp 0x18c46 ; 0x18c46 70ec: 0c 94 58 dd jmp 0x1bab0 ; 0x1bab0 70f0: 0c 94 4e c6 jmp 0x18c9c ; 0x18c9c 70f4: 0c 94 76 c1 jmp 0x182ec ; 0x182ec ()> 70f8: 0c 94 53 d5 jmp 0x1aaa6 ; 0x1aaa6 70fc: 0c 94 45 c6 jmp 0x18c8a ; 0x18c8a 7100: 0d 94 86 02 jmp 0x2050c ; 0x2050c 7104: 0c 94 f6 ba jmp 0x175ec ; 0x175ec 7108: 0c 94 74 c2 jmp 0x184e8 ; 0x184e8 710c: 0c 94 ba bc jmp 0x17974 ; 0x17974 7110: 0c 94 16 d9 jmp 0x1b22c ; 0x1b22c 7114: 0c 94 c1 f7 jmp 0x1ef82 ; 0x1ef82 7118: 0c 94 7d cd jmp 0x19afa ; 0x19afa 711c: 0c 94 30 e4 jmp 0x1c860 ; 0x1c860 7120: 0c 94 82 ce jmp 0x19d04 ; 0x19d04 7124: 0c 94 25 d9 jmp 0x1b24a ; 0x1b24a 7128: 0c 94 f8 c3 jmp 0x187f0 ; 0x187f0 712c: 0c 94 cb fb jmp 0x1f796 ; 0x1f796 7130: 0c 94 dd 73 jmp 0xe7ba ; 0xe7ba <_menu_edit_P()> 7134: 0d 94 ed 23 jmp 0x247da ; 0x247da 7138: 0c 94 fc ba jmp 0x175f8 ; 0x175f8 713c: 0c 94 6d c2 jmp 0x184da ; 0x184da 7140: 0d 94 d3 24 jmp 0x249a6 ; 0x249a6 7144: 0d 94 25 0a jmp 0x2144a ; 0x2144a 7148: 0c 94 08 bb jmp 0x17610 ; 0x17610 714c: 0c 94 11 c0 jmp 0x18022 ; 0x18022 7150: 0c 94 57 be jmp 0x17cae ; 0x17cae 7154: 0d 94 fd 0d jmp 0x21bfa ; 0x21bfa 7158: 0c 94 05 79 jmp 0xf20a ; 0xf20a 715c: 0c 94 d0 ca jmp 0x195a0 ; 0x195a0 7160: 0d 94 7a 02 jmp 0x204f4 ; 0x204f4 7164: 0d 94 1e 02 jmp 0x2043c ; 0x2043c 7168: 0c 94 be d8 jmp 0x1b17c ; 0x1b17c 716c: 0c 94 7b c2 jmp 0x184f6 ; 0x184f6 7170: 0d 94 27 0d jmp 0x21a4e ; 0x21a4e 7174: 0c 94 a9 bc jmp 0x17952 ; 0x17952 7178: 0c 94 6b bd jmp 0x17ad6 ; 0x17ad6 717c: 0c 94 99 d1 jmp 0x1a332 ; 0x1a332 7180: 0c 94 0d d2 jmp 0x1a41a ; 0x1a41a 7184: 0c 94 7b c1 jmp 0x182f6 ; 0x182f6 ()> 7188: 0c 94 84 d6 jmp 0x1ad08 ; 0x1ad08 718c: 0d 94 5d 02 jmp 0x204ba ; 0x204ba 7190: 0c 94 34 ea jmp 0x1d468 ; 0x1d468 7194: 0d 94 ea 23 jmp 0x247d4 ; 0x247d4 7198: 0c 94 b2 d1 jmp 0x1a364 ; 0x1a364 719c: 0c 94 bc d1 jmp 0x1a378 ; 0x1a378 71a0: 0c 94 66 ce jmp 0x19ccc ; 0x19ccc 71a4: 0c 94 23 bd jmp 0x17a46 ; 0x17a46 71a8: 0c 94 a7 f7 jmp 0x1ef4e ; 0x1ef4e 71ac: 0c 94 67 e1 jmp 0x1c2ce ; 0x1c2ce 71b0: 0c 94 41 d7 jmp 0x1ae82 ; 0x1ae82 71b4: 0c 94 71 c1 jmp 0x182e2 ; 0x182e2 ()> 71b8: 0d 94 c3 24 jmp 0x24986 ; 0x24986 71bc: 0d 94 90 24 jmp 0x24920 ; 0x24920 71c0: 0c 94 fd bc jmp 0x179fa ; 0x179fa 71c4: 0c 94 d6 d1 jmp 0x1a3ac ; 0x1a3ac 71c8: 0c 94 1f bb jmp 0x1763e ; 0x1763e 71cc: 0c 94 b3 cc jmp 0x19966 ; 0x19966 71d0: 0c 94 35 c2 jmp 0x1846a ; 0x1846a 71d4: 0c 94 15 bb jmp 0x1762a ; 0x1762a 71d8: 0c 94 a8 d1 jmp 0x1a350 ; 0x1a350 71dc: 0c 94 bd cd jmp 0x19b7a ; 0x19b7a 71e0: 0d 94 9f 63 jmp 0x2c73e ; 0x2c73e 71e4: 0c 94 1f f8 jmp 0x1f03e ; 0x1f03e 71e8: 0c 94 1e cf jmp 0x19e3c ; 0x19e3c 71ec: 0d 94 b3 24 jmp 0x24966 ; 0x24966 71f0: 0c 94 12 ca jmp 0x19424 ; 0x19424 71f4: 0c 94 1a 7b jmp 0xf634 ; 0xf634 71f8: 0c 94 35 fc jmp 0x1f86a ; 0x1f86a 71fc: 0d 94 fa 0c jmp 0x219f4 ; 0x219f4 7200: 0d 94 89 02 jmp 0x20512 ; 0x20512 7204: 0d 94 bb 24 jmp 0x24976 ; 0x24976 7208: 0d 94 7e 0c jmp 0x218fc ; 0x218fc 720c: 0c 94 84 ea jmp 0x1d508 ; 0x1d508 7210: 0c 94 91 d1 jmp 0x1a322 ; 0x1a322 7214: 0c 94 20 f9 jmp 0x1f240 ; 0x1f240 7218: 0c 94 f1 bc jmp 0x179e2 ; 0x179e2 721c: 0c 94 37 bd jmp 0x17a6e ; 0x17a6e 7220: 0c 94 3b bb jmp 0x17676 ; 0x17676 7224: 0d 94 8f 9d jmp 0x33b1e ; 0x33b1e 00007228 <__trampolines_end>: 7228: 6e 61 ori r22, 0x1E ; 30 722a: 6e 00 .word 0x006e ; ???? 0000722c <__c.2228>: 722c: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 723c: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 724c: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 725c: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 726c: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 727c: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 728c: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 729c: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 72ac: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 72bc: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 72cc: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 72dc: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 72ec: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 72fc: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 730c: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 731c: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 0000732a : 732a: 22 00 ". 0000732c : ... 0000732d : 732d: 20 45 53 50 00 ESP. 00007332 : 7332: 20 4e 53 50 00 NSP. 00007337 : 7337: 20 4f 46 46 00 OFF. 0000733c : 733c: 20 4f 4e 00 ON. 00007340 : 7340: 50 56 30 31 00 PV01. 00007345 : 7345: 20 5b 4d 50 5d 20 00 [MP] . 0000734c : 734c: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 735c: 74 65 73 00 tes. 00007360 : 7360: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 0000736b : 736b: 4d 33 31 30 00 M310. 00007370 : 7370: 4d 31 31 32 00 M112. 00007375 : 7375: 4d 31 31 30 00 M110. 0000737a : 737a: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 00007389 : 7389: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 00007399 : 7399: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 73a9: 72 65 74 72 69 65 76 65 64 00 retrieved. 000073b3 : 73b3: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 73c3: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 73d3: 64 00 d. 000073d5 : 73d5: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 73e5: 00 00 05 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 73f5: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 7405: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 7415: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 7425: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 7435: 00 00 00 00 cd cc cc 3e 3d 0a 81 41 ff 08 43 3e .......>=..A..C> 7445: b0 99 ab 43 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 ...C.B.B.Z4?Lb.E 7455: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 7465: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 2c 43 ......A....?..,C 7475: 00 00 2c 43 00 00 40 41 00 00 f0 42 c0 03 00 00 ..,C..@A...B.... 7485: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 10 ................ 7495: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 000074a6 : 74a6: 20 30 78 00 0x. 000074aa : 74aa: 20 30 78 00 0x. 000074ae : 74ae: 65 72 72 6f 72 3a 20 00 error: . 000074b6 : 74b6: 44 32 33 20 2d 20 65 6d 65 72 67 65 6e 63 79 20 D23 - emergency 74c6: 73 65 72 69 61 6c 20 64 75 6d 70 00 serial dump. 000074d2 : 74d2: 43 75 73 74 6f 6d 00 Custom. 000074d9 : 74d9: 4e 79 6c 6f 6e 50 41 00 NylonPA. 000074e1 : 74e1: 53 61 74 69 6e 20 20 00 Satin . 000074e9 : 74e9: 54 65 78 74 75 72 00 Textur. 000074f0 : 74f0: 53 6d 6f 6f 74 68 00 Smooth. 000074f7 : 74f7: 31 2e 30 00 1.0. 000074fb : 74fb: 31 2e 35 00 1.5. 000074ff : 74ff: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 00007507 : 7507: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 7517: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 00007524 : 7524: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 7534: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 0000753d <_PRI_LANG_SIGNATURE>: 753d: ff ff ff ff .... 00007541 : 7541: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 7551: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 7561: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 7571: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 7581: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 7591: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 75a1: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 75b1: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 75c1: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 75d1: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 75e1: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 75f1: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 7601: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 7611: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 7621: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 7631: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7641: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 7651: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 7661: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 7671: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 7681: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 7691: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 76a1: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 76b1: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 76c1: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 76fd: 00 40 14 54 .@.T 00007701 : 7701: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 7711: 95 95 e6 24 1f b1 4f 0a ...$..O. 00007719 : 7719: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 7729: ca 1b 0e 5a ae c5 9d 74 ...Z...t 00007731 : 7731: 4e 41 4e NAN 00007734 : 7734: 49 4e 46 INF 00007737 : 7737: 00 00 7a 43 00 00 52 43 00 00 52 43 ..zC..RC..RC 00007743 : 7743: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 0000774f : 774f: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 0000775b : 775b: 20 50 3a 00 P:. 0000775f : 775f: 20 42 40 3a 00 B@:. 00007764 : 7764: 20 40 3a 00 @:. 00007768 : 7768: 20 2f 00 /. 0000776b : 776b: 20 54 30 3a 00 T0:. 00007770 : 7770: 20 2f 00 /. 00007773 : 7773: 20 42 3a 00 B:. 00007777 : 7777: 20 2f 00 /. 0000777a : 777a: 54 3a 00 T:. 0000777d : 777d: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 778d: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 779d: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 000077ae : 77ae: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 77be: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 77ce: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 77de: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 000077e7 : 77e7: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 77f7: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 7807: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 00007816 : 7816: 20 20 00 . 00007819 : 7819: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 0000782a : 782a: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 783a: 20 35 2e 30 66 00 5.0f. 00007840 : 7840: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 0000784d : 784d: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 785d: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 0000786b : 786b: 20 45 3a 00 E:. 0000786f : 786f: 20 5a 3a 00 Z:. 00007873 : 7873: 20 59 3a 00 Y:. 00007877 : 7877: 20 45 3a 00 E:. 0000787b : 787b: 20 5a 3a 00 Z:. 0000787f : 787f: 20 59 3a 00 Y:. 00007883 : 7883: 58 3a 00 X:. 00007886 : 7886: 20 2d 3e 20 00 -> . 0000788b : 788b: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 00007897 : 7897: 2c 20 00 , . 0000789a : 789a: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 78aa: 6f 77 6e 00 own. 000078ae : 78ae: 4b 49 4c 4c 45 44 2e 00 KILLED.. 000078b6 : 78b6: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 78c6: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 000078d5 : 78d5: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 78e5: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 78f5: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 7905: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 00007912 : 7912: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7922: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7932: 69 6e 67 20 74 6f 20 30 00 ing to 0. 0000793b : 793b: 20 45 3a 30 20 42 3a 00 E:0 B:. 00007943 : 7943: 54 3a 00 T:. 00007946 : 7946: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7956: 20 69 6e 70 75 74 00 input. 0000795d : 795d: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 796d: 20 75 73 65 72 00 user. 00007973 : 7973: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 00007984 : 7984: 73 65 72 69 61 6c 20 64 75 6d 70 20 00 serial dump . 00007991 : 7991: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 000079a1 : 79a1: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 79b1: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 000079bb : 79bb: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 000079c6 : 79c6: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 79d6: 20 72 61 6e 67 65 21 00 range!. 000079de <_sPrinterName>: 79de: 4d 4b 32 2e 35 00 MK2.5. 000079e4 <_sPrinterMmuName>: 79e4: 4d 4b 32 2e 35 4d 4d 55 32 00 MK2.5MMU2. 000079ee <_nPrinterMmuType>: 79ee: 1a 4f .O 000079f0 <_nPrinterType>: 79f0: fa 00 .. 000079f2 : 79f2: 25 33 64 2f 25 33 64 00 %3d/%3d. 000079fa : 79fa: 25 33 64 00 %3d. 000079fe : 79fe: 20 0a 20 0a 20 0a 20 00 . . . . 00007a06 : 7a06: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 7a16: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 7a26: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 7a36: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 7a46: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 7a56: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 7a66: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 7a76: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 7a86: 0a 00 .. 00007a88 : 7a88: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7a98: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 00007aa7 : 7aa7: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7ab7: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 7ac7: 25 2e 32 66 0a 00 %.2f.. 00007acd : 7acd: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 7add: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 7aed: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 7afd: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 7b0d: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 7b1d: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 7b2d: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 7b3d: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 7b4d: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 7b5d: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 7b6d: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 7b7d: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 7b8d: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 7b9d: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 7bad: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 7bbd: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 00007bce : 7bce: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 7bde: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 7bee: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 7bfe: 2e 32 66 0a 00 .2f.. 00007c03 : 7c03: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 7c13: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 7c23: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 00007c30 : 7c30: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 7c40: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 7c50: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 7c60: 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 f.%SMaximum feed 7c70: 72 61 74 65 73 20 28 6d 6d 2f 73 29 3a 0a 25 53 rates (mm/s):.%S 7c80: 20 20 4d 32 30 33 20 58 25 2e 32 66 20 59 25 2e M203 X%.2f Y%. 7c90: 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 2f Z%.2f E%.2f.% 7ca0: 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 SMaximum acceler 7cb0: 61 74 69 6f 6e 20 28 6d 6d 2f 73 32 29 3a 0a 25 ation (mm/s2):.% 7cc0: 53 20 20 4d 32 30 31 20 58 25 6c 75 20 59 25 6c S M201 X%lu Y%l 7cd0: 75 20 5a 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 u Z%lu E%lu.%SAc 7ce0: 63 65 6c 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 celeration: P=pr 7cf0: 69 6e 74 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 int, R=retract, 7d00: 54 3d 74 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 T=travel.%S M20 7d10: 34 20 50 25 2e 32 66 20 52 25 2e 32 66 20 54 25 4 P%.2f R%.2f T% 7d20: 2e 32 66 0a 25 53 41 64 76 61 6e 63 65 64 20 76 .2f.%SAdvanced v 7d30: 61 72 69 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 ariables: S=Min 7d40: 66 65 65 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c feedrate (mm/s), 7d50: 20 54 3d 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 T=Min travel fe 7d60: 65 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 edrate (mm/s), B 7d70: 3d 6d 69 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 =minimum segment 7d80: 20 74 69 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 time (us), X=ma 7d90: 78 69 6d 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d ximum XY jerk (m 7da0: 6d 2f 73 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d m/s), Z=maximum 7db0: 20 5a 20 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 Z jerk (mm/s), 7dc0: 20 45 3d 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 E=maximum E jer 7dd0: 6b 20 28 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 k (mm/s).%S M20 7de0: 35 20 53 25 2e 32 66 20 54 25 2e 32 66 20 42 25 5 S%.2f T%.2f B% 7df0: 6c 75 20 58 25 2e 32 66 20 59 25 2e 32 66 20 5a lu X%.2f Y%.2f Z 7e00: 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d %.2f E%.2f.%SHom 7e10: 65 20 6f 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 e offset (mm):.% 7e20: 53 20 20 4d 32 30 36 20 58 25 2e 32 66 20 59 25 S M206 X%.2f Y% 7e30: 2e 32 66 20 5a 25 2e 32 66 0a 00 .2f Z%.2f.. 00007e3b : 7e3b: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 00007e46 : 7e46: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 00007e51 : 7e51: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 00007e5e : 7e5e: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 7e6e: 49 4f 4e 00 ION. 00007e72 : 7e72: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 00007e82 : 7e82: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 00007e92 : ... 00007e93 : 7e93: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 7ea3: 20 46 69 6c 65 3a 20 00 File: . 00007eab : 7eab: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 00007eb9 : 7eb9: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 00007ec9 : 7ec9: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 00007ed5 : 7ed5: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 00007ee5 : 7ee5: 25 33 64 2f 25 33 64 00 %3d/%3d. 00007eed : 7eed: 66 76 00 fv. 00007ef0 : 7ef0: 74 68 78 00 thx. 00007ef4 : 7ef4: 50 52 4e 00 PRN. 00007ef8 <_ZZ16process_commandsvE3__c__86_>: 7ef8: 22 28 32 29 00 "(2). 00007efd <_ZZ16process_commandsvE3__c__85_>: 7efd: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 00007f0e <_ZZ16process_commandsvE3__c__84_>: 7f0e: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 00007f18 <_ZZ16process_commandsvE3__c__83_>: 7f18: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 00007f29 <_ZZ16process_commandsvE3__c__81_>: 7f29: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 7f39: 65 70 2c 20 75 6d 00 ep, um. 00007f40 <_ZZ16process_commandsvE3__c__82_>: 7f40: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 7f50: 3a 20 00 : . 00007f53 <_ZZ16process_commandsvE3__c__80_>: 7f53: 50 3a 00 P:. 00007f56 <_ZZ16process_commandsvE3__c__79_>: 7f56: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 7f66: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 7f76: 65 3a 00 e:. 00007f79 <_ZZ16process_commandsvE3__c__78_>: 7f79: 20 41 00 A. 00007f7c <_ZZ16process_commandsvE3__c__77_>: 7f7c: 20 50 00 P. 00007f7f <_ZZ16process_commandsvE3__c__76_>: 7f7f: 20 42 00 B. 00007f82 <_ZZ16process_commandsvE3__c__75_>: 7f82: 20 4c 00 L. 00007f85 <_ZZ16process_commandsvE3__c__74_>: 7f85: 20 52 00 R. 00007f88 <_ZZ16process_commandsvE3__c__73_>: 7f88: 20 5a 00 Z. 00007f8b <_ZZ16process_commandsvE3__c__72_>: 7f8b: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 00007f9c <_ZZ16process_commandsvE3__c__71_>: 7f9c: 53 68 65 65 74 20 00 Sheet . 00007fa3 <_ZZ16process_commandsvE3__c__70_>: 7fa3: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 7fb3: 52 41 4e 47 45 00 RANGE. 00007fb9 <_ZZ16process_commandsvE3__c__69_>: 7fb9: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 7fc9: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 00007fd8 <_ZZ16process_commandsvE3__c__68_>: 7fd8: 41 55 54 4f 00 AUTO. 00007fdd <_ZZ16process_commandsvE3__c__67_>: 7fdd: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 00007fed <_ZZ16process_commandsvE3__c__66_>: 7fed: 20 64 3a 00 d:. 00007ff1 <_ZZ16process_commandsvE3__c__65_>: 7ff1: 20 69 3a 00 i:. 00007ff5 <_ZZ16process_commandsvE3__c__64_>: 7ff5: 20 70 3a 00 p:. 00007ff9 <_ZZ16process_commandsvE3__c__63_>: 7ff9: 20 64 3a 00 d:. 00007ffd <_ZZ16process_commandsvE3__c__62_>: 7ffd: 20 69 3a 00 i:. 00008001 <_ZZ16process_commandsvE3__c__61_>: 8001: 20 70 3a 00 p:. 00008005 <_ZZ16process_commandsvE3__c__60_>: 8005: 25 69 25 25 0a 00 %i%%.. 0000800b <_ZZ16process_commandsvE3__c__59_>: 800b: 25 69 25 25 0a 00 %i%%.. 00008011 <_ZZ16process_commandsvE3__c__58_>: 8011: 22 28 31 29 00 "(1). 00008016 <_ZZ16process_commandsvE3__c__53_>: 8016: 2f 2f 00 //. 00008019 <_ZZ16process_commandsvE3__c__52_>: ... 0000801a <_ZZ16process_commandsvE3__c__51_>: 801a: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 802a: 31 00 1. 0000802c <_ZZ16process_commandsvE3__c__50_>: 802c: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 0000803b <_ZZ16process_commandsvE3__c__49_>: 803b: 31 2e 30 00 1.0. 0000803f <_ZZ16process_commandsvE3__c__48_>: 803f: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 804f: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 805f: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 806f: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 807f: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 808f: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 00008099 <_ZZ16process_commandsvE3__c__47_>: 8099: 30 30 30 30 30 30 30 30 30 00 000000000. 000080a3 <_ZZ16process_commandsvE3__c__46_>: 80a3: 5f 00 _. 000080a5 <_ZZ16process_commandsvE3__c__45_>: 80a5: 38 32 33 37 00 8237. 000080aa <_ZZ16process_commandsvE3__c__44_>: 80aa: 2b 00 +. 000080ac <_ZZ16process_commandsvE3__c__43_>: 80ac: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 80bc: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 000080ca <_ZZ16process_commandsvE3__c__42_>: 80ca: 4d 31 31 33 20 53 00 M113 S. 000080d1 <_ZZ16process_commandsvE3__c__41_>: 80d1: 6f 6b 20 00 ok . 000080d5 <_ZZ16process_commandsvE3__c__40_>: 80d5: 20 63 6d 2e 00 cm.. 000080da <_ZZ16process_commandsvE3__c__39_>: 80da: 20 6d 69 6e 20 00 min . 000080e0 <_ZZ16process_commandsvE3__c__38_>: 80e0: 53 54 41 54 53 20 00 STATS . 000080e7 <_ZZ16process_commandsvE3__c__33_>: 80e7: 6e 2f 61 00 n/a. 000080eb <_ZZ16process_commandsvE3__c__32_>: 80eb: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 80fb: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 0000810b : 810b: 00 01 25 30 1d 0c ff 24 31 1c 0b ff 23 2f 1b 0a ..%0...$1...#/.. 811b: 17 ff 04 06 22 2b 1a 03 36 35 35 38 ...."+..6558 00008127 <_ZZ16process_commandsvE3__c__31_>: 8127: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 00008136 <_ZZ16process_commandsvE3__c__28_>: 8136: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 8146: 25 73 0a 00 %s.. 0000814a <_ZZ16process_commandsvE3__c__22_>: 814a: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 815a: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 00008168 <_ZZ16process_commandsvE3__c__21_>: 8168: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 8178: 74 6f 72 00 tor. 0000817c <_ZZ16process_commandsvE3__c__17_>: 817c: 73 65 74 00 set. 00008180 <_ZZ16process_commandsvE3__c__16_>: 8180: 6e 6f 7a 7a 6c 65 00 nozzle. 00008187 <_ZZ16process_commandsvE3__c__15_>: 8187: 4d 42 4c 00 MBL. 0000818b <_ZZ16process_commandsvE3__c__14_>: 818b: 46 52 00 FR. 0000818e <_ZZ16process_commandsvE3__c__13_>: 818e: 4c 7a 00 Lz. 00008191 <_ZZ16process_commandsvE3__c__12_>: 8191: 4c 61 6e 67 00 Lang. 00008196 <_ZZ16process_commandsvE3__c__11_>: 8196: 31 5f 37 35 6d 6d 5f 4d 4b 32 35 2d 52 41 4d 42 1_75mm_MK25-RAMB 81a6: 6f 31 30 61 2d 45 33 44 76 36 66 75 6c 6c 00 o10a-E3Dv6full. 000081b5 <_ZZ16process_commandsvE3__c__10_>: 81b5: 52 65 76 00 Rev. 000081b9 : 81b9: 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 000081c5 : 81c5: 46 69 72 00 Fir. 000081c9 : 81c9: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 000081d4 : 81d4: 53 4e 00 SN. 000081d7 : 81d7: 52 45 53 45 54 00 RESET. 000081dd : 81dd: 4d 4d 55 52 45 53 00 MMURES. 000081e4 : 81e4: 75 76 6c 6f 00 uvlo. 000081e9 : 81e9: 46 41 4e 00 FAN. 000081ed : 81ed: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 000081f7 : 81f7: 50 52 55 53 41 00 PRUSA. 000081fd : 81fd: 25 2e 31 30 53 20 00 %.10S . 00008204 : 8204: 25 34 64 00 %4d. 00008208 : 8208: 47 31 20 58 31 30 20 59 31 38 30 20 46 34 30 30 G1 X10 Y180 F400 8218: 30 00 0. 0000821a : 821a: 47 31 20 5a 31 30 20 46 31 33 30 30 00 G1 Z10 F1300. 00008227 : 8227: 4d 31 34 30 20 53 30 00 M140 S0. 0000822f : 822f: 4d 31 30 34 20 53 30 00 M104 S0. 00008237 : 8237: 47 31 20 45 2d 30 2e 30 37 35 20 46 32 31 30 30 G1 E-0.075 F2100 ... 00008248 : 8248: 47 31 20 46 34 30 30 30 00 G1 F4000. 00008251 : 8251: 4d 32 30 34 20 53 31 30 30 30 00 M204 S1000. 0000825c : 825c: 47 31 20 5a 35 20 46 37 32 30 30 00 G1 Z5 F7200. 00008268 : 8268: 47 31 20 45 2d 31 2e 35 20 46 32 31 30 30 00 G1 E-1.5 F2100. 00008277 : 8277: 47 39 30 00 G90. 0000827b : 827b: 47 31 20 58 35 20 45 34 20 46 31 30 30 30 00 G1 X5 E4 F1000. 0000828a : 828a: 47 31 20 5a 30 2e 32 20 46 31 30 30 30 00 G1 Z0.2 F1000. 00008298 : 8298: 47 31 20 58 35 35 20 45 32 35 20 46 31 34 30 30 G1 X55 E25 F1400 ... 000082a9 : 82a9: 47 31 20 59 2d 32 20 46 31 30 30 30 00 G1 Y-2 F1000. 000082b6 : 82b6: 47 31 20 58 32 34 30 20 45 32 35 20 20 46 32 32 G1 X240 E25 F22 82c6: 30 30 00 00. 000082c9 : 82c9: 47 31 20 5a 30 2e 33 20 46 31 30 30 30 00 G1 Z0.3 F1000. 000082d7 : 82d7: 47 31 20 58 35 35 20 45 38 20 46 32 30 30 30 00 G1 X55 E8 F2000. 000082e7 : 82e7: 47 31 20 58 35 20 45 32 39 20 46 31 38 30 30 00 G1 X5 E29 F1800. 000082f7 : 82f7: 47 31 20 58 35 35 20 45 32 39 20 46 31 30 37 33 G1 X55 E29 F1073 ... 00008308 : 8308: 47 39 32 20 45 30 00 G92 E0. 0000830f : 830f: 47 32 38 00 G28. 00008313 : 8313: 4d 31 30 39 00 M109. 00008318 : 8318: 4d 31 39 30 00 M190. 0000831d : 831d: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 0000832c : 832c: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 00008336 : 8336: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 00008341 : 8341: 58 3a 00 X:. 00008344 : 8344: 59 3a 00 Y:. 00008347 : 8347: 5a 3a 00 Z:. 0000834a : 834a: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 0000835b : 835b: 25 33 75 00 %3u. 0000835f : 835f: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio 836f: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin 837f: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing 838f: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 0000839a : 839a: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio 83aa: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue 83ba: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t 83ca: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 000083d3 : 83d3: 5a 30 00 Z0. 000083d6 : 83d6: 5a 31 00 Z1. 000083d9 : 83d9: 59 30 00 Y0. 000083dc : 83dc: 59 31 00 Y1. 000083df : 83df: 58 30 00 X0. 000083e2 : 83e2: 58 31 00 X1. 000083e5 : 83e5: 45 6e 64 20 73 74 6f 70 73 20 64 69 61 67 00 End stops diag. 000083f4 : 83f4: 47 38 30 00 G80. 000083f8 : 83f8: 4d 34 35 00 M45. 000083fc : 83fc: 4d 34 35 20 5a 00 M45 Z. 00008402 : 8402: 47 37 36 00 G76. 00008406 : 8406: 4d 37 30 31 20 50 30 00 M701 P0. 0000840e : 840e: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d 841e: 0a 00 .. 00008420 : 8420: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 0000842d : 842d: 30 2e 38 30 00 0.80. 00008432 : 8432: 30 2e 36 30 00 0.60. 00008437 : 8437: 30 2e 34 30 00 0.40. 0000843c : 843c: 30 2e 32 35 00 0.25. 00008441 : 8441: 44 69 73 61 62 6c 65 20 66 61 72 6d 20 6d 6f 64 Disable farm mod 8451: 65 00 e. 00008453 : 8453: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 0000845d : 845d: 4d 4d 55 00 MMU. 00008461 : 8461: 4d 34 34 00 M44. 00008465 : 8465: 47 39 39 00 G99. 00008469 : 8469: 44 69 73 61 62 6c 65 20 66 61 72 6d 20 6d 6f 64 Disable farm mod 8479: 65 3f 00 e?. 0000847c : 847c: 47 32 38 20 58 59 00 G28 XY. 00008483 : 8483: 4d 20 38 34 00 M 84. 00008488 : 8488: 85 2e 2e 00 .... 0000848c : 848c: 25 33 64 2f 30 00 %3d/0. 00008492 : 8492: 25 33 64 2f 30 00 %3d/0. 00008498 : 8498: 6c 63 64 5f 73 65 6c 66 63 68 65 63 6b 5f 61 78 lcd_selfcheck_ax 84a8: 69 73 20 25 64 2c 20 25 64 0a 00 is %d, %d.. 000084b3 : 84b3: 48 6f 74 65 6e 64 00 Hotend. 000084ba : 84ba: 42 65 64 00 Bed. 000084be : 84be: 5a 00 Z. 000084c0 : 84c0: 59 00 Y. 000084c2 : 84c2: 58 00 X. 000084c4 <_ZL13STR_SEPARATOR.lto_priv.416>: 84c4: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 84d4: 2d 2d 2d 2d 00 ----. 000084d9 : 84d9: 53 75 70 65 72 50 49 4e 44 41 3a 00 SuperPINDA:. 000084e5 : 84e5: f9 67 37 82 2f 82 27 82 1a 82 08 82 .g7./.'..... 000084f1 : 84f1: 47 31 20 58 25 64 20 59 25 64 20 45 25 2d 2e 35 G1 X%d Y%d E%-.5 8501: 66 00 f. 00008503 : 8503: 47 31 20 46 31 30 38 30 00 G1 F1080. 0000850c : 850c: 47 31 20 5a 25 2d 2e 33 66 20 46 37 32 30 30 00 G1 Z%-.3f F7200. 0000851c : 851c: 47 31 20 58 35 30 20 59 31 35 35 00 G1 X50 Y155. 00008528 : 8528: 08 83 77 82 57 6d 68 82 5c 82 51 82 48 82 ..w.Wmh.\.Q.H. 00008536 : 8536: 47 31 20 58 25 64 20 45 25 2d 2e 33 66 20 46 31 G1 X%d E%-.3f F1 8546: 30 30 30 00 000. 0000854a : 854a: f7 82 e7 82 d7 82 c9 82 08 83 b6 82 a9 82 98 82 ................ 855a: 8a 82 7b 82 ..{. 0000855e : 855e: 54 25 64 00 T%d. 00008562 : 8562: 47 31 20 5a 30 2e 34 20 46 31 30 30 30 00 G1 Z0.4 F1000. 00008570 : 8570: 47 31 20 59 2d 33 20 46 31 30 30 30 00 G1 Y-3 F1000. 0000857d : 857d: f9 67 18 83 13 83 0f 83 08 83 .g........ 00008587 : 8587: 4d 38 34 20 58 59 00 M84 XY. 0000858e : 858e: 4d 31 30 39 20 53 32 38 30 00 M109 S280. 00008598 : 8598: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 85a8: 30 30 00 00. 000085ab : 85ab: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 85bb: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 85cb: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 000085db : 85db: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 85eb: 20 44 25 2e 32 66 00 D%.2f. 000085f2 : 85f2: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 000085ff : 85ff: 52 43 00 RC. 00008602 : 8602: 44 45 56 00 DEV. 00008606 : 8606: 42 45 54 41 00 BETA. 0000860b : 860b: 41 4c 50 48 41 00 ALPHA. 00008611 : 8611: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 8621: 01 01 00 00 04 01 07 01 0a 01 .......... 0000862b : 862b: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 863b: 02 01 00 00 05 01 08 01 0b 01 .......... 00008645 : 8645: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8655: 00 01 00 00 03 01 06 01 09 01 .......... 0000865f : 865f: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 866f: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 867f: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 868f: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 869f: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 86af: 05 04 04 04 08 08 ...... 000086b5 : 86b5: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 86c5: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 86d5: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 86e5: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 86f5: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8705: 80 10 20 40 04 80 .. @.. 0000870b : 870b: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8737: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 00008761 : 8761: 33 2e 31 34 2e 31 00 3.14.1. 00008768 : 8768: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 8778: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 8788: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 00008796 : 8796: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 000087a4 : 87a4: 61 64 63 5f 69 6e 69 74 00 adc_init. 000087ad : 87ad: 20 0a 20 0a 20 0a 20 00 . . . . 000087b5 : 87b5: 41 6c 6c 20 44 61 74 61 00 All Data. 000087be : 87be: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 000087cb : 87cb: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 000087d9 : 87d9: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 000087e4 : 87e4: 4c 61 6e 67 75 61 67 65 00 Language. 000087ed <_ZZL13factory_resetcE3__c.lto_priv.492>: 87ed: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 000087fe : 87fe: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 0000880c : 880c: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 00008816 : 8816: 03 00 0e 00 01 00 40 00 ......@. 0000881e : 881e: 03 00 02 00 00 00 04 00 ........ 00008826 : 8826: 55 6e 6b 6e 6f 77 6e 00 Unknown. 0000882e : 882e: 31 39 37 30 2d 30 31 2d 30 31 20 30 31 3a 30 30 1970-01-01 01:00 883e: 3a 30 30 00 :00. 00008842 : 8842: 20 33 2e 31 34 2e 31 2d 38 32 33 37 5f 30 30 30 3.14.1-8237_000 8852: 30 30 30 30 30 30 00 000000. 00008859 : 8859: 73 74 61 72 74 00 start. 0000885f : 885f: 4d 32 39 00 M29. 00008863 : 8863: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 0000886b : 886b: 20 0a 20 0a 20 00 . . . 00008871 : 8871: 00 00 48 42 00 00 58 41 9a 99 8d 41 33 33 53 40 ..HB..XA...A33S@ 00008881 : 8881: 4d 4d 55 32 3a 00 MMU2:. 00008887 : 8887: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 8897: 64 00 d. 00008899 : 8899: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 88a9: 69 78 65 64 00 ixed. 000088ae : 88ae: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t 88be: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 000088cb : 88cb: 25 64 2f 39 00 %d/9. 000088d0 : 88d0: 4d 4d 55 32 3a 00 MMU2:. 000088d6 : 88d6: 25 33 64 00 %3d. 000088da : 88da: 18 01 04 19 02 0a ...... 000088e0 : 88e0: cd 55 57 55 dd 54 70 54 27 54 95 53 1d 53 b5 52 .UWU.TpT'T.S.S.R 88f0: 66 52 46 52 fa 51 46 52 e3 51 e3 51 e3 51 e3 51 fRFR.QFR.Q.Q.Q.Q 8900: e3 51 e3 51 e3 51 e3 51 e3 51 e3 51 e3 51 e3 51 .Q.Q.Q.Q.Q.Q.Q.Q 8910: e3 51 e3 51 e3 51 e3 51 e3 51 e3 51 e3 51 e3 51 .Q.Q.Q.Q.Q.Q.Q.Q 8920: e3 51 e3 51 ac 51 6b 51 21 51 ae 50 79 50 2f 50 .Q.Q.QkQ!Q.PyP/P 8930: e5 4f 87 4f 4e 4f 0c 4f ef 4e .O.ONO.O.N 0000893a : 893a: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. 894a: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ 895a: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 00008967 : 8967: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. 8977: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... 8987: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. 8997: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. 89a7: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. 89b7: f9 01 fa 01 fb 01 fc 01 84 03 .......... 000089c1 : 89c1: 5a 56 c3 56 4f 56 46 56 3f 56 08 59 ef 47 38 56 ZV.VOVFV?V.Y.G8V 89d1: 2e 56 .V 000089d3 : 89d3: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 89e3: 34 25 68 75 00 4%hu. 000089e8 : 89e8: 7b 5b 45 52 52 3a 00 {[ERR:. 000089ef <_ZL14FW_VERSION_STR.lto_priv.495>: 89ef: 33 2e 31 34 2e 31 00 3.14.1. 000089f6 : 89f6: 5d 5b 46 57 52 3a 00 ][FWR:. 000089fd : 89fd: 5d 5b 54 49 4d 3a 00 ][TIM:. 00008a04 : 8a04: 5d 5b 46 4e 4d 3a 00 ][FNM:. 00008a0b : 8a0b: 5d 5b 46 45 4d 3a 00 ][FEM:. 00008a12 : 8a12: 5d 5b 50 43 44 3a 00 ][PCD:. 00008a19 : 8a19: 5b 54 46 55 3a 00 [TFU:. 00008a1f : 8a1f: 5b 50 52 4e 3a 00 [PRN:. 00008a25 : 8a25: 5b 50 46 4e 3a 30 5d 00 [PFN:0]. 00008a2d : 8a2d: 5b 44 49 41 3a 00 [DIA:. 00008a33 : 8a33: 5d 5b 41 54 42 3a 00 ][ATB:. 00008a3a : 8a3a: 5d 5b 41 54 30 3a 00 ][AT0:. 00008a41 : 8a41: 5d 5b 53 54 42 3a 00 ][STB:. 00008a48 : 8a48: 5b 53 54 30 3a 00 [ST0:. 00008a4e : 8a4e: 7b 5b 50 52 4e 3a 35 5d 00 {[PRN:5]. 00008a57 : 8a57: 7b 5b 50 52 4e 3a 30 5d 00 {[PRN:0]. 00008a60 : 8a60: 7b 5b 50 52 4e 3a 39 5d 00 {[PRN:9]. 00008a69 : 8a69: 7b 5b 50 52 4e 3a 38 5d 00 {[PRN:8]. 00008a72 : 8a72: 7b 5b 52 45 53 3a 30 5d 5b 46 49 4c 3a 00 {[RES:0][FIL:. 00008a80 : 8a80: 7b 5b 52 45 53 3a 31 5d 5b 46 49 4c 3a 00 {[RES:1][FIL:. 00008a8e : 8a8e: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p 8a9e: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... 8aae: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b 8abe: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... 8ace: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T 8ade: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... 8aee: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F 8afe: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... 8b0e: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 8b1e: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. 8b2e: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* 8b3e: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... 8b4e: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. 8b5e: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. 8b6e: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. 8b7e: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. 8b8e: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. 8b9e: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` 8bae: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. 8bbe: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr 8bce: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... 8bde: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D 8bee: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. 8bfe: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V 8c0e: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... 8c1e: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( 8c2e: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... 8c3e: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: 8c4e: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... 8c5e: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... 8c6e: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... 8c7e: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 00008c8e : 8c8e: 7c 3c 3e 3f 2f 2a 22 5c 00 |<>?/*"\. 00008c97 : 8c97: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 8ca7: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 8cb7: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 8cc7: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 8cd7: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 8ce7: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 8cf7: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 8d07: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 8d17: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 8d27: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 8d37: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 8d47: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 8d57: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 8d67: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 8d77: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 8d87: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 8d97: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 8da7: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 8db7: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 8dc7: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 8dd7: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 8de7: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 8df7: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 8e07: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 8e17: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 8e27: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 8e37: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 8e47: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 8e57: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 8e67: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 8e77: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 8e87: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 8e97: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 8ea7: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 8eb7: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 8ec7: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 8ed7: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 8ee7: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 8ef7: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 8f07: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 8f17: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 8f27: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 8f37: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 8f47: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 8f57: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 8f67: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 8f77: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 8f87: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 8f97: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 8fa7: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 8fb7: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 8fc7: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 8fd7: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 8fe7: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 8ff7: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 9007: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 9017: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 9027: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 9037: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 9047: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 9057: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 9067: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 9077: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 9087: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 00009097 : 9097: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 90a7: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 90b7: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 90c7: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 90d7: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 90e7: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 90f7: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 9107: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 9117: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 9127: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 9137: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 9147: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 9157: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 9167: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 9177: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 9187: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 9197: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 91a7: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 91b7: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 91c7: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 91d7: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 91e7: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 91f7: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 9207: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 9217: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 9227: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 9237: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 9247: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 9257: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 9267: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 9277: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 9287: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 9297: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 92a7: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 92b7: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 92c7: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 92d7: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 92e7: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 92f7: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 9307: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 9317: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 9327: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 9337: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 9347: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 9357: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 9367: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 9377: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 9387: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 9397: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 93a7: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 93b7: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 93c7: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 93d7: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 93e7: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 93f7: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 9407: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 9417: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 9427: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 9437: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9447: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9457: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 9467: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 9477: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 9487: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 00009497 : 9497: 45 30 3a 20 00 E0: . 0000949c : 949c: 5a 3a 20 00 Z: . 000094a0 : 94a0: 59 3a 20 00 Y: . 000094a4 : 94a4: 58 3a 20 00 X: . 000094a8 : 94a8: 4d 53 31 2c 4d 53 32 20 50 69 6e 73 00 MS1,MS2 Pins. 000094b5 <_ZZ12PID_autotunefiiE3__c__16_>: 94b5: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 94c5: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 94d5: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 94e5: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 94f5: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9505: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 00009511 <_ZZ12PID_autotunefiiE3__c__15_>: 9511: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9521: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 0000952e <_ZZ12PID_autotunefiiE3__c__14_>: 952e: 20 40 3a 00 @:. 00009532 <_ZZ12PID_autotunefiiE3__c__13_>: 9532: 54 3a 00 T:. 00009535 <_ZZ12PID_autotunefiiE3__c__12_>: 9535: 42 3a 00 B:. 00009538 <_ZZ12PID_autotunefiiE3__c__11_>: 9538: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9548: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9558: 20 74 6f 6f 20 68 69 67 68 00 too high. 00009562 <_ZZ12PID_autotunefiiE3__c__10_>: 9562: 20 4b 64 3a 20 00 Kd: . 00009568 : 9568: 20 4b 69 3a 20 00 Ki: . 0000956e : 956e: 20 4b 70 3a 20 00 Kp: . 00009574 : 9574: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 00009582 : 9582: 20 54 75 3a 20 00 Tu: . 00009588 : 9588: 20 4b 75 3a 20 00 Ku: . 0000958e : 958e: 20 6d 61 78 3a 20 00 max: . 00009595 : 9595: 20 6d 69 6e 3a 20 00 min: . 0000959c : 959c: 20 64 3a 20 00 d: . 000095a1 : 95a1: 20 62 69 61 73 3a 20 00 bias: . 000095a9 : 95a9: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 95b9: 72 74 00 rt. 000095bc : 95bc: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 95cc: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 95dc: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 000095e6 : 95e6: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 95f6: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 9606: 78 70 65 63 74 65 64 00 xpected. 0000960e : 960e: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 961e: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 962e: 70 65 63 74 65 64 00 pected. 00009635 : 9635: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009641 : 9641: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009649 : 9649: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009651 : 9651: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 0000965d : 965d: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 966d: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 967d: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 968d: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 969d: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 96ad: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 96bd: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 96cd: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 96dd: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 96ed: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 96fd: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 970d: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 971d: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 972d: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 973d: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 974d: 00 3f 00 00 .?.. 00009751 : 9751: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 9761: 52 55 4e 41 57 41 59 00 RUNAWAY. 00009769 : 9769: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 9779: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 00009782 : 9782: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 00009792 : 9792: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 97a2: 57 41 59 00 WAY. 000097a6 : 97a6: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 97b6: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 97c6: 29 00 ). 000097c8 : 97c8: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 97d8: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 97e8: 44 29 00 D). 000097eb : 97eb: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 000097f9 : 97f9: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9809: 52 00 R. 0000980b : 980b: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009817 : 9817: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9827: 20 6f 66 66 2e 20 00 off. . 0000982e : 982e: 3a 20 00 : . 00009831 : 9831: 45 72 72 3a 20 00 Err: . 00009837 : 9837: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009847 : 9847: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009856 <__c.1906>: 9856: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! 9866: 21 00 !. 00009868 : 9868: 3a 20 00 : . 0000986b : 986b: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 00009879 : 9879: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 00009882 : 9882: 20 3a 20 00 : . 00009886 : 9886: 25 33 53 00 %3S. 0000988a : 988a: 25 2d 37 73 00 %-7s. 0000988f : 988f: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 989f: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 000098aa : 98aa: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 98ba: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 000098c9 : 98c9: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 98d9: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. 98e9: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 000098f6 : 98f6: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 9906: 0a 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 .%S. %-16.16S%-3 9916: 64 0a 00 d.. 00009919 : 9919: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 00009923 : 9923: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000992f <_ZZL16lcd_support_menuvE3__c__15_>: 992f: 20 00 . 00009931 <_ZZL16lcd_support_menuvE3__c__14_>: 9931: 20 00 . 00009933 <_ZZL16lcd_support_menuvE3__c__13_>: 9933: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr 9943: 3a 00 :. 00009945 <_ZZL16lcd_support_menuvE3__c__12_>: 9945: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 00009954 <_ZZL16lcd_support_menuvE3__c__11_>: 9954: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000995d <_ZZL16lcd_support_menuvE3__c__10_>: 995d: 20 46 57 3a 00 FW:. 00009962 : 9962: 31 39 37 30 2d 30 31 2d 30 31 00 1970-01-01. 0000996d : 996d: 45 33 44 76 36 66 75 6c 6c 00 E3Dv6full. 00009977 : 9977: 52 41 4d 42 6f 31 30 61 00 RAMBo10a. 00009980 : 9980: 31 5f 37 35 6d 6d 5f 4d 4b 32 35 00 1_75mm_MK25. 0000998c : 998c: 20 48 61 73 68 3a 30 30 30 30 30 30 30 30 30 00 Hash:000000000. 0000999c : 999c: 20 52 65 70 6f 3a 55 6e 6b 6e 6f 77 6e 00 Repo:Unknown. 000099aa : 99aa: 20 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 000099b7 : 99b7: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 000099c1 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: 99c1: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 000099d0 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: 99d0: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 000099dc <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: 99dc: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 000099ec <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: 99ec: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 000099f8 <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: 99f8: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 00009a08 <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: 9a08: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 00009a14 <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: 9a14: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 00009a24 <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: 9a24: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 00009a30 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: 9a30: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 00009a3f <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: 9a3f: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 00009a4b <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: 9a4b: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 00009a5a : 9a5a: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 00009a66 : 9a66: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 30 35 00 PC - 275/105. 00009a76 : 9a76: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 00009a82 : 9a82: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 00009a92 : 9a92: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 00009a9e : 9a9e: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 00009aad : 9aad: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 00009ab9 : 9ab9: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 00009ac8 : 9ac8: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 00009ad4 : 9ad4: 6e 6f 7a 7a 6c 65 20 2d 20 20 32 35 30 2f 30 00 nozzle - 250/0. 00009ae4 : 9ae4: 66 61 72 6d 20 20 20 2d 20 20 32 35 30 2f 38 30 farm - 250/80 ... 00009af5 : 9af5: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... 9b05: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... 9b15: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... 9b25: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ 9b35: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. 9b45: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. 9b55: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. 9b65: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 00009b75 : 9b75: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 00009b86 : 9b86: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e 9b96: 6e 74 65 72 0a 00 nter.. 00009b9c : 9b9c: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c 9bac: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 9bbc: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 9bcc: 20 61 64 3d 25 64 0a 00 ad=%d.. 00009bd4 : 9bd4: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n 9be4: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld 9bf4: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 00009c01 : 9c01: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= 9c11: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= 9c21: 25 64 0a 00 %d.. 00009c25 : 9c25: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x 9c35: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld 9c45: 0a 00 .. 00009c47 : 9c47: 25 30 32 78 00 %02x. 00009c4c : 9c4c: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt 9c5c: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 00009c68 : 9c68: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm 9c78: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 00009c84 : 9c84: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ 9c94: fc 03 f8 01 f0 00 00 00 ........ 00009c9c : 9c9c: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ 9cac: f8 01 f0 00 00 00 00 00 ........ 00009cb4 : 9cb4: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l 9cc4: 65 61 76 65 0a 00 eave.. 00009cca : 9cca: 20 3c 20 00 < . 00009cce : 9cce: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p 9cde: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab 9cee: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate 9cfe: 3a 00 :. 00009d00 : ... 00009d01 : 9d01: 00 00 40 41 00 00 80 40 00 00 5c 43 00 00 80 40 ..@A...@..\C...@ 9d11: 00 00 5c 43 00 00 44 43 00 00 40 41 00 00 44 43 ..\C..DC..@A..DC 00009d21 : 9d21: 25 64 2f 34 00 %d/4. 00009d26 : 9d26: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 00009d32 : 9d32: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail 9d42: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax 9d52: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again 9d62: 2e 00 .. 00009d64 : 9d64: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c 9d74: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 9d84: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 9d94: 20 61 64 3d 25 64 0a 00 ad=%d.. 00009d9c : 9d9c: 0a 00 .. 00009d9e : 9d9e: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 00009dad : 9dad: 25 64 0a 00 %d.. 00009db1 : 9db1: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 00009dc2 : 9dc2: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ 9dd2: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f 9de2: 25 25 0a 00 %%.. 00009de6 : 9de6: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi 9df6: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 00009e02 : 9e02: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 00009e0e : 9e0e: 00 00 7a 43 00 00 56 43 9a d9 51 43 ..zC..VC..QC 00009e1a : 9e1a: ff ff ff ... 00009e1d <_ZL16ramming_sequence.lto_priv.384>: 9e1d: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A 9e2d: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A 9e3d: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B 9e4d: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB 9e5d: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B 9e6d: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B 9e7d: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A 9e8d: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ 9e9d: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 00009ead : 9ead: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st 9ebd: 6f 70 70 65 64 00 opped. 00009ec3 : 9ec3: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 00009ed3 : 9ed3: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout 9ee3: 73 74 61 72 74 65 64 00 started. 00009eeb : 9eeb: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki 9efb: 6e 67 00 ng. 00009efe : 9efe: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown 9f0e: 70 65 6e 64 69 6e 67 00 pending. 00009f16 : 9f16: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 00009f23 : 9f23: 47 31 20 58 25 64 20 59 25 2d 2e 32 66 20 45 25 G1 X%d Y%-.2f E% 9f33: 2d 2e 33 66 00 -.3f. 00009f38 : 9f38: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: 9f48: 20 00 . 00009f4a : 9f4a: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope 9f5a: 6e 65 64 00 ned. 00009f5e : 9f5e: 7c 5b 6b 5b 57 5b 42 5b 2c 5b 19 5b 03 5b ef 5a |[k[W[B[,[.[.[.Z 9f6e: de 5a c8 5a 57 5b 6b 5b b4 5a a5 5a 91 5a 80 5a .Z.ZW[k[.Z.Z.Z.Z 9f7e: 6b 5a af 62 55 5a 43 5a 30 5a 1f 5a 0a 5a f7 59 kZ.bUZCZ0Z.Z.Z.Y 9f8e: e3 59 ce 59 c5 59 b3 59 9e 59 .Y.Y.Y.Y.Y 00009f98 : 9f98: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 00009fa2 : 9fa2: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r 9fb2: 75 6e 6f 75 74 21 00 unout!. 00009fb9 : 9fb9: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti 9fc9: 6d 65 6f 75 74 00 meout. 00009fcf : 9fcf: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 00009fde : 9fde: 03 00 03 ... 00009fe1 : 9fe1: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 00009ff2 : 9ff2: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 0000a000 : a000: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 0000a011 : a011: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe a021: 64 00 d. 0000a023 : a023: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress a033: 65 64 00 ed. 0000a036 <_ZN4MMU2L11errorTitlesE.lto_priv.448>: a036: d9 5d c4 5d ad 5d 98 5d 83 5d 6f 5d 5f 5d 48 5d .].].].].]o]_]H] a046: 31 5d 1a 5d 06 5d f2 5c dc 5c dc 5c dc 5c c7 5c 1].].].\.\.\.\.\ a056: c7 5c c7 5c b4 5c b4 5c b4 5c a1 5c a1 5c a1 5c .\.\.\.\.\.\.\.\ a066: 8a 5c 8a 5c 8a 5c 75 5c 75 5c 75 5c 5f 5c 5f 5c .\.\.\u\u\u\_\_\ a076: 5f 5c 4f 5c 3a 5c 24 5c 0e 5c ff 5b f2 5b db 5b _\O\:\$\.\.[.[.[ a086: c8 5b b6 5b a3 5b 91 5b 81 5b .[.[.[.[.[ 0000a090 : a090: 42 75 74 74 6f 6e 00 Button. 0000a097 : a097: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b a0a7: 74 6e 4c 4d 52 20 00 tnLMR . 0000a0ae : a0ae: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp a0be: 74 73 00 ts. 0000a0c1 <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.447>: a0c1: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . a0d1: 20 20 20 81 00 .. 0000a0d6 : a0d6: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu a0e6: 72 65 20 72 65 61 63 68 65 64 00 re reached. 0000a0f1 : a0f1: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 0000a0ff : a0ff: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl a10f: 65 61 72 65 64 00 eared. 0000a115 : a115: 20 57 3a 00 W:. 0000a119 : a119: 20 45 3a 00 E:. 0000a11d : a11d: 54 3a 00 T:. 0000a120 : a120: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 0000a131 : a131: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 0000a13e : a13e: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 0000a14c : a14c: 20 53 69 7a 65 3a 20 00 Size: . 0000a154 : a154: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 0000a162 : a162: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 0000a173 : a173: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 0000a184 : a184: 22 20 70 6f 73 00 " pos. 0000a18a : a18a: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 0000a195 : a195: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL a1a5: 74 61 72 67 65 74 3a 22 00 target:". 0000a1ae : a1ae: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s a1be: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w a1ce: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev a1de: 65 6c 73 2e 00 els.. 0000a1e3 : a1e3: 06 28 33 d0 36 c2 3e 01 3f 15 41 32 42 3b 43 f2 .(3.6.>.?.A2B;C. a1f3: 44 3b 45 f2 46 22 47 3b 48 f2 49 3b 4a f0 58 98 D;E.F"G;H.I;J.X. a203: 59 0c 5a 08 5b 0c 5c 08 61 10 67 9b 6e 22 71 07 Y.Z.[.\.a.g.n"q. a213: 72 08 ff r.. 0000a216 : a216: 09 5a 0d 00 0e f0 19 14 5e 08 20 64 2b 6d 32 2f .Z......^. d+m2/ a226: ff . 0000a227 : a227: 20 22 25 73 22 00 "%s". 0000a22d : a22d: 20 25 23 6c 78 00 %#lx. 0000a233 : a233: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 0000a23c : a23c: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% a24c: 73 22 0a 00 s".. 0000a250 : a250: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 0000a259 : a259: 04 1a .. 0000a25b : a25b: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt a26b: 74 65 6d 70 74 73 00 tempts. 0000a272 : a272: 08 1b 1c ... 0000a275 : a275: 0b 14 .. 0000a277 : a277: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 0000a286 : a286: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 0000a295 <_ZL10bufferFull.lto_priv.514>: a295: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer a2a5: 20 66 75 6c 6c 21 00 full!. 0000a2ac : a2ac: 22 00 ". 0000a2ae : a2ae: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the a2be: 66 72 6f 6e 74 3a 20 22 00 front: ". 0000a2c7 : a2c7: 45 72 72 6f 72 3a 00 Error:. 0000a2ce : a2ce: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 0000a2d8 <_ZL9mmu2Magic.lto_priv.360>: a2d8: 4d 4d 55 32 3a 00 MMU2:. 0000a2de <_ZL9mmu2Magic.lto_priv.361>: a2de: 4d 4d 55 32 3a 00 MMU2:. 0000a2e4 : a2e4: 65 63 68 6f 3a 00 echo:. 0000a2ea : a2ea: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 0000a2f2 : a2f2: 4d 4d 55 20 69 73 20 00 MMU is . 0000a2fa <__ctors_start>: a2fa: f0 38 cpi r31, 0x80 ; 128 0000a2fc <__ctors_end>: a2fc: 2a 64 ori r18, 0x4A ; 74 0000a2fe <__dtors_end>: a2fe: 11 24 eor r1, r1 a300: 1f be out 0x3f, r1 ; 63 a302: cf ef ldi r28, 0xFF ; 255 a304: d1 e2 ldi r29, 0x21 ; 33 a306: de bf out 0x3e, r29 ; 62 a308: cd bf out 0x3d, r28 ; 61 a30a: 00 e0 ldi r16, 0x00 ; 0 a30c: 0c bf out 0x3c, r16 ; 60 0000a30e <__do_copy_data>: a30e: 13 e0 ldi r17, 0x03 ; 3 a310: a0 e0 ldi r26, 0x00 ; 0 a312: b2 e0 ldi r27, 0x02 ; 2 a314: e4 e1 ldi r30, 0x14 ; 20 a316: f6 e5 ldi r31, 0x56 ; 86 a318: 03 e0 ldi r16, 0x03 ; 3 a31a: 0b bf out 0x3b, r16 ; 59 a31c: 02 c0 rjmp .+4 ; 0xa322 <__do_copy_data+0x14> a31e: 07 90 elpm r0, Z+ a320: 0d 92 st X+, r0 a322: a2 30 cpi r26, 0x02 ; 2 a324: b1 07 cpc r27, r17 a326: d9 f7 brne .-10 ; 0xa31e <__do_copy_data+0x10> 0000a328 <__do_clear_bss>: a328: 27 e1 ldi r18, 0x17 ; 23 a32a: a2 e0 ldi r26, 0x02 ; 2 a32c: b3 e0 ldi r27, 0x03 ; 3 a32e: 01 c0 rjmp .+2 ; 0xa332 <.do_clear_bss_start> 0000a330 <.do_clear_bss_loop>: a330: 1d 92 st X+, r1 0000a332 <.do_clear_bss_start>: a332: a7 31 cpi r26, 0x17 ; 23 a334: b2 07 cpc r27, r18 a336: e1 f7 brne .-8 ; 0xa330 <.do_clear_bss_loop> 0000a338 <__do_global_ctors>: a338: 11 e5 ldi r17, 0x51 ; 81 a33a: ce e7 ldi r28, 0x7E ; 126 a33c: d1 e5 ldi r29, 0x51 ; 81 a33e: 00 e0 ldi r16, 0x00 ; 0 a340: 06 c0 rjmp .+12 ; 0xa34e <__do_global_ctors+0x16> a342: 21 97 sbiw r28, 0x01 ; 1 a344: 01 09 sbc r16, r1 a346: 80 2f mov r24, r16 a348: fe 01 movw r30, r28 a34a: 0f 94 4e a5 call 0x34a9c ; 0x34a9c <__tablejump2__> a34e: cd 37 cpi r28, 0x7D ; 125 a350: d1 07 cpc r29, r17 a352: 80 e0 ldi r24, 0x00 ; 0 a354: 08 07 cpc r16, r24 a356: a9 f7 brne .-22 ; 0xa342 <__do_global_ctors+0xa> a358: 0e 94 05 eb call 0x1d60a ; 0x1d60a
a35c: 0d 94 f8 aa jmp 0x355f0 ; 0x355f0 <__do_global_dtors> 0000a360 <__bad_interrupt>: a360: 0c 94 5a 85 jmp 0x10ab4 ; 0x10ab4 <__vector_default> 0000a364 : a364: 2f 92 push r2 a366: 3f 92 push r3 a368: 4f 92 push r4 a36a: 5f 92 push r5 a36c: 6f 92 push r6 a36e: 7f 92 push r7 a370: 8f 92 push r8 a372: 9f 92 push r9 a374: af 92 push r10 a376: bf 92 push r11 a378: cf 92 push r12 a37a: df 92 push r13 a37c: ef 92 push r14 a37e: ff 92 push r15 a380: 0f 93 push r16 a382: 1f 93 push r17 a384: cf 93 push r28 a386: df 93 push r29 a388: cd b7 in r28, 0x3d ; 61 a38a: de b7 in r29, 0x3e ; 62 a38c: 2f 97 sbiw r28, 0x0f ; 15 a38e: 0f b6 in r0, 0x3f ; 63 a390: f8 94 cli a392: de bf out 0x3e, r29 ; 62 a394: 0f be out 0x3f, r0 ; 63 a396: cd bf out 0x3d, r28 ; 61 a398: 6c 01 movw r12, r24 a39a: 1b 01 movw r2, r22 a39c: 5a 01 movw r10, r20 a39e: fc 01 movw r30, r24 a3a0: 17 82 std Z+7, r1 ; 0x07 a3a2: 16 82 std Z+6, r1 ; 0x06 a3a4: 83 81 ldd r24, Z+3 ; 0x03 a3a6: 9e 01 movw r18, r28 a3a8: 2f 5f subi r18, 0xFF ; 255 a3aa: 3f 4f sbci r19, 0xFF ; 255 a3ac: 49 01 movw r8, r18 a3ae: 81 fd sbrc r24, 1 a3b0: d2 c0 rjmp .+420 ; 0xa556 a3b2: 8f ef ldi r24, 0xFF ; 255 a3b4: 9f ef ldi r25, 0xFF ; 255 a3b6: ee c2 rjmp .+1500 ; 0xa994 a3b8: f1 2c mov r15, r1 a3ba: 51 2c mov r5, r1 a3bc: 00 e0 ldi r16, 0x00 ; 0 a3be: 00 32 cpi r16, 0x20 ; 32 a3c0: 38 f4 brcc .+14 ; 0xa3d0 a3c2: 8b 32 cpi r24, 0x2B ; 43 a3c4: 09 f1 breq .+66 ; 0xa408 a3c6: 90 f4 brcc .+36 ; 0xa3ec a3c8: 80 32 cpi r24, 0x20 ; 32 a3ca: f9 f0 breq .+62 ; 0xa40a a3cc: 83 32 cpi r24, 0x23 ; 35 a3ce: 09 f1 breq .+66 ; 0xa412 a3d0: 07 fd sbrc r16, 7 a3d2: 34 c0 rjmp .+104 ; 0xa43c a3d4: 20 ed ldi r18, 0xD0 ; 208 a3d6: 28 0f add r18, r24 a3d8: 2a 30 cpi r18, 0x0A ; 10 a3da: 20 f5 brcc .+72 ; 0xa424 a3dc: 06 ff sbrs r16, 6 a3de: 1b c0 rjmp .+54 ; 0xa416 a3e0: fa e0 ldi r31, 0x0A ; 10 a3e2: ff 9e mul r15, r31 a3e4: 20 0d add r18, r0 a3e6: 11 24 eor r1, r1 a3e8: f2 2e mov r15, r18 a3ea: 05 c0 rjmp .+10 ; 0xa3f6 a3ec: 8d 32 cpi r24, 0x2D ; 45 a3ee: 79 f0 breq .+30 ; 0xa40e a3f0: 80 33 cpi r24, 0x30 ; 48 a3f2: 71 f7 brne .-36 ; 0xa3d0 a3f4: 01 60 ori r16, 0x01 ; 1 a3f6: f1 01 movw r30, r2 a3f8: 93 fd sbrc r25, 3 a3fa: 85 91 lpm r24, Z+ a3fc: 93 ff sbrs r25, 3 a3fe: 81 91 ld r24, Z+ a400: 1f 01 movw r2, r30 a402: 81 11 cpse r24, r1 a404: dc cf rjmp .-72 ; 0xa3be a406: 1a c0 rjmp .+52 ; 0xa43c a408: 02 60 ori r16, 0x02 ; 2 a40a: 04 60 ori r16, 0x04 ; 4 a40c: f4 cf rjmp .-24 ; 0xa3f6 a40e: 08 60 ori r16, 0x08 ; 8 a410: f2 cf rjmp .-28 ; 0xa3f6 a412: 00 61 ori r16, 0x10 ; 16 a414: f0 cf rjmp .-32 ; 0xa3f6 a416: 3a e0 ldi r19, 0x0A ; 10 a418: 53 9e mul r5, r19 a41a: 20 0d add r18, r0 a41c: 11 24 eor r1, r1 a41e: 52 2e mov r5, r18 a420: 00 62 ori r16, 0x20 ; 32 a422: e9 cf rjmp .-46 ; 0xa3f6 a424: 8e 32 cpi r24, 0x2E ; 46 a426: 21 f4 brne .+8 ; 0xa430 a428: 06 fd sbrc r16, 6 a42a: b1 c2 rjmp .+1378 ; 0xa98e a42c: 00 64 ori r16, 0x40 ; 64 a42e: e3 cf rjmp .-58 ; 0xa3f6 a430: 8c 36 cpi r24, 0x6C ; 108 a432: 11 f4 brne .+4 ; 0xa438 a434: 00 68 ori r16, 0x80 ; 128 a436: df cf rjmp .-66 ; 0xa3f6 a438: 88 36 cpi r24, 0x68 ; 104 a43a: e9 f2 breq .-70 ; 0xa3f6 a43c: 9b eb ldi r25, 0xBB ; 187 a43e: 98 0f add r25, r24 a440: 93 30 cpi r25, 0x03 ; 3 a442: 08 f0 brcs .+2 ; 0xa446 a444: 5f c0 rjmp .+190 ; 0xa504 a446: 00 61 ori r16, 0x10 ; 16 a448: 80 5e subi r24, 0xE0 ; 224 a44a: 06 fd sbrc r16, 6 a44c: 02 c0 rjmp .+4 ; 0xa452 a44e: 46 e0 ldi r20, 0x06 ; 6 a450: f4 2e mov r15, r20 a452: 10 2f mov r17, r16 a454: 1f 73 andi r17, 0x3F ; 63 a456: 85 36 cpi r24, 0x65 ; 101 a458: 09 f0 breq .+2 ; 0xa45c a45a: 5b c0 rjmp .+182 ; 0xa512 a45c: 10 64 ori r17, 0x40 ; 64 a45e: 17 ff sbrs r17, 7 a460: 61 c0 rjmp .+194 ; 0xa524 a462: 8f 2d mov r24, r15 a464: 9b e3 ldi r25, 0x3B ; 59 a466: 9f 15 cp r25, r15 a468: 08 f4 brcc .+2 ; 0xa46c a46a: 8b e3 ldi r24, 0x3B ; 59 a46c: 44 24 eor r4, r4 a46e: 43 94 inc r4 a470: 48 0e add r4, r24 a472: 27 e0 ldi r18, 0x07 ; 7 a474: 35 01 movw r6, r10 a476: f4 e0 ldi r31, 0x04 ; 4 a478: 6f 0e add r6, r31 a47a: 71 1c adc r7, r1 a47c: f5 01 movw r30, r10 a47e: 60 81 ld r22, Z a480: 71 81 ldd r23, Z+1 ; 0x01 a482: 82 81 ldd r24, Z+2 ; 0x02 a484: 93 81 ldd r25, Z+3 ; 0x03 a486: 04 2d mov r16, r4 a488: a4 01 movw r20, r8 a48a: 0f 94 f7 a0 call 0x341ee ; 0x341ee <__ftoa_engine> a48e: 5c 01 movw r10, r24 a490: f9 81 ldd r31, Y+1 ; 0x01 a492: fc 87 std Y+12, r31 ; 0x0c a494: f0 ff sbrs r31, 0 a496: 03 c0 rjmp .+6 ; 0xa49e a498: 0d e2 ldi r16, 0x2D ; 45 a49a: f3 ff sbrs r31, 3 a49c: 07 c0 rjmp .+14 ; 0xa4ac a49e: 0b e2 ldi r16, 0x2B ; 43 a4a0: 11 fd sbrc r17, 1 a4a2: 04 c0 rjmp .+8 ; 0xa4ac a4a4: 01 2f mov r16, r17 a4a6: 04 70 andi r16, 0x04 ; 4 a4a8: 12 fd sbrc r17, 2 a4aa: 00 e2 ldi r16, 0x20 ; 32 a4ac: 2c 85 ldd r18, Y+12 ; 0x0c a4ae: 2c 70 andi r18, 0x0C ; 12 a4b0: e2 2e mov r14, r18 a4b2: 09 f4 brne .+2 ; 0xa4b6 a4b4: 6b c0 rjmp .+214 ; 0xa58c a4b6: 01 11 cpse r16, r1 a4b8: d8 c2 rjmp .+1456 ; 0xaa6a a4ba: f3 e0 ldi r31, 0x03 ; 3 a4bc: e1 2c mov r14, r1 a4be: f5 15 cp r31, r5 a4c0: a0 f4 brcc .+40 ; 0xa4ea a4c2: 83 e0 ldi r24, 0x03 ; 3 a4c4: e5 2c mov r14, r5 a4c6: e8 1a sub r14, r24 a4c8: 13 fd sbrc r17, 3 a4ca: 08 c0 rjmp .+16 ; 0xa4dc a4cc: b6 01 movw r22, r12 a4ce: 80 e2 ldi r24, 0x20 ; 32 a4d0: 90 e0 ldi r25, 0x00 ; 0 a4d2: 0f 94 a6 a2 call 0x3454c ; 0x3454c a4d6: ea 94 dec r14 a4d8: e1 10 cpse r14, r1 a4da: f8 cf rjmp .-16 ; 0xa4cc a4dc: 00 23 and r16, r16 a4de: 29 f0 breq .+10 ; 0xa4ea a4e0: b6 01 movw r22, r12 a4e2: 80 2f mov r24, r16 a4e4: 90 e0 ldi r25, 0x00 ; 0 a4e6: 0f 94 a6 a2 call 0x3454c ; 0x3454c a4ea: 3c 85 ldd r19, Y+12 ; 0x0c a4ec: 28 e2 ldi r18, 0x28 ; 40 a4ee: a2 2e mov r10, r18 a4f0: 22 e7 ldi r18, 0x72 ; 114 a4f2: b2 2e mov r11, r18 a4f4: 33 fd sbrc r19, 3 a4f6: 04 c0 rjmp .+8 ; 0xa500 a4f8: 9c e2 ldi r25, 0x2C ; 44 a4fa: a9 2e mov r10, r25 a4fc: 92 e7 ldi r25, 0x72 ; 114 a4fe: b9 2e mov r11, r25 a500: 10 71 andi r17, 0x10 ; 16 a502: 22 c0 rjmp .+68 ; 0xa548 a504: 9b e9 ldi r25, 0x9B ; 155 a506: 98 0f add r25, r24 a508: 93 30 cpi r25, 0x03 ; 3 a50a: 08 f0 brcs .+2 ; 0xa50e a50c: 47 c1 rjmp .+654 ; 0xa79c a50e: 0f 7e andi r16, 0xEF ; 239 a510: 9c cf rjmp .-200 ; 0xa44a a512: 86 36 cpi r24, 0x66 ; 102 a514: 11 f4 brne .+4 ; 0xa51a a516: 10 68 ori r17, 0x80 ; 128 a518: a2 cf rjmp .-188 ; 0xa45e a51a: ff 20 and r15, r15 a51c: 09 f4 brne .+2 ; 0xa520 a51e: 9f cf rjmp .-194 ; 0xa45e a520: fa 94 dec r15 a522: 9d cf rjmp .-198 ; 0xa45e a524: e7 e0 ldi r30, 0x07 ; 7 a526: 2f 2d mov r18, r15 a528: ef 15 cp r30, r15 a52a: 18 f4 brcc .+6 ; 0xa532 a52c: 27 e0 ldi r18, 0x07 ; 7 a52e: 37 e0 ldi r19, 0x07 ; 7 a530: f3 2e mov r15, r19 a532: 41 2c mov r4, r1 a534: 9f cf rjmp .-194 ; 0xa474 a536: 11 11 cpse r17, r1 a538: 80 52 subi r24, 0x20 ; 32 a53a: b6 01 movw r22, r12 a53c: 90 e0 ldi r25, 0x00 ; 0 a53e: 0f 94 a6 a2 call 0x3454c ; 0x3454c a542: 8f ef ldi r24, 0xFF ; 255 a544: a8 1a sub r10, r24 a546: b8 0a sbc r11, r24 a548: f5 01 movw r30, r10 a54a: 84 91 lpm r24, Z a54c: 81 11 cpse r24, r1 a54e: f3 cf rjmp .-26 ; 0xa536 a550: e1 10 cpse r14, r1 a552: 84 c2 rjmp .+1288 ; 0xaa5c a554: 53 01 movw r10, r6 a556: f6 01 movw r30, r12 a558: 93 81 ldd r25, Z+3 ; 0x03 a55a: f1 01 movw r30, r2 a55c: 93 fd sbrc r25, 3 a55e: 85 91 lpm r24, Z+ a560: 93 ff sbrs r25, 3 a562: 81 91 ld r24, Z+ a564: 1f 01 movw r2, r30 a566: 88 23 and r24, r24 a568: 09 f4 brne .+2 ; 0xa56c a56a: 11 c2 rjmp .+1058 ; 0xa98e a56c: 85 32 cpi r24, 0x25 ; 37 a56e: 41 f4 brne .+16 ; 0xa580 a570: 93 fd sbrc r25, 3 a572: 85 91 lpm r24, Z+ a574: 93 ff sbrs r25, 3 a576: 81 91 ld r24, Z+ a578: 1f 01 movw r2, r30 a57a: 85 32 cpi r24, 0x25 ; 37 a57c: 09 f0 breq .+2 ; 0xa580 a57e: 1c cf rjmp .-456 ; 0xa3b8 a580: b6 01 movw r22, r12 a582: 90 e0 ldi r25, 0x00 ; 0 a584: 0f 94 a6 a2 call 0x3454c ; 0x3454c a588: 35 01 movw r6, r10 a58a: e4 cf rjmp .-56 ; 0xa554 a58c: 17 ff sbrs r17, 7 a58e: 6f c0 rjmp .+222 ; 0xa66e a590: 4a 0c add r4, r10 a592: fc 85 ldd r31, Y+12 ; 0x0c a594: f4 ff sbrs r31, 4 a596: 04 c0 rjmp .+8 ; 0xa5a0 a598: 8a 81 ldd r24, Y+2 ; 0x02 a59a: 81 33 cpi r24, 0x31 ; 49 a59c: 09 f4 brne .+2 ; 0xa5a0 a59e: 4a 94 dec r4 a5a0: 14 14 cp r1, r4 a5a2: 0c f0 brlt .+2 ; 0xa5a6 a5a4: 86 c0 rjmp .+268 ; 0xa6b2 a5a6: 28 e0 ldi r18, 0x08 ; 8 a5a8: 24 15 cp r18, r4 a5aa: 10 f4 brcc .+4 ; 0xa5b0 a5ac: 88 e0 ldi r24, 0x08 ; 8 a5ae: 48 2e mov r4, r24 a5b0: 85 e0 ldi r24, 0x05 ; 5 a5b2: 90 e0 ldi r25, 0x00 ; 0 a5b4: 17 ff sbrs r17, 7 a5b6: 06 c0 rjmp .+12 ; 0xa5c4 a5b8: c5 01 movw r24, r10 a5ba: b7 fe sbrs r11, 7 a5bc: 02 c0 rjmp .+4 ; 0xa5c2 a5be: 90 e0 ldi r25, 0x00 ; 0 a5c0: 80 e0 ldi r24, 0x00 ; 0 a5c2: 01 96 adiw r24, 0x01 ; 1 a5c4: 01 11 cpse r16, r1 a5c6: 01 96 adiw r24, 0x01 ; 1 a5c8: ff 20 and r15, r15 a5ca: 31 f0 breq .+12 ; 0xa5d8 a5cc: 2f 2d mov r18, r15 a5ce: 30 e0 ldi r19, 0x00 ; 0 a5d0: 2f 5f subi r18, 0xFF ; 255 a5d2: 3f 4f sbci r19, 0xFF ; 255 a5d4: 82 0f add r24, r18 a5d6: 93 1f adc r25, r19 a5d8: 58 16 cp r5, r24 a5da: 19 06 cpc r1, r25 a5dc: 19 f0 breq .+6 ; 0xa5e4 a5de: 14 f0 brlt .+4 ; 0xa5e4 a5e0: e5 2c mov r14, r5 a5e2: e8 1a sub r14, r24 a5e4: 81 2f mov r24, r17 a5e6: 89 70 andi r24, 0x09 ; 9 a5e8: 11 f4 brne .+4 ; 0xa5ee a5ea: e1 10 cpse r14, r1 a5ec: 67 c0 rjmp .+206 ; 0xa6bc a5ee: 00 23 and r16, r16 a5f0: 29 f0 breq .+10 ; 0xa5fc a5f2: b6 01 movw r22, r12 a5f4: 80 2f mov r24, r16 a5f6: 90 e0 ldi r25, 0x00 ; 0 a5f8: 0f 94 a6 a2 call 0x3454c ; 0x3454c a5fc: 13 fd sbrc r17, 3 a5fe: 02 c0 rjmp .+4 ; 0xa604 a600: e1 10 cpse r14, r1 a602: 63 c0 rjmp .+198 ; 0xa6ca a604: 17 ff sbrs r17, 7 a606: 7c c0 rjmp .+248 ; 0xa700 a608: 85 01 movw r16, r10 a60a: b7 fe sbrs r11, 7 a60c: 02 c0 rjmp .+4 ; 0xa612 a60e: 10 e0 ldi r17, 0x00 ; 0 a610: 00 e0 ldi r16, 0x00 ; 0 a612: c5 01 movw r24, r10 a614: 84 19 sub r24, r4 a616: 91 09 sbc r25, r1 a618: 2c 01 movw r4, r24 a61a: 6f 2d mov r22, r15 a61c: 70 e0 ldi r23, 0x00 ; 0 a61e: ee 27 eor r30, r30 a620: ff 27 eor r31, r31 a622: e6 1b sub r30, r22 a624: f7 0b sbc r31, r23 a626: ff 87 std Y+15, r31 ; 0x0f a628: ee 87 std Y+14, r30 ; 0x0e a62a: 0f 3f cpi r16, 0xFF ; 255 a62c: 10 07 cpc r17, r16 a62e: 29 f4 brne .+10 ; 0xa63a a630: b6 01 movw r22, r12 a632: 8e e2 ldi r24, 0x2E ; 46 a634: 90 e0 ldi r25, 0x00 ; 0 a636: 0f 94 a6 a2 call 0x3454c ; 0x3454c a63a: a0 16 cp r10, r16 a63c: b1 06 cpc r11, r17 a63e: 0c f4 brge .+2 ; 0xa642 a640: 4b c0 rjmp .+150 ; 0xa6d8 a642: 40 16 cp r4, r16 a644: 51 06 cpc r5, r17 a646: 0c f0 brlt .+2 ; 0xa64a a648: 47 c0 rjmp .+142 ; 0xa6d8 a64a: f5 01 movw r30, r10 a64c: e0 1b sub r30, r16 a64e: f1 0b sbc r31, r17 a650: e8 0d add r30, r8 a652: f9 1d adc r31, r9 a654: 81 81 ldd r24, Z+1 ; 0x01 a656: 01 50 subi r16, 0x01 ; 1 a658: 11 09 sbc r17, r1 a65a: 2e 85 ldd r18, Y+14 ; 0x0e a65c: 3f 85 ldd r19, Y+15 ; 0x0f a65e: 02 17 cp r16, r18 a660: 13 07 cpc r17, r19 a662: e4 f1 brlt .+120 ; 0xa6dc a664: b6 01 movw r22, r12 a666: 90 e0 ldi r25, 0x00 ; 0 a668: 0f 94 a6 a2 call 0x3454c ; 0x3454c a66c: de cf rjmp .-68 ; 0xa62a a66e: 16 fd sbrc r17, 6 a670: 9f cf rjmp .-194 ; 0xa5b0 a672: ef 2d mov r30, r15 a674: f0 e0 ldi r31, 0x00 ; 0 a676: ea 15 cp r30, r10 a678: fb 05 cpc r31, r11 a67a: 34 f0 brlt .+12 ; 0xa688 a67c: 3c ef ldi r19, 0xFC ; 252 a67e: a3 16 cp r10, r19 a680: 3f ef ldi r19, 0xFF ; 255 a682: b3 06 cpc r11, r19 a684: 0c f0 brlt .+2 ; 0xa688 a686: 10 68 ori r17, 0x80 ; 128 a688: 32 96 adiw r30, 0x02 ; 2 a68a: e8 0d add r30, r8 a68c: f9 1d adc r31, r9 a68e: 01 c0 rjmp .+2 ; 0xa692 a690: fa 94 dec r15 a692: ff 20 and r15, r15 a694: 19 f0 breq .+6 ; 0xa69c a696: 82 91 ld r24, -Z a698: 80 33 cpi r24, 0x30 ; 48 a69a: d1 f3 breq .-12 ; 0xa690 a69c: 17 ff sbrs r17, 7 a69e: 88 cf rjmp .-240 ; 0xa5b0 a6a0: 44 24 eor r4, r4 a6a2: 43 94 inc r4 a6a4: 4f 0c add r4, r15 a6a6: fa 14 cp r15, r10 a6a8: 1b 04 cpc r1, r11 a6aa: 31 f0 breq .+12 ; 0xa6b8 a6ac: 2c f0 brlt .+10 ; 0xa6b8 a6ae: fa 18 sub r15, r10 a6b0: 7f cf rjmp .-258 ; 0xa5b0 a6b2: 44 24 eor r4, r4 a6b4: 43 94 inc r4 a6b6: 7c cf rjmp .-264 ; 0xa5b0 a6b8: f1 2c mov r15, r1 a6ba: 7a cf rjmp .-268 ; 0xa5b0 a6bc: b6 01 movw r22, r12 a6be: 80 e2 ldi r24, 0x20 ; 32 a6c0: 90 e0 ldi r25, 0x00 ; 0 a6c2: 0f 94 a6 a2 call 0x3454c ; 0x3454c a6c6: ea 94 dec r14 a6c8: 90 cf rjmp .-224 ; 0xa5ea a6ca: b6 01 movw r22, r12 a6cc: 80 e3 ldi r24, 0x30 ; 48 a6ce: 90 e0 ldi r25, 0x00 ; 0 a6d0: 0f 94 a6 a2 call 0x3454c ; 0x3454c a6d4: ea 94 dec r14 a6d6: 94 cf rjmp .-216 ; 0xa600 a6d8: 80 e3 ldi r24, 0x30 ; 48 a6da: bd cf rjmp .-134 ; 0xa656 a6dc: a0 16 cp r10, r16 a6de: b1 06 cpc r11, r17 a6e0: 41 f4 brne .+16 ; 0xa6f2 a6e2: 9a 81 ldd r25, Y+2 ; 0x02 a6e4: 96 33 cpi r25, 0x36 ; 54 a6e6: 50 f4 brcc .+20 ; 0xa6fc a6e8: 95 33 cpi r25, 0x35 ; 53 a6ea: 19 f4 brne .+6 ; 0xa6f2 a6ec: 3c 85 ldd r19, Y+12 ; 0x0c a6ee: 34 ff sbrs r19, 4 a6f0: 05 c0 rjmp .+10 ; 0xa6fc a6f2: b6 01 movw r22, r12 a6f4: 90 e0 ldi r25, 0x00 ; 0 a6f6: 0f 94 a6 a2 call 0x3454c ; 0x3454c a6fa: 2a cf rjmp .-428 ; 0xa550 a6fc: 81 e3 ldi r24, 0x31 ; 49 a6fe: f9 cf rjmp .-14 ; 0xa6f2 a700: 8a 81 ldd r24, Y+2 ; 0x02 a702: 81 33 cpi r24, 0x31 ; 49 a704: 19 f0 breq .+6 ; 0xa70c a706: 9c 85 ldd r25, Y+12 ; 0x0c a708: 9f 7e andi r25, 0xEF ; 239 a70a: 9c 87 std Y+12, r25 ; 0x0c a70c: b6 01 movw r22, r12 a70e: 90 e0 ldi r25, 0x00 ; 0 a710: 0f 94 a6 a2 call 0x3454c ; 0x3454c a714: ff 20 and r15, r15 a716: a9 f0 breq .+42 ; 0xa742 a718: b6 01 movw r22, r12 a71a: 8e e2 ldi r24, 0x2E ; 46 a71c: 90 e0 ldi r25, 0x00 ; 0 a71e: 0f 94 a6 a2 call 0x3454c ; 0x3454c a722: f3 94 inc r15 a724: f3 94 inc r15 a726: e2 e0 ldi r30, 0x02 ; 2 a728: 01 e0 ldi r16, 0x01 ; 1 a72a: 0e 0f add r16, r30 a72c: e8 0d add r30, r8 a72e: f9 2d mov r31, r9 a730: f1 1d adc r31, r1 a732: 80 81 ld r24, Z a734: b6 01 movw r22, r12 a736: 90 e0 ldi r25, 0x00 ; 0 a738: 0f 94 a6 a2 call 0x3454c ; 0x3454c a73c: e0 2f mov r30, r16 a73e: 0f 11 cpse r16, r15 a740: f3 cf rjmp .-26 ; 0xa728 a742: 85 e6 ldi r24, 0x65 ; 101 a744: 90 e0 ldi r25, 0x00 ; 0 a746: 14 ff sbrs r17, 4 a748: 02 c0 rjmp .+4 ; 0xa74e a74a: 85 e4 ldi r24, 0x45 ; 69 a74c: 90 e0 ldi r25, 0x00 ; 0 a74e: b6 01 movw r22, r12 a750: 0f 94 a6 a2 call 0x3454c ; 0x3454c a754: b7 fc sbrc r11, 7 a756: 06 c0 rjmp .+12 ; 0xa764 a758: a1 14 cp r10, r1 a75a: b1 04 cpc r11, r1 a75c: c1 f4 brne .+48 ; 0xa78e a75e: ec 85 ldd r30, Y+12 ; 0x0c a760: e4 ff sbrs r30, 4 a762: 15 c0 rjmp .+42 ; 0xa78e a764: b1 94 neg r11 a766: a1 94 neg r10 a768: b1 08 sbc r11, r1 a76a: 8d e2 ldi r24, 0x2D ; 45 a76c: b6 01 movw r22, r12 a76e: 90 e0 ldi r25, 0x00 ; 0 a770: 0f 94 a6 a2 call 0x3454c ; 0x3454c a774: 80 e3 ldi r24, 0x30 ; 48 a776: 2a e0 ldi r18, 0x0A ; 10 a778: a2 16 cp r10, r18 a77a: b1 04 cpc r11, r1 a77c: 54 f4 brge .+20 ; 0xa792 a77e: b6 01 movw r22, r12 a780: 90 e0 ldi r25, 0x00 ; 0 a782: 0f 94 a6 a2 call 0x3454c ; 0x3454c a786: b6 01 movw r22, r12 a788: c5 01 movw r24, r10 a78a: c0 96 adiw r24, 0x30 ; 48 a78c: b4 cf rjmp .-152 ; 0xa6f6 a78e: 8b e2 ldi r24, 0x2B ; 43 a790: ed cf rjmp .-38 ; 0xa76c a792: 8f 5f subi r24, 0xFF ; 255 a794: fa e0 ldi r31, 0x0A ; 10 a796: af 1a sub r10, r31 a798: b1 08 sbc r11, r1 a79a: ed cf rjmp .-38 ; 0xa776 a79c: 83 36 cpi r24, 0x63 ; 99 a79e: c9 f0 breq .+50 ; 0xa7d2 a7a0: 83 37 cpi r24, 0x73 ; 115 a7a2: 71 f1 breq .+92 ; 0xa800 a7a4: 83 35 cpi r24, 0x53 ; 83 a7a6: 09 f0 breq .+2 ; 0xa7aa a7a8: 5b c0 rjmp .+182 ; 0xa860 a7aa: 35 01 movw r6, r10 a7ac: f2 e0 ldi r31, 0x02 ; 2 a7ae: 6f 0e add r6, r31 a7b0: 71 1c adc r7, r1 a7b2: f5 01 movw r30, r10 a7b4: a0 80 ld r10, Z a7b6: b1 80 ldd r11, Z+1 ; 0x01 a7b8: 6f 2d mov r22, r15 a7ba: 70 e0 ldi r23, 0x00 ; 0 a7bc: 06 fd sbrc r16, 6 a7be: 02 c0 rjmp .+4 ; 0xa7c4 a7c0: 6f ef ldi r22, 0xFF ; 255 a7c2: 7f ef ldi r23, 0xFF ; 255 a7c4: c5 01 movw r24, r10 a7c6: 0f 94 3a a2 call 0x34474 ; 0x34474 a7ca: 9d 87 std Y+13, r25 ; 0x0d a7cc: 8c 87 std Y+12, r24 ; 0x0c a7ce: 00 68 ori r16, 0x80 ; 128 a7d0: 0d c0 rjmp .+26 ; 0xa7ec a7d2: 35 01 movw r6, r10 a7d4: 32 e0 ldi r19, 0x02 ; 2 a7d6: 63 0e add r6, r19 a7d8: 71 1c adc r7, r1 a7da: f5 01 movw r30, r10 a7dc: 80 81 ld r24, Z a7de: 89 83 std Y+1, r24 ; 0x01 a7e0: 21 e0 ldi r18, 0x01 ; 1 a7e2: 30 e0 ldi r19, 0x00 ; 0 a7e4: 3d 87 std Y+13, r19 ; 0x0d a7e6: 2c 87 std Y+12, r18 ; 0x0c a7e8: 54 01 movw r10, r8 a7ea: 0f 77 andi r16, 0x7F ; 127 a7ec: 03 fd sbrc r16, 3 a7ee: 06 c0 rjmp .+12 ; 0xa7fc a7f0: 2c 85 ldd r18, Y+12 ; 0x0c a7f2: 3d 85 ldd r19, Y+13 ; 0x0d a7f4: 52 16 cp r5, r18 a7f6: 13 06 cpc r1, r19 a7f8: 09 f0 breq .+2 ; 0xa7fc a7fa: a8 f4 brcc .+42 ; 0xa826 a7fc: e5 2c mov r14, r5 a7fe: 2b c0 rjmp .+86 ; 0xa856 a800: 35 01 movw r6, r10 a802: 32 e0 ldi r19, 0x02 ; 2 a804: 63 0e add r6, r19 a806: 71 1c adc r7, r1 a808: f5 01 movw r30, r10 a80a: a0 80 ld r10, Z a80c: b1 80 ldd r11, Z+1 ; 0x01 a80e: 6f 2d mov r22, r15 a810: 70 e0 ldi r23, 0x00 ; 0 a812: 06 fd sbrc r16, 6 a814: 02 c0 rjmp .+4 ; 0xa81a a816: 6f ef ldi r22, 0xFF ; 255 a818: 7f ef ldi r23, 0xFF ; 255 a81a: c5 01 movw r24, r10 a81c: 0f 94 5f a2 call 0x344be ; 0x344be a820: 9d 87 std Y+13, r25 ; 0x0d a822: 8c 87 std Y+12, r24 ; 0x0c a824: e2 cf rjmp .-60 ; 0xa7ea a826: b6 01 movw r22, r12 a828: 80 e2 ldi r24, 0x20 ; 32 a82a: 90 e0 ldi r25, 0x00 ; 0 a82c: 0f 94 a6 a2 call 0x3454c ; 0x3454c a830: 5a 94 dec r5 a832: de cf rjmp .-68 ; 0xa7f0 a834: f5 01 movw r30, r10 a836: 07 fd sbrc r16, 7 a838: 85 91 lpm r24, Z+ a83a: 07 ff sbrs r16, 7 a83c: 81 91 ld r24, Z+ a83e: 5f 01 movw r10, r30 a840: b6 01 movw r22, r12 a842: 90 e0 ldi r25, 0x00 ; 0 a844: 0f 94 a6 a2 call 0x3454c ; 0x3454c a848: e1 10 cpse r14, r1 a84a: ea 94 dec r14 a84c: 8c 85 ldd r24, Y+12 ; 0x0c a84e: 9d 85 ldd r25, Y+13 ; 0x0d a850: 01 97 sbiw r24, 0x01 ; 1 a852: 9d 87 std Y+13, r25 ; 0x0d a854: 8c 87 std Y+12, r24 ; 0x0c a856: ec 85 ldd r30, Y+12 ; 0x0c a858: fd 85 ldd r31, Y+13 ; 0x0d a85a: ef 2b or r30, r31 a85c: 59 f7 brne .-42 ; 0xa834 a85e: 78 ce rjmp .-784 ; 0xa550 a860: 84 36 cpi r24, 0x64 ; 100 a862: 19 f0 breq .+6 ; 0xa86a a864: 89 36 cpi r24, 0x69 ; 105 a866: 09 f0 breq .+2 ; 0xa86a a868: 74 c0 rjmp .+232 ; 0xa952 a86a: 35 01 movw r6, r10 a86c: 07 ff sbrs r16, 7 a86e: 66 c0 rjmp .+204 ; 0xa93c a870: f4 e0 ldi r31, 0x04 ; 4 a872: 6f 0e add r6, r31 a874: 71 1c adc r7, r1 a876: f5 01 movw r30, r10 a878: 60 81 ld r22, Z a87a: 71 81 ldd r23, Z+1 ; 0x01 a87c: 82 81 ldd r24, Z+2 ; 0x02 a87e: 93 81 ldd r25, Z+3 ; 0x03 a880: 10 2f mov r17, r16 a882: 1f 76 andi r17, 0x6F ; 111 a884: 97 ff sbrs r25, 7 a886: 08 c0 rjmp .+16 ; 0xa898 a888: 90 95 com r25 a88a: 80 95 com r24 a88c: 70 95 com r23 a88e: 61 95 neg r22 a890: 7f 4f sbci r23, 0xFF ; 255 a892: 8f 4f sbci r24, 0xFF ; 255 a894: 9f 4f sbci r25, 0xFF ; 255 a896: 10 68 ori r17, 0x80 ; 128 a898: 2a e0 ldi r18, 0x0A ; 10 a89a: 30 e0 ldi r19, 0x00 ; 0 a89c: a4 01 movw r20, r8 a89e: 0f 94 cd a3 call 0x3479a ; 0x3479a <__ultoa_invert> a8a2: a8 2e mov r10, r24 a8a4: a8 18 sub r10, r8 a8a6: ba 2c mov r11, r10 a8a8: 01 2f mov r16, r17 a8aa: 16 ff sbrs r17, 6 a8ac: 0a c0 rjmp .+20 ; 0xa8c2 a8ae: 0e 7f andi r16, 0xFE ; 254 a8b0: af 14 cp r10, r15 a8b2: 38 f4 brcc .+14 ; 0xa8c2 a8b4: 14 ff sbrs r17, 4 a8b6: 04 c0 rjmp .+8 ; 0xa8c0 a8b8: 12 fd sbrc r17, 2 a8ba: 02 c0 rjmp .+4 ; 0xa8c0 a8bc: 01 2f mov r16, r17 a8be: 0e 7e andi r16, 0xEE ; 238 a8c0: bf 2c mov r11, r15 a8c2: 04 ff sbrs r16, 4 a8c4: a3 c0 rjmp .+326 ; 0xaa0c a8c6: fe 01 movw r30, r28 a8c8: ea 0d add r30, r10 a8ca: f1 1d adc r31, r1 a8cc: 80 81 ld r24, Z a8ce: 80 33 cpi r24, 0x30 ; 48 a8d0: 09 f0 breq .+2 ; 0xa8d4 a8d2: 95 c0 rjmp .+298 ; 0xa9fe a8d4: 09 7e andi r16, 0xE9 ; 233 a8d6: f0 2f mov r31, r16 a8d8: f8 70 andi r31, 0x08 ; 8 a8da: ef 2e mov r14, r31 a8dc: 03 fd sbrc r16, 3 a8de: a5 c0 rjmp .+330 ; 0xaa2a a8e0: 00 ff sbrs r16, 0 a8e2: 9f c0 rjmp .+318 ; 0xaa22 a8e4: fa 2c mov r15, r10 a8e6: b5 14 cp r11, r5 a8e8: 10 f4 brcc .+4 ; 0xa8ee a8ea: f5 0c add r15, r5 a8ec: fb 18 sub r15, r11 a8ee: 04 ff sbrs r16, 4 a8f0: a2 c0 rjmp .+324 ; 0xaa36 a8f2: b6 01 movw r22, r12 a8f4: 80 e3 ldi r24, 0x30 ; 48 a8f6: 90 e0 ldi r25, 0x00 ; 0 a8f8: 0f 94 a6 a2 call 0x3454c ; 0x3454c a8fc: 02 ff sbrs r16, 2 a8fe: 09 c0 rjmp .+18 ; 0xa912 a900: 88 e7 ldi r24, 0x78 ; 120 a902: 90 e0 ldi r25, 0x00 ; 0 a904: 01 ff sbrs r16, 1 a906: 02 c0 rjmp .+4 ; 0xa90c a908: 88 e5 ldi r24, 0x58 ; 88 a90a: 90 e0 ldi r25, 0x00 ; 0 a90c: b6 01 movw r22, r12 a90e: 0f 94 a6 a2 call 0x3454c ; 0x3454c a912: af 14 cp r10, r15 a914: 08 f4 brcc .+2 ; 0xa918 a916: 9b c0 rjmp .+310 ; 0xaa4e a918: aa 94 dec r10 a91a: 0a 2d mov r16, r10 a91c: 10 e0 ldi r17, 0x00 ; 0 a91e: 0f 5f subi r16, 0xFF ; 255 a920: 1f 4f sbci r17, 0xFF ; 255 a922: 08 0d add r16, r8 a924: 19 1d adc r17, r9 a926: f8 01 movw r30, r16 a928: 82 91 ld r24, -Z a92a: 8f 01 movw r16, r30 a92c: b6 01 movw r22, r12 a92e: 90 e0 ldi r25, 0x00 ; 0 a930: 0f 94 a6 a2 call 0x3454c ; 0x3454c a934: 80 16 cp r8, r16 a936: 91 06 cpc r9, r17 a938: b1 f7 brne .-20 ; 0xa926 a93a: 0a ce rjmp .-1004 ; 0xa550 a93c: f2 e0 ldi r31, 0x02 ; 2 a93e: 6f 0e add r6, r31 a940: 71 1c adc r7, r1 a942: f5 01 movw r30, r10 a944: 60 81 ld r22, Z a946: 71 81 ldd r23, Z+1 ; 0x01 a948: 07 2e mov r0, r23 a94a: 00 0c add r0, r0 a94c: 88 0b sbc r24, r24 a94e: 99 0b sbc r25, r25 a950: 97 cf rjmp .-210 ; 0xa880 a952: 10 2f mov r17, r16 a954: 85 37 cpi r24, 0x75 ; 117 a956: a9 f4 brne .+42 ; 0xa982 a958: 1f 7e andi r17, 0xEF ; 239 a95a: 2a e0 ldi r18, 0x0A ; 10 a95c: 30 e0 ldi r19, 0x00 ; 0 a95e: 35 01 movw r6, r10 a960: 17 ff sbrs r17, 7 a962: 44 c0 rjmp .+136 ; 0xa9ec a964: f4 e0 ldi r31, 0x04 ; 4 a966: 6f 0e add r6, r31 a968: 71 1c adc r7, r1 a96a: f5 01 movw r30, r10 a96c: 60 81 ld r22, Z a96e: 71 81 ldd r23, Z+1 ; 0x01 a970: 82 81 ldd r24, Z+2 ; 0x02 a972: 93 81 ldd r25, Z+3 ; 0x03 a974: a4 01 movw r20, r8 a976: 0f 94 cd a3 call 0x3479a ; 0x3479a <__ultoa_invert> a97a: a8 2e mov r10, r24 a97c: a8 18 sub r10, r8 a97e: 1f 77 andi r17, 0x7F ; 127 a980: 92 cf rjmp .-220 ; 0xa8a6 a982: 19 7f andi r17, 0xF9 ; 249 a984: 8f 36 cpi r24, 0x6F ; 111 a986: 79 f1 breq .+94 ; 0xa9e6 a988: f0 f4 brcc .+60 ; 0xa9c6 a98a: 88 35 cpi r24, 0x58 ; 88 a98c: 39 f1 breq .+78 ; 0xa9dc a98e: f6 01 movw r30, r12 a990: 86 81 ldd r24, Z+6 ; 0x06 a992: 97 81 ldd r25, Z+7 ; 0x07 a994: 2f 96 adiw r28, 0x0f ; 15 a996: 0f b6 in r0, 0x3f ; 63 a998: f8 94 cli a99a: de bf out 0x3e, r29 ; 62 a99c: 0f be out 0x3f, r0 ; 63 a99e: cd bf out 0x3d, r28 ; 61 a9a0: df 91 pop r29 a9a2: cf 91 pop r28 a9a4: 1f 91 pop r17 a9a6: 0f 91 pop r16 a9a8: ff 90 pop r15 a9aa: ef 90 pop r14 a9ac: df 90 pop r13 a9ae: cf 90 pop r12 a9b0: bf 90 pop r11 a9b2: af 90 pop r10 a9b4: 9f 90 pop r9 a9b6: 8f 90 pop r8 a9b8: 7f 90 pop r7 a9ba: 6f 90 pop r6 a9bc: 5f 90 pop r5 a9be: 4f 90 pop r4 a9c0: 3f 90 pop r3 a9c2: 2f 90 pop r2 a9c4: 08 95 ret a9c6: 80 37 cpi r24, 0x70 ; 112 a9c8: 39 f0 breq .+14 ; 0xa9d8 a9ca: 88 37 cpi r24, 0x78 ; 120 a9cc: 01 f7 brne .-64 ; 0xa98e a9ce: 14 fd sbrc r17, 4 a9d0: 14 60 ori r17, 0x04 ; 4 a9d2: 20 e1 ldi r18, 0x10 ; 16 a9d4: 30 e0 ldi r19, 0x00 ; 0 a9d6: c3 cf rjmp .-122 ; 0xa95e a9d8: 10 61 ori r17, 0x10 ; 16 a9da: f9 cf rjmp .-14 ; 0xa9ce a9dc: 04 fd sbrc r16, 4 a9de: 16 60 ori r17, 0x06 ; 6 a9e0: 20 e1 ldi r18, 0x10 ; 16 a9e2: 32 e0 ldi r19, 0x02 ; 2 a9e4: bc cf rjmp .-136 ; 0xa95e a9e6: 28 e0 ldi r18, 0x08 ; 8 a9e8: 30 e0 ldi r19, 0x00 ; 0 a9ea: b9 cf rjmp .-142 ; 0xa95e a9ec: f2 e0 ldi r31, 0x02 ; 2 a9ee: 6f 0e add r6, r31 a9f0: 71 1c adc r7, r1 a9f2: f5 01 movw r30, r10 a9f4: 60 81 ld r22, Z a9f6: 71 81 ldd r23, Z+1 ; 0x01 a9f8: 90 e0 ldi r25, 0x00 ; 0 a9fa: 80 e0 ldi r24, 0x00 ; 0 a9fc: bb cf rjmp .-138 ; 0xa974 a9fe: 02 fd sbrc r16, 2 aa00: 02 c0 rjmp .+4 ; 0xaa06 aa02: b3 94 inc r11 aa04: 68 cf rjmp .-304 ; 0xa8d6 aa06: b3 94 inc r11 aa08: b3 94 inc r11 aa0a: 65 cf rjmp .-310 ; 0xa8d6 aa0c: 80 2f mov r24, r16 aa0e: 86 78 andi r24, 0x86 ; 134 aa10: 09 f4 brne .+2 ; 0xaa14 aa12: 61 cf rjmp .-318 ; 0xa8d6 aa14: f6 cf rjmp .-20 ; 0xaa02 aa16: b6 01 movw r22, r12 aa18: 80 e2 ldi r24, 0x20 ; 32 aa1a: 90 e0 ldi r25, 0x00 ; 0 aa1c: 0f 94 a6 a2 call 0x3454c ; 0x3454c aa20: b3 94 inc r11 aa22: b5 14 cp r11, r5 aa24: c0 f3 brcs .-16 ; 0xaa16 aa26: e1 2c mov r14, r1 aa28: 62 cf rjmp .-316 ; 0xa8ee aa2a: e5 2c mov r14, r5 aa2c: eb 18 sub r14, r11 aa2e: b5 14 cp r11, r5 aa30: 08 f4 brcc .+2 ; 0xaa34 aa32: 5d cf rjmp .-326 ; 0xa8ee aa34: f8 cf rjmp .-16 ; 0xaa26 aa36: 80 2f mov r24, r16 aa38: 86 78 andi r24, 0x86 ; 134 aa3a: 09 f4 brne .+2 ; 0xaa3e aa3c: 6a cf rjmp .-300 ; 0xa912 aa3e: 8b e2 ldi r24, 0x2B ; 43 aa40: 01 ff sbrs r16, 1 aa42: 80 e2 ldi r24, 0x20 ; 32 aa44: 07 fd sbrc r16, 7 aa46: 8d e2 ldi r24, 0x2D ; 45 aa48: b6 01 movw r22, r12 aa4a: 90 e0 ldi r25, 0x00 ; 0 aa4c: 60 cf rjmp .-320 ; 0xa90e aa4e: b6 01 movw r22, r12 aa50: 80 e3 ldi r24, 0x30 ; 48 aa52: 90 e0 ldi r25, 0x00 ; 0 aa54: 0f 94 a6 a2 call 0x3454c ; 0x3454c aa58: fa 94 dec r15 aa5a: 5b cf rjmp .-330 ; 0xa912 aa5c: b6 01 movw r22, r12 aa5e: 80 e2 ldi r24, 0x20 ; 32 aa60: 90 e0 ldi r25, 0x00 ; 0 aa62: 0f 94 a6 a2 call 0x3454c ; 0x3454c aa66: ea 94 dec r14 aa68: 73 cd rjmp .-1306 ; 0xa550 aa6a: 24 e0 ldi r18, 0x04 ; 4 aa6c: e1 2c mov r14, r1 aa6e: 25 15 cp r18, r5 aa70: 08 f0 brcs .+2 ; 0xaa74 aa72: 36 cd rjmp .-1428 ; 0xa4e0 aa74: 84 e0 ldi r24, 0x04 ; 4 aa76: 26 cd rjmp .-1460 ; 0xa4c4 0000aa78 : 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 ( aa78: 20 e0 ldi r18, 0x00 ; 0 aa7a: 30 e0 ldi r19, 0x00 ; 0 aa7c: 40 e8 ldi r20, 0x80 ; 128 aa7e: 5f eb ldi r21, 0xBF ; 191 aa80: 60 91 7e 02 lds r22, 0x027E ; 0x80027e aa84: 70 91 7f 02 lds r23, 0x027F ; 0x80027f aa88: 80 91 80 02 lds r24, 0x0280 ; 0x800280 aa8c: 90 91 81 02 lds r25, 0x0281 ; 0x800281 aa90: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> aa94: 88 23 and r24, r24 aa96: 21 f1 breq .+72 ; 0xaae0 (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || aa98: e0 91 38 12 lds r30, 0x1238 ; 0x801238 aa9c: f0 91 39 12 lds r31, 0x1239 ; 0x801239 aaa0: e5 5b subi r30, 0xB5 ; 181 aaa2: 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) && ( aaa4: 80 81 ld r24, Z aaa6: 8b 7f andi r24, 0xFB ; 251 aaa8: 82 30 cpi r24, 0x02 ; 2 aaaa: d1 f4 brne .+52 ; 0xaae0 (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)); aaac: 80 e1 ldi r24, 0x10 ; 16 aaae: ee e7 ldi r30, 0x7E ; 126 aab0: f2 e0 ldi r31, 0x02 ; 2 aab2: a1 e6 ldi r26, 0x61 ; 97 aab4: b2 e1 ldi r27, 0x12 ; 18 aab6: 01 90 ld r0, Z+ aab8: 0d 92 st X+, r0 aaba: 8a 95 dec r24 aabc: e1 f7 brne .-8 ; 0xaab6 saved_start_position[0] = SAVED_START_POSITION_UNSET; aabe: 80 e0 ldi r24, 0x00 ; 0 aac0: 90 e0 ldi r25, 0x00 ; 0 aac2: a0 e8 ldi r26, 0x80 ; 128 aac4: bf eb ldi r27, 0xBF ; 191 aac6: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e aaca: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f aace: a0 93 80 02 sts 0x0280, r26 ; 0x800280 aad2: b0 93 81 02 sts 0x0281, r27 ; 0x800281 return saved_segment_idx; aad6: 80 91 4d 12 lds r24, 0x124D ; 0x80124d aada: 90 91 4e 12 lds r25, 0x124E ; 0x80124e aade: 08 95 ret } else return 1; //begin with the first segment aae0: 81 e0 ldi r24, 0x01 ; 1 aae2: 90 e0 ldi r25, 0x00 ; 0 } aae4: 08 95 ret 0000aae6 : 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)); } aae6: 80 e1 ldi r24, 0x10 ; 16 aae8: e9 e2 ldi r30, 0x29 ; 41 aaea: f6 e0 ldi r31, 0x06 ; 6 aaec: a1 e6 ldi r26, 0x61 ; 97 aaee: b2 e1 ldi r27, 0x12 ; 18 aaf0: 01 90 ld r0, Z+ aaf2: 0d 92 st X+, r0 aaf4: 8a 95 dec r24 aaf6: e1 f7 brne .-8 ; 0xaaf0 aaf8: 08 95 ret 0000aafa : /// @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)); aafa: e0 e0 ldi r30, 0x00 ; 0 aafc: f7 e7 ldi r31, 0x77 ; 119 aafe: 83 30 cpi r24, 0x03 ; 3 ab00: 21 f0 breq .+8 ; 0xab0a ab02: e8 2f mov r30, r24 ab04: f0 e0 ldi r31, 0x00 ; 0 ab06: e3 50 subi r30, 0x03 ; 3 ab08: f9 48 sbci r31, 0x89 ; 137 ab0a: 84 91 lpm r24, Z } ab0c: 08 95 ret 0000ab0e : 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; ab0e: 80 91 42 05 lds r24, 0x0542 ; 0x800542 ab12: 90 91 43 05 lds r25, 0x0543 ; 0x800543 ab16: 20 91 44 05 lds r18, 0x0544 ; 0x800544 ab1a: 30 91 45 05 lds r19, 0x0545 ; 0x800545 ab1e: 82 1b sub r24, r18 ab20: 93 0b sbc r25, r19 } ab22: 8f 77 andi r24, 0x7F ; 127 ab24: 99 27 eor r25, r25 ab26: 08 95 ret 0000ab28 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; ab28: 98 2f mov r25, r24 ab2a: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); ab2c: 83 ff sbrs r24, 3 ab2e: 0d c0 rjmp .+26 ; 0xab4a ab30: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ab34: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); ab36: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); ab3a: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> ab3e: 88 7f andi r24, 0xF8 ; 248 ab40: 97 70 andi r25, 0x07 ; 7 ab42: 89 2b or r24, r25 ab44: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } ab48: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ab4a: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ab4e: 87 7f andi r24, 0xF7 ; 247 ab50: f2 cf rjmp .-28 ; 0xab36 0000ab52 : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); ab52: 4f ef ldi r20, 0xFF ; 255 ab54: 5f ef ldi r21, 0xFF ; 255 ab56: ba 01 movw r22, r20 ab58: 85 ee ldi r24, 0xE5 ; 229 ab5a: 9f e0 ldi r25, 0x0F ; 15 ab5c: 0f 94 74 a4 call 0x348e8 ; 0x348e8 ab60: 4f ef ldi r20, 0xFF ; 255 ab62: 5f ef ldi r21, 0xFF ; 255 ab64: ba 01 movw r22, r20 ab66: 89 ee ldi r24, 0xE9 ; 233 ab68: 9f e0 ldi r25, 0x0F ; 15 ab6a: 0f 94 74 a4 call 0x348e8 ; 0x348e8 ab6e: 4f ef ldi r20, 0xFF ; 255 ab70: 5f ef ldi r21, 0xFF ; 255 ab72: ba 01 movw r22, r20 ab74: 8d ed ldi r24, 0xDD ; 221 ab76: 9f e0 ldi r25, 0x0F ; 15 ab78: 0f 94 74 a4 call 0x348e8 ; 0x348e8 ab7c: 4f ef ldi r20, 0xFF ; 255 ab7e: 5f ef ldi r21, 0xFF ; 255 ab80: ba 01 movw r22, r20 ab82: 81 ee ldi r24, 0xE1 ; 225 ab84: 9f e0 ldi r25, 0x0F ; 15 ab86: 0f 94 74 a4 call 0x348e8 ; 0x348e8 ab8a: 4f ef ldi r20, 0xFF ; 255 ab8c: 5f ef ldi r21, 0xFF ; 255 ab8e: ba 01 movw r22, r20 ab90: 85 ed ldi r24, 0xD5 ; 213 ab92: 9f e0 ldi r25, 0x0F ; 15 ab94: 0f 94 74 a4 call 0x348e8 ; 0x348e8 ab98: 4f ef ldi r20, 0xFF ; 255 ab9a: 5f ef ldi r21, 0xFF ; 255 ab9c: ba 01 movw r22, r20 ab9e: 89 ed ldi r24, 0xD9 ; 217 aba0: 9f e0 ldi r25, 0x0F ; 15 aba2: 0f 94 74 a4 call 0x348e8 ; 0x348e8 aba6: 4f ef ldi r20, 0xFF ; 255 aba8: 5f ef ldi r21, 0xFF ; 255 abaa: ba 01 movw r22, r20 abac: 85 ec ldi r24, 0xC5 ; 197 abae: 9f e0 ldi r25, 0x0F ; 15 abb0: 0f 94 74 a4 call 0x348e8 ; 0x348e8 abb4: 4f ef ldi r20, 0xFF ; 255 abb6: 5f ef ldi r21, 0xFF ; 255 abb8: ba 01 movw r22, r20 abba: 89 ec ldi r24, 0xC9 ; 201 abbc: 9f e0 ldi r25, 0x0F ; 15 abbe: 0f 94 74 a4 call 0x348e8 ; 0x348e8 abc2: 4f ef ldi r20, 0xFF ; 255 abc4: 5f ef ldi r21, 0xFF ; 255 abc6: ba 01 movw r22, r20 abc8: 8d ec ldi r24, 0xCD ; 205 abca: 9f e0 ldi r25, 0x0F ; 15 abcc: 0f 94 74 a4 call 0x348e8 ; 0x348e8 abd0: 4f ef ldi r20, 0xFF ; 255 abd2: 5f ef ldi r21, 0xFF ; 255 abd4: ba 01 movw r22, r20 abd6: 81 ed ldi r24, 0xD1 ; 209 abd8: 9f e0 ldi r25, 0x0F ; 15 abda: 0d 94 74 a4 jmp 0x348e8 ; 0x348e8 0000abde : // 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) abde: 80 36 cpi r24, 0x60 ; 96 abe0: 91 05 cpc r25, r1 abe2: f8 f4 brcc .+62 ; 0xac22 return false; if (bufindr == bufindw && buflen > 0) abe4: 40 91 38 12 lds r20, 0x1238 ; 0x801238 abe8: 50 91 39 12 lds r21, 0x1239 ; 0x801239 abec: 20 91 49 10 lds r18, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> abf0: 30 91 4a 10 lds r19, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> abf4: 42 17 cp r20, r18 abf6: 53 07 cpc r21, r19 abf8: 39 f4 brne .+14 ; 0xac08 abfa: 60 91 3c 12 lds r22, 0x123C ; 0x80123c abfe: 70 91 3d 12 lds r23, 0x123D ; 0x80123d ac02: 16 16 cp r1, r22 ac04: 17 06 cpc r1, r23 ac06: 6c f0 brlt .+26 ; 0xac22 // 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); ac08: b9 01 movw r22, r18 ac0a: 68 0f add r22, r24 ac0c: 79 1f adc r23, r25 ac0e: fb 01 movw r30, r22 ac10: e3 59 subi r30, 0x93 ; 147 ac12: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) ac14: 24 17 cp r18, r20 ac16: 35 07 cpc r19, r21 ac18: 30 f4 brcc .+12 ; 0xac26 // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; ac1a: 81 e0 ldi r24, 0x01 ; 1 ac1c: 4e 17 cp r20, r30 ac1e: 5f 07 cpc r21, r31 ac20: 08 f4 brcc .+2 ; 0xac24 // 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; ac22: 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; } ac24: 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? ac26: ee 3e cpi r30, 0xEE ; 238 ac28: f1 40 sbci r31, 0x01 ; 1 ac2a: f8 f0 brcs .+62 ; 0xac6a // 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); ac2c: 6c 5f subi r22, 0xFC ; 252 ac2e: 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) || ac30: 6e 3e cpi r22, 0xEE ; 238 ac32: 71 40 sbci r23, 0x01 ; 1 ac34: 18 f4 brcc .+6 ; 0xac3c // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) ac36: 49 36 cpi r20, 0x69 ; 105 ac38: 51 05 cpc r21, r1 ac3a: b8 f4 brcc .+46 ; 0xac6a return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { ac3c: 83 59 subi r24, 0x93 ; 147 ac3e: 9f 4f sbci r25, 0xFF ; 255 ac40: 48 17 cp r20, r24 ac42: 59 07 cpc r21, r25 ac44: 70 f3 brcs .-36 ; 0xac22 // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); ac46: 4d ee ldi r20, 0xED ; 237 ac48: 51 e0 ldi r21, 0x01 ; 1 ac4a: 42 1b sub r20, r18 ac4c: 53 0b sbc r21, r19 ac4e: 70 e0 ldi r23, 0x00 ; 0 ac50: 60 e0 ldi r22, 0x00 ; 0 ac52: c9 01 movw r24, r18 ac54: 85 5b subi r24, 0xB5 ; 181 ac56: 9f 4e sbci r25, 0xEF ; 239 ac58: 0f 94 70 aa call 0x354e0 ; 0x354e0 // 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; } ac5c: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); ac5e: f8 94 cli ac60: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> ac64: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.512> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; ac68: 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; ac6a: 81 e0 ldi r24, 0x01 ; 1 ac6c: 08 95 ret 0000ac6e : // 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; ac6e: 80 91 44 05 lds r24, 0x0544 ; 0x800544 ac72: 90 91 45 05 lds r25, 0x0545 ; 0x800545 ac76: 90 93 43 05 sts 0x0543, r25 ; 0x800543 ac7a: 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); ac7e: 80 e9 ldi r24, 0x90 ; 144 ac80: 9a e6 ldi r25, 0x6A ; 106 ac82: 9f 93 push r25 ac84: 8f 93 push r24 ac86: 80 91 3e 12 lds r24, 0x123E ; 0x80123e ac8a: 90 91 3f 12 lds r25, 0x123F ; 0x80123f ac8e: a0 91 40 12 lds r26, 0x1240 ; 0x801240 ac92: b0 91 41 12 lds r27, 0x1241 ; 0x801241 ac96: 01 96 adiw r24, 0x01 ; 1 ac98: a1 1d adc r26, r1 ac9a: b1 1d adc r27, r1 ac9c: bf 93 push r27 ac9e: af 93 push r26 aca0: 9f 93 push r25 aca2: 8f 93 push r24 aca4: 8d e0 ldi r24, 0x0D ; 13 aca6: 95 e6 ldi r25, 0x65 ; 101 aca8: 9f 93 push r25 acaa: 8f 93 push r24 acac: 84 e1 ldi r24, 0x14 ; 20 acae: 95 e6 ldi r25, 0x65 ; 101 acb0: 9f 93 push r25 acb2: 8f 93 push r24 acb4: 0f 94 00 a3 call 0x34600 ; 0x34600 acb8: 8d b7 in r24, 0x3d ; 61 acba: 9e b7 in r25, 0x3e ; 62 acbc: 0a 96 adiw r24, 0x0a ; 10 acbe: 0f b6 in r0, 0x3f ; 63 acc0: f8 94 cli acc2: 9e bf out 0x3e, r25 ; 62 acc4: 0f be out 0x3f, r0 ; 63 acc6: 8d bf out 0x3d, r24 ; 61 } acc8: 08 95 ret 0000acca : 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) { acca: 0f 93 push r16 accc: 1f 93 push r17 acce: cf 93 push r28 acd0: df 93 push r29 acd2: ec 01 movw r28, r24 acd4: c6 0f add r28, r22 acd6: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { acd8: 8c 17 cp r24, r28 acda: 9d 07 cpc r25, r29 acdc: 79 f0 breq .+30 ; 0xacfc if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) acde: 8c 01 movw r16, r24 ace0: 0f 5f subi r16, 0xFF ; 255 ace2: 1f 4f sbci r17, 0xFF ; 255 ace4: 0f 94 3e a4 call 0x3487c ; 0x3487c ace8: 8f 3f cpi r24, 0xFF ; 255 acea: 31 f0 breq .+12 ; 0xacf8 return true; acec: 81 e0 ldi r24, 0x01 ; 1 } return false; } acee: df 91 pop r29 acf0: cf 91 pop r28 acf2: 1f 91 pop r17 acf4: 0f 91 pop r16 acf6: 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) acf8: c8 01 movw r24, r16 acfa: ee cf rjmp .-36 ; 0xacd8 return true; } return false; acfc: 80 e0 ldi r24, 0x00 ; 0 acfe: f7 cf rjmp .-18 ; 0xacee 0000ad00 : #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; } ad00: 68 2f mov r22, r24 ad02: 88 0f add r24, r24 ad04: 77 0b sbc r23, r23 ad06: 80 91 38 12 lds r24, 0x1238 ; 0x801238 ad0a: 90 91 39 12 lds r25, 0x1239 ; 0x801239 ad0e: 82 5b subi r24, 0xB2 ; 178 ad10: 9f 4e sbci r25, 0xEF ; 239 ad12: 0f 94 95 aa call 0x3552a ; 0x3552a ad16: 9c 01 movw r18, r24 ad18: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc ad1c: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb ad20: 81 e0 ldi r24, 0x01 ; 1 ad22: 23 2b or r18, r19 ad24: 09 f4 brne .+2 ; 0xad28 ad26: 80 e0 ldi r24, 0x00 ; 0 ad28: 08 95 ret 0000ad2a : 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)); }; ad2a: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb ad2e: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc ad32: 4a e0 ldi r20, 0x0A ; 10 ad34: 50 e0 ldi r21, 0x00 ; 0 ad36: 70 e0 ldi r23, 0x00 ; 0 ad38: 60 e0 ldi r22, 0x00 ; 0 ad3a: 01 96 adiw r24, 0x01 ; 1 ad3c: 0f 94 c9 9f call 0x33f92 ; 0x33f92 ad40: 86 2f mov r24, r22 ad42: 08 95 ret 0000ad44 : // 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)); }; ad44: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb ad48: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc ad4c: 4a e0 ldi r20, 0x0A ; 10 ad4e: 50 e0 ldi r21, 0x00 ; 0 ad50: 70 e0 ldi r23, 0x00 ; 0 ad52: 60 e0 ldi r22, 0x00 ; 0 ad54: 01 96 adiw r24, 0x01 ; 1 ad56: 0f 94 c9 9f call 0x33f92 ; 0x33f92 ad5a: cb 01 movw r24, r22 ad5c: 08 95 ret 0000ad5e : #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 { ad5e: 0f 93 push r16 ad60: 1f 93 push r17 ad62: cf 93 push r28 ad64: df 93 push r29 ad66: 8c 01 movw r16, r24 ad68: 86 2f mov r24, r22 ad6a: ea 01 movw r28, r20 if (code_seen(code)) { ad6c: 0e 94 80 56 call 0xad00 ; 0xad00 ad70: 88 23 and r24, r24 ad72: 19 f1 breq .+70 ; 0xadba // Verify value is within allowed range int16_t temp = code_value_short(); ad74: 0e 94 a2 56 call 0xad44 ; 0xad44 if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { ad78: 9c 01 movw r18, r24 ad7a: 97 ff sbrs r25, 7 ad7c: 03 c0 rjmp .+6 ; 0xad84 ad7e: 31 95 neg r19 ad80: 21 95 neg r18 ad82: 31 09 sbc r19, r1 ad84: 25 36 cpi r18, 0x65 ; 101 ad86: 31 05 cpc r19, r1 ad88: 9c f0 brlt .+38 ; 0xadb0 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); ad8a: 9f 93 push r25 ad8c: 8f 93 push r24 ad8e: 87 ec ldi r24, 0xC7 ; 199 ad90: 92 ea ldi r25, 0xA2 ; 162 ad92: 9f 93 push r25 ad94: 8f 93 push r24 ad96: 8d e7 ldi r24, 0x7D ; 125 ad98: 97 e7 ldi r25, 0x77 ; 119 ad9a: 9f 93 push r25 ad9c: 8f 93 push r24 ad9e: 0f 94 00 a3 call 0x34600 ; 0x34600 ada2: 0f 90 pop r0 ada4: 0f 90 pop r0 ada6: 0f 90 pop r0 ada8: 0f 90 pop r0 adaa: 0f 90 pop r0 adac: 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; adae: 80 e0 ldi r24, 0x00 ; 0 }; adb0: df 91 pop r29 adb2: cf 91 pop r28 adb4: 1f 91 pop r17 adb6: 0f 91 pop r16 adb8: 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) { adba: f8 01 movw r30, r16 adbc: 80 81 ld r24, Z adbe: 88 23 and r24, r24 adc0: b1 f3 breq .-20 ; 0xadae return (int8_t)eeprom_read_byte(eep_address); adc2: ce 01 movw r24, r28 } return 0; }; adc4: df 91 pop r29 adc6: cf 91 pop r28 adc8: 1f 91 pop r17 adca: 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); adcc: 0d 94 3e a4 jmp 0x3487c ; 0x3487c 0000add0 : // 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); } add0: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb add4: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc add8: 4a e0 ldi r20, 0x0A ; 10 adda: 50 e0 ldi r21, 0x00 ; 0 addc: 70 e0 ldi r23, 0x00 ; 0 adde: 60 e0 ldi r22, 0x00 ; 0 ade0: 01 96 adiw r24, 0x01 ; 1 ade2: 0d 94 c9 9f jmp 0x33f92 ; 0x33f92 0000ade6 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ade6: 60 e0 ldi r22, 0x00 ; 0 ade8: 86 e6 ldi r24, 0x66 ; 102 adea: 9f e0 ldi r25, 0x0F ; 15 adec: 0f 94 62 a4 call 0x348c4 ; 0x348c4 adf0: 60 e0 ldi r22, 0x00 ; 0 adf2: 88 e6 ldi r24, 0x68 ; 104 adf4: 9f e0 ldi r25, 0x0F ; 15 adf6: 0f 94 62 a4 call 0x348c4 ; 0x348c4 adfa: 60 e0 ldi r22, 0x00 ; 0 adfc: 85 e6 ldi r24, 0x65 ; 101 adfe: 9f e0 ldi r25, 0x0F ; 15 ae00: 0f 94 62 a4 call 0x348c4 ; 0x348c4 ae04: 60 e0 ldi r22, 0x00 ; 0 ae06: 84 e6 ldi r24, 0x64 ; 100 ae08: 9f e0 ldi r25, 0x0F ; 15 ae0a: 0f 94 62 a4 call 0x348c4 ; 0x348c4 ae0e: 60 e0 ldi r22, 0x00 ; 0 ae10: 82 ed ldi r24, 0xD2 ; 210 ae12: 9e e0 ldi r25, 0x0E ; 14 ae14: 0f 94 62 a4 call 0x348c4 ; 0x348c4 ae18: 60 e0 ldi r22, 0x00 ; 0 ae1a: 8f ec ldi r24, 0xCF ; 207 ae1c: 9e e0 ldi r25, 0x0E ; 14 ae1e: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 0000ae22 : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { ae22: 2f 92 push r2 ae24: 3f 92 push r3 ae26: 4f 92 push r4 ae28: 5f 92 push r5 ae2a: 6f 92 push r6 ae2c: 7f 92 push r7 ae2e: 8f 92 push r8 ae30: 9f 92 push r9 ae32: af 92 push r10 ae34: bf 92 push r11 ae36: cf 92 push r12 ae38: df 92 push r13 ae3a: ef 92 push r14 ae3c: ff 92 push r15 ae3e: 0f 93 push r16 ae40: 1f 93 push r17 ae42: cf 93 push r28 ae44: df 93 push r29 ae46: cd b7 in r28, 0x3d ; 61 ae48: de b7 in r29, 0x3e ; 62 ae4a: cc 58 subi r28, 0x8C ; 140 ae4c: d2 40 sbci r29, 0x02 ; 2 ae4e: 0f b6 in r0, 0x3f ; 63 ae50: f8 94 cli ae52: de bf out 0x3e, r29 ; 62 ae54: 0f be out 0x3f, r0 ; 63 ae56: cd bf out 0x3d, r28 ; 61 ae58: cb 58 subi r28, 0x8B ; 139 ae5a: dd 4f sbci r29, 0xFD ; 253 ae5c: 68 83 st Y, r22 ae5e: 79 83 std Y+1, r23 ; 0x01 ae60: 8a 83 std Y+2, r24 ; 0x02 ae62: 9b 83 std Y+3, r25 ; 0x03 ae64: c5 57 subi r28, 0x75 ; 117 ae66: 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; ae68: fe 01 movw r30, r28 ae6a: e7 54 subi r30, 0x47 ; 71 ae6c: fe 4f sbci r31, 0xFE ; 254 ae6e: 88 e2 ldi r24, 0x28 ; 40 ae70: df 01 movw r26, r30 ae72: 1d 92 st X+, r1 ae74: 8a 95 dec r24 ae76: e9 f7 brne .-6 ; 0xae72 ae78: e8 5b subi r30, 0xB8 ; 184 ae7a: f1 40 sbci r31, 0x01 ; 1 ae7c: 1f 01 movw r2, r30 ae7e: 80 e9 ldi r24, 0x90 ; 144 ae80: 91 e0 ldi r25, 0x01 ; 1 ae82: df 01 movw r26, r30 ae84: fc 01 movw r30, r24 ae86: 1d 92 st X+, r1 ae88: 31 97 sbiw r30, 0x01 ; 1 ae8a: e9 f7 brne .-6 ; 0xae86 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; ae8c: c7 5a subi r28, 0xA7 ; 167 ae8e: dd 4f sbci r29, 0xFD ; 253 ae90: 19 82 std Y+1, r1 ; 0x01 ae92: 18 82 st Y, r1 ae94: c9 55 subi r28, 0x59 ; 89 ae96: d2 40 sbci r29, 0x02 ; 2 ae98: 9e 01 movw r18, r28 ae9a: 2f 51 subi r18, 0x1F ; 31 ae9c: 3e 4f sbci r19, 0xFE ; 254 ae9e: c1 59 subi r28, 0x91 ; 145 aea0: dd 4f sbci r29, 0xFD ; 253 aea2: 39 83 std Y+1, r19 ; 0x01 aea4: 28 83 st Y, r18 aea6: cf 56 subi r28, 0x6F ; 111 aea8: d2 40 sbci r29, 0x02 ; 2 aeaa: 8e 01 movw r16, r28 aeac: 07 5a subi r16, 0xA7 ; 167 aeae: 1d 4f sbci r17, 0xFD ; 253 aeb0: ce 01 movw r24, r28 aeb2: 8f 5c subi r24, 0xCF ; 207 aeb4: 9d 4f sbci r25, 0xFD ; 253 aeb6: c3 59 subi r28, 0x93 ; 147 aeb8: dd 4f sbci r29, 0xFD ; 253 aeba: 99 83 std Y+1, r25 ; 0x01 aebc: 88 83 st Y, r24 aebe: cd 56 subi r28, 0x6D ; 109 aec0: d2 40 sbci r29, 0x02 ; 2 aec2: 3c 01 movw r6, r24 aec4: 49 01 movw r8, r18 aec6: 40 eb ldi r20, 0xB0 ; 176 aec8: a4 2e mov r10, r20 aeca: 4f e0 ldi r20, 0x0F ; 15 aecc: b4 2e mov r11, r20 aece: 53 e2 ldi r21, 0x23 ; 35 aed0: c5 2e mov r12, r21 aed2: d1 2c mov r13, r1 for (i = 0; i < n; i++) { aed4: f1 2c mov r15, r1 aed6: 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]; aed8: b6 01 movw r22, r12 aeda: 0d 2c mov r0, r13 aedc: 00 0c add r0, r0 aede: 88 0b sbc r24, r24 aee0: 99 0b sbc r25, r25 aee2: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> aee6: d4 01 movw r26, r8 aee8: 6d 93 st X+, r22 aeea: 7d 93 st X+, r23 aeec: 8d 93 st X+, r24 aeee: 9d 93 st X+, r25 aef0: 4d 01 movw r8, r26 f[i] = (float)shift[i]; aef2: f8 01 movw r30, r16 aef4: 61 91 ld r22, Z+ aef6: 71 91 ld r23, Z+ aef8: 8f 01 movw r16, r30 aefa: 07 2e mov r0, r23 aefc: 00 0c add r0, r0 aefe: 88 0b sbc r24, r24 af00: 99 0b sbc r25, r25 af02: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> af06: d3 01 movw r26, r6 af08: 6d 93 st X+, r22 af0a: 7d 93 st X+, r23 af0c: 8d 93 st X+, r24 af0e: 9d 93 st X+, r25 af10: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { af12: bf ef ldi r27, 0xFF ; 255 af14: eb 1a sub r14, r27 af16: fb 0a sbc r15, r27 af18: e6 e0 ldi r30, 0x06 ; 6 af1a: ee 16 cp r14, r30 af1c: f1 04 cpc r15, r1 af1e: 09 f0 breq .+2 ; 0xaf22 af20: 38 c3 rjmp .+1648 ; 0xb592 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; af22: cb 58 subi r28, 0x8B ; 139 af24: dd 4f sbci r29, 0xFD ; 253 af26: 28 81 ld r18, Y af28: 39 81 ldd r19, Y+1 ; 0x01 af2a: 4a 81 ldd r20, Y+2 ; 0x02 af2c: 5b 81 ldd r21, Y+3 ; 0x03 af2e: c5 57 subi r28, 0x75 ; 117 af30: d2 40 sbci r29, 0x02 ; 2 af32: c1 59 subi r28, 0x91 ; 145 af34: dd 4f sbci r29, 0xFD ; 253 af36: a8 81 ld r26, Y af38: b9 81 ldd r27, Y+1 ; 0x01 af3a: cf 56 subi r28, 0x6F ; 111 af3c: d2 40 sbci r29, 0x02 ; 2 af3e: 6d 91 ld r22, X+ af40: 7d 91 ld r23, X+ af42: 8d 91 ld r24, X+ af44: 9c 91 ld r25, X af46: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> af4a: 41 2c mov r4, r1 af4c: 51 2c mov r5, r1 af4e: 32 01 movw r6, r4 af50: 18 16 cp r1, r24 af52: 0c f4 brge .+2 ; 0xaf56 af54: 02 c3 rjmp .+1540 ; 0xb55a af56: c3 59 subi r28, 0x93 ; 147 af58: dd 4f sbci r29, 0xFD ; 253 af5a: 08 81 ld r16, Y af5c: 19 81 ldd r17, Y+1 ; 0x01 af5e: cd 56 subi r28, 0x6D ; 109 af60: d2 40 sbci r29, 0x02 ; 2 af62: 0c 5e subi r16, 0xEC ; 236 af64: 1f 4f sbci r17, 0xFF ; 255 af66: c1 59 subi r28, 0x91 ; 145 af68: dd 4f sbci r29, 0xFD ; 253 af6a: e8 80 ld r14, Y af6c: f9 80 ldd r15, Y+1 ; 0x01 af6e: cf 56 subi r28, 0x6F ; 111 af70: d2 40 sbci r29, 0x02 ; 2 af72: b4 e1 ldi r27, 0x14 ; 20 af74: eb 0e add r14, r27 af76: f1 1c adc r15, r1 af78: 6e 01 movw r12, r28 af7a: ef ed ldi r30, 0xDF ; 223 af7c: ce 1a sub r12, r30 af7e: ed ef ldi r30, 0xFD ; 253 af80: de 0a sbc r13, r30 af82: 9e 01 movw r18, r28 af84: 2b 55 subi r18, 0x5B ; 91 af86: 3e 4f sbci r19, 0xFE ; 254 af88: cf 58 subi r28, 0x8F ; 143 af8a: dd 4f sbci r29, 0xFD ; 253 af8c: 39 83 std Y+1, r19 ; 0x01 af8e: 28 83 st Y, r18 af90: c1 57 subi r28, 0x71 ; 113 af92: 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]); af94: d8 01 movw r26, r16 af96: 4d 90 ld r4, X+ af98: 5d 90 ld r5, X+ af9a: 6d 90 ld r6, X+ af9c: 7c 90 ld r7, X af9e: f7 01 movw r30, r14 afa0: 60 81 ld r22, Z afa2: 71 81 ldd r23, Z+1 ; 0x01 afa4: 82 81 ldd r24, Z+2 ; 0x02 afa6: 93 81 ldd r25, Z+3 ; 0x03 afa8: d7 01 movw r26, r14 afaa: 5e 91 ld r21, -X afac: 4e 91 ld r20, -X afae: 3e 91 ld r19, -X afb0: 2e 91 ld r18, -X afb2: 7d 01 movw r14, r26 afb4: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> afb8: 4b 01 movw r8, r22 afba: 5c 01 movw r10, r24 afbc: f8 01 movw r30, r16 afbe: 52 91 ld r21, -Z afc0: 42 91 ld r20, -Z afc2: 32 91 ld r19, -Z afc4: 22 91 ld r18, -Z afc6: 8f 01 movw r16, r30 afc8: c3 01 movw r24, r6 afca: b2 01 movw r22, r4 afcc: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> afd0: a5 01 movw r20, r10 afd2: 94 01 movw r18, r8 afd4: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> afd8: d6 01 movw r26, r12 afda: 9e 93 st -X, r25 afdc: 8e 93 st -X, r24 afde: 7e 93 st -X, r23 afe0: 6e 93 st -X, r22 afe2: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; afe4: cf 58 subi r28, 0x8F ; 143 afe6: dd 4f sbci r29, 0xFD ; 253 afe8: e8 81 ld r30, Y afea: f9 81 ldd r31, Y+1 ; 0x01 afec: c1 57 subi r28, 0x71 ; 113 afee: d2 40 sbci r29, 0x02 ; 2 aff0: b2 92 st -Z, r11 aff2: a2 92 st -Z, r10 aff4: 92 92 st -Z, r9 aff6: 82 92 st -Z, r8 aff8: cf 58 subi r28, 0x8F ; 143 affa: dd 4f sbci r29, 0xFD ; 253 affc: f9 83 std Y+1, r31 ; 0x01 affe: e8 83 st Y, r30 b000: c1 57 subi r28, 0x71 ; 113 b002: 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--) { b004: c3 59 subi r28, 0x93 ; 147 b006: dd 4f sbci r29, 0xFD ; 253 b008: 28 81 ld r18, Y b00a: 39 81 ldd r19, Y+1 ; 0x01 b00c: cd 56 subi r28, 0x6D ; 109 b00e: d2 40 sbci r29, 0x02 ; 2 b010: 02 17 cp r16, r18 b012: 13 07 cpc r17, r19 b014: 09 f0 breq .+2 ; 0xb018 b016: be cf rjmp .-132 ; 0xaf94 b018: 4e 01 movw r8, r28 b01a: 3f e6 ldi r19, 0x6F ; 111 b01c: 83 1a sub r8, r19 b01e: 3e ef ldi r19, 0xFE ; 254 b020: 93 0a sbc r9, r19 b022: 5e 01 movw r10, r28 b024: 83 ef ldi r24, 0xF3 ; 243 b026: a8 1a sub r10, r24 b028: 8d ef ldi r24, 0xFD ; 253 b02a: b8 0a sbc r11, r24 b02c: 61 01 movw r12, r2 b02e: 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 b052: 9b 01 movw r18, r22 b054: ac 01 movw r20, r24 b056: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> b05a: f8 01 movw r30, r16 b05c: 64 a7 std Z+44, r22 ; 0x2c b05e: 75 a7 std Z+45, r23 ; 0x2d b060: 86 a7 std Z+46, r24 ; 0x2e b062: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { b064: f1 e0 ldi r31, 0x01 ; 1 b066: ef 16 cp r14, r31 b068: f1 04 cpc r15, r1 b06a: 61 f0 breq .+24 ; 0xb084 m[i][i - 1] = h[i - 1]; b06c: d8 01 movw r26, r16 b06e: 98 96 adiw r26, 0x28 ; 40 b070: 4d 92 st X+, r4 b072: 5d 92 st X+, r5 b074: 6d 92 st X+, r6 b076: 7c 92 st X, r7 b078: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; b07a: f8 01 movw r30, r16 b07c: 44 82 std Z+4, r4 ; 0x04 b07e: 55 82 std Z+5, r5 ; 0x05 b080: 66 82 std Z+6, r6 ; 0x06 b082: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); b084: ff ef ldi r31, 0xFF ; 255 b086: ef 1a sub r14, r31 b088: ff 0a sbc r15, r31 b08a: f5 01 movw r30, r10 b08c: 20 81 ld r18, Z b08e: 31 81 ldd r19, Z+1 ; 0x01 b090: 42 81 ldd r20, Z+2 ; 0x02 b092: 53 81 ldd r21, Z+3 ; 0x03 b094: 84 e0 ldi r24, 0x04 ; 4 b096: a8 0e add r10, r24 b098: b1 1c adc r11, r1 b09a: 64 81 ldd r22, Z+4 ; 0x04 b09c: 75 81 ldd r23, Z+5 ; 0x05 b09e: 86 81 ldd r24, Z+6 ; 0x06 b0a0: 97 81 ldd r25, Z+7 ; 0x07 b0a2: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> b0a6: 20 e0 ldi r18, 0x00 ; 0 b0a8: 30 e0 ldi r19, 0x00 ; 0 b0aa: 40 ec ldi r20, 0xC0 ; 192 b0ac: 50 e4 ldi r21, 0x40 ; 64 b0ae: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b0b2: d6 01 movw r26, r12 b0b4: dc 96 adiw r26, 0x3c ; 60 b0b6: 6d 93 st X+, r22 b0b8: 7d 93 st X+, r23 b0ba: 8d 93 st X+, r24 b0bc: 9c 93 st X, r25 b0be: df 97 sbiw r26, 0x3f ; 63 b0c0: 04 5d subi r16, 0xD4 ; 212 b0c2: 1f 4f sbci r17, 0xFF ; 255 b0c4: b8 e2 ldi r27, 0x28 ; 40 b0c6: cb 0e add r12, r27 b0c8: 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 b0d2: b1 cf rjmp .-158 ; 0xb036 b0d4: 7e 01 movw r14, r28 b0d6: fd e2 ldi r31, 0x2D ; 45 b0d8: ef 0e add r14, r31 b0da: f1 1c adc r15, r1 b0dc: 28 e2 ldi r18, 0x28 ; 40 b0de: a2 2e mov r10, r18 b0e0: b1 2c mov r11, r1 b0e2: 00 eb ldi r16, 0xB0 ; 176 b0e4: 1f ef ldi r17, 0xFF ; 255 b0e6: 24 e0 ldi r18, 0x04 ; 4 b0e8: 22 0e add r2, r18 b0ea: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i b108: 2b 01 movw r4, r22 b10a: 3c 01 movw r6, r24 b10c: 61 01 movw r12, r2 b10e: c0 1a sub r12, r16 b110: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) b112: 88 24 eor r8, r8 b114: 83 94 inc r8 b116: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; b118: f6 01 movw r30, r12 b11a: e0 0f add r30, r16 b11c: f1 1f adc r31, r17 b11e: ea 0d add r30, r10 b120: fb 1d adc r31, r11 b122: 20 81 ld r18, Z b124: 31 81 ldd r19, Z+1 ; 0x01 b126: 42 81 ldd r20, Z+2 ; 0x02 b128: 53 81 ldd r21, Z+3 ; 0x03 b12a: c3 01 movw r24, r6 b12c: b2 01 movw r22, r4 b12e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b132: 9b 01 movw r18, r22 b134: ac 01 movw r20, r24 b136: f6 01 movw r30, r12 b138: 60 81 ld r22, Z b13a: 71 81 ldd r23, Z+1 ; 0x01 b13c: 82 81 ldd r24, Z+2 ; 0x02 b13e: 93 81 ldd r25, Z+3 ; 0x03 b140: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> b144: d6 01 movw r26, r12 b146: 6d 93 st X+, r22 b148: 7d 93 st X+, r23 b14a: 8d 93 st X+, r24 b14c: 9d 93 st X+, r25 b14e: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i b15e: 3c e2 ldi r19, 0x2C ; 44 b160: e3 0e add r14, r19 b162: f1 1c adc r15, r1 b164: 08 52 subi r16, 0x28 ; 40 b166: 11 09 sbc r17, r1 b168: 88 e2 ldi r24, 0x28 ; 40 b16a: a8 0e add r10, r24 b16c: 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 b176: ba cf rjmp .-140 ; 0xb0ec b178: 1e 01 movw r2, r28 b17a: f5 eb ldi r31, 0xB5 ; 181 b17c: 2f 0e add r2, r31 b17e: 31 1c adc r3, r1 b180: 6e 01 movw r12, r28 b182: 21 eb ldi r18, 0xB1 ; 177 b184: c2 0e add r12, r18 b186: d1 1c adc r13, r1 b188: 7e 01 movw r14, r28 b18a: 37 e3 ldi r19, 0x37 ; 55 b18c: e3 1a sub r14, r19 b18e: 3e ef ldi r19, 0xFE ; 254 b190: 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--) { b192: 04 e0 ldi r16, 0x04 ; 4 b194: 10 e0 ldi r17, 0x00 ; 0 b196: 48 01 movw r8, r16 b198: b1 2c mov r11, r1 b19a: a1 2c mov r10, r1 sum = 0; b19c: 41 2c mov r4, r1 b19e: 51 2c mov r5, r1 b1a0: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; b1a2: f6 01 movw r30, r12 b1a4: ea 0d add r30, r10 b1a6: fb 1d adc r31, r11 b1a8: d7 01 movw r26, r14 b1aa: aa 0d add r26, r10 b1ac: bb 1d adc r27, r11 b1ae: 2d 91 ld r18, X+ b1b0: 3d 91 ld r19, X+ b1b2: 4d 91 ld r20, X+ b1b4: 5c 91 ld r21, X b1b6: 60 81 ld r22, Z b1b8: 71 81 ldd r23, Z+1 ; 0x01 b1ba: 82 81 ldd r24, Z+2 ; 0x02 b1bc: 93 81 ldd r25, Z+3 ; 0x03 b1be: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b1c2: 9b 01 movw r18, r22 b1c4: ac 01 movw r20, r24 b1c6: c3 01 movw r24, r6 b1c8: b2 01 movw r22, r4 b1ca: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> b1ce: 2b 01 movw r4, r22 b1d0: 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++) b1d2: 8f ef ldi r24, 0xFF ; 255 b1d4: 88 1a sub r8, r24 b1d6: 98 0a sbc r9, r24 b1d8: 94 e0 ldi r25, 0x04 ; 4 b1da: a9 0e add r10, r25 b1dc: b1 1c adc r11, r1 b1de: a5 e0 ldi r26, 0x05 ; 5 b1e0: 8a 16 cp r8, r26 b1e2: 91 04 cpc r9, r1 b1e4: f1 f6 brne .-68 ; 0xb1a2 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; b1e6: a3 01 movw r20, r6 b1e8: 92 01 movw r18, r4 b1ea: f1 01 movw r30, r2 b1ec: 60 81 ld r22, Z b1ee: 71 81 ldd r23, Z+1 ; 0x01 b1f0: 82 81 ldd r24, Z+2 ; 0x02 b1f2: 93 81 ldd r25, Z+3 ; 0x03 b1f4: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> b1f8: d6 01 movw r26, r12 b1fa: 2d 91 ld r18, X+ b1fc: 3d 91 ld r19, X+ b1fe: 4d 91 ld r20, X+ b200: 5c 91 ld r21, X b202: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> b206: f7 01 movw r30, r14 b208: 60 83 st Z, r22 b20a: 71 83 std Z+1, r23 ; 0x01 b20c: 82 83 std Z+2, r24 ; 0x02 b20e: 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--) { b210: 01 50 subi r16, 0x01 ; 1 b212: 11 09 sbc r17, r1 b214: f8 e2 ldi r31, 0x28 ; 40 b216: 2f 1a sub r2, r31 b218: 31 08 sbc r3, r1 b21a: 2c e2 ldi r18, 0x2C ; 44 b21c: c2 1a sub r12, r18 b21e: d1 08 sbc r13, r1 b220: 34 e0 ldi r19, 0x04 ; 4 b222: e3 1a sub r14, r19 b224: f1 08 sbc r15, r1 b226: 01 15 cp r16, r1 b228: 11 05 cpc r17, r1 b22a: 09 f0 breq .+2 ; 0xb22e b22c: b4 cf rjmp .-152 ; 0xb196 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { b22e: cb 50 subi r28, 0x0B ; 11 b230: de 4f sbci r29, 0xFE ; 254 b232: 88 81 ld r24, Y b234: 99 81 ldd r25, Y+1 ; 0x01 b236: aa 81 ldd r26, Y+2 ; 0x02 b238: bb 81 ldd r27, Y+3 ; 0x03 b23a: c5 5f subi r28, 0xF5 ; 245 b23c: d1 40 sbci r29, 0x01 ; 1 b23e: cf 57 subi r28, 0x7F ; 127 b240: dd 4f sbci r29, 0xFD ; 253 b242: 88 83 st Y, r24 b244: 99 83 std Y+1, r25 ; 0x01 b246: aa 83 std Y+2, r26 ; 0x02 b248: bb 83 std Y+3, r27 ; 0x03 b24a: c1 58 subi r28, 0x81 ; 129 b24c: d2 40 sbci r29, 0x02 ; 2 b24e: 1e 01 movw r2, r28 b250: 97 e4 ldi r25, 0x47 ; 71 b252: 29 1a sub r2, r25 b254: 9e ef ldi r25, 0xFE ; 254 b256: 39 0a sbc r3, r25 b258: 10 e0 ldi r17, 0x00 ; 0 b25a: 00 e0 ldi r16, 0x00 ; 0 b25c: c1 59 subi r28, 0x91 ; 145 b25e: dd 4f sbci r29, 0xFD ; 253 b260: a8 81 ld r26, Y b262: b9 81 ldd r27, Y+1 ; 0x01 b264: cf 56 subi r28, 0x6F ; 111 b266: d2 40 sbci r29, 0x02 ; 2 b268: cd 90 ld r12, X+ b26a: dd 90 ld r13, X+ b26c: ed 90 ld r14, X+ b26e: fd 90 ld r15, X+ b270: c1 59 subi r28, 0x91 ; 145 b272: dd 4f sbci r29, 0xFD ; 253 b274: b9 83 std Y+1, r27 ; 0x01 b276: a8 83 st Y, r26 b278: cf 56 subi r28, 0x6F ; 111 b27a: d2 40 sbci r29, 0x02 ; 2 b27c: cb 58 subi r28, 0x8B ; 139 b27e: dd 4f sbci r29, 0xFD ; 253 b280: 28 81 ld r18, Y b282: 39 81 ldd r19, Y+1 ; 0x01 b284: 4a 81 ldd r20, Y+2 ; 0x02 b286: 5b 81 ldd r21, Y+3 ; 0x03 b288: c5 57 subi r28, 0x75 ; 117 b28a: d2 40 sbci r29, 0x02 ; 2 b28c: c7 01 movw r24, r14 b28e: b6 01 movw r22, r12 b290: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> b294: 18 16 cp r1, r24 b296: b4 f0 brlt .+44 ; 0xb2c4 b298: cb 58 subi r28, 0x8B ; 139 b29a: dd 4f sbci r29, 0xFD ; 253 b29c: 28 81 ld r18, Y b29e: 39 81 ldd r19, Y+1 ; 0x01 b2a0: 4a 81 ldd r20, Y+2 ; 0x02 b2a2: 5b 81 ldd r21, Y+3 ; 0x03 b2a4: c5 57 subi r28, 0x75 ; 117 b2a6: d2 40 sbci r29, 0x02 ; 2 b2a8: c1 59 subi r28, 0x91 ; 145 b2aa: dd 4f sbci r29, 0xFD ; 253 b2ac: e8 81 ld r30, Y b2ae: f9 81 ldd r31, Y+1 ; 0x01 b2b0: cf 56 subi r28, 0x6F ; 111 b2b2: d2 40 sbci r29, 0x02 ; 2 b2b4: 60 81 ld r22, Z b2b6: 71 81 ldd r23, Z+1 ; 0x01 b2b8: 82 81 ldd r24, Z+2 ; 0x02 b2ba: 93 81 ldd r25, Z+3 ; 0x03 b2bc: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> b2c0: 87 ff sbrs r24, 7 b2c2: 18 c0 rjmp .+48 ; 0xb2f4 b2c4: 04 30 cpi r16, 0x04 ; 4 b2c6: 11 05 cpc r17, r1 b2c8: 09 f0 breq .+2 ; 0xb2cc b2ca: 30 c1 rjmp .+608 ; 0xb52c b2cc: cb 58 subi r28, 0x8B ; 139 b2ce: dd 4f sbci r29, 0xFD ; 253 b2d0: 28 81 ld r18, Y b2d2: 39 81 ldd r19, Y+1 ; 0x01 b2d4: 4a 81 ldd r20, Y+2 ; 0x02 b2d6: 5b 81 ldd r21, Y+3 ; 0x03 b2d8: c5 57 subi r28, 0x75 ; 117 b2da: d2 40 sbci r29, 0x02 ; 2 b2dc: cf 57 subi r28, 0x7F ; 127 b2de: dd 4f sbci r29, 0xFD ; 253 b2e0: 68 81 ld r22, Y b2e2: 79 81 ldd r23, Y+1 ; 0x01 b2e4: 8a 81 ldd r24, Y+2 ; 0x02 b2e6: 9b 81 ldd r25, Y+3 ; 0x03 b2e8: c1 58 subi r28, 0x81 ; 129 b2ea: d2 40 sbci r29, 0x02 ; 2 b2ec: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> b2f0: 87 ff sbrs r24, 7 b2f2: 1c c1 rjmp .+568 ; 0xb52c a = (s[i + 1] - s[i]) / (6 * h[i]); b2f4: d1 01 movw r26, r2 b2f6: 14 96 adiw r26, 0x04 ; 4 b2f8: 8d 90 ld r8, X+ b2fa: 9d 90 ld r9, X+ b2fc: ad 90 ld r10, X+ b2fe: bc 90 ld r11, X b300: 17 97 sbiw r26, 0x07 ; 7 b302: 8d 91 ld r24, X+ b304: 9d 91 ld r25, X+ b306: 0d 90 ld r0, X+ b308: bc 91 ld r27, X b30a: a0 2d mov r26, r0 b30c: cf 58 subi r28, 0x8F ; 143 b30e: dd 4f sbci r29, 0xFD ; 253 b310: 88 83 st Y, r24 b312: 99 83 std Y+1, r25 ; 0x01 b314: aa 83 std Y+2, r26 ; 0x02 b316: bb 83 std Y+3, r27 ; 0x03 b318: c1 57 subi r28, 0x71 ; 113 b31a: d2 40 sbci r29, 0x02 ; 2 b31c: f8 01 movw r30, r16 b31e: ee 0f add r30, r30 b320: ff 1f adc r31, r31 b322: ee 0f add r30, r30 b324: ff 1f adc r31, r31 b326: 21 e9 ldi r18, 0x91 ; 145 b328: 31 e0 ldi r19, 0x01 ; 1 b32a: 2c 0f add r18, r28 b32c: 3d 1f adc r19, r29 b32e: e2 0f add r30, r18 b330: f3 1f adc r31, r19 b332: 40 80 ld r4, Z b334: 51 80 ldd r5, Z+1 ; 0x01 b336: 62 80 ldd r6, Z+2 ; 0x02 b338: 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; b33a: c3 59 subi r28, 0x93 ; 147 b33c: dd 4f sbci r29, 0xFD ; 253 b33e: a8 81 ld r26, Y b340: b9 81 ldd r27, Y+1 ; 0x01 b342: cd 56 subi r28, 0x6D ; 109 b344: d2 40 sbci r29, 0x02 ; 2 b346: 8d 91 ld r24, X+ b348: 9d 91 ld r25, X+ b34a: 0d 90 ld r0, X+ b34c: bc 91 ld r27, X b34e: a0 2d mov r26, r0 b350: c3 58 subi r28, 0x83 ; 131 b352: dd 4f sbci r29, 0xFD ; 253 b354: 88 83 st Y, r24 b356: 99 83 std Y+1, r25 ; 0x01 b358: aa 83 std Y+2, r26 ; 0x02 b35a: bb 83 std Y+3, r27 ; 0x03 b35c: cd 57 subi r28, 0x7D ; 125 b35e: 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; b360: a7 01 movw r20, r14 b362: 96 01 movw r18, r12 b364: cb 58 subi r28, 0x8B ; 139 b366: dd 4f sbci r29, 0xFD ; 253 b368: 68 81 ld r22, Y b36a: 79 81 ldd r23, Y+1 ; 0x01 b36c: 8a 81 ldd r24, Y+2 ; 0x02 b36e: 9b 81 ldd r25, Y+3 ; 0x03 b370: c5 57 subi r28, 0x75 ; 117 b372: d2 40 sbci r29, 0x02 ; 2 b374: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> b378: 6b 01 movw r12, r22 b37a: 7c 01 movw r14, r24 b37c: 20 e0 ldi r18, 0x00 ; 0 b37e: 30 e0 ldi r19, 0x00 ; 0 b380: 40 e4 ldi r20, 0x40 ; 64 b382: 50 e4 ldi r21, 0x40 ; 64 b384: 0f 94 d6 a8 call 0x351ac ; 0x351ac b388: cb 57 subi r28, 0x7B ; 123 b38a: dd 4f sbci r29, 0xFD ; 253 b38c: 68 83 st Y, r22 b38e: 79 83 std Y+1, r23 ; 0x01 b390: 8a 83 std Y+2, r24 ; 0x02 b392: 9b 83 std Y+3, r25 ; 0x03 b394: c5 58 subi r28, 0x85 ; 133 b396: 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; b398: c3 58 subi r28, 0x83 ; 131 b39a: dd 4f sbci r29, 0xFD ; 253 b39c: 28 81 ld r18, Y b39e: 39 81 ldd r19, Y+1 ; 0x01 b3a0: 4a 81 ldd r20, Y+2 ; 0x02 b3a2: 5b 81 ldd r21, Y+3 ; 0x03 b3a4: cd 57 subi r28, 0x7D ; 125 b3a6: d2 40 sbci r29, 0x02 ; 2 b3a8: c3 59 subi r28, 0x93 ; 147 b3aa: dd 4f sbci r29, 0xFD ; 253 b3ac: e8 81 ld r30, Y b3ae: f9 81 ldd r31, Y+1 ; 0x01 b3b0: cd 56 subi r28, 0x6D ; 109 b3b2: d2 40 sbci r29, 0x02 ; 2 b3b4: 64 81 ldd r22, Z+4 ; 0x04 b3b6: 75 81 ldd r23, Z+5 ; 0x05 b3b8: 86 81 ldd r24, Z+6 ; 0x06 b3ba: 97 81 ldd r25, Z+7 ; 0x07 b3bc: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> b3c0: a3 01 movw r20, r6 b3c2: 92 01 movw r18, r4 b3c4: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> b3c8: c7 58 subi r28, 0x87 ; 135 b3ca: dd 4f sbci r29, 0xFD ; 253 b3cc: 68 83 st Y, r22 b3ce: 79 83 std Y+1, r23 ; 0x01 b3d0: 8a 83 std Y+2, r24 ; 0x02 b3d2: 9b 83 std Y+3, r25 ; 0x03 b3d4: c9 57 subi r28, 0x79 ; 121 b3d6: d2 40 sbci r29, 0x02 ; 2 b3d8: a3 01 movw r20, r6 b3da: 92 01 movw r18, r4 b3dc: c3 01 movw r24, r6 b3de: b2 01 movw r22, r4 b3e0: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> b3e4: cf 58 subi r28, 0x8F ; 143 b3e6: dd 4f sbci r29, 0xFD ; 253 b3e8: 28 81 ld r18, Y b3ea: 39 81 ldd r19, Y+1 ; 0x01 b3ec: 4a 81 ldd r20, Y+2 ; 0x02 b3ee: 5b 81 ldd r21, Y+3 ; 0x03 b3f0: c1 57 subi r28, 0x71 ; 113 b3f2: d2 40 sbci r29, 0x02 ; 2 b3f4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b3f8: c7 57 subi r28, 0x77 ; 119 b3fa: dd 4f sbci r29, 0xFD ; 253 b3fc: 68 83 st Y, r22 b3fe: 79 83 std Y+1, r23 ; 0x01 b400: 8a 83 std Y+2, r24 ; 0x02 b402: 9b 83 std Y+3, r25 ; 0x03 b404: c9 58 subi r28, 0x89 ; 137 b406: d2 40 sbci r29, 0x02 ; 2 b408: a3 01 movw r20, r6 b40a: 92 01 movw r18, r4 b40c: c5 01 movw r24, r10 b40e: b4 01 movw r22, r8 b410: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b414: 9b 01 movw r18, r22 b416: ac 01 movw r20, r24 b418: c7 57 subi r28, 0x77 ; 119 b41a: dd 4f sbci r29, 0xFD ; 253 b41c: 68 81 ld r22, Y b41e: 79 81 ldd r23, Y+1 ; 0x01 b420: 8a 81 ldd r24, Y+2 ; 0x02 b422: 9b 81 ldd r25, Y+3 ; 0x03 b424: c9 58 subi r28, 0x89 ; 137 b426: d2 40 sbci r29, 0x02 ; 2 b428: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> b42c: 20 e0 ldi r18, 0x00 ; 0 b42e: 30 e0 ldi r19, 0x00 ; 0 b430: 40 ec ldi r20, 0xC0 ; 192 b432: 50 e4 ldi r21, 0x40 ; 64 b434: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> b438: 9b 01 movw r18, r22 b43a: ac 01 movw r20, r24 b43c: c7 58 subi r28, 0x87 ; 135 b43e: dd 4f sbci r29, 0xFD ; 253 b440: 68 81 ld r22, Y b442: 79 81 ldd r23, Y+1 ; 0x01 b444: 8a 81 ldd r24, Y+2 ; 0x02 b446: 9b 81 ldd r25, Y+3 ; 0x03 b448: c9 57 subi r28, 0x79 ; 121 b44a: d2 40 sbci r29, 0x02 ; 2 b44c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__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; b450: a7 01 movw r20, r14 b452: 96 01 movw r18, r12 b454: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b458: c7 58 subi r28, 0x87 ; 135 b45a: dd 4f sbci r29, 0xFD ; 253 b45c: 68 83 st Y, r22 b45e: 79 83 std Y+1, r23 ; 0x01 b460: 8a 83 std Y+2, r24 ; 0x02 b462: 9b 83 std Y+3, r25 ; 0x03 b464: c9 57 subi r28, 0x79 ; 121 b466: 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]); b468: cf 58 subi r28, 0x8F ; 143 b46a: dd 4f sbci r29, 0xFD ; 253 b46c: 28 81 ld r18, Y b46e: 39 81 ldd r19, Y+1 ; 0x01 b470: 4a 81 ldd r20, Y+2 ; 0x02 b472: 5b 81 ldd r21, Y+3 ; 0x03 b474: c1 57 subi r28, 0x71 ; 113 b476: d2 40 sbci r29, 0x02 ; 2 b478: c5 01 movw r24, r10 b47a: b4 01 movw r22, r8 b47c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> b480: 4b 01 movw r8, r22 b482: 5c 01 movw r10, r24 b484: 20 e0 ldi r18, 0x00 ; 0 b486: 30 e0 ldi r19, 0x00 ; 0 b488: 40 ec ldi r20, 0xC0 ; 192 b48a: 50 e4 ldi r21, 0x40 ; 64 b48c: c3 01 movw r24, r6 b48e: b2 01 movw r22, r4 b490: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b494: 9b 01 movw r18, r22 b496: ac 01 movw r20, r24 b498: c5 01 movw r24, r10 b49a: b4 01 movw r22, r8 b49c: 0f 94 65 a6 call 0x34cca ; 0x34cca <__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; b4a0: cb 57 subi r28, 0x7B ; 123 b4a2: dd 4f sbci r29, 0xFD ; 253 b4a4: 28 81 ld r18, Y b4a6: 39 81 ldd r19, Y+1 ; 0x01 b4a8: 4a 81 ldd r20, Y+2 ; 0x02 b4aa: 5b 81 ldd r21, Y+3 ; 0x03 b4ac: c5 58 subi r28, 0x85 ; 133 b4ae: d2 40 sbci r29, 0x02 ; 2 b4b0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b4b4: 4b 01 movw r8, r22 b4b6: 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; b4b8: 20 e0 ldi r18, 0x00 ; 0 b4ba: 30 e0 ldi r19, 0x00 ; 0 b4bc: 40 e0 ldi r20, 0x00 ; 0 b4be: 5f e3 ldi r21, 0x3F ; 63 b4c0: cf 58 subi r28, 0x8F ; 143 b4c2: dd 4f sbci r29, 0xFD ; 253 b4c4: 68 81 ld r22, Y b4c6: 79 81 ldd r23, Y+1 ; 0x01 b4c8: 8a 81 ldd r24, Y+2 ; 0x02 b4ca: 9b 81 ldd r25, Y+3 ; 0x03 b4cc: c1 57 subi r28, 0x71 ; 113 b4ce: d2 40 sbci r29, 0x02 ; 2 b4d0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b4d4: 2b 01 movw r4, r22 b4d6: 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; b4d8: a7 01 movw r20, r14 b4da: 96 01 movw r18, r12 b4dc: c7 01 movw r24, r14 b4de: b6 01 movw r22, r12 b4e0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b4e4: 9b 01 movw r18, r22 b4e6: ac 01 movw r20, r24 b4e8: c3 01 movw r24, r6 b4ea: b2 01 movw r22, r4 b4ec: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b4f0: 9b 01 movw r18, r22 b4f2: ac 01 movw r20, r24 b4f4: c5 01 movw r24, r10 b4f6: b4 01 movw r22, r8 b4f8: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> b4fc: 9b 01 movw r18, r22 b4fe: ac 01 movw r20, r24 b500: c7 58 subi r28, 0x87 ; 135 b502: dd 4f sbci r29, 0xFD ; 253 b504: 68 81 ld r22, Y b506: 79 81 ldd r23, Y+1 ; 0x01 b508: 8a 81 ldd r24, Y+2 ; 0x02 b50a: 9b 81 ldd r25, Y+3 ; 0x03 b50c: c9 57 subi r28, 0x79 ; 121 b50e: d2 40 sbci r29, 0x02 ; 2 b510: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> b514: c3 58 subi r28, 0x83 ; 131 b516: dd 4f sbci r29, 0xFD ; 253 b518: 28 81 ld r18, Y b51a: 39 81 ldd r19, Y+1 ; 0x01 b51c: 4a 81 ldd r20, Y+2 ; 0x02 b51e: 5b 81 ldd r21, Y+3 ; 0x03 b520: cd 57 subi r28, 0x7D ; 125 b522: d2 40 sbci r29, 0x02 ; 2 b524: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> b528: 2b 01 movw r4, r22 b52a: 3c 01 movw r6, r24 b52c: 0f 5f subi r16, 0xFF ; 255 b52e: 1f 4f sbci r17, 0xFF ; 255 b530: f4 e0 ldi r31, 0x04 ; 4 b532: 2f 0e add r2, r31 b534: 31 1c adc r3, r1 b536: c3 59 subi r28, 0x93 ; 147 b538: dd 4f sbci r29, 0xFD ; 253 b53a: 28 81 ld r18, Y b53c: 39 81 ldd r19, Y+1 ; 0x01 b53e: cd 56 subi r28, 0x6D ; 109 b540: d2 40 sbci r29, 0x02 ; 2 b542: 2c 5f subi r18, 0xFC ; 252 b544: 3f 4f sbci r19, 0xFF ; 255 b546: c3 59 subi r28, 0x93 ; 147 b548: dd 4f sbci r29, 0xFD ; 253 b54a: 39 83 std Y+1, r19 ; 0x01 b54c: 28 83 st Y, r18 b54e: cd 56 subi r28, 0x6D ; 109 b550: 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 b558: 81 ce rjmp .-766 ; 0xb25c sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } b55a: c3 01 movw r24, r6 b55c: b2 01 movw r22, r4 b55e: c4 57 subi r28, 0x74 ; 116 b560: dd 4f sbci r29, 0xFD ; 253 b562: 0f b6 in r0, 0x3f ; 63 b564: f8 94 cli b566: de bf out 0x3e, r29 ; 62 b568: 0f be out 0x3f, r0 ; 63 b56a: cd bf out 0x3d, r28 ; 61 b56c: df 91 pop r29 b56e: cf 91 pop r28 b570: 1f 91 pop r17 b572: 0f 91 pop r16 b574: ff 90 pop r15 b576: ef 90 pop r14 b578: df 90 pop r13 b57a: cf 90 pop r12 b57c: bf 90 pop r11 b57e: af 90 pop r10 b580: 9f 90 pop r9 b582: 8f 90 pop r8 b584: 7f 90 pop r7 b586: 6f 90 pop r6 b588: 5f 90 pop r5 b58a: 4f 90 pop r4 b58c: 3f 90 pop r3 b58e: 2f 90 pop r2 b590: 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)); b592: c5 01 movw r24, r10 b594: 0f 94 4c a4 call 0x34898 ; 0x34898 b598: d8 01 movw r26, r16 b59a: 8d 93 st X+, r24 b59c: 9c 93 st X, r25 b59e: b5 e0 ldi r27, 0x05 ; 5 b5a0: cb 0e add r12, r27 b5a2: d1 1c adc r13, r1 b5a4: e2 e0 ldi r30, 0x02 ; 2 b5a6: ae 0e add r10, r30 b5a8: b1 1c adc r11, r1 b5aa: 96 cc rjmp .-1748 ; 0xaed8 0000b5ac : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { b5ac: 0f 93 push r16 b5ae: 1f 93 push r17 b5b0: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) b5b2: 20 91 01 13 lds r18, 0x1301 ; 0x801301 b5b6: 21 30 cpi r18, 0x01 ; 1 b5b8: 79 f5 brne .+94 ; 0xb618 b5ba: 8c 01 movw r16, r24 b5bc: 80 e5 ldi r24, 0x50 ; 80 b5be: 0e 94 80 56 call 0xad00 ; 0xad00 b5c2: 88 23 and r24, r24 b5c4: 49 f1 breq .+82 ; 0xb618 { mmuSlotIndex = code_value_uint8(); b5c6: 0e 94 95 56 call 0xad2a ; 0xad2a b5ca: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { b5cc: 85 30 cpi r24, 0x05 ; 5 b5ce: 20 f5 brcc .+72 ; 0xb618 switch (gcode) b5d0: 01 3c cpi r16, 0xC1 ; 193 b5d2: 82 e0 ldi r24, 0x02 ; 2 b5d4: 18 07 cpc r17, r24 b5d6: 49 f0 breq .+18 ; 0xb5ea b5d8: 02 3c cpi r16, 0xC2 ; 194 b5da: 12 40 sbci r17, 0x02 ; 2 b5dc: 69 f0 breq .+26 ; 0xb5f8 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); b5de: 8c 2f mov r24, r28 default: break; } } } } b5e0: cf 91 pop r28 b5e2: 1f 91 pop r17 b5e4: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); b5e6: 0d 94 e7 9d jmp 0x33bce ; 0x33bce break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); b5ea: 60 e0 ldi r22, 0x00 ; 0 b5ec: 8c 2f mov r24, r28 default: break; } } } } b5ee: cf 91 pop r28 b5f0: 1f 91 pop r17 b5f2: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); b5f4: 0d 94 2a 9e jmp 0x33c54 ; 0x33c54 break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ b5f8: 8e ec ldi r24, 0xCE ; 206 b5fa: 9e e0 ldi r25, 0x0E ; 14 b5fc: 0f 94 3e a4 call 0x3487c ; 0x3487c b600: 88 23 and r24, r24 b602: 51 f0 breq .+20 ; 0xb618 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { b604: 0f 94 04 7a call 0x2f408 ; 0x2f408 b608: 88 23 and r24, r24 b60a: 31 f0 breq .+12 ; 0xb618 b60c: 8c 2f mov r24, r28 default: break; } } } } b60e: cf 91 pop r28 b610: 1f 91 pop r17 b612: 0f 91 pop r16 b614: 0d 94 a7 9e jmp 0x33d4e ; 0x33d4e b618: cf 91 pop r28 b61a: 1f 91 pop r17 b61c: 0f 91 pop r16 b61e: 08 95 ret 0000b620 : #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);} b620: 8f 92 push r8 b622: 9f 92 push r9 b624: af 92 push r10 b626: bf 92 push r11 b628: cf 92 push r12 b62a: df 92 push r13 b62c: ef 92 push r14 b62e: ff 92 push r15 b630: 0f 93 push r16 b632: 1f 93 push r17 b634: cf 93 push r28 b636: df 93 push r29 b638: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb b63c: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc b640: 0f 5f subi r16, 0xFF ; 255 b642: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; b644: 68 01 movw r12, r16 b646: 8f ef ldi r24, 0xFF ; 255 b648: c8 1a sub r12, r24 b64a: d8 0a sbc r13, r24 b64c: d8 01 movw r26, r16 b64e: dc 91 ld r29, X } while (isspace(c)); b650: 8d 2f mov r24, r29 b652: 90 e0 ldi r25, 0x00 ; 0 b654: 0f 94 cf a1 call 0x3439e ; 0x3439e b658: 7c 01 movw r14, r24 b65a: 89 2b or r24, r25 b65c: 01 f5 brne .+64 ; 0xb69e flag = 0; if (c == '-') { b65e: dd 32 cpi r29, 0x2D ; 45 b660: 01 f5 brne .+64 ; 0xb6a2 flag = FL_MINUS; c = *nptr++; b662: 68 01 movw r12, r16 b664: b2 e0 ldi r27, 0x02 ; 2 b666: cb 0e add r12, r27 b668: d1 1c adc r13, r1 b66a: f8 01 movw r30, r16 b66c: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; b66e: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { b670: 86 01 movw r16, r12 b672: 01 50 subi r16, 0x01 ; 1 b674: 11 09 sbc r17, r1 b676: 43 e0 ldi r20, 0x03 ; 3 b678: 50 e0 ldi r21, 0x00 ; 0 b67a: 64 e3 ldi r22, 0x34 ; 52 b67c: 77 e7 ldi r23, 0x77 ; 119 b67e: c8 01 movw r24, r16 b680: 0f 94 05 a2 call 0x3440a ; 0x3440a b684: 89 2b or r24, r25 b686: c1 f4 brne .+48 ; 0xb6b8 nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; b688: 60 e0 ldi r22, 0x00 ; 0 b68a: 70 e0 ldi r23, 0x00 ; 0 b68c: 80 e8 ldi r24, 0x80 ; 128 b68e: 9f ef ldi r25, 0xFF ; 255 b690: c1 11 cpse r28, r1 b692: db c0 rjmp .+438 ; 0xb84a b694: 60 e0 ldi r22, 0x00 ; 0 b696: 70 e0 ldi r23, 0x00 ; 0 b698: 80 e8 ldi r24, 0x80 ; 128 b69a: 9f e7 ldi r25, 0x7F ; 127 b69c: d6 c0 rjmp .+428 ; 0xb84a if (endptr) *endptr = (char*)nptr; do { c = *nptr++; b69e: 86 01 movw r16, r12 b6a0: d1 cf rjmp .-94 ; 0xb644 flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { b6a2: db 32 cpi r29, 0x2B ; 43 b6a4: 39 f4 brne .+14 ; 0xb6b4 c = *nptr++; b6a6: 68 01 movw r12, r16 b6a8: f2 e0 ldi r31, 0x02 ; 2 b6aa: cf 0e add r12, r31 b6ac: d1 1c adc r13, r1 b6ae: d8 01 movw r26, r16 b6b0: 11 96 adiw r26, 0x01 ; 1 b6b2: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; b6b4: c0 e0 ldi r28, 0x00 ; 0 b6b6: dc cf rjmp .-72 ; 0xb670 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)) { b6b8: 43 e0 ldi r20, 0x03 ; 3 b6ba: 50 e0 ldi r21, 0x00 ; 0 b6bc: 61 e3 ldi r22, 0x31 ; 49 b6be: 77 e7 ldi r23, 0x77 ; 119 b6c0: c8 01 movw r24, r16 b6c2: 0f 94 05 a2 call 0x3440a ; 0x3440a b6c6: 89 2b or r24, r25 b6c8: 09 f4 brne .+2 ; 0xb6cc b6ca: cc c0 rjmp .+408 ; 0xb864 b6cc: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; b6ce: 10 e0 ldi r17, 0x00 ; 0 b6d0: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; b6d2: 20 e0 ldi r18, 0x00 ; 0 b6d4: 30 e0 ldi r19, 0x00 ; 0 b6d6: a9 01 movw r20, r18 b6d8: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; b6da: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { b6dc: da 30 cpi r29, 0x0A ; 10 b6de: 60 f5 brcc .+88 ; 0xb738 flag |= FL_ANY; b6e0: bc 2e mov r11, r28 b6e2: 68 94 set b6e4: b1 f8 bld r11, 1 b6e6: 8c 2f mov r24, r28 b6e8: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { b6ea: c2 ff sbrs r28, 2 b6ec: 09 c0 rjmp .+18 ; 0xb700 if (!(flag & FL_DOT)) b6ee: 81 11 cpse r24, r1 b6f0: 02 c0 rjmp .+4 ; 0xb6f6 exp += 1; b6f2: 0f 5f subi r16, 0xFF ; 255 b6f4: 1f 4f sbci r17, 0xFF ; 255 b6f6: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; b6f8: d6 01 movw r26, r12 b6fa: dc 91 ld r29, X b6fc: cb 2d mov r28, r11 b6fe: ec cf rjmp .-40 ; 0xb6d8 if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) b700: 88 23 and r24, r24 b702: 11 f0 breq .+4 ; 0xb708 exp -= 1; b704: 01 50 subi r16, 0x01 ; 1 b706: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; b708: a5 e0 ldi r26, 0x05 ; 5 b70a: b0 e0 ldi r27, 0x00 ; 0 b70c: 0f 94 d3 a4 call 0x349a6 ; 0x349a6 <__muluhisi3> b710: 9b 01 movw r18, r22 b712: ac 01 movw r20, r24 b714: 22 0f add r18, r18 b716: 33 1f adc r19, r19 b718: 44 1f adc r20, r20 b71a: 55 1f adc r21, r21 b71c: 2d 0f add r18, r29 b71e: 31 1d adc r19, r1 b720: 41 1d adc r20, r1 b722: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) b724: 28 39 cpi r18, 0x98 ; 152 b726: b9 e9 ldi r27, 0x99 ; 153 b728: 3b 07 cpc r19, r27 b72a: 4b 07 cpc r20, r27 b72c: b9 e1 ldi r27, 0x19 ; 25 b72e: 5b 07 cpc r21, r27 b730: 10 f3 brcs .-60 ; 0xb6f6 flag |= FL_OVFL; b732: c6 60 ori r28, 0x06 ; 6 b734: bc 2e mov r11, r28 b736: df cf rjmp .-66 ; 0xb6f6 } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { b738: de 3f cpi r29, 0xFE ; 254 b73a: 31 f4 brne .+12 ; 0xb748 b73c: c3 fd sbrc r28, 3 b73e: 33 c0 rjmp .+102 ; 0xb7a6 flag |= FL_DOT; b740: bc 2e mov r11, r28 b742: 68 94 set b744: b3 f8 bld r11, 3 b746: d7 cf rjmp .-82 ; 0xb6f6 } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) b748: d5 33 cpi r29, 0x35 ; 53 b74a: 69 f5 brne .+90 ; 0xb7a6 { int i; c = *nptr++; b74c: 80 81 ld r24, Z i = 2; if (c == '-') { b74e: 8d 32 cpi r24, 0x2D ; 45 b750: 31 f4 brne .+12 ; 0xb75e flag |= FL_MEXP; b752: c0 61 ori r28, 0x10 ; 16 c = *nptr++; b754: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; b756: 6e 5f subi r22, 0xFE ; 254 b758: 7f 4f sbci r23, 0xFF ; 255 b75a: 81 81 ldd r24, Z+1 ; 0x01 b75c: 05 c0 rjmp .+10 ; 0xb768 b75e: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { b760: 8b 32 cpi r24, 0x2B ; 43 b762: c9 f3 breq .-14 ; 0xb756 // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; b764: 6f 5f subi r22, 0xFF ; 255 b766: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; b768: 80 53 subi r24, 0x30 ; 48 if (c > 9) { b76a: 8a 30 cpi r24, 0x0A ; 10 b76c: e0 f4 brcc .+56 ; 0xb7a6 b76e: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) b770: b0 e8 ldi r27, 0x80 ; 128 b772: eb 16 cp r14, r27 b774: bc e0 ldi r27, 0x0C ; 12 b776: fb 06 cpc r15, r27 b778: 5c f4 brge .+22 ; 0xb790 i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ b77a: b7 01 movw r22, r14 b77c: 66 0f add r22, r22 b77e: 77 1f adc r23, r23 b780: 66 0f add r22, r22 b782: 77 1f adc r23, r23 b784: e6 0e add r14, r22 b786: f7 1e adc r15, r23 b788: ee 0c add r14, r14 b78a: ff 1c adc r15, r15 b78c: e8 0e add r14, r24 b78e: f1 1c adc r15, r1 c = *nptr++ - '0'; b790: 81 91 ld r24, Z+ b792: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); b794: 8a 30 cpi r24, 0x0A ; 10 b796: 60 f3 brcs .-40 ; 0xb770 if (flag & FL_MEXP) b798: c4 ff sbrs r28, 4 b79a: 03 c0 rjmp .+6 ; 0xb7a2 i = -i; b79c: f1 94 neg r15 b79e: e1 94 neg r14 b7a0: f1 08 sbc r15, r1 exp += i; b7a2: 0e 0d add r16, r14 b7a4: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ b7a6: ca 01 movw r24, r20 b7a8: b9 01 movw r22, r18 b7aa: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) b7ae: c3 70 andi r28, 0x03 ; 3 b7b0: c3 30 cpi r28, 0x03 ; 3 b7b2: 09 f4 brne .+2 ; 0xb7b6 x.flt = -x.flt; b7b4: 90 58 subi r25, 0x80 ; 128 b7b6: 4b 01 movw r8, r22 b7b8: 5c 01 movw r10, r24 if (x.flt != 0) { b7ba: 20 e0 ldi r18, 0x00 ; 0 b7bc: 30 e0 ldi r19, 0x00 ; 0 b7be: a9 01 movw r20, r18 b7c0: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> b7c4: 88 23 and r24, r24 b7c6: 09 f4 brne .+2 ; 0xb7ca b7c8: 3e c0 rjmp .+124 ; 0xb846 if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); b7ca: cd e2 ldi r28, 0x2D ; 45 b7cc: d7 e7 ldi r29, 0x77 ; 119 if ((flag & FL_MINUS) && (flag & FL_ANY)) x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { b7ce: 17 ff sbrs r17, 7 b7d0: 05 c0 rjmp .+10 ; 0xb7dc nptr = (void*)(pwr_m10 + 5); exp = -exp; b7d2: 11 95 neg r17 b7d4: 01 95 neg r16 b7d6: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); b7d8: c5 e1 ldi r28, 0x15 ; 21 b7da: d7 e7 ldi r29, 0x77 ; 119 b7dc: 6e 01 movw r12, r28 b7de: e8 e1 ldi r30, 0x18 ; 24 b7e0: ce 1a sub r12, r30 b7e2: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); b7e4: 80 e2 ldi r24, 0x20 ; 32 b7e6: e8 2e mov r14, r24 b7e8: f1 2c mov r15, r1 b7ea: 0d c0 rjmp .+26 ; 0xb806 for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); b7ec: fe 01 movw r30, r28 b7ee: 25 91 lpm r18, Z+ b7f0: 35 91 lpm r19, Z+ b7f2: 45 91 lpm r20, Z+ b7f4: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { b7f6: 0e 19 sub r16, r14 b7f8: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; b7fa: c5 01 movw r24, r10 b7fc: b4 01 movw r22, r8 b7fe: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b802: 4b 01 movw r8, r22 b804: 5c 01 movw r10, r24 b806: d5 01 movw r26, r10 b808: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { b80a: 0e 15 cp r16, r14 b80c: 1f 05 cpc r17, r15 b80e: 74 f7 brge .-36 ; 0xb7ec float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); b810: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { b812: f5 94 asr r15 b814: e7 94 ror r14 b816: cc 16 cp r12, r28 b818: dd 06 cpc r13, r29 b81a: a9 f7 brne .-22 ; 0xb806 not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( b81c: 8a 2f mov r24, r26 b81e: 88 0f add r24, r24 b820: 8b 2f mov r24, r27 b822: 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) b824: 8f 3f cpi r24, 0xFF ; 255 b826: 49 f0 breq .+18 ; 0xb83a b828: 20 e0 ldi r18, 0x00 ; 0 b82a: 30 e0 ldi r19, 0x00 ; 0 b82c: a9 01 movw r20, r18 b82e: c5 01 movw r24, r10 b830: b4 01 movw r22, r8 b832: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> b836: 81 11 cpse r24, r1 b838: 06 c0 rjmp .+12 ; 0xb846 errno = ERANGE; b83a: 82 e2 ldi r24, 0x22 ; 34 b83c: 90 e0 ldi r25, 0x00 ; 0 b83e: 90 93 0c 17 sts 0x170C, r25 ; 0x80170c b842: 80 93 0b 17 sts 0x170B, r24 ; 0x80170b } return x.flt; b846: c5 01 movw r24, r10 b848: b4 01 movw r22, r8 b84a: df 91 pop r29 b84c: cf 91 pop r28 b84e: 1f 91 pop r17 b850: 0f 91 pop r16 b852: ff 90 pop r15 b854: ef 90 pop r14 b856: df 90 pop r13 b858: cf 90 pop r12 b85a: bf 90 pop r11 b85c: af 90 pop r10 b85e: 9f 90 pop r9 b860: 8f 90 pop r8 b862: 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; b864: 60 e0 ldi r22, 0x00 ; 0 b866: 70 e0 ldi r23, 0x00 ; 0 b868: 80 ec ldi r24, 0xC0 ; 192 b86a: 9f e7 ldi r25, 0x7F ; 127 b86c: ee cf rjmp .-36 ; 0xb84a 0000b86e : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { b86e: 2f 92 push r2 b870: 3f 92 push r3 b872: 4f 92 push r4 b874: 5f 92 push r5 b876: 6f 92 push r6 b878: 7f 92 push r7 b87a: 8f 92 push r8 b87c: 9f 92 push r9 b87e: af 92 push r10 b880: bf 92 push r11 b882: cf 92 push r12 b884: df 92 push r13 b886: ef 92 push r14 b888: ff 92 push r15 b88a: 0f 93 push r16 b88c: 1f 93 push r17 b88e: cf 93 push r28 b890: df 93 push r29 b892: cd b7 in r28, 0x3d ; 61 b894: de b7 in r29, 0x3e ; 62 b896: a1 97 sbiw r28, 0x21 ; 33 b898: 0f b6 in r0, 0x3f ; 63 b89a: f8 94 cli b89c: de bf out 0x3e, r29 ; 62 b89e: 0f be out 0x3f, r0 ; 63 b8a0: cd bf out 0x3d, r28 ; 61 b8a2: 84 ec ldi r24, 0xC4 ; 196 b8a4: 92 e0 ldi r25, 0x02 ; 2 b8a6: 9d 8f std Y+29, r25 ; 0x1d b8a8: 8c 8f std Y+28, r24 ; 0x1c b8aa: 81 e6 ldi r24, 0x61 ; 97 b8ac: 28 2e mov r2, r24 b8ae: 82 e1 ldi r24, 0x12 ; 18 b8b0: 38 2e mov r3, r24 b8b2: 09 e2 ldi r16, 0x29 ; 41 b8b4: 16 e0 ldi r17, 0x06 ; 6 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { b8b6: 91 e0 ldi r25, 0x01 ; 1 b8b8: 9a 8f std Y+26, r25 ; 0x1a b8ba: 19 8e std Y+25, r1 ; 0x19 if(code_seen(axis_codes[i])) b8bc: ec 8d ldd r30, Y+28 ; 0x1c b8be: fd 8d ldd r31, Y+29 ; 0x1d b8c0: 81 91 ld r24, Z+ b8c2: fd 8f std Y+29, r31 ; 0x1d b8c4: ec 8f std Y+28, r30 ; 0x1c b8c6: 0e 94 80 56 call 0xad00 ; 0xad00 b8ca: e8 2e mov r14, r24 b8cc: 88 23 and r24, r24 b8ce: 09 f4 brne .+2 ; 0xb8d2 b8d0: 54 c1 rjmp .+680 ; 0xbb7a { bool relative = axis_relative_modes & mask; b8d2: f0 90 57 12 lds r15, 0x1257 ; 0x801257 b8d6: fa 8d ldd r31, Y+26 ; 0x1a b8d8: ff 22 and r15, r31 destination[i] = code_value(); b8da: 0e 94 10 5b call 0xb620 ; 0xb620 b8de: 2b 01 movw r4, r22 b8e0: 3c 01 movw r6, r24 b8e2: f8 01 movw r30, r16 b8e4: 40 82 st Z, r4 b8e6: 51 82 std Z+1, r5 ; 0x01 b8e8: 62 82 std Z+2, r6 ; 0x02 b8ea: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { b8ec: f9 8d ldd r31, Y+25 ; 0x19 b8ee: f3 30 cpi r31, 0x03 ; 3 b8f0: 09 f0 breq .+2 ; 0xb8f4 b8f2: 45 c0 rjmp .+138 ; 0xb97e 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; b8f4: dd 24 eor r13, r13 b8f6: d3 94 inc r13 b8f8: f1 10 cpse r15, r1 b8fa: 01 c0 rjmp .+2 ; 0xb8fe b8fc: d1 2c mov r13, r1 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; b8fe: 80 90 10 02 lds r8, 0x0210 ; 0x800210 b902: 90 90 11 02 lds r9, 0x0211 ; 0x800211 b906: a0 90 12 02 lds r10, 0x0212 ; 0x800212 b90a: b0 90 13 02 lds r11, 0x0213 ; 0x800213 if (emult != 1.) { b90e: 20 e0 ldi r18, 0x00 ; 0 b910: 30 e0 ldi r19, 0x00 ; 0 b912: 40 e8 ldi r20, 0x80 ; 128 b914: 5f e3 ldi r21, 0x3F ; 63 b916: c5 01 movw r24, r10 b918: b4 01 movw r22, r8 b91a: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> b91e: 88 23 and r24, r24 b920: 59 f1 breq .+86 ; 0xb978 if (! relative) { b922: f1 10 cpse r15, r1 b924: 15 c0 rjmp .+42 ; 0xb950 destination[i] -= current_position[i]; b926: 20 91 6d 12 lds r18, 0x126D ; 0x80126d b92a: 30 91 6e 12 lds r19, 0x126E ; 0x80126e b92e: 40 91 6f 12 lds r20, 0x126F ; 0x80126f b932: 50 91 70 12 lds r21, 0x1270 ; 0x801270 b936: c3 01 movw r24, r6 b938: b2 01 movw r22, r4 b93a: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> b93e: 60 93 35 06 sts 0x0635, r22 ; 0x800635 b942: 70 93 36 06 sts 0x0636, r23 ; 0x800636 b946: 80 93 37 06 sts 0x0637, r24 ; 0x800637 b94a: 90 93 38 06 sts 0x0638, r25 ; 0x800638 relative = true; b94e: de 2c mov r13, r14 } destination[i] *= emult; b950: a5 01 movw r20, r10 b952: 94 01 movw r18, r8 b954: 60 91 35 06 lds r22, 0x0635 ; 0x800635 b958: 70 91 36 06 lds r23, 0x0636 ; 0x800636 b95c: 80 91 37 06 lds r24, 0x0637 ; 0x800637 b960: 90 91 38 06 lds r25, 0x0638 ; 0x800638 b964: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> b968: 60 93 35 06 sts 0x0635, r22 ; 0x800635 b96c: 70 93 36 06 sts 0x0636, r23 ; 0x800636 b970: 80 93 37 06 sts 0x0637, r24 ; 0x800637 b974: 90 93 38 06 sts 0x0638, r25 ; 0x800638 } } if (relative) b978: d1 10 cpse r13, r1 b97a: 03 c0 rjmp .+6 ; 0xb982 b97c: 5f c0 rjmp .+190 ; 0xba3c b97e: ff 20 and r15, r15 b980: 89 f0 breq .+34 ; 0xb9a4 destination[i] += current_position[i]; b982: f1 01 movw r30, r2 b984: 20 81 ld r18, Z b986: 31 81 ldd r19, Z+1 ; 0x01 b988: 42 81 ldd r20, Z+2 ; 0x02 b98a: 53 81 ldd r21, Z+3 ; 0x03 b98c: f8 01 movw r30, r16 b98e: 60 81 ld r22, Z b990: 71 81 ldd r23, Z+1 ; 0x01 b992: 82 81 ldd r24, Z+2 ; 0x02 b994: 93 81 ldd r25, Z+3 ; 0x03 b996: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> b99a: f8 01 movw r30, r16 b99c: 60 83 st Z, r22 b99e: 71 83 std Z+1, r23 ; 0x01 b9a0: 82 83 std Z+2, r24 ; 0x02 b9a2: 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(); b9a4: f9 8d ldd r31, Y+25 ; 0x19 b9a6: f2 30 cpi r31, 0x02 ; 2 b9a8: d9 f5 brne .+118 ; 0xba20 b9aa: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb b9ae: 82 30 cpi r24, 0x02 ; 2 b9b0: 09 f0 breq .+2 ; 0xb9b4 b9b2: ee c0 rjmp .+476 ; 0xbb90 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; b9b4: 8c e0 ldi r24, 0x0C ; 12 b9b6: e0 ea ldi r30, 0xA0 ; 160 b9b8: f2 e0 ldi r31, 0x02 ; 2 b9ba: de 01 movw r26, r28 b9bc: 1d 96 adiw r26, 0x0d ; 13 b9be: 01 90 ld r0, Z+ b9c0: 0d 92 st X+, r0 b9c2: 8a 95 dec r24 b9c4: e1 f7 brne .-8 ; 0xb9be float current_low[3] = DEFAULT_PWM_MOTOR_CURRENT; b9c6: 8c e0 ldi r24, 0x0C ; 12 b9c8: ec ea ldi r30, 0xAC ; 172 b9ca: f2 e0 ldi r31, 0x02 ; 2 b9cc: de 01 movw r26, r28 b9ce: 11 96 adiw r26, 0x01 ; 1 b9d0: 01 90 ld r0, Z+ b9d2: 0d 92 st X+, r0 b9d4: 8a 95 dec r24 b9d6: e1 f7 brne .-8 ; 0xb9d0 float tmp_motor[3]; //SERIAL_ECHOLNPGM("Currents updated: "); if (destination[Z_AXIS] < Z_SILENT) { b9d8: c0 90 31 06 lds r12, 0x0631 ; 0x800631 b9dc: d0 90 32 06 lds r13, 0x0632 ; 0x800632 b9e0: e0 90 33 06 lds r14, 0x0633 ; 0x800633 b9e4: f0 90 34 06 lds r15, 0x0634 ; 0x800634 b9e8: 20 e0 ldi r18, 0x00 ; 0 b9ea: 30 e0 ldi r19, 0x00 ; 0 b9ec: a9 01 movw r20, r18 b9ee: c7 01 movw r24, r14 b9f0: b6 01 movw r22, r12 b9f2: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> b9f6: 87 ff sbrs r24, 7 b9f8: 52 c0 rjmp .+164 ; 0xba9e b9fa: ce 01 movw r24, r28 b9fc: 01 96 adiw r24, 0x01 ; 1 b9fe: 7c 01 movw r14, r24 //SERIAL_ECHOLNPGM("LOW"); for (uint8_t i = 0; i < 3; i++) { ba00: d1 2c mov r13, r1 st_current_set(i, current_low[i]); ba02: f7 01 movw r30, r14 ba04: 61 91 ld r22, Z+ ba06: 71 91 ld r23, Z+ ba08: 81 91 ld r24, Z+ ba0a: 91 91 ld r25, Z+ ba0c: 7f 01 movw r14, r30 ba0e: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> ba12: 8d 2d mov r24, r13 ba14: 0f 94 be 17 call 0x22f7c ; 0x22f7c //SERIAL_ECHOLNPGM("Currents updated: "); if (destination[Z_AXIS] < Z_SILENT) { //SERIAL_ECHOLNPGM("LOW"); for (uint8_t i = 0; i < 3; i++) { ba18: d3 94 inc r13 ba1a: f3 e0 ldi r31, 0x03 ; 3 ba1c: df 12 cpse r13, r31 ba1e: f1 cf rjmp .-30 ; 0xba02 } } #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) { ba20: f9 8d ldd r31, Y+25 ; 0x19 ba22: ff 5f subi r31, 0xFF ; 255 ba24: f9 8f std Y+25, r31 ; 0x19 ba26: 8a 8d ldd r24, Y+26 ; 0x1a ba28: 88 0f add r24, r24 ba2a: 8a 8f std Y+26, r24 ; 0x1a ba2c: 94 e0 ldi r25, 0x04 ; 4 ba2e: 29 0e add r2, r25 ba30: 31 1c adc r3, r1 ba32: 0c 5f subi r16, 0xFC ; 252 ba34: 1f 4f sbci r17, 0xFF ; 255 ba36: f4 30 cpi r31, 0x04 ; 4 ba38: 09 f0 breq .+2 ; 0xba3c ba3a: 40 cf rjmp .-384 ; 0xb8bc 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')) { ba3c: 86 e4 ldi r24, 0x46 ; 70 ba3e: 0e 94 80 56 call 0xad00 ; 0xad00 ba42: 88 23 and r24, r24 ba44: 99 f0 breq .+38 ; 0xba6c const float next_feedrate = code_value(); ba46: 0e 94 10 5b call 0xb620 ; 0xb620 ba4a: 6b 01 movw r12, r22 ba4c: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; ba4e: 20 e0 ldi r18, 0x00 ; 0 ba50: 30 e0 ldi r19, 0x00 ; 0 ba52: a9 01 movw r20, r18 ba54: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> ba58: 18 16 cp r1, r24 ba5a: 44 f4 brge .+16 ; 0xba6c ba5c: c0 92 7a 02 sts 0x027A, r12 ; 0x80027a ba60: d0 92 7b 02 sts 0x027B, r13 ; 0x80027b ba64: e0 92 7c 02 sts 0x027C, r14 ; 0x80027c ba68: f0 92 7d 02 sts 0x027D, r15 ; 0x80027d } } ba6c: a1 96 adiw r28, 0x21 ; 33 ba6e: 0f b6 in r0, 0x3f ; 63 ba70: f8 94 cli ba72: de bf out 0x3e, r29 ; 62 ba74: 0f be out 0x3f, r0 ; 63 ba76: cd bf out 0x3d, r28 ; 61 ba78: df 91 pop r29 ba7a: cf 91 pop r28 ba7c: 1f 91 pop r17 ba7e: 0f 91 pop r16 ba80: ff 90 pop r15 ba82: ef 90 pop r14 ba84: df 90 pop r13 ba86: cf 90 pop r12 ba88: bf 90 pop r11 ba8a: af 90 pop r10 ba8c: 9f 90 pop r9 ba8e: 8f 90 pop r8 ba90: 7f 90 pop r7 ba92: 6f 90 pop r6 ba94: 5f 90 pop r5 ba96: 4f 90 pop r4 ba98: 3f 90 pop r3 ba9a: 2f 90 pop r2 ba9c: 08 95 ret /*MYSERIAL.print(int(i)); SERIAL_ECHOPGM(": "); MYSERIAL.println(current_low[i]);*/ } } else if (destination[Z_AXIS] > Z_HIGH_POWER) { ba9e: 20 e0 ldi r18, 0x00 ; 0 baa0: 30 e0 ldi r19, 0x00 ; 0 baa2: 48 e4 ldi r20, 0x48 ; 72 baa4: 53 e4 ldi r21, 0x43 ; 67 baa6: c7 01 movw r24, r14 baa8: b6 01 movw r22, r12 baaa: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> baae: 18 16 cp r1, r24 bab0: a4 f4 brge .+40 ; 0xbada bab2: ce 01 movw r24, r28 bab4: 0d 96 adiw r24, 0x0d ; 13 bab6: 7c 01 movw r14, r24 //SERIAL_ECHOLNPGM("HIGH"); for (uint8_t i = 0; i < 3; i++) { bab8: d1 2c mov r13, r1 st_current_set(i, current_high[i]); baba: f7 01 movw r30, r14 babc: 61 91 ld r22, Z+ babe: 71 91 ld r23, Z+ bac0: 81 91 ld r24, Z+ bac2: 91 91 ld r25, Z+ bac4: 7f 01 movw r14, r30 bac6: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> baca: 8d 2d mov r24, r13 bacc: 0f 94 be 17 call 0x22f7c ; 0x22f7c MYSERIAL.println(current_low[i]);*/ } } else if (destination[Z_AXIS] > Z_HIGH_POWER) { //SERIAL_ECHOLNPGM("HIGH"); for (uint8_t i = 0; i < 3; i++) { bad0: d3 94 inc r13 bad2: f3 e0 ldi r31, 0x03 ; 3 bad4: df 12 cpse r13, r31 bad6: f1 cf rjmp .-30 ; 0xbaba bad8: a3 cf rjmp .-186 ; 0xba20 bada: ce 01 movw r24, r28 badc: 01 96 adiw r24, 0x01 ; 1 bade: 99 a3 std Y+33, r25 ; 0x21 bae0: 88 a3 std Y+32, r24 ; 0x20 bae2: fe 01 movw r30, r28 bae4: 3d 96 adiw r30, 0x0d ; 13 bae6: ff 8f std Y+31, r31 ; 0x1f bae8: ee 8f std Y+30, r30 ; 0x1e SERIAL_ECHOPGM(": "); MYSERIAL.println(current_high[i]);*/ } } else { for (uint8_t i = 0; i < 3; i++) { baea: 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)); baec: e8 a1 ldd r30, Y+32 ; 0x20 baee: f9 a1 ldd r31, Y+33 ; 0x21 baf0: c1 90 ld r12, Z+ baf2: d1 90 ld r13, Z+ baf4: e1 90 ld r14, Z+ baf6: f1 90 ld r15, Z+ baf8: f9 a3 std Y+33, r31 ; 0x21 bafa: e8 a3 std Y+32, r30 ; 0x20 bafc: ee 8d ldd r30, Y+30 ; 0x1e bafe: ff 8d ldd r31, Y+31 ; 0x1f bb00: 61 91 ld r22, Z+ bb02: 71 91 ld r23, Z+ bb04: 81 91 ld r24, Z+ bb06: 91 91 ld r25, Z+ bb08: ff 8f std Y+31, r31 ; 0x1f bb0a: ee 8f std Y+30, r30 ; 0x1e bb0c: a7 01 movw r20, r14 bb0e: 96 01 movw r18, r12 bb10: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> bb14: 20 e0 ldi r18, 0x00 ; 0 bb16: 30 e0 ldi r19, 0x00 ; 0 bb18: 48 e4 ldi r20, 0x48 ; 72 bb1a: 53 e4 ldi r21, 0x43 ; 67 bb1c: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> bb20: 4b 01 movw r8, r22 bb22: 5c 01 movw r10, r24 tmp_motor[i] = ((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT))*destination[Z_AXIS] + q; bb24: 20 91 31 06 lds r18, 0x0631 ; 0x800631 bb28: 30 91 32 06 lds r19, 0x0632 ; 0x800632 bb2c: 40 91 33 06 lds r20, 0x0633 ; 0x800633 bb30: 50 91 34 06 lds r21, 0x0634 ; 0x800634 bb34: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> bb38: 2b 01 movw r4, r22 bb3a: 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)); bb3c: 20 e0 ldi r18, 0x00 ; 0 bb3e: 30 e0 ldi r19, 0x00 ; 0 bb40: a9 01 movw r20, r18 bb42: c5 01 movw r24, r10 bb44: b4 01 movw r22, r8 bb46: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> bb4a: 9b 01 movw r18, r22 bb4c: ac 01 movw r20, r24 bb4e: c7 01 movw r24, r14 bb50: b6 01 movw r22, r12 bb52: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> bb56: 9b 01 movw r18, r22 bb58: ac 01 movw r20, r24 tmp_motor[i] = ((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT))*destination[Z_AXIS] + q; bb5a: c3 01 movw r24, r6 bb5c: b2 01 movw r22, r4 bb5e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> st_current_set(i, tmp_motor[i]); bb62: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> bb66: 8b 8d ldd r24, Y+27 ; 0x1b bb68: 0f 94 be 17 call 0x22f7c ; 0x22f7c SERIAL_ECHOPGM(": "); MYSERIAL.println(current_high[i]);*/ } } else { for (uint8_t i = 0; i < 3; i++) { bb6c: fb 8d ldd r31, Y+27 ; 0x1b bb6e: ff 5f subi r31, 0xFF ; 255 bb70: fb 8f std Y+27, r31 ; 0x1b bb72: f3 30 cpi r31, 0x03 ; 3 bb74: 09 f0 breq .+2 ; 0xbb78 bb76: ba cf rjmp .-140 ; 0xbaec bb78: 53 cf rjmp .-346 ; 0xba20 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? bb7a: f1 01 movw r30, r2 bb7c: 80 81 ld r24, Z bb7e: 91 81 ldd r25, Z+1 ; 0x01 bb80: a2 81 ldd r26, Z+2 ; 0x02 bb82: b3 81 ldd r27, Z+3 ; 0x03 bb84: f8 01 movw r30, r16 bb86: 80 83 st Z, r24 bb88: 91 83 std Z+1, r25 ; 0x01 bb8a: a2 83 std Z+2, r26 ; 0x02 bb8c: b3 83 std Z+3, r27 ; 0x03 bb8e: 48 cf rjmp .-368 ; 0xba20 } } #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) { bb90: ea 8d ldd r30, Y+26 ; 0x1a bb92: ee 0f add r30, r30 bb94: ea 8f std Y+26, r30 ; 0x1a bb96: f4 e0 ldi r31, 0x04 ; 4 bb98: 2f 0e add r2, r31 bb9a: 31 1c adc r3, r1 bb9c: 0c 5f subi r16, 0xFC ; 252 bb9e: 1f 4f sbci r17, 0xFF ; 255 bba0: 83 e0 ldi r24, 0x03 ; 3 bba2: 89 8f std Y+25, r24 ; 0x19 bba4: 8b ce rjmp .-746 ; 0xb8bc 0000bba6 : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); bba6: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> bbaa: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> bbae: 90 e0 ldi r25, 0x00 ; 0 bbb0: 8a 30 cpi r24, 0x0A ; 10 bbb2: 20 f0 brcs .+8 ; 0xbbbc bbb4: 89 5a subi r24, 0xA9 ; 169 bbb6: 9f 4f sbci r25, 0xFF ; 255 bbb8: 0d 94 a6 a2 jmp 0x3454c ; 0x3454c bbbc: c0 96 adiw r24, 0x30 ; 48 bbbe: fc cf rjmp .-8 ; 0xbbb8 0000bbc0 : 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); bbc0: 2f b7 in r18, 0x3f ; 63 bbc2: 84 ff sbrs r24, 4 bbc4: 1e c0 rjmp .+60 ; 0xbc02 bbc6: f8 94 cli bbc8: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bbcc: 92 60 ori r25, 0x02 ; 2 bbce: 90 93 05 01 sts 0x0105, r25 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bbd2: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D5, value & 0x20); bbd4: 2f b7 in r18, 0x3f ; 63 bbd6: 85 ff sbrs r24, 5 bbd8: 19 c0 rjmp .+50 ; 0xbc0c bbda: f8 94 cli bbdc: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bbe0: 91 60 ori r25, 0x01 ; 1 bbe2: 90 93 05 01 sts 0x0105, r25 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bbe6: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D6, value & 0x40); bbe8: 86 ff sbrs r24, 6 bbea: 15 c0 rjmp .+42 ; 0xbc16 bbec: 45 9a sbi 0x08, 5 ; 8 WRITE(LCD_PINS_D7, value & 0x80); bbee: 87 ff sbrs r24, 7 bbf0: 14 c0 rjmp .+40 ; 0xbc1a bbf2: 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); bbf4: 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); bbf6: 85 e0 ldi r24, 0x05 ; 5 bbf8: 8a 95 dec r24 bbfa: f1 f7 brne .-4 ; 0xbbf8 bbfc: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); bbfe: 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(); } bc00: 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); bc02: f8 94 cli bc04: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bc08: 9d 7f andi r25, 0xFD ; 253 bc0a: e1 cf rjmp .-62 ; 0xbbce WRITE(LCD_PINS_D5, value & 0x20); bc0c: f8 94 cli bc0e: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> bc12: 9e 7f andi r25, 0xFE ; 254 bc14: e6 cf rjmp .-52 ; 0xbbe2 WRITE(LCD_PINS_D6, value & 0x40); bc16: 45 98 cbi 0x08, 5 ; 8 bc18: ea cf rjmp .-44 ; 0xbbee WRITE(LCD_PINS_D7, value & 0x80); bc1a: 46 98 cbi 0x08, 6 ; 8 bc1c: eb cf rjmp .-42 ; 0xbbf4 0000bc1e : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { bc1e: 0f 93 push r16 bc20: 1f 93 push r17 bc22: cf 93 push r28 bc24: df 93 push r29 bc26: c8 2f mov r28, r24 bc28: d6 2f mov r29, r22 bc2a: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); bc2c: 60 ff sbrs r22, 0 bc2e: 15 c0 rjmp .+42 ; 0xbc5a bc30: 5f 9a sbi 0x0b, 7 ; 11 bc32: 8a e1 ldi r24, 0x1A ; 26 bc34: 8a 95 dec r24 bc36: f1 f7 brne .-4 ; 0xbc34 bc38: 00 c0 rjmp .+0 ; 0xbc3a _delay_us(5); lcd_writebits(data); bc3a: 8c 2f mov r24, r28 bc3c: 0e 94 e0 5d call 0xbbc0 ; 0xbbc0 #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { bc40: d1 fd sbrc r29, 1 bc42: 04 c0 rjmp .+8 ; 0xbc4c // _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 bc44: 8c 2f mov r24, r28 bc46: 82 95 swap r24 bc48: 0e 94 e0 5d call 0xbbc0 ; 0xbbc0 } #endif delayMicroseconds(duration); bc4c: c8 01 movw r24, r16 } bc4e: df 91 pop r29 bc50: cf 91 pop r28 bc52: 1f 91 pop r17 bc54: 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); bc56: 0c 94 c6 d0 jmp 0x1a18c ; 0x1a18c 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); bc5a: 5f 98 cbi 0x0b, 7 ; 11 bc5c: ea cf rjmp .-44 ; 0xbc32 0000bc5e : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { bc5e: cf 92 push r12 bc60: df 92 push r13 bc62: ef 92 push r14 bc64: ff 92 push r15 bc66: cf 93 push r28 bc68: df 93 push r29 bc6a: ec 01 movw r28, r24 bc6c: 6a 01 movw r12, r20 bc6e: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) bc70: 0f 94 46 a4 call 0x3488c ; 0x3488c bc74: 6f 3f cpi r22, 0xFF ; 255 bc76: 7f 4f sbci r23, 0xFF ; 255 bc78: 8f 4f sbci r24, 0xFF ; 255 bc7a: 9f 4f sbci r25, 0xFF ; 255 bc7c: 59 f4 brne .+22 ; 0xbc94 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); bc7e: b7 01 movw r22, r14 bc80: a6 01 movw r20, r12 bc82: 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); } bc84: df 91 pop r29 bc86: cf 91 pop r28 bc88: ff 90 pop r15 bc8a: ef 90 pop r14 bc8c: df 90 pop r13 bc8e: 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); bc90: 0d 94 94 a4 jmp 0x34928 ; 0x34928 } 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); } bc94: df 91 pop r29 bc96: cf 91 pop r28 bc98: ff 90 pop r15 bc9a: ef 90 pop r14 bc9c: df 90 pop r13 bc9e: cf 90 pop r12 bca0: 08 95 ret 0000bca2 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { bca2: 7f 92 push r7 bca4: 8f 92 push r8 bca6: 9f 92 push r9 bca8: af 92 push r10 bcaa: bf 92 push r11 bcac: cf 92 push r12 bcae: df 92 push r13 bcb0: ef 92 push r14 bcb2: ff 92 push r15 bcb4: 0f 93 push r16 bcb6: 1f 93 push r17 bcb8: cf 93 push r28 bcba: df 93 push r29 bcbc: cd b7 in r28, 0x3d ; 61 bcbe: de b7 in r29, 0x3e ; 62 bcc0: 60 97 sbiw r28, 0x10 ; 16 bcc2: 0f b6 in r0, 0x3f ; 63 bcc4: f8 94 cli bcc6: de bf out 0x3e, r29 ; 62 bcc8: 0f be out 0x3f, r0 ; 63 bcca: cd bf out 0x3d, r28 ; 61 bccc: 5c 01 movw r10, r24 bcce: 6b 01 movw r12, r22 bcd0: 74 2e mov r7, r20 KEEPALIVE_STATE(NOT_BUSY); bcd2: 81 e0 ldi r24, 0x01 ; 1 bcd4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); bcd8: 1f 93 push r17 bcda: 0f 93 push r16 bcdc: 1f 92 push r1 bcde: 2f 93 push r18 bce0: 8f e4 ldi r24, 0x4F ; 79 bce2: 94 e6 ldi r25, 0x64 ; 100 bce4: 9f 93 push r25 bce6: 8f 93 push r24 bce8: 0f 94 00 a3 call 0x34600 ; 0x34600 daddr_t count = -1; // RW the entire space by default if (code_seen('A')) bcec: 81 e4 ldi r24, 0x41 ; 65 bcee: 0e 94 80 56 call 0xad00 ; 0xad00 bcf2: 0f 90 pop r0 bcf4: 0f 90 pop r0 bcf6: 0f 90 pop r0 bcf8: 0f 90 pop r0 bcfa: 0f 90 pop r0 bcfc: 0f 90 pop r0 bcfe: 88 23 and r24, r24 bd00: 89 f0 breq .+34 ; 0xbd24 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); bd02: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb bd06: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc bd0a: fc 01 movw r30, r24 bd0c: 21 81 ldd r18, Z+1 ; 0x01 bd0e: 28 37 cpi r18, 0x78 ; 120 bd10: 09 f0 breq .+2 ; 0xbd14 bd12: 56 c0 rjmp .+172 ; 0xbdc0 bd14: 40 e1 ldi r20, 0x10 ; 16 bd16: 50 e0 ldi r21, 0x00 ; 0 bd18: 70 e0 ldi r23, 0x00 ; 0 bd1a: 60 e0 ldi r22, 0x00 ; 0 bd1c: 02 96 adiw r24, 0x02 ; 2 bd1e: 0f 94 c9 9f call 0x33f92 ; 0x33f92 bd22: 5b 01 movw r10, r22 if (code_seen('C')) bd24: 83 e4 ldi r24, 0x43 ; 67 bd26: 0e 94 80 56 call 0xad00 ; 0xad00 bd2a: 88 23 and r24, r24 bd2c: 09 f4 brne .+2 ; 0xbd30 bd2e: 4d c0 rjmp .+154 ; 0xbdca count = code_value_long(); bd30: 0e 94 e8 56 call 0xadd0 ; 0xadd0 bd34: 4b 01 movw r8, r22 bd36: 75 01 movw r14, r10 bd38: ca 14 cp r12, r10 bd3a: db 04 cpc r13, r11 bd3c: 08 f4 brcc .+2 ; 0xbd40 bd3e: 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) bd40: c4 01 movw r24, r8 bd42: 8e 0d add r24, r14 bd44: 9f 1d adc r25, r15 bd46: c8 16 cp r12, r24 bd48: d9 06 cpc r13, r25 bd4a: 18 f0 brcs .+6 ; 0xbd52 bd4c: 8e 15 cp r24, r14 bd4e: 9f 05 cpc r25, r15 bd50: 18 f4 brcc .+6 ; 0xbd58 count = addr_end - addr_start; bd52: 46 01 movw r8, r12 bd54: 8e 18 sub r8, r14 bd56: 9f 08 sbc r9, r15 if (code_seen('X')) bd58: 88 e5 ldi r24, 0x58 ; 88 bd5a: 0e 94 80 56 call 0xad00 ; 0xad00 bd5e: 88 23 and r24, r24 bd60: 09 f4 brne .+2 ; 0xbd64 bd62: 71 c0 rjmp .+226 ; 0xbe46 { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); bd64: 20 91 bb 04 lds r18, 0x04BB ; 0x8004bb bd68: 30 91 bc 04 lds r19, 0x04BC ; 0x8004bc bd6c: 2f 5f subi r18, 0xFF ; 255 bd6e: 3f 4f sbci r19, 0xFF ; 255 bd70: ce 01 movw r24, r28 bd72: 01 96 adiw r24, 0x01 ; 1 bd74: 5c 01 movw r10, r24 bd76: dc 01 movw r26, r24 print_hex_byte(val & 0xFF); } int parse_hex(const char* hex, uint8_t* data, int count) { int parsed = 0; bd78: d1 2c mov r13, r1 bd7a: c1 2c mov r12, r1 bd7c: f9 01 movw r30, r18 while (*hex) bd7e: 80 81 ld r24, Z bd80: 2f 5f subi r18, 0xFF ; 255 bd82: 3f 4f sbci r19, 0xFF ; 255 bd84: 88 23 and r24, r24 bd86: b9 f1 breq .+110 ; 0xbdf6 { if (count && (parsed >= count)) break; bd88: 90 e1 ldi r25, 0x10 ; 16 bd8a: c9 16 cp r12, r25 bd8c: d1 04 cpc r13, r1 bd8e: 99 f1 breq .+102 ; 0xbdf6 char c = *(hex++); if (c == ' ') continue; bd90: 80 32 cpi r24, 0x20 ; 32 bd92: a1 f3 breq .-24 ; 0xbd7c if (c == '\n') break; bd94: 8a 30 cpi r24, 0x0A ; 10 bd96: 79 f1 breq .+94 ; 0xbdf6 uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); bd98: 90 ed ldi r25, 0xD0 ; 208 bd9a: 98 0f add r25, r24 bd9c: 9a 30 cpi r25, 0x0A ; 10 bd9e: c8 f4 brcc .+50 ; 0xbdd2 bda0: 82 95 swap r24 bda2: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); bda4: 9f 01 movw r18, r30 bda6: 2e 5f subi r18, 0xFE ; 254 bda8: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); bdaa: 91 81 ldd r25, Z+1 ; 0x01 bdac: 40 ed ldi r20, 0xD0 ; 208 bdae: 49 0f add r20, r25 bdb0: 4a 30 cpi r20, 0x0A ; 10 bdb2: b8 f4 brcc .+46 ; 0xbde2 bdb4: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; bdb6: 8d 93 st X+, r24 parsed++; bdb8: ef ef ldi r30, 0xFF ; 255 bdba: ce 1a sub r12, r30 bdbc: de 0a sbc r13, r30 bdbe: de cf rjmp .-68 ; 0xbd7c { 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(); bdc0: 0e 94 10 5b call 0xb620 ; 0xb620 bdc4: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> bdc8: ac cf rjmp .-168 ; 0xbd22 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 bdca: 88 24 eor r8, r8 bdcc: 8a 94 dec r8 bdce: 98 2c mov r9, r8 bdd0: b2 cf rjmp .-156 ; 0xbd36 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); bdd2: 9f e9 ldi r25, 0x9F ; 159 bdd4: 98 0f add r25, r24 bdd6: 96 30 cpi r25, 0x06 ; 6 bdd8: 58 f4 brcc .+22 ; 0xbdf0 bdda: 82 95 swap r24 bddc: 80 7f andi r24, 0xF0 ; 240 bdde: 80 57 subi r24, 0x70 ; 112 bde0: e1 cf rjmp .-62 ; 0xbda4 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); bde2: 4f e9 ldi r20, 0x9F ; 159 bde4: 49 0f add r20, r25 bde6: 46 30 cpi r20, 0x06 ; 6 bde8: 18 f4 brcc .+6 ; 0xbdf0 bdea: 97 55 subi r25, 0x57 ; 87 bdec: 89 2b or r24, r25 bdee: e3 cf rjmp .-58 ; 0xbdb6 else return -parsed; bdf0: d1 94 neg r13 bdf2: c1 94 neg r12 bdf4: 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++) bdf6: 91 2c mov r9, r1 bdf8: 81 2c mov r8, r1 bdfa: c8 14 cp r12, r8 bdfc: d9 04 cpc r13, r9 bdfe: 91 f0 breq .+36 ; 0xbe24 be00: f5 01 movw r30, r10 be02: 61 91 ld r22, Z+ be04: 5f 01 movw r10, r30 be06: c4 01 movw r24, r8 be08: 8e 0d add r24, r14 be0a: 9f 1d adc r25, r15 { switch (type) be0c: f1 e0 ldi r31, 0x01 ; 1 be0e: 7f 16 cp r7, r31 be10: 31 f0 breq .+12 ; 0xbe1e { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; be12: fc 01 movw r30, r24 be14: 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++) be16: ff ef ldi r31, 0xFF ; 255 be18: 8f 1a sub r8, r31 be1a: 9f 0a sbc r9, r31 be1c: ee cf rjmp .-36 ; 0xbdfa 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); be1e: 0f 94 86 a4 call 0x3490c ; 0x3490c be22: f9 cf rjmp .-14 ; 0xbe16 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); be24: ff 92 push r15 be26: ef 92 push r14 be28: 1f 93 push r17 be2a: 0f 93 push r16 be2c: 9f 92 push r9 be2e: 8f 92 push r8 be30: 85 e2 ldi r24, 0x25 ; 37 be32: 94 e6 ldi r25, 0x64 ; 100 be34: 9f 93 push r25 be36: 8f 93 push r24 be38: 0f 94 00 a3 call 0x34600 ; 0x34600 be3c: 0f b6 in r0, 0x3f ; 63 be3e: f8 94 cli be40: de bf out 0x3e, r29 ; 62 be42: 0f be out 0x3f, r0 ; 63 be44: cd bf out 0x3d, r28 ; 61 #endif } print_mem(addr_start, count, type); be46: 47 2d mov r20, r7 be48: b4 01 movw r22, r8 be4a: c7 01 movw r24, r14 } be4c: 60 96 adiw r28, 0x10 ; 16 be4e: 0f b6 in r0, 0x3f ; 63 be50: f8 94 cli be52: de bf out 0x3e, r29 ; 62 be54: 0f be out 0x3f, r0 ; 63 be56: cd bf out 0x3d, r28 ; 61 be58: df 91 pop r29 be5a: cf 91 pop r28 be5c: 1f 91 pop r17 be5e: 0f 91 pop r16 be60: ff 90 pop r15 be62: ef 90 pop r14 be64: df 90 pop r13 be66: cf 90 pop r12 be68: bf 90 pop r11 be6a: af 90 pop r10 be6c: 9f 90 pop r9 be6e: 8f 90 pop r8 be70: 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); be72: 0d 94 2d 78 jmp 0x2f05a ; 0x2f05a 0000be76 : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); be76: 68 2f mov r22, r24 be78: 70 e0 ldi r23, 0x00 ; 0 be7a: 90 e0 ldi r25, 0x00 ; 0 be7c: 80 e0 ldi r24, 0x00 ; 0 be7e: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> be82: 20 e0 ldi r18, 0x00 ; 0 be84: 30 e0 ldi r19, 0x00 ; 0 be86: 48 e0 ldi r20, 0x08 ; 8 be88: 52 e4 ldi r21, 0x42 ; 66 be8a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> be8e: 20 e0 ldi r18, 0x00 ; 0 be90: 30 e0 ldi r19, 0x00 ; 0 be92: 40 e8 ldi r20, 0x80 ; 128 be94: 5f e3 ldi r21, 0x3F ; 63 be96: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> } be9a: 08 95 ret 0000be9c : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); be9c: 82 e0 ldi r24, 0x02 ; 2 be9e: 0f 94 47 18 call 0x2308e ; 0x2308e bea2: 60 93 69 12 sts 0x1269, r22 ; 0x801269 bea6: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a beaa: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b beae: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_set_z_position(current_position[Z_AXIS]); beb2: 89 e6 ldi r24, 0x69 ; 105 beb4: 92 e1 ldi r25, 0x12 ; 18 beb6: 0d 94 33 3a jmp 0x27466 ; 0x27466 0000beba : * 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() { beba: 4f 92 push r4 bebc: 5f 92 push r5 bebe: 6f 92 push r6 bec0: 7f 92 push r7 bec2: 8f 92 push r8 bec4: 9f 92 push r9 bec6: af 92 push r10 bec8: bf 92 push r11 beca: cf 92 push r12 becc: df 92 push r13 bece: ef 92 push r14 bed0: ff 92 push r15 bed2: 0f 93 push r16 bed4: 1f 93 push r17 bed6: cf 93 push r28 bed8: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; beda: 01 e6 ldi r16, 0x61 ; 97 bedc: 12 e1 ldi r17, 0x12 ; 18 bede: ca e9 ldi r28, 0x9A ; 154 bee0: d4 e0 ldi r29, 0x04 ; 4 bee2: 28 81 ld r18, Y bee4: 39 81 ldd r19, Y+1 ; 0x01 bee6: 4a 81 ldd r20, Y+2 ; 0x02 bee8: 5b 81 ldd r21, Y+3 ; 0x03 beea: f8 01 movw r30, r16 beec: 60 81 ld r22, Z beee: 71 81 ldd r23, Z+1 ; 0x01 bef0: 82 81 ldd r24, Z+2 ; 0x02 bef2: 93 81 ldd r25, Z+3 ; 0x03 bef4: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> bef8: 4b 01 movw r8, r22 befa: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; befc: 2c 81 ldd r18, Y+4 ; 0x04 befe: 3d 81 ldd r19, Y+5 ; 0x05 bf00: 4e 81 ldd r20, Y+6 ; 0x06 bf02: 5f 81 ldd r21, Y+7 ; 0x07 bf04: f8 01 movw r30, r16 bf06: 64 81 ldd r22, Z+4 ; 0x04 bf08: 75 81 ldd r23, Z+5 ; 0x05 bf0a: 86 81 ldd r24, Z+6 ; 0x06 bf0c: 97 81 ldd r25, Z+7 ; 0x07 bf0e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> bf12: 6b 01 movw r12, r22 bf14: 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; bf16: ca e8 ldi r28, 0x8A ; 138 bf18: d4 e0 ldi r29, 0x04 ; 4 bf1a: 28 81 ld r18, Y bf1c: 39 81 ldd r19, Y+1 ; 0x01 bf1e: 4a 81 ldd r20, Y+2 ; 0x02 bf20: 5b 81 ldd r21, Y+3 ; 0x03 bf22: c5 01 movw r24, r10 bf24: b4 01 movw r22, r8 bf26: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> bf2a: 2b 01 movw r4, r22 bf2c: 3c 01 movw r6, r24 bf2e: 2c 81 ldd r18, Y+4 ; 0x04 bf30: 3d 81 ldd r19, Y+5 ; 0x05 bf32: 4e 81 ldd r20, Y+6 ; 0x06 bf34: 5f 81 ldd r21, Y+7 ; 0x07 bf36: c7 01 movw r24, r14 bf38: b6 01 movw r22, r12 bf3a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> bf3e: 9b 01 movw r18, r22 bf40: ac 01 movw r20, r24 bf42: c3 01 movw r24, r6 bf44: b2 01 movw r22, r4 bf46: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> bf4a: f8 01 movw r30, r16 bf4c: 60 83 st Z, r22 bf4e: 71 83 std Z+1, r23 ; 0x01 bf50: 82 83 std Z+2, r24 ; 0x02 bf52: 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; bf54: 28 85 ldd r18, Y+8 ; 0x08 bf56: 39 85 ldd r19, Y+9 ; 0x09 bf58: 4a 85 ldd r20, Y+10 ; 0x0a bf5a: 5b 85 ldd r21, Y+11 ; 0x0b bf5c: c5 01 movw r24, r10 bf5e: b4 01 movw r22, r8 bf60: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> bf64: 4b 01 movw r8, r22 bf66: 5c 01 movw r10, r24 bf68: 2c 85 ldd r18, Y+12 ; 0x0c bf6a: 3d 85 ldd r19, Y+13 ; 0x0d bf6c: 4e 85 ldd r20, Y+14 ; 0x0e bf6e: 5f 85 ldd r21, Y+15 ; 0x0f bf70: c7 01 movw r24, r14 bf72: b6 01 movw r22, r12 bf74: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> bf78: 9b 01 movw r18, r22 bf7a: ac 01 movw r20, r24 bf7c: c5 01 movw r24, r10 bf7e: b4 01 movw r22, r8 bf80: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> bf84: f8 01 movw r30, r16 bf86: 64 83 std Z+4, r22 ; 0x04 bf88: 75 83 std Z+5, r23 ; 0x05 bf8a: 86 83 std Z+6, r24 ; 0x06 bf8c: 97 83 std Z+7, r25 ; 0x07 } bf8e: df 91 pop r29 bf90: cf 91 pop r28 bf92: 1f 91 pop r17 bf94: 0f 91 pop r16 bf96: ff 90 pop r15 bf98: ef 90 pop r14 bf9a: df 90 pop r13 bf9c: cf 90 pop r12 bf9e: bf 90 pop r11 bfa0: af 90 pop r10 bfa2: 9f 90 pop r9 bfa4: 8f 90 pop r8 bfa6: 7f 90 pop r7 bfa8: 6f 90 pop r6 bfaa: 5f 90 pop r5 bfac: 4f 90 pop r4 bfae: 08 95 ret 0000bfb0 : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { bfb0: 4f 92 push r4 bfb2: 5f 92 push r5 bfb4: 6f 92 push r6 bfb6: 7f 92 push r7 bfb8: 8f 92 push r8 bfba: 9f 92 push r9 bfbc: af 92 push r10 bfbe: bf 92 push r11 bfc0: cf 92 push r12 bfc2: df 92 push r13 bfc4: ef 92 push r14 bfc6: ff 92 push r15 bfc8: 0f 93 push r16 bfca: 1f 93 push r17 bfcc: cf 93 push r28 bfce: df 93 push r29 bfd0: 00 d0 rcall .+0 ; 0xbfd2 bfd2: 00 d0 rcall .+0 ; 0xbfd4 bfd4: 1f 92 push r1 bfd6: 1f 92 push r1 bfd8: cd b7 in r28, 0x3d ; 61 bfda: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; bfdc: dc 01 movw r26, r24 bfde: cd 90 ld r12, X+ bfe0: dd 90 ld r13, X+ bfe2: ed 90 ld r14, X+ bfe4: fc 90 ld r15, X bfe6: 13 97 sbiw r26, 0x03 ; 3 bfe8: c0 92 6f 03 sts 0x036F, r12 ; 0x80036f bfec: d0 92 70 03 sts 0x0370, r13 ; 0x800370 bff0: e0 92 71 03 sts 0x0371, r14 ; 0x800371 bff4: f0 92 72 03 sts 0x0372, r15 ; 0x800372 world2machine_rotation_and_skew[1][0] = vec_x[1]; bff8: 14 96 adiw r26, 0x04 ; 4 bffa: 0d 91 ld r16, X+ bffc: 1d 91 ld r17, X+ bffe: 2d 91 ld r18, X+ c000: 3c 91 ld r19, X c002: 17 97 sbiw r26, 0x07 ; 7 c004: 09 83 std Y+1, r16 ; 0x01 c006: 1a 83 std Y+2, r17 ; 0x02 c008: 2b 83 std Y+3, r18 ; 0x03 c00a: 3c 83 std Y+4, r19 ; 0x04 c00c: 00 93 77 03 sts 0x0377, r16 ; 0x800377 c010: 10 93 78 03 sts 0x0378, r17 ; 0x800378 c014: 20 93 79 03 sts 0x0379, r18 ; 0x800379 c018: 30 93 7a 03 sts 0x037A, r19 ; 0x80037a world2machine_rotation_and_skew[0][1] = vec_y[0]; c01c: db 01 movw r26, r22 c01e: 0d 91 ld r16, X+ c020: 1d 91 ld r17, X+ c022: 2d 91 ld r18, X+ c024: 3c 91 ld r19, X c026: 13 97 sbiw r26, 0x03 ; 3 c028: 0d 83 std Y+5, r16 ; 0x05 c02a: 1e 83 std Y+6, r17 ; 0x06 c02c: 2f 83 std Y+7, r18 ; 0x07 c02e: 38 87 std Y+8, r19 ; 0x08 c030: 00 93 73 03 sts 0x0373, r16 ; 0x800373 c034: 10 93 74 03 sts 0x0374, r17 ; 0x800374 c038: 20 93 75 03 sts 0x0375, r18 ; 0x800375 c03c: 30 93 76 03 sts 0x0376, r19 ; 0x800376 world2machine_rotation_and_skew[1][1] = vec_y[1]; c040: 14 96 adiw r26, 0x04 ; 4 c042: 4d 90 ld r4, X+ c044: 5d 90 ld r5, X+ c046: 6d 90 ld r6, X+ c048: 7c 90 ld r7, X c04a: 17 97 sbiw r26, 0x07 ; 7 c04c: 40 92 7b 03 sts 0x037B, r4 ; 0x80037b c050: 50 92 7c 03 sts 0x037C, r5 ; 0x80037c c054: 60 92 7d 03 sts 0x037D, r6 ; 0x80037d c058: 70 92 7e 03 sts 0x037E, r7 ; 0x80037e world2machine_shift[0] = cntr[0]; c05c: fa 01 movw r30, r20 c05e: 60 81 ld r22, Z c060: 71 81 ldd r23, Z+1 ; 0x01 c062: 82 81 ldd r24, Z+2 ; 0x02 c064: 93 81 ldd r25, Z+3 ; 0x03 c066: 60 93 9a 04 sts 0x049A, r22 ; 0x80049a c06a: 70 93 9b 04 sts 0x049B, r23 ; 0x80049b c06e: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c c072: 90 93 9d 04 sts 0x049D, r25 ; 0x80049d world2machine_shift[1] = cntr[1]; c076: 84 80 ldd r8, Z+4 ; 0x04 c078: 95 80 ldd r9, Z+5 ; 0x05 c07a: a6 80 ldd r10, Z+6 ; 0x06 c07c: b7 80 ldd r11, Z+7 ; 0x07 c07e: 80 92 9e 04 sts 0x049E, r8 ; 0x80049e c082: 90 92 9f 04 sts 0x049F, r9 ; 0x80049f c086: a0 92 a0 04 sts 0x04A0, r10 ; 0x8004a0 c08a: 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) c08e: 20 e0 ldi r18, 0x00 ; 0 c090: 30 e0 ldi r19, 0x00 ; 0 c092: a9 01 movw r20, r18 c094: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> c098: 81 11 cpse r24, r1 c09a: aa c0 rjmp .+340 ; 0xc1f0 c09c: 20 e0 ldi r18, 0x00 ; 0 c09e: 30 e0 ldi r19, 0x00 ; 0 c0a0: a9 01 movw r20, r18 c0a2: c5 01 movw r24, r10 c0a4: b4 01 movw r22, r8 c0a6: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> c0aa: 81 11 cpse r24, r1 c0ac: a1 c0 rjmp .+322 ; 0xc1f0 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; c0ae: 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 || c0b2: 20 e0 ldi r18, 0x00 ; 0 c0b4: 30 e0 ldi r19, 0x00 ; 0 c0b6: 40 e8 ldi r20, 0x80 ; 128 c0b8: 5f e3 ldi r21, 0x3F ; 63 c0ba: c7 01 movw r24, r14 c0bc: b6 01 movw r22, r12 c0be: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> c0c2: 81 11 cpse r24, r1 c0c4: 21 c0 rjmp .+66 ; 0xc108 c0c6: 20 e0 ldi r18, 0x00 ; 0 c0c8: 30 e0 ldi r19, 0x00 ; 0 c0ca: a9 01 movw r20, r18 c0cc: 6d 81 ldd r22, Y+5 ; 0x05 c0ce: 7e 81 ldd r23, Y+6 ; 0x06 c0d0: 8f 81 ldd r24, Y+7 ; 0x07 c0d2: 98 85 ldd r25, Y+8 ; 0x08 c0d4: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> c0d8: 81 11 cpse r24, r1 c0da: 16 c0 rjmp .+44 ; 0xc108 c0dc: 20 e0 ldi r18, 0x00 ; 0 c0de: 30 e0 ldi r19, 0x00 ; 0 c0e0: a9 01 movw r20, r18 c0e2: 69 81 ldd r22, Y+1 ; 0x01 c0e4: 7a 81 ldd r23, Y+2 ; 0x02 c0e6: 8b 81 ldd r24, Y+3 ; 0x03 c0e8: 9c 81 ldd r25, Y+4 ; 0x04 c0ea: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> c0ee: 81 11 cpse r24, r1 c0f0: 0b c0 rjmp .+22 ; 0xc108 world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { c0f2: 20 e0 ldi r18, 0x00 ; 0 c0f4: 30 e0 ldi r19, 0x00 ; 0 c0f6: 40 e8 ldi r20, 0x80 ; 128 c0f8: 5f e3 ldi r21, 0x3F ; 63 c0fa: c3 01 movw r24, r6 c0fc: b2 01 movw r22, r4 c0fe: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> c102: 88 23 and r24, r24 c104: 09 f4 brne .+2 ; 0xc108 c106: 78 c0 rjmp .+240 ; 0xc1f8 // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; c108: 80 91 a2 04 lds r24, 0x04A2 ; 0x8004a2 c10c: 82 60 ori r24, 0x02 ; 2 c10e: 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]; c112: a3 01 movw r20, r6 c114: 92 01 movw r18, r4 c116: c7 01 movw r24, r14 c118: b6 01 movw r22, r12 c11a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> c11e: 4b 01 movw r8, r22 c120: 5c 01 movw r10, r24 c122: 2d 81 ldd r18, Y+5 ; 0x05 c124: 3e 81 ldd r19, Y+6 ; 0x06 c126: 4f 81 ldd r20, Y+7 ; 0x07 c128: 58 85 ldd r21, Y+8 ; 0x08 c12a: 69 81 ldd r22, Y+1 ; 0x01 c12c: 7a 81 ldd r23, Y+2 ; 0x02 c12e: 8b 81 ldd r24, Y+3 ; 0x03 c130: 9c 81 ldd r25, Y+4 ; 0x04 c132: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> c136: 9b 01 movw r18, r22 c138: ac 01 movw r20, r24 c13a: c5 01 movw r24, r10 c13c: b4 01 movw r22, r8 c13e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> c142: 4b 01 movw r8, r22 c144: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; c146: ac 01 movw r20, r24 c148: 9b 01 movw r18, r22 c14a: c3 01 movw r24, r6 c14c: b2 01 movw r22, r4 c14e: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> c152: 60 93 8a 04 sts 0x048A, r22 ; 0x80048a c156: 70 93 8b 04 sts 0x048B, r23 ; 0x80048b c15a: 80 93 8c 04 sts 0x048C, r24 ; 0x80048c c15e: 90 93 8d 04 sts 0x048D, r25 ; 0x80048d world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; c162: 6d 81 ldd r22, Y+5 ; 0x05 c164: 7e 81 ldd r23, Y+6 ; 0x06 c166: 8f 81 ldd r24, Y+7 ; 0x07 c168: 98 85 ldd r25, Y+8 ; 0x08 c16a: 90 58 subi r25, 0x80 ; 128 c16c: a5 01 movw r20, r10 c16e: 94 01 movw r18, r8 c170: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> c174: 60 93 8e 04 sts 0x048E, r22 ; 0x80048e c178: 70 93 8f 04 sts 0x048F, r23 ; 0x80048f c17c: 80 93 90 04 sts 0x0490, r24 ; 0x800490 c180: 90 93 91 04 sts 0x0491, r25 ; 0x800491 world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; c184: 69 81 ldd r22, Y+1 ; 0x01 c186: 7a 81 ldd r23, Y+2 ; 0x02 c188: 8b 81 ldd r24, Y+3 ; 0x03 c18a: 9c 81 ldd r25, Y+4 ; 0x04 c18c: 90 58 subi r25, 0x80 ; 128 c18e: a5 01 movw r20, r10 c190: 94 01 movw r18, r8 c192: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> c196: 60 93 92 04 sts 0x0492, r22 ; 0x800492 c19a: 70 93 93 04 sts 0x0493, r23 ; 0x800493 c19e: 80 93 94 04 sts 0x0494, r24 ; 0x800494 c1a2: 90 93 95 04 sts 0x0495, r25 ; 0x800495 world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; c1a6: a5 01 movw r20, r10 c1a8: 94 01 movw r18, r8 c1aa: c7 01 movw r24, r14 c1ac: b6 01 movw r22, r12 c1ae: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> c1b2: 60 93 96 04 sts 0x0496, r22 ; 0x800496 c1b6: 70 93 97 04 sts 0x0497, r23 ; 0x800497 c1ba: 80 93 98 04 sts 0x0498, r24 ; 0x800498 c1be: 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; } } c1c2: 28 96 adiw r28, 0x08 ; 8 c1c4: 0f b6 in r0, 0x3f ; 63 c1c6: f8 94 cli c1c8: de bf out 0x3e, r29 ; 62 c1ca: 0f be out 0x3f, r0 ; 63 c1cc: cd bf out 0x3d, r28 ; 61 c1ce: df 91 pop r29 c1d0: cf 91 pop r28 c1d2: 1f 91 pop r17 c1d4: 0f 91 pop r16 c1d6: ff 90 pop r15 c1d8: ef 90 pop r14 c1da: df 90 pop r13 c1dc: cf 90 pop r12 c1de: bf 90 pop r11 c1e0: af 90 pop r10 c1e2: 9f 90 pop r9 c1e4: 8f 90 pop r8 c1e6: 7f 90 pop r7 c1e8: 6f 90 pop r6 c1ea: 5f 90 pop r5 c1ec: 4f 90 pop r4 c1ee: 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; c1f0: 81 e0 ldi r24, 0x01 ; 1 c1f2: 80 93 a2 04 sts 0x04A2, r24 ; 0x8004a2 c1f6: 5d cf rjmp .-326 ; 0xc0b2 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; c1f8: 80 e0 ldi r24, 0x00 ; 0 c1fa: 90 e0 ldi r25, 0x00 ; 0 c1fc: a0 e8 ldi r26, 0x80 ; 128 c1fe: bf e3 ldi r27, 0x3F ; 63 c200: 80 93 8a 04 sts 0x048A, r24 ; 0x80048a c204: 90 93 8b 04 sts 0x048B, r25 ; 0x80048b c208: a0 93 8c 04 sts 0x048C, r26 ; 0x80048c c20c: b0 93 8d 04 sts 0x048D, r27 ; 0x80048d world2machine_rotation_and_skew_inv[0][1] = 0.f; c210: 10 92 8e 04 sts 0x048E, r1 ; 0x80048e c214: 10 92 8f 04 sts 0x048F, r1 ; 0x80048f c218: 10 92 90 04 sts 0x0490, r1 ; 0x800490 c21c: 10 92 91 04 sts 0x0491, r1 ; 0x800491 world2machine_rotation_and_skew_inv[1][0] = 0.f; c220: 10 92 92 04 sts 0x0492, r1 ; 0x800492 c224: 10 92 93 04 sts 0x0493, r1 ; 0x800493 c228: 10 92 94 04 sts 0x0494, r1 ; 0x800494 c22c: 10 92 95 04 sts 0x0495, r1 ; 0x800495 world2machine_rotation_and_skew_inv[1][1] = 1.f; c230: 80 93 96 04 sts 0x0496, r24 ; 0x800496 c234: 90 93 97 04 sts 0x0497, r25 ; 0x800497 c238: a0 93 98 04 sts 0x0498, r26 ; 0x800498 c23c: b0 93 99 04 sts 0x0499, r27 ; 0x800499 c240: c0 cf rjmp .-128 ; 0xc1c2 0000c242 : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { c242: 4f 92 push r4 c244: 5f 92 push r5 c246: 6f 92 push r6 c248: 7f 92 push r7 c24a: 8f 92 push r8 c24c: 9f 92 push r9 c24e: af 92 push r10 c250: bf 92 push r11 c252: cf 92 push r12 c254: df 92 push r13 c256: ef 92 push r14 c258: ff 92 push r15 c25a: 1f 93 push r17 c25c: cf 93 push r28 c25e: df 93 push r29 c260: cd b7 in r28, 0x3d ; 61 c262: de b7 in r29, 0x3e ; 62 c264: a8 97 sbiw r28, 0x28 ; 40 c266: 0f b6 in r0, 0x3f ; 63 c268: f8 94 cli c26a: de bf out 0x3e, r29 ; 62 c26c: 0f be out 0x3f, r0 ; 63 c26e: 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); c270: 48 e0 ldi r20, 0x08 ; 8 c272: 50 e0 ldi r21, 0x00 ; 0 c274: 6d ed ldi r22, 0xDD ; 221 c276: 7f e0 ldi r23, 0x0F ; 15 c278: ce 01 movw r24, r28 c27a: 01 96 adiw r24, 0x01 ; 1 c27c: 0f 94 2e a4 call 0x3485c ; 0x3485c eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); c280: 48 e0 ldi r20, 0x08 ; 8 c282: 50 e0 ldi r21, 0x00 ; 0 c284: 65 ed ldi r22, 0xD5 ; 213 c286: 7f e0 ldi r23, 0x0F ; 15 c288: ce 01 movw r24, r28 c28a: 09 96 adiw r24, 0x09 ; 9 c28c: 0f 94 2e a4 call 0x3485c ; 0x3485c eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); c290: 48 e0 ldi r20, 0x08 ; 8 c292: 50 e0 ldi r21, 0x00 ; 0 c294: 65 ee ldi r22, 0xE5 ; 229 c296: 7f e0 ldi r23, 0x0F ; 15 c298: ce 01 movw r24, r28 c29a: 41 96 adiw r24, 0x11 ; 17 c29c: 0f 94 2e a4 call 0x3485c ; 0x3485c } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; c2a0: 89 89 ldd r24, Y+17 ; 0x11 c2a2: 9a 89 ldd r25, Y+18 ; 0x12 c2a4: ab 89 ldd r26, Y+19 ; 0x13 c2a6: bc 89 ldd r27, Y+20 ; 0x14 c2a8: 89 a3 std Y+33, r24 ; 0x21 c2aa: 9a a3 std Y+34, r25 ; 0x22 c2ac: ab a3 std Y+35, r26 ; 0x23 c2ae: bc a3 std Y+36, r27 ; 0x24 c2b0: 8f 3f cpi r24, 0xFF ; 255 c2b2: 9f 4f sbci r25, 0xFF ; 255 c2b4: af 4f sbci r26, 0xFF ; 255 c2b6: bf 4f sbci r27, 0xFF ; 255 c2b8: 09 f4 brne .+2 ; 0xc2bc c2ba: b1 c0 rjmp .+354 ; 0xc41e c2bc: 8d 89 ldd r24, Y+21 ; 0x15 c2be: 9e 89 ldd r25, Y+22 ; 0x16 c2c0: af 89 ldd r26, Y+23 ; 0x17 c2c2: b8 8d ldd r27, Y+24 ; 0x18 c2c4: 8d a3 std Y+37, r24 ; 0x25 c2c6: 9e a3 std Y+38, r25 ; 0x26 c2c8: af a3 std Y+39, r26 ; 0x27 c2ca: b8 a7 std Y+40, r27 ; 0x28 c2cc: 8f 3f cpi r24, 0xFF ; 255 c2ce: 9f 4f sbci r25, 0xFF ; 255 c2d0: af 4f sbci r26, 0xFF ; 255 c2d2: bf 4f sbci r27, 0xFF ; 255 c2d4: 09 f4 brne .+2 ; 0xc2d8 c2d6: a3 c0 rjmp .+326 ; 0xc41e c2d8: 89 80 ldd r8, Y+1 ; 0x01 c2da: 9a 80 ldd r9, Y+2 ; 0x02 c2dc: ab 80 ldd r10, Y+3 ; 0x03 c2de: bc 80 ldd r11, Y+4 ; 0x04 c2e0: 8f ef ldi r24, 0xFF ; 255 c2e2: 88 16 cp r8, r24 c2e4: 98 06 cpc r9, r24 c2e6: a8 06 cpc r10, r24 c2e8: b8 06 cpc r11, r24 c2ea: 09 f4 brne .+2 ; 0xc2ee c2ec: 98 c0 rjmp .+304 ; 0xc41e c2ee: 8d 81 ldd r24, Y+5 ; 0x05 c2f0: 9e 81 ldd r25, Y+6 ; 0x06 c2f2: af 81 ldd r26, Y+7 ; 0x07 c2f4: b8 85 ldd r27, Y+8 ; 0x08 c2f6: 89 8f std Y+25, r24 ; 0x19 c2f8: 9a 8f std Y+26, r25 ; 0x1a c2fa: ab 8f std Y+27, r26 ; 0x1b c2fc: bc 8f std Y+28, r27 ; 0x1c c2fe: 8f 3f cpi r24, 0xFF ; 255 c300: 9f 4f sbci r25, 0xFF ; 255 c302: af 4f sbci r26, 0xFF ; 255 c304: bf 4f sbci r27, 0xFF ; 255 c306: 09 f4 brne .+2 ; 0xc30a c308: 8a c0 rjmp .+276 ; 0xc41e c30a: c9 84 ldd r12, Y+9 ; 0x09 c30c: da 84 ldd r13, Y+10 ; 0x0a c30e: eb 84 ldd r14, Y+11 ; 0x0b c310: fc 84 ldd r15, Y+12 ; 0x0c c312: 8f ef ldi r24, 0xFF ; 255 c314: c8 16 cp r12, r24 c316: d8 06 cpc r13, r24 c318: e8 06 cpc r14, r24 c31a: f8 06 cpc r15, r24 c31c: 09 f4 brne .+2 ; 0xc320 c31e: 7f c0 rjmp .+254 ; 0xc41e c320: 8d 85 ldd r24, Y+13 ; 0x0d c322: 9e 85 ldd r25, Y+14 ; 0x0e c324: af 85 ldd r26, Y+15 ; 0x0f c326: b8 89 ldd r27, Y+16 ; 0x10 c328: 8d 8f std Y+29, r24 ; 0x1d c32a: 9e 8f std Y+30, r25 ; 0x1e c32c: af 8f std Y+31, r26 ; 0x1f c32e: b8 a3 std Y+32, r27 ; 0x20 c330: 8f 3f cpi r24, 0xFF ; 255 c332: 9f 4f sbci r25, 0xFF ; 255 c334: af 4f sbci r26, 0xFF ; 255 c336: bf 4f sbci r27, 0xFF ; 255 c338: 09 f4 brne .+2 ; 0xc33c c33a: 71 c0 rjmp .+226 ; 0xc41e reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); c33c: 29 8d ldd r18, Y+25 ; 0x19 c33e: 3a 8d ldd r19, Y+26 ; 0x1a c340: 4b 8d ldd r20, Y+27 ; 0x1b c342: 5c 8d ldd r21, Y+28 ; 0x1c c344: c5 01 movw r24, r10 c346: b4 01 movw r22, r8 c348: 0f 94 02 a8 call 0x35004 ; 0x35004 c34c: 2b 01 movw r4, r22 c34e: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) c350: 26 e6 ldi r18, 0x66 ; 102 c352: 36 e6 ldi r19, 0x66 ; 102 c354: 46 e6 ldi r20, 0x66 ; 102 c356: 5f e3 ldi r21, 0x3F ; 63 c358: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__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; c35c: 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) c35e: 87 fd sbrc r24, 7 c360: 0b c0 rjmp .+22 ; 0xc378 c362: 2d ec ldi r18, 0xCD ; 205 c364: 3c ec ldi r19, 0xCC ; 204 c366: 4c e8 ldi r20, 0x8C ; 140 c368: 5f e3 ldi r21, 0x3F ; 63 c36a: c3 01 movw r24, r6 c36c: b2 01 movw r22, r4 c36e: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> c372: 18 16 cp r1, r24 c374: 0c f0 brlt .+2 ; 0xc378 c376: 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]); c378: 2d 8d ldd r18, Y+29 ; 0x1d c37a: 3e 8d ldd r19, Y+30 ; 0x1e c37c: 4f 8d ldd r20, Y+31 ; 0x1f c37e: 58 a1 ldd r21, Y+32 ; 0x20 c380: c7 01 movw r24, r14 c382: b6 01 movw r22, r12 c384: 0f 94 02 a8 call 0x35004 ; 0x35004 c388: 2b 01 movw r4, r22 c38a: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) c38c: 26 e6 ldi r18, 0x66 ; 102 c38e: 36 e6 ldi r19, 0x66 ; 102 c390: 46 e6 ldi r20, 0x66 ; 102 c392: 5f e3 ldi r21, 0x3F ; 63 c394: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> c398: 87 fd sbrc r24, 7 c39a: 7f c0 rjmp .+254 ; 0xc49a c39c: 2d ec ldi r18, 0xCD ; 205 c39e: 3c ec ldi r19, 0xCC ; 204 c3a0: 4c e8 ldi r20, 0x8C ; 140 c3a2: 5f e3 ldi r21, 0x3F ; 63 c3a4: c3 01 movw r24, r6 c3a6: b2 01 movw r22, r4 c3a8: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> c3ac: 18 16 cp r1, r24 c3ae: 0c f4 brge .+2 ; 0xc3b2 c3b0: 74 c0 rjmp .+232 ; 0xc49a 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]); c3b2: 2d a1 ldd r18, Y+37 ; 0x25 c3b4: 3e a1 ldd r19, Y+38 ; 0x26 c3b6: 4f a1 ldd r20, Y+39 ; 0x27 c3b8: 58 a5 ldd r21, Y+40 ; 0x28 c3ba: 69 a1 ldd r22, Y+33 ; 0x21 c3bc: 7a a1 ldd r23, Y+34 ; 0x22 c3be: 8b a1 ldd r24, Y+35 ; 0x23 c3c0: 9c a1 ldd r25, Y+36 ; 0x24 c3c2: 0f 94 02 a8 call 0x35004 ; 0x35004 if (l > 15.f) c3c6: 20 e0 ldi r18, 0x00 ; 0 c3c8: 30 e0 ldi r19, 0x00 ; 0 c3ca: 40 e7 ldi r20, 0x70 ; 112 c3cc: 51 e4 ldi r21, 0x41 ; 65 c3ce: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> c3d2: 18 16 cp r1, r24 c3d4: 0c f4 brge .+2 ; 0xc3d8 #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; c3d6: 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]; c3d8: a5 01 movw r20, r10 c3da: 94 01 movw r18, r8 c3dc: c7 01 movw r24, r14 c3de: b6 01 movw r22, r12 c3e0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> c3e4: 6b 01 movw r12, r22 c3e6: 7c 01 movw r14, r24 c3e8: 2d 8d ldd r18, Y+29 ; 0x1d c3ea: 3e 8d ldd r19, Y+30 ; 0x1e c3ec: 4f 8d ldd r20, Y+31 ; 0x1f c3ee: 58 a1 ldd r21, Y+32 ; 0x20 c3f0: 69 8d ldd r22, Y+25 ; 0x19 c3f2: 7a 8d ldd r23, Y+26 ; 0x1a c3f4: 8b 8d ldd r24, Y+27 ; 0x1b c3f6: 9c 8d ldd r25, Y+28 ; 0x1c c3f8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> c3fc: 9b 01 movw r18, r22 c3fe: ac 01 movw r20, r24 c400: c7 01 movw r24, r14 c402: b6 01 movw r22, r12 c404: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> if (fabs(l) > 0.1f) c408: 9f 77 andi r25, 0x7F ; 127 c40a: 2d ec ldi r18, 0xCD ; 205 c40c: 3c ec ldi r19, 0xCC ; 204 c40e: 4c ec ldi r20, 0xCC ; 204 c410: 5d e3 ldi r21, 0x3D ; 61 c412: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> c416: 18 16 cp r1, r24 c418: 14 f0 brlt .+4 ; 0xc41e #endif reset = true; } } if (reset) c41a: 11 23 and r17, r17 c41c: f1 f0 breq .+60 ; 0xc45a { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); c41e: 0e 94 a9 55 call 0xab52 ; 0xab52 * @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; c422: 80 e0 ldi r24, 0x00 ; 0 c424: 90 e0 ldi r25, 0x00 ; 0 c426: a0 e8 ldi r26, 0x80 ; 128 c428: bf e3 ldi r27, 0x3F ; 63 c42a: 89 83 std Y+1, r24 ; 0x01 c42c: 9a 83 std Y+2, r25 ; 0x02 c42e: ab 83 std Y+3, r26 ; 0x03 c430: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; c432: 1d 82 std Y+5, r1 ; 0x05 c434: 1e 82 std Y+6, r1 ; 0x06 c436: 1f 82 std Y+7, r1 ; 0x07 c438: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; c43a: 19 86 std Y+9, r1 ; 0x09 c43c: 1a 86 std Y+10, r1 ; 0x0a c43e: 1b 86 std Y+11, r1 ; 0x0b c440: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; c442: 8d 87 std Y+13, r24 ; 0x0d c444: 9e 87 std Y+14, r25 ; 0x0e c446: af 87 std Y+15, r26 ; 0x0f c448: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; c44a: 19 8a std Y+17, r1 ; 0x11 c44c: 1a 8a std Y+18, r1 ; 0x12 c44e: 1b 8a std Y+19, r1 ; 0x13 c450: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; c452: 1d 8a std Y+21, r1 ; 0x15 c454: 1e 8a std Y+22, r1 ; 0x16 c456: 1f 8a std Y+23, r1 ; 0x17 c458: 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); c45a: ae 01 movw r20, r28 c45c: 4f 5e subi r20, 0xEF ; 239 c45e: 5f 4f sbci r21, 0xFF ; 255 c460: be 01 movw r22, r28 c462: 67 5f subi r22, 0xF7 ; 247 c464: 7f 4f sbci r23, 0xFF ; 255 c466: ce 01 movw r24, r28 c468: 01 96 adiw r24, 0x01 ; 1 c46a: 0e 94 d8 5f call 0xbfb0 ; 0xbfb0 MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } c46e: a8 96 adiw r28, 0x28 ; 40 c470: 0f b6 in r0, 0x3f ; 63 c472: f8 94 cli c474: de bf out 0x3e, r29 ; 62 c476: 0f be out 0x3f, r0 ; 63 c478: cd bf out 0x3d, r28 ; 61 c47a: df 91 pop r29 c47c: cf 91 pop r28 c47e: 1f 91 pop r17 c480: ff 90 pop r15 c482: ef 90 pop r14 c484: df 90 pop r13 c486: cf 90 pop r12 c488: bf 90 pop r11 c48a: af 90 pop r10 c48c: 9f 90 pop r9 c48e: 8f 90 pop r8 c490: 7f 90 pop r7 c492: 6f 90 pop r6 c494: 5f 90 pop r5 c496: 4f 90 pop r4 c498: 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; c49a: 11 e0 ldi r17, 0x01 ; 1 c49c: 8a cf rjmp .-236 ; 0xc3b2 0000c49e : * * 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() { c49e: cf 93 push r28 c4a0: df 93 push r29 c4a2: cd b7 in r28, 0x3d ; 61 c4a4: de b7 in r29, 0x3e ; 62 c4a6: 68 97 sbiw r28, 0x18 ; 24 c4a8: 0f b6 in r0, 0x3f ; 63 c4aa: f8 94 cli c4ac: de bf out 0x3e, r29 ; 62 c4ae: 0f be out 0x3f, r0 ; 63 c4b0: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; c4b2: 80 e0 ldi r24, 0x00 ; 0 c4b4: 90 e0 ldi r25, 0x00 ; 0 c4b6: a0 e8 ldi r26, 0x80 ; 128 c4b8: bf e3 ldi r27, 0x3F ; 63 c4ba: 89 83 std Y+1, r24 ; 0x01 c4bc: 9a 83 std Y+2, r25 ; 0x02 c4be: ab 83 std Y+3, r26 ; 0x03 c4c0: bc 83 std Y+4, r27 ; 0x04 c4c2: 1d 82 std Y+5, r1 ; 0x05 c4c4: 1e 82 std Y+6, r1 ; 0x06 c4c6: 1f 82 std Y+7, r1 ; 0x07 c4c8: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; c4ca: 19 86 std Y+9, r1 ; 0x09 c4cc: 1a 86 std Y+10, r1 ; 0x0a c4ce: 1b 86 std Y+11, r1 ; 0x0b c4d0: 1c 86 std Y+12, r1 ; 0x0c c4d2: 8d 87 std Y+13, r24 ; 0x0d c4d4: 9e 87 std Y+14, r25 ; 0x0e c4d6: af 87 std Y+15, r26 ; 0x0f c4d8: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; c4da: 19 8a std Y+17, r1 ; 0x11 c4dc: 1a 8a std Y+18, r1 ; 0x12 c4de: 1b 8a std Y+19, r1 ; 0x13 c4e0: 1c 8a std Y+20, r1 ; 0x14 c4e2: 1d 8a std Y+21, r1 ; 0x15 c4e4: 1e 8a std Y+22, r1 ; 0x16 c4e6: 1f 8a std Y+23, r1 ; 0x17 c4e8: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); c4ea: ae 01 movw r20, r28 c4ec: 4f 5e subi r20, 0xEF ; 239 c4ee: 5f 4f sbci r21, 0xFF ; 255 c4f0: be 01 movw r22, r28 c4f2: 67 5f subi r22, 0xF7 ; 247 c4f4: 7f 4f sbci r23, 0xFF ; 255 c4f6: ce 01 movw r24, r28 c4f8: 01 96 adiw r24, 0x01 ; 1 c4fa: 0e 94 d8 5f call 0xbfb0 ; 0xbfb0 } c4fe: 68 96 adiw r28, 0x18 ; 24 c500: 0f b6 in r0, 0x3f ; 63 c502: f8 94 cli c504: de bf out 0x3e, r29 ; 62 c506: 0f be out 0x3f, r0 ; 63 c508: cd bf out 0x3d, r28 ; 61 c50a: df 91 pop r29 c50c: cf 91 pop r28 c50e: 08 95 ret 0000c510 : * * 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) { c510: 80 91 a2 04 lds r24, 0x04A2 ; 0x8004a2 c514: 88 23 and r24, r24 c516: d1 f0 breq .+52 ; 0xc54c world2machine_reset(); c518: 0e 94 4f 62 call 0xc49e ; 0xc49e st_synchronize(); c51c: 0f 94 5b 18 call 0x230b6 ; 0x230b6 current_position[X_AXIS] = st_get_position_mm(X_AXIS); c520: 80 e0 ldi r24, 0x00 ; 0 c522: 0f 94 47 18 call 0x2308e ; 0x2308e c526: 60 93 61 12 sts 0x1261, r22 ; 0x801261 c52a: 70 93 62 12 sts 0x1262, r23 ; 0x801262 c52e: 80 93 63 12 sts 0x1263, r24 ; 0x801263 c532: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); c536: 81 e0 ldi r24, 0x01 ; 1 c538: 0f 94 47 18 call 0x2308e ; 0x2308e c53c: 60 93 65 12 sts 0x1265, r22 ; 0x801265 c540: 70 93 66 12 sts 0x1266, r23 ; 0x801266 c544: 80 93 67 12 sts 0x1267, r24 ; 0x801267 c548: 90 93 68 12 sts 0x1268, r25 ; 0x801268 } } c54c: 08 95 ret 0000c54e : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; c54e: 80 91 63 04 lds r24, 0x0463 ; 0x800463 c552: 90 91 62 04 lds r25, 0x0462 ; 0x800462 c556: 89 13 cpse r24, r25 c558: 0b c0 rjmp .+22 ; 0xc570 c55a: 90 91 61 04 lds r25, 0x0461 ; 0x800461 c55e: 99 23 and r25, r25 c560: 39 f0 breq .+14 ; 0xc570 c562: 20 91 1e 06 lds r18, 0x061E ; 0x80061e c566: 30 91 1f 06 lds r19, 0x061F ; 0x80061f c56a: 82 17 cp r24, r18 c56c: 13 06 cpc r1, r19 c56e: 39 f0 breq .+14 ; 0xc57e c570: 81 e0 ldi r24, 0x01 ; 1 c572: 90 91 c4 03 lds r25, 0x03C4 ; 0x8003c4 c576: 91 11 cpse r25, r1 c578: 03 c0 rjmp .+6 ; 0xc580 c57a: 80 e0 ldi r24, 0x00 ; 0 c57c: 08 95 ret c57e: 81 e0 ldi r24, 0x01 ; 1 } c580: 08 95 ret 0000c582 : 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)?'>':' '; c582: 20 91 63 04 lds r18, 0x0463 ; 0x800463 c586: 80 91 1e 06 lds r24, 0x061E ; 0x80061e c58a: 90 91 1f 06 lds r25, 0x061F ; 0x80061f c58e: 28 17 cp r18, r24 c590: 19 06 cpc r1, r25 c592: 11 f0 breq .+4 ; 0xc598 c594: 80 e2 ldi r24, 0x20 ; 32 c596: 08 95 ret c598: 8e e3 ldi r24, 0x3E ; 62 } c59a: 08 95 ret 0000c59c : } } void menu_item_ret(void) { lcd_draw_update = 2; c59c: 82 e0 ldi r24, 0x02 ; 2 c59e: 80 93 59 02 sts 0x0259, r24 ; 0x800259 menu_item++; c5a2: 80 91 63 04 lds r24, 0x0463 ; 0x800463 c5a6: 8f 5f subi r24, 0xFF ; 255 c5a8: 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 c5ac: 84 e0 ldi r24, 0x04 ; 4 c5ae: 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 c5b2: 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 c5b6: 10 92 61 04 sts 0x0461, r1 ; 0x800461 } c5ba: 08 95 ret 0000c5bc : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) c5bc: 80 91 60 04 lds r24, 0x0460 ; 0x800460 c5c0: 84 30 cpi r24, 0x04 ; 4 c5c2: 38 f5 brcc .+78 ; 0xc612 { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) c5c4: 80 91 63 04 lds r24, 0x0463 ; 0x800463 c5c8: 90 e0 ldi r25, 0x00 ; 0 c5ca: 20 91 1e 06 lds r18, 0x061E ; 0x80061e c5ce: 30 91 1f 06 lds r19, 0x061F ; 0x80061f c5d2: 28 17 cp r18, r24 c5d4: 39 07 cpc r19, r25 c5d6: 44 f0 brlt .+16 ; 0xc5e8 { lcd_encoder = menu_item - 1; c5d8: 01 97 sbiw r24, 0x01 ; 1 c5da: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f c5de: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e Sound_MakeSound(e_SOUND_TYPE_BlindAlert); c5e2: 87 e0 ldi r24, 0x07 ; 7 c5e4: 0f 94 06 23 call 0x2460c ; 0x2460c } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) c5e8: 80 91 1e 06 lds r24, 0x061E ; 0x80061e c5ec: 20 91 92 03 lds r18, 0x0392 ; 0x800392 c5f0: 30 e0 ldi r19, 0x00 ; 0 c5f2: 2d 5f subi r18, 0xFD ; 253 c5f4: 3f 4f sbci r19, 0xFF ; 255 c5f6: 82 17 cp r24, r18 c5f8: 13 06 cpc r1, r19 c5fa: 59 f0 breq .+22 ; 0xc612 c5fc: 54 f0 brlt .+20 ; 0xc612 { menu_top = lcd_encoder - LCD_HEIGHT + 1; c5fe: 9d ef ldi r25, 0xFD ; 253 c600: 98 0f add r25, r24 c602: 90 93 92 03 sts 0x0392, r25 ; 0x800392 menu_line = menu_top - 1; c606: 84 50 subi r24, 0x04 ; 4 c608: 80 93 62 04 sts 0x0462, r24 ; 0x800462 menu_row = -1; c60c: 8f ef ldi r24, 0xFF ; 255 c60e: 80 93 60 04 sts 0x0460, r24 ; 0x800460 } } c612: 08 95 ret 0000c614 : 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)); c614: e6 e9 ldi r30, 0x96 ; 150 c616: f3 e0 ldi r31, 0x03 ; 3 c618: 80 e2 ldi r24, 0x20 ; 32 c61a: df 01 movw r26, r30 c61c: 1d 92 st X+, r1 c61e: 8a 95 dec r24 c620: e9 f7 brne .-6 ; 0xc61c } c622: 08 95 ret 0000c624 : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { c624: cf 93 push r28 CRITICAL_SECTION_START; c626: 3f b7 in r19, 0x3f ; 63 c628: f8 94 cli if (menu_menu != menu) c62a: e0 91 02 04 lds r30, 0x0402 ; 0x800402 c62e: f0 91 03 04 lds r31, 0x0403 ; 0x800403 c632: e8 17 cp r30, r24 c634: f9 07 cpc r31, r25 c636: c9 f0 breq .+50 ; 0xc66a c638: c4 2f mov r28, r20 { menu_menu = menu; c63a: 90 93 03 04 sts 0x0403, r25 ; 0x800403 c63e: 80 93 02 04 sts 0x0402, r24 ; 0x800402 lcd_encoder = encoder; c642: 70 93 1f 06 sts 0x061F, r23 ; 0x80061f c646: 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 c64a: 10 92 92 03 sts 0x0392, r1 ; 0x800392 lcd_draw_update = 2; // Full LCD re-draw c64e: 82 e0 ldi r24, 0x02 ; 2 c650: 80 93 59 02 sts 0x0259, r24 ; 0x800259 CRITICAL_SECTION_END; c654: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); c656: 22 23 and r18, r18 c658: 19 f0 breq .+6 ; 0xc660 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); c65a: 80 e0 ldi r24, 0x00 ; 0 c65c: 0f 94 06 23 call 0x2460c ; 0x2460c if (reset_menu_state) menu_data_reset(); c660: cc 23 and r28, r28 c662: 21 f0 breq .+8 ; 0xc66c } else CRITICAL_SECTION_END; } c664: 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(); c666: 0c 94 0a 63 jmp 0xc614 ; 0xc614 } else CRITICAL_SECTION_END; c66a: 3f bf out 0x3f, r19 ; 63 } c66c: cf 91 pop r28 c66e: 08 95 ret 0000c670 : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { c670: dc 01 movw r26, r24 c672: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) c674: 90 91 df 03 lds r25, 0x03DF ; 0x8003df c678: 97 30 cpi r25, 0x07 ; 7 c67a: d8 f4 brcc .+54 ; 0xc6b2 { menu_stack[menu_depth].menu = menu_menu; c67c: 49 2f mov r20, r25 c67e: 50 e0 ldi r21, 0x00 ; 0 c680: fa 01 movw r30, r20 c682: ee 0f add r30, r30 c684: ff 1f adc r31, r31 c686: e4 0f add r30, r20 c688: f5 1f adc r31, r21 c68a: e9 5a subi r30, 0xA9 ; 169 c68c: fc 4f sbci r31, 0xFC ; 252 c68e: 40 91 02 04 lds r20, 0x0402 ; 0x800402 c692: 50 91 03 04 lds r21, 0x0403 ; 0x800403 c696: 51 83 std Z+1, r21 ; 0x01 c698: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; c69a: 80 91 1e 06 lds r24, 0x061E ; 0x80061e c69e: 9f 5f subi r25, 0xFF ; 255 c6a0: 90 93 df 03 sts 0x03DF, r25 ; 0x8003df c6a4: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); c6a6: 41 e0 ldi r20, 0x01 ; 1 c6a8: 70 e0 ldi r23, 0x00 ; 0 c6aa: 60 e0 ldi r22, 0x00 ; 0 c6ac: cd 01 movw r24, r26 c6ae: 0c 94 12 63 jmp 0xc624 ; 0xc624 } } c6b2: 08 95 ret 0000c6b4 : menu_row = -1; } } void menu_back(uint8_t nLevel) { c6b4: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); c6b6: 80 91 df 03 lds r24, 0x03DF ; 0x8003df c6ba: 98 17 cp r25, r24 c6bc: a8 f4 brcc .+42 ; 0xc6e8 c6be: 89 1b sub r24, r25 c6c0: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); c6c4: 90 e0 ldi r25, 0x00 ; 0 c6c6: fc 01 movw r30, r24 c6c8: ee 0f add r30, r30 c6ca: ff 1f adc r31, r31 c6cc: e8 0f add r30, r24 c6ce: f9 1f adc r31, r25 c6d0: e9 5a subi r30, 0xA9 ; 169 c6d2: fc 4f sbci r31, 0xFC ; 252 c6d4: 62 81 ldd r22, Z+2 ; 0x02 c6d6: 06 2e mov r0, r22 c6d8: 00 0c add r0, r0 c6da: 77 0b sbc r23, r23 c6dc: 20 e0 ldi r18, 0x00 ; 0 c6de: 41 e0 ldi r20, 0x01 ; 1 c6e0: 80 81 ld r24, Z c6e2: 91 81 ldd r25, Z+1 ; 0x01 c6e4: 0c 94 12 63 jmp 0xc624 ; 0xc624 } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); c6e8: 80 e0 ldi r24, 0x00 ; 0 c6ea: ea cf rjmp .-44 ; 0xc6c0 0000c6ec : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); c6ec: 81 e0 ldi r24, 0x01 ; 1 c6ee: 0c 94 5a 63 jmp 0xc6b4 ; 0xc6b4 0000c6f2 <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { c6f2: 1f 92 push r1 c6f4: 0f 92 push r0 c6f6: 0f b6 in r0, 0x3f ; 63 c6f8: 0f 92 push r0 c6fa: 11 24 eor r1, r1 c6fc: 0b b6 in r0, 0x3b ; 59 c6fe: 0f 92 push r0 c700: 2f 93 push r18 c702: 3f 93 push r19 c704: 4f 93 push r20 c706: 6f 93 push r22 c708: 7f 93 push r23 c70a: 8f 93 push r24 c70c: 9f 93 push r25 c70e: ef 93 push r30 c710: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< c716: 84 ff sbrs r24, 4 c718: 12 c0 rjmp .+36 ; 0xc73e <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); c71a: 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 } } c71e: ff 91 pop r31 c720: ef 91 pop r30 c722: 9f 91 pop r25 c724: 8f 91 pop r24 c726: 7f 91 pop r23 c728: 6f 91 pop r22 c72a: 4f 91 pop r20 c72c: 3f 91 pop r19 c72e: 2f 91 pop r18 c730: 0f 90 pop r0 c732: 0b be out 0x3b, r0 ; 59 c734: 0f 90 pop r0 c736: 0f be out 0x3f, r0 ; 63 c738: 0f 90 pop r0 c73a: 1f 90 pop r1 c73c: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; c73e: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) c742: 80 91 1c 06 lds r24, 0x061C ; 0x80061c c746: 81 30 cpi r24, 0x01 ; 1 c748: 51 f7 brne .-44 ; 0xc71e <__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; c74a: 20 91 42 05 lds r18, 0x0542 ; 0x800542 c74e: 30 91 43 05 lds r19, 0x0543 ; 0x800543 c752: c9 01 movw r24, r18 c754: 01 96 adiw r24, 0x01 ; 1 c756: 8f 77 andi r24, 0x7F ; 127 c758: 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) { c75a: 60 91 44 05 lds r22, 0x0544 ; 0x800544 c75e: 70 91 45 05 lds r23, 0x0545 ; 0x800545 c762: 86 17 cp r24, r22 c764: 97 07 cpc r25, r23 c766: d9 f2 breq .-74 ; 0xc71e <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; c768: 2e 53 subi r18, 0x3E ; 62 c76a: 3b 4f sbci r19, 0xFB ; 251 c76c: f9 01 movw r30, r18 c76e: 40 83 st Z, r20 rx_buffer.head = i; c770: 90 93 43 05 sts 0x0543, r25 ; 0x800543 c774: 80 93 42 05 sts 0x0542, r24 ; 0x800542 c778: d2 cf rjmp .-92 ; 0xc71e <__vector_36+0x2c> 0000c77a <__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) { c77a: 1f 92 push r1 c77c: 0f 92 push r0 c77e: 0f b6 in r0, 0x3f ; 63 c780: 0f 92 push r0 c782: 11 24 eor r1, r1 c784: 0b b6 in r0, 0x3b ; 59 c786: 0f 92 push r0 c788: 2f 93 push r18 c78a: 3f 93 push r19 c78c: 4f 93 push r20 c78e: 6f 93 push r22 c790: 7f 93 push r23 c792: 8f 93 push r24 c794: 9f 93 push r25 c796: ef 93 push r30 c798: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< c79e: 84 ff sbrs r24, 4 c7a0: 12 c0 rjmp .+36 ; 0xc7c6 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); c7a2: 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 } } c7a6: ff 91 pop r31 c7a8: ef 91 pop r30 c7aa: 9f 91 pop r25 c7ac: 8f 91 pop r24 c7ae: 7f 91 pop r23 c7b0: 6f 91 pop r22 c7b2: 4f 91 pop r20 c7b4: 3f 91 pop r19 c7b6: 2f 91 pop r18 c7b8: 0f 90 pop r0 c7ba: 0b be out 0x3b, r0 ; 59 c7bc: 0f 90 pop r0 c7be: 0f be out 0x3f, r0 ; 63 c7c0: 0f 90 pop r0 c7c2: 1f 90 pop r1 c7c4: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; c7c6: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) c7ca: 80 91 1c 06 lds r24, 0x061C ; 0x80061c c7ce: 81 11 cpse r24, r1 c7d0: ea cf rjmp .-44 ; 0xc7a6 <__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; c7d2: 20 91 42 05 lds r18, 0x0542 ; 0x800542 c7d6: 30 91 43 05 lds r19, 0x0543 ; 0x800543 c7da: c9 01 movw r24, r18 c7dc: 01 96 adiw r24, 0x01 ; 1 c7de: 8f 77 andi r24, 0x7F ; 127 c7e0: 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) { c7e2: 60 91 44 05 lds r22, 0x0544 ; 0x800544 c7e6: 70 91 45 05 lds r23, 0x0545 ; 0x800545 c7ea: 86 17 cp r24, r22 c7ec: 97 07 cpc r25, r23 c7ee: d9 f2 breq .-74 ; 0xc7a6 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; c7f0: 2e 53 subi r18, 0x3E ; 62 c7f2: 3b 4f sbci r19, 0xFB ; 251 c7f4: f9 01 movw r30, r18 c7f6: 40 83 st Z, r20 rx_buffer.head = i; c7f8: 90 93 43 05 sts 0x0543, r25 ; 0x800543 c7fc: 80 93 42 05 sts 0x0542, r24 ; 0x800542 c800: d2 cf rjmp .-92 ; 0xc7a6 <__vector_25+0x2c> 0000c802 : /// 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)); c802: 80 e1 ldi r24, 0x10 ; 16 c804: e1 e6 ldi r30, 0x61 ; 97 c806: f2 e1 ldi r31, 0x12 ; 18 c808: a0 e9 ldi r26, 0x90 ; 144 c80a: b2 e0 ldi r27, 0x02 ; 2 c80c: 01 90 ld r0, Z+ c80e: 0d 92 st X+, r0 c810: 8a 95 dec r24 c812: e1 f7 brne .-8 ; 0xc80c saved_feedmultiply2 = feedmultiply; //save feedmultiply c814: 80 91 8e 02 lds r24, 0x028E ; 0x80028e c818: 90 91 8f 02 lds r25, 0x028F ; 0x80028f c81c: 90 93 60 12 sts 0x1260, r25 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.496+0x1> c820: 80 93 5f 12 sts 0x125F, r24 ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.496> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); c824: 80 91 5d 12 lds r24, 0x125D ; 0x80125d c828: 90 91 5e 12 lds r25, 0x125E ; 0x80125e c82c: 90 93 5c 12 sts 0x125C, r25 ; 0x80125c c830: 80 93 5b 12 sts 0x125B, r24 ; 0x80125b saved_bed_temperature = (uint8_t)degTargetBed(); c834: 80 91 59 12 lds r24, 0x1259 ; 0x801259 c838: 80 93 58 12 sts 0x1258, r24 ; 0x801258 saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; c83c: 80 91 57 12 lds r24, 0x1257 ; 0x801257 c840: 83 fb bst r24, 3 c842: 88 27 eor r24, r24 c844: 80 f9 bld r24, 0 c846: 80 93 56 12 sts 0x1256, r24 ; 0x801256 saved_fan_speed = fanSpeed; c84a: 80 91 55 12 lds r24, 0x1255 ; 0x801255 c84e: 80 93 54 12 sts 0x1254, r24 ; 0x801254 isPartialBackupAvailable = true; } c852: 08 95 ret 0000c854 <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } c854: cf 93 push r28 c856: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { c858: 87 e6 ldi r24, 0x67 ; 103 c85a: 96 e1 ldi r25, 0x16 ; 22 c85c: 0e 94 06 7a call 0xf40c ; 0xf40c #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader c860: 85 ea ldi r24, 0xA5 ; 165 c862: 94 e1 ldi r25, 0x14 ; 20 c864: 89 2b or r24, r25 c866: 51 f0 breq .+20 ; 0xc87c <_GLOBAL__sub_D_card+0x28> c868: c7 e7 ldi r28, 0x77 ; 119 c86a: d5 e1 ldi r29, 0x15 ; 21 c86c: a3 97 sbiw r28, 0x23 ; 35 c86e: ce 01 movw r24, r28 c870: 0e 94 06 7a call 0xf40c ; 0xf40c c874: 84 e1 ldi r24, 0x14 ; 20 c876: c5 3a cpi r28, 0xA5 ; 165 c878: d8 07 cpc r29, r24 c87a: c1 f7 brne .-16 ; 0xc86c <_GLOBAL__sub_D_card+0x18> c87c: 82 e8 ldi r24, 0x82 ; 130 c87e: 94 e1 ldi r25, 0x14 ; 20 c880: 0e 94 06 7a call 0xf40c ; 0xf40c c884: 8d e5 ldi r24, 0x5D ; 93 c886: 94 e1 ldi r25, 0x14 ; 20 c888: df 91 pop r29 c88a: cf 91 pop r28 c88c: 0c 94 06 7a jmp 0xf40c ; 0xf40c 0000c890 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { c890: cf 93 push r28 c892: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; c894: c1 e6 ldi r28, 0x61 ; 97 c896: d2 e1 ldi r29, 0x12 ; 18 c898: 20 e0 ldi r18, 0x00 ; 0 c89a: 30 e0 ldi r19, 0x00 ; 0 c89c: 48 ec ldi r20, 0xC8 ; 200 c89e: 51 e4 ldi r21, 0x41 ; 65 c8a0: 6c 85 ldd r22, Y+12 ; 0x0c c8a2: 7d 85 ldd r23, Y+13 ; 0x0d c8a4: 8e 85 ldd r24, Y+14 ; 0x0e c8a6: 9f 85 ldd r25, Y+15 ; 0x0f c8a8: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> c8ac: 6c 87 std Y+12, r22 ; 0x0c c8ae: 7d 87 std Y+13, r23 ; 0x0d c8b0: 8e 87 std Y+14, r24 ; 0x0e c8b2: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c8b4: 63 e3 ldi r22, 0x33 ; 51 c8b6: 73 e3 ldi r23, 0x33 ; 51 c8b8: 83 e5 ldi r24, 0x53 ; 83 c8ba: 90 e4 ldi r25, 0x40 ; 64 } c8bc: df 91 pop r29 c8be: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c8c0: 0d 94 a8 49 jmp 0x29350 ; 0x29350 0000c8c4 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); c8c4: 60 e0 ldi r22, 0x00 ; 0 c8c6: 85 ea ldi r24, 0xA5 ; 165 c8c8: 9f e0 ldi r25, 0x0F ; 15 c8ca: 0f 94 62 a4 call 0x348c4 ; 0x348c4 c8ce: 60 e0 ldi r22, 0x00 ; 0 c8d0: 8f e7 ldi r24, 0x7F ; 127 c8d2: 9c e0 ldi r25, 0x0C ; 12 c8d4: 0f 94 62 a4 call 0x348c4 ; 0x348c4 // 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; c8d8: 80 e0 ldi r24, 0x00 ; 0 c8da: 90 e0 ldi r25, 0x00 ; 0 c8dc: a0 e8 ldi r26, 0x80 ; 128 c8de: bf eb ldi r27, 0xBF ; 191 c8e0: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e c8e4: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f c8e8: a0 93 80 02 sts 0x0280, r26 ; 0x800280 c8ec: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; c8f0: 82 e0 ldi r24, 0x02 ; 2 c8f2: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; c8f6: 10 92 73 12 sts 0x1273, r1 ; 0x801273 } c8fa: 08 95 ret 0000c8fc : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) c8fc: 80 91 5b 12 lds r24, 0x125B ; 0x80125b c900: 90 91 5c 12 lds r25, 0x125C ; 0x80125c c904: 20 91 5d 12 lds r18, 0x125D ; 0x80125d c908: 30 91 5e 12 lds r19, 0x125E ; 0x80125e c90c: 28 17 cp r18, r24 c90e: 39 07 cpc r19, r25 c910: 71 f0 breq .+28 ; 0xc92e return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; c912: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e c916: 80 93 5d 12 sts 0x125D, r24 ; 0x80125d { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; c91a: 81 e0 ldi r24, 0x01 ; 1 c91c: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb wait_for_heater(_millis(), active_extruder); c920: 0f 94 01 0b call 0x21602 ; 0x21602 c924: 0f 94 e0 73 call 0x2e7c0 ; 0x2e7c0 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; c928: 82 e0 ldi r24, 0x02 ; 2 c92a: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb } } c92e: 08 95 ret 0000c930 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { c930: 80 91 73 12 lds r24, 0x1273 ; 0x801273 c934: 88 23 and r24, r24 c936: 41 f0 breq .+16 ; 0xc948 // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; c938: 80 91 8e 02 lds r24, 0x028E ; 0x80028e c93c: 90 91 8f 02 lds r25, 0x028F ; 0x80028f c940: 90 93 60 12 sts 0x1260, r25 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.496+0x1> c944: 80 93 5f 12 sts 0x125F, r24 ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.496> } c948: 08 95 ret 0000c94a : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { c94a: cf 92 push r12 c94c: df 92 push r13 c94e: ef 92 push r14 c950: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); c952: c0 90 ff 0d lds r12, 0x0DFF ; 0x800dff c956: d0 90 00 0e lds r13, 0x0E00 ; 0x800e00 c95a: e0 90 01 0e lds r14, 0x0E01 ; 0x800e01 c95e: 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) { c962: 80 91 fe 0d lds r24, 0x0DFE ; 0x800dfe c966: 88 23 and r24, r24 c968: 09 f4 brne .+2 ; 0xc96c c96a: 4e c0 rjmp .+156 ; 0xca08 c96c: 20 e0 ldi r18, 0x00 ; 0 c96e: 30 e0 ldi r19, 0x00 ; 0 c970: a9 01 movw r20, r18 c972: c7 01 movw r24, r14 c974: b6 01 movw r22, r12 c976: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> c97a: 18 16 cp r1, r24 c97c: 0c f0 brlt .+2 ; 0xc980 c97e: 44 c0 rjmp .+136 ; 0xca08 float area = M_PI * diameter * diameter * 0.25; c980: 2b ed ldi r18, 0xDB ; 219 c982: 3f e0 ldi r19, 0x0F ; 15 c984: 49 e4 ldi r20, 0x49 ; 73 c986: 50 e4 ldi r21, 0x40 ; 64 c988: c7 01 movw r24, r14 c98a: b6 01 movw r22, r12 c98c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> c990: a7 01 movw r20, r14 c992: 96 01 movw r18, r12 c994: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> c998: 20 e0 ldi r18, 0x00 ; 0 c99a: 30 e0 ldi r19, 0x00 ; 0 c99c: 40 e8 ldi r20, 0x80 ; 128 c99e: 5e e3 ldi r21, 0x3E ; 62 c9a0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> c9a4: 9b 01 movw r18, r22 c9a6: ac 01 movw r20, r24 out = 1.f / area; c9a8: 60 e0 ldi r22, 0x00 ; 0 c9aa: 70 e0 ldi r23, 0x00 ; 0 c9ac: 80 e8 ldi r24, 0x80 ; 128 c9ae: 9f e3 ldi r25, 0x3F ; 63 c9b0: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> c9b4: 6b 01 movw r12, r22 c9b6: 7c 01 movw r14, r24 } if (extrudemultiply != 100) c9b8: 60 91 75 02 lds r22, 0x0275 ; 0x800275 c9bc: 70 91 76 02 lds r23, 0x0276 ; 0x800276 c9c0: 64 36 cpi r22, 0x64 ; 100 c9c2: 71 05 cpc r23, r1 c9c4: a1 f0 breq .+40 ; 0xc9ee out *= float(extrudemultiply) * 0.01f; c9c6: 07 2e mov r0, r23 c9c8: 00 0c add r0, r0 c9ca: 88 0b sbc r24, r24 c9cc: 99 0b sbc r25, r25 c9ce: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> c9d2: 2a e0 ldi r18, 0x0A ; 10 c9d4: 37 ed ldi r19, 0xD7 ; 215 c9d6: 43 e2 ldi r20, 0x23 ; 35 c9d8: 5c e3 ldi r21, 0x3C ; 60 c9da: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> c9de: 9b 01 movw r18, r22 c9e0: ac 01 movw r20, r24 c9e2: c7 01 movw r24, r14 c9e4: b6 01 movw r22, r12 c9e6: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> c9ea: 6b 01 movw r12, r22 c9ec: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); c9ee: c0 92 10 02 sts 0x0210, r12 ; 0x800210 c9f2: d0 92 11 02 sts 0x0211, r13 ; 0x800211 c9f6: e0 92 12 02 sts 0x0212, r14 ; 0x800212 c9fa: 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 } c9fe: ff 90 pop r15 ca00: ef 90 pop r14 ca02: df 90 pop r13 ca04: cf 90 pop r12 ca06: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; ca08: c1 2c mov r12, r1 ca0a: d1 2c mov r13, r1 ca0c: 80 e8 ldi r24, 0x80 ; 128 ca0e: e8 2e mov r14, r24 ca10: 8f e3 ldi r24, 0x3F ; 63 ca12: f8 2e mov r15, r24 ca14: d1 cf rjmp .-94 ; 0xc9b8 0000ca16 : } } #endif //FAST_PWM_FAN void save_statistics() { ca16: 8f 92 push r8 ca18: 9f 92 push r9 ca1a: af 92 push r10 ca1c: bf 92 push r11 ca1e: cf 92 push r12 ca20: df 92 push r13 ca22: ef 92 push r14 ca24: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: meter ca26: 81 ef ldi r24, 0xF1 ; 241 ca28: 9f e0 ldi r25, 0x0F ; 15 ca2a: 0f 94 47 6c call 0x2d88e ; 0x2d88e ca2e: 6b 01 movw r12, r22 ca30: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min ca32: 8d ee ldi r24, 0xED ; 237 ca34: 9f e0 ldi r25, 0x0F ; 15 ca36: 0f 94 47 6c call 0x2d88e ; 0x2d88e ca3a: 4b 01 movw r8, r22 ca3c: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; ca3e: 0f 94 cd 14 call 0x2299a ; 0x2299a ca42: 2c e3 ldi r18, 0x3C ; 60 ca44: 30 e0 ldi r19, 0x00 ; 0 ca46: 40 e0 ldi r20, 0x00 ; 0 ca48: 50 e0 ldi r21, 0x00 ; 0 ca4a: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min ca4e: ba 01 movw r22, r20 ca50: a9 01 movw r20, r18 ca52: 48 0d add r20, r8 ca54: 59 1d adc r21, r9 ca56: 6a 1d adc r22, r10 ca58: 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); ca5a: 8d ee ldi r24, 0xED ; 237 ca5c: 9f e0 ldi r25, 0x0F ; 15 ca5e: 0f 94 74 a4 call 0x348e8 ; 0x348e8 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); ca62: 60 91 17 06 lds r22, 0x0617 ; 0x800617 ca66: 70 91 18 06 lds r23, 0x0618 ; 0x800618 ca6a: 80 91 19 06 lds r24, 0x0619 ; 0x800619 ca6e: 90 91 1a 06 lds r25, 0x061A ; 0x80061a ca72: 28 ee ldi r18, 0xE8 ; 232 ca74: 33 e0 ldi r19, 0x03 ; 3 ca76: 40 e0 ldi r20, 0x00 ; 0 ca78: 50 e0 ldi r21, 0x00 ; 0 ca7a: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> ca7e: ba 01 movw r22, r20 ca80: a9 01 movw r20, r18 ca82: 4c 0d add r20, r12 ca84: 5d 1d adc r21, r13 ca86: 6e 1d adc r22, r14 ca88: 7f 1d adc r23, r15 ca8a: 81 ef ldi r24, 0xF1 ; 241 ca8c: 9f e0 ldi r25, 0x0F ; 15 ca8e: 0f 94 74 a4 call 0x348e8 ; 0x348e8 print_job_timer.reset(); ca92: 0f 94 6a 16 call 0x22cd4 ; 0x22cd4 total_filament_used = 0; ca96: 10 92 17 06 sts 0x0617, r1 ; 0x800617 ca9a: 10 92 18 06 sts 0x0618, r1 ; 0x800618 ca9e: 10 92 19 06 sts 0x0619, r1 ; 0x800619 caa2: 10 92 1a 06 sts 0x061A, r1 ; 0x80061a if (MMU2::mmu2.Enabled()) { caa6: 80 91 01 13 lds r24, 0x1301 ; 0x801301 caaa: 81 30 cpi r24, 0x01 ; 1 caac: 81 f4 brne .+32 ; 0xcace eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); caae: 60 91 05 13 lds r22, 0x1305 ; 0x801305 cab2: 70 91 06 13 lds r23, 0x1306 ; 0x801306 cab6: 90 e0 ldi r25, 0x00 ; 0 cab8: 80 e0 ldi r24, 0x00 ; 0 caba: 0f 94 2f 6c call 0x2d85e ; 0x2d85e /// @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; }; cabe: 10 92 06 13 sts 0x1306, r1 ; 0x801306 cac2: 10 92 05 13 sts 0x1305, r1 ; 0x801305 inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } cac6: 10 92 08 13 sts 0x1308, r1 ; 0x801308 caca: 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 } } cace: ff 90 pop r15 cad0: ef 90 pop r14 cad2: df 90 pop r13 cad4: cf 90 pop r12 cad6: bf 90 pop r11 cad8: af 90 pop r10 cada: 9f 90 pop r9 cadc: 8f 90 pop r8 cade: 08 95 ret 0000cae0 : } #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); cae0: 80 91 55 12 lds r24, 0x1255 ; 0x801255 cae4: 1f 92 push r1 cae6: 8f 93 push r24 cae8: 80 91 3e 03 lds r24, 0x033E ; 0x80033e caec: 1f 92 push r1 caee: 8f 93 push r24 caf0: e7 eb ldi r30, 0xB7 ; 183 caf2: f3 e0 ldi r31, 0x03 ; 3 caf4: 42 81 ldd r20, Z+2 ; 0x02 caf6: 53 81 ldd r21, Z+3 ; 0x03 caf8: 2c e3 ldi r18, 0x3C ; 60 cafa: 24 9f mul r18, r20 cafc: c0 01 movw r24, r0 cafe: 25 9f mul r18, r21 cb00: 90 0d add r25, r0 cb02: 11 24 eor r1, r1 cb04: 9f 93 push r25 cb06: 8f 93 push r24 cb08: 40 81 ld r20, Z cb0a: 51 81 ldd r21, Z+1 ; 0x01 cb0c: 24 9f mul r18, r20 cb0e: c0 01 movw r24, r0 cb10: 25 9f mul r18, r21 cb12: 90 0d add r25, r0 cb14: 11 24 eor r1, r1 cb16: 9f 93 push r25 cb18: 8f 93 push r24 cb1a: 86 ee ldi r24, 0xE6 ; 230 cb1c: 94 e6 ldi r25, 0x64 ; 100 cb1e: 9f 93 push r25 cb20: 8f 93 push r24 cb22: 0f 94 00 a3 call 0x34600 ; 0x34600 cb26: 8d b7 in r24, 0x3d ; 61 cb28: 9e b7 in r25, 0x3e ; 62 cb2a: 0a 96 adiw r24, 0x0a ; 10 cb2c: 0f b6 in r0, 0x3f ; 63 cb2e: f8 94 cli cb30: 9e bf out 0x3e, r25 ; 62 cb32: 0f be out 0x3f, r0 ; 63 cb34: 8d bf out 0x3d, r24 ; 61 } cb36: 08 95 ret 0000cb38 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); cb38: 88 e4 ldi r24, 0x48 ; 72 cb3a: 93 e0 ldi r25, 0x03 ; 3 cb3c: 0d 94 2a 0d jmp 0x21a54 ; 0x21a54 ::start()> 0000cb40 : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; cb40: 20 e0 ldi r18, 0x00 ; 0 cb42: 30 e0 ldi r19, 0x00 ; 0 cb44: 40 e7 ldi r20, 0x70 ; 112 cb46: 52 e4 ldi r21, 0x42 ; 66 cb48: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> } cb4c: 08 95 ret 0000cb4e : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; cb4e: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.386> //! @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; cb52: 40 91 39 03 lds r20, 0x0339 ; 0x800339 cb56: 50 91 3a 03 lds r21, 0x033A ; 0x80033a cb5a: 60 91 3b 03 lds r22, 0x033B ; 0x80033b cb5e: 70 91 3c 03 lds r23, 0x033C ; 0x80033c cb62: 40 93 7a 02 sts 0x027A, r20 ; 0x80027a cb66: 50 93 7b 02 sts 0x027B, r21 ; 0x80027b cb6a: 60 93 7c 02 sts 0x027C, r22 ; 0x80027c cb6e: 70 93 7d 02 sts 0x027D, r23 ; 0x80027d feedmultiply = original_feedmultiply; cb72: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f cb76: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); cb7a: 88 e4 ldi r24, 0x48 ; 72 cb7c: 93 e0 ldi r25, 0x03 ; 3 cb7e: 0d 94 2a 0d jmp 0x21a54 ; 0x21a54 ::start()> 0000cb82 : 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) { cb82: 1f 93 push r17 cb84: cf 93 push r28 cb86: df 93 push r29 cb88: 18 2f mov r17, r24 saved_feedrate = feedrate; cb8a: 80 91 7a 02 lds r24, 0x027A ; 0x80027a cb8e: 90 91 7b 02 lds r25, 0x027B ; 0x80027b cb92: a0 91 7c 02 lds r26, 0x027C ; 0x80027c cb96: b0 91 7d 02 lds r27, 0x027D ; 0x80027d cb9a: 80 93 39 03 sts 0x0339, r24 ; 0x800339 cb9e: 90 93 3a 03 sts 0x033A, r25 ; 0x80033a cba2: a0 93 3b 03 sts 0x033B, r26 ; 0x80033b cba6: b0 93 3c 03 sts 0x033C, r27 ; 0x80033c int l_feedmultiply = feedmultiply; cbaa: c0 91 8e 02 lds r28, 0x028E ; 0x80028e cbae: d0 91 8f 02 lds r29, 0x028F ; 0x80028f feedmultiply = 100; cbb2: 84 e6 ldi r24, 0x64 ; 100 cbb4: 90 e0 ldi r25, 0x00 ; 0 cbb6: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f cbba: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); cbbe: 88 e4 ldi r24, 0x48 ; 72 cbc0: 93 e0 ldi r25, 0x03 ; 3 cbc2: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> cbc6: 10 93 77 02 sts 0x0277, r17 ; 0x800277 <_ZL14check_endstops.lto_priv.386> enable_endstops(enable_endstops_now); return l_feedmultiply; } cbca: ce 01 movw r24, r28 cbcc: df 91 pop r29 cbce: cf 91 pop r28 cbd0: 1f 91 pop r17 cbd2: 08 95 ret 0000cbd4 : 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) { cbd4: cf 92 push r12 cbd6: df 92 push r13 cbd8: ef 92 push r14 cbda: ff 92 push r15 cbdc: 0f 93 push r16 cbde: 1f 93 push r17 cbe0: cf 93 push r28 cbe2: 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); cbe4: 90 e0 ldi r25, 0x00 ; 0 cbe6: ec 01 movw r28, r24 cbe8: cc 0f add r28, r28 cbea: dd 1f adc r29, r29 cbec: cc 0f add r28, r28 cbee: dd 1f adc r29, r29 cbf0: fe 01 movw r30, r28 cbf2: e1 5b subi r30, 0xB1 ; 177 cbf4: f8 48 sbci r31, 0x88 ; 136 #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); cbf6: 25 91 lpm r18, Z+ cbf8: 35 91 lpm r19, Z+ cbfa: 45 91 lpm r20, Z+ cbfc: 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]; cbfe: fe 01 movw r30, r28 cc00: e1 54 subi r30, 0x41 ; 65 cc02: f2 4f sbci r31, 0xF2 ; 242 cc04: c0 80 ld r12, Z cc06: d1 80 ldd r13, Z+1 ; 0x01 cc08: e2 80 ldd r14, Z+2 ; 0x02 cc0a: f3 80 ldd r15, Z+3 ; 0x03 cc0c: 8e 01 movw r16, r28 cc0e: 0f 59 subi r16, 0x9F ; 159 cc10: 1d 4e sbci r17, 0xED ; 237 cc12: c7 01 movw r24, r14 cc14: b6 01 movw r22, r12 cc16: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> cc1a: f8 01 movw r30, r16 cc1c: 60 83 st Z, r22 cc1e: 71 83 std Z+1, r23 ; 0x01 cc20: 82 83 std Z+2, r24 ; 0x02 cc22: 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); cc24: fe 01 movw r30, r28 cc26: ed 5b subi r30, 0xBD ; 189 cc28: f8 48 sbci r31, 0x88 ; 136 #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); cc2a: 25 91 lpm r18, Z+ cc2c: 35 91 lpm r19, Z+ cc2e: 45 91 lpm r20, Z+ cc30: 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]; cc32: 8e 01 movw r16, r28 cc34: 0c 5d subi r16, 0xDC ; 220 cc36: 1d 4f sbci r17, 0xFD ; 253 cc38: c7 01 movw r24, r14 cc3a: b6 01 movw r22, r12 cc3c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> cc40: f8 01 movw r30, r16 cc42: 60 83 st Z, r22 cc44: 71 83 std Z+1, r23 ; 0x01 cc46: 82 83 std Z+2, r24 ; 0x02 cc48: 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); cc4a: fe 01 movw r30, r28 cc4c: e9 5c subi r30, 0xC9 ; 201 cc4e: f8 48 sbci r31, 0x88 ; 136 #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); cc50: 25 91 lpm r18, Z+ cc52: 35 91 lpm r19, Z+ cc54: 45 91 lpm r20, Z+ cc56: 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]; cc58: c8 5e subi r28, 0xE8 ; 232 cc5a: dd 4f sbci r29, 0xFD ; 253 cc5c: c7 01 movw r24, r14 cc5e: b6 01 movw r22, r12 cc60: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> cc64: 68 83 st Y, r22 cc66: 79 83 std Y+1, r23 ; 0x01 cc68: 8a 83 std Y+2, r24 ; 0x02 cc6a: 9b 83 std Y+3, r25 ; 0x03 } cc6c: df 91 pop r29 cc6e: cf 91 pop r28 cc70: 1f 91 pop r17 cc72: 0f 91 pop r16 cc74: ff 90 pop r15 cc76: ef 90 pop r14 cc78: df 90 pop r13 cc7a: cf 90 pop r12 cc7c: 08 95 ret 0000cc7e : cc7e: 40 e0 ldi r20, 0x00 ; 0 cc80: 50 e0 ldi r21, 0x00 ; 0 cc82: ba 01 movw r22, r20 cc84: 8d ee ldi r24, 0xED ; 237 cc86: 9f e0 ldi r25, 0x0F ; 15 cc88: 0f 94 74 a4 call 0x348e8 ; 0x348e8 cc8c: 40 e0 ldi r20, 0x00 ; 0 cc8e: 50 e0 ldi r21, 0x00 ; 0 cc90: ba 01 movw r22, r20 cc92: 81 ef ldi r24, 0xF1 ; 241 cc94: 9f e0 ldi r25, 0x0F ; 15 cc96: 0f 94 74 a4 call 0x348e8 ; 0x348e8 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(); cc9a: 0e 94 f3 56 call 0xade6 ; 0xade6 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); cc9e: 70 e0 ldi r23, 0x00 ; 0 cca0: 60 e0 ldi r22, 0x00 ; 0 cca2: 85 e0 ldi r24, 0x05 ; 5 cca4: 9f e0 ldi r25, 0x0F ; 15 cca6: 0f 94 80 a4 call 0x34900 ; 0x34900 ccaa: 70 e0 ldi r23, 0x00 ; 0 ccac: 60 e0 ldi r22, 0x00 ; 0 ccae: 83 e0 ldi r24, 0x03 ; 3 ccb0: 9f e0 ldi r25, 0x0F ; 15 ccb2: 0f 94 80 a4 call 0x34900 ; 0x34900 ccb6: 70 e0 ldi r23, 0x00 ; 0 ccb8: 60 e0 ldi r22, 0x00 ; 0 ccba: 81 e0 ldi r24, 0x01 ; 1 ccbc: 9f e0 ldi r25, 0x0F ; 15 ccbe: 0f 94 80 a4 call 0x34900 ; 0x34900 ccc2: 70 e0 ldi r23, 0x00 ; 0 ccc4: 60 e0 ldi r22, 0x00 ; 0 ccc6: 8f ef ldi r24, 0xFF ; 255 ccc8: 9e e0 ldi r25, 0x0E ; 14 ccca: 0f 94 80 a4 call 0x34900 ; 0x34900 ccce: 70 e0 ldi r23, 0x00 ; 0 ccd0: 60 e0 ldi r22, 0x00 ; 0 ccd2: 83 ed ldi r24, 0xD3 ; 211 ccd4: 9e e0 ldi r25, 0x0E ; 14 ccd6: 0f 94 80 a4 call 0x34900 ; 0x34900 ccda: 70 e0 ldi r23, 0x00 ; 0 ccdc: 60 e0 ldi r22, 0x00 ; 0 ccde: 80 ed ldi r24, 0xD0 ; 208 cce0: 9e e0 ldi r25, 0x0E ; 14 cce2: 0f 94 80 a4 call 0x34900 ; 0x34900 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); cce6: 40 e0 ldi r20, 0x00 ; 0 cce8: 50 e0 ldi r21, 0x00 ; 0 ccea: ba 01 movw r22, r20 ccec: 88 ea ldi r24, 0xA8 ; 168 ccee: 9c e0 ldi r25, 0x0C ; 12 ccf0: 0d 94 74 a4 jmp 0x348e8 ; 0x348e8 0000ccf4 : wdt_disable(); } } void softReset(void) { cli(); ccf4: 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" ); ccf6: 88 e1 ldi r24, 0x18 ; 24 ccf8: 9f e0 ldi r25, 0x0F ; 15 ccfa: 0f b6 in r0, 0x3f ; 63 ccfc: f8 94 cli ccfe: a8 95 wdr cd00: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> cd04: 0f be out 0x3f, r0 ; 63 cd06: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> cd0a: ff cf rjmp .-2 ; 0xcd0a 0000cd0c : } #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); cd0c: 85 ea ldi r24, 0xA5 ; 165 cd0e: 9f e0 ldi r25, 0x0F ; 15 cd10: 0f 94 3e a4 call 0x3487c ; 0x3487c cd14: 91 e0 ldi r25, 0x01 ; 1 cd16: 81 11 cpse r24, r1 cd18: 01 c0 rjmp .+2 ; 0xcd1c cd1a: 90 e0 ldi r25, 0x00 ; 0 } cd1c: 89 2f mov r24, r25 cd1e: 08 95 ret 0000cd20 : 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(); cd20: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd cd24: 81 11 cpse r24, r1 cd26: 06 c0 rjmp .+12 ; 0xcd34 cd28: 81 e0 ldi r24, 0x01 ; 1 cd2a: 90 91 8b 03 lds r25, 0x038B ; 0x80038b cd2e: 92 30 cpi r25, 0x02 ; 2 cd30: 09 f0 breq .+2 ; 0xcd34 cd32: 80 e0 ldi r24, 0x00 ; 0 } cd34: 08 95 ret 0000cd36 : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); cd36: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 cd3a: 81 11 cpse r24, r1 cd3c: 0a c0 rjmp .+20 ; 0xcd52 cd3e: 80 91 42 12 lds r24, 0x1242 ; 0x801242 cd42: 81 11 cpse r24, r1 cd44: 06 c0 rjmp .+12 ; 0xcd52 cd46: 81 e0 ldi r24, 0x01 ; 1 cd48: 90 91 8b 03 lds r25, 0x038B ; 0x80038b cd4c: 91 30 cpi r25, 0x01 ; 1 cd4e: 09 f0 breq .+2 ; 0xcd52 cd50: 80 e0 ldi r24, 0x00 ; 0 } cd52: 08 95 ret 0000cd54 : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { cd54: cf 93 push r28 cd56: df 93 push r29 return ( !homing_flag cd58: c0 91 71 12 lds r28, 0x1271 ; 0x801271 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cd5c: c1 11 cpse r28, r1 cd5e: 1f c0 rjmp .+62 ; 0xcd9e && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag cd60: 80 91 72 12 lds r24, 0x1272 ; 0x801272 cd64: 81 11 cpse r24, r1 cd66: 1c c0 rjmp .+56 ; 0xcda0 && !printingIsPaused() cd68: 0e 94 90 66 call 0xcd20 ; 0xcd20 cd6c: 81 11 cpse r24, r1 cd6e: 18 c0 rjmp .+48 ; 0xcda0 && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cd70: d0 91 5e 0d lds r29, 0x0D5E ; 0x800d5e cd74: d4 30 cpi r29, 0x04 ; 4 cd76: 61 f4 brne .+24 ; 0xcd90 cd78: 80 91 5d 12 lds r24, 0x125D ; 0x80125d cd7c: 90 91 5e 12 lds r25, 0x125E ; 0x80125e cd80: 89 2b or r24, r25 cd82: 91 f4 brne .+36 ; 0xcda8 cd84: 80 91 59 12 lds r24, 0x1259 ; 0x801259 cd88: 90 91 5a 12 lds r25, 0x125A ; 0x80125a cd8c: 89 2b or r24, r25 cd8e: 61 f4 brne .+24 ; 0xcda8 || printJobOngoing() cd90: 0e 94 9b 66 call 0xcd36 ; 0xcd36 cd94: c8 2f mov r28, r24 cd96: 81 11 cpse r24, r1 cd98: 03 c0 rjmp .+6 ; 0xcda0 || lcd_commands_type == LcdCommands::Idle cd9a: c1 e0 ldi r28, 0x01 ; 1 cd9c: 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) cd9e: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } cda0: 8c 2f mov r24, r28 cda2: df 91 pop r29 cda4: cf 91 pop r28 cda6: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cda8: c1 e0 ldi r28, 0x01 ; 1 cdaa: fa cf rjmp .-12 ; 0xcda0 0000cdac : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); cdac: 0e 94 aa 66 call 0xcd54 ; 0xcd54 cdb0: 88 23 and r24, r24 cdb2: 89 f0 breq .+34 ; 0xcdd6 cdb4: 20 e0 ldi r18, 0x00 ; 0 cdb6: 30 e0 ldi r19, 0x00 ; 0 cdb8: 40 e0 ldi r20, 0x00 ; 0 cdba: 50 e4 ldi r21, 0x40 ; 64 cdbc: 60 91 69 12 lds r22, 0x1269 ; 0x801269 cdc0: 70 91 6a 12 lds r23, 0x126A ; 0x80126a cdc4: 80 91 6b 12 lds r24, 0x126B ; 0x80126b cdc8: 90 91 6c 12 lds r25, 0x126C ; 0x80126c cdcc: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> cdd0: 88 1f adc r24, r24 cdd2: 88 27 eor r24, r24 cdd4: 88 1f adc r24, r24 } cdd6: 08 95 ret 0000cdd8 : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() cdd8: 0e 94 9b 66 call 0xcd36 ; 0xcd36 || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; cddc: 81 11 cpse r24, r1 cdde: 18 c0 rjmp .+48 ; 0xce10 return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() cde0: 0e 94 90 66 call 0xcd20 ; 0xcd20 cde4: 81 11 cpse r24, r1 cde6: 14 c0 rjmp .+40 ; 0xce10 || saved_printing cde8: 80 91 73 12 lds r24, 0x1273 ; 0x801273 cdec: 81 11 cpse r24, r1 cdee: 10 c0 rjmp .+32 ; 0xce10 || (lcd_commands_type != LcdCommands::Idle) cdf0: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e cdf4: 81 11 cpse r24, r1 cdf6: 0b c0 rjmp .+22 ; 0xce0e || MMU2::mmu2.MMU_PRINT_SAVED() cdf8: 80 91 02 13 lds r24, 0x1302 ; 0x801302 cdfc: 81 11 cpse r24, r1 cdfe: 07 c0 rjmp .+14 ; 0xce0e || homing_flag ce00: 80 91 71 12 lds r24, 0x1271 ; 0x801271 ce04: 81 11 cpse r24, r1 ce06: 04 c0 rjmp .+8 ; 0xce10 || mesh_bed_leveling_flag; ce08: 80 91 72 12 lds r24, 0x1272 ; 0x801272 ce0c: 08 95 ret ce0e: 81 e0 ldi r24, 0x01 ; 1 } ce10: 08 95 ret 0000ce12 : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } ce12: 80 e1 ldi r24, 0x10 ; 16 ce14: e1 e6 ldi r30, 0x61 ; 97 ce16: f2 e1 ldi r31, 0x12 ; 18 ce18: a9 e2 ldi r26, 0x29 ; 41 ce1a: b6 e0 ldi r27, 0x06 ; 6 ce1c: 01 90 ld r0, Z+ ce1e: 0d 92 st X+, r0 ce20: 8a 95 dec r24 ce22: e1 f7 brne .-8 ; 0xce1c ce24: 08 95 ret 0000ce26 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { ce26: 4f 92 push r4 ce28: 5f 92 push r5 ce2a: 6f 92 push r6 ce2c: 7f 92 push r7 ce2e: 8f 92 push r8 ce30: 9f 92 push r9 ce32: af 92 push r10 ce34: bf 92 push r11 ce36: cf 92 push r12 ce38: df 92 push r13 ce3a: ef 92 push r14 ce3c: ff 92 push r15 ce3e: 0f 93 push r16 ce40: 1f 93 push r17 ce42: cf 93 push r28 ce44: df 93 push r29 ce46: 00 d0 rcall .+0 ; 0xce48 ce48: 00 d0 rcall .+0 ; 0xce4a ce4a: 1f 92 push r1 ce4c: 1f 92 push r1 ce4e: cd b7 in r28, 0x3d ; 61 ce50: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; ce52: 20 91 73 12 lds r18, 0x1273 ; 0x801273 ce56: 22 23 and r18, r18 ce58: 09 f4 brne .+2 ; 0xce5c ce5a: 73 c1 rjmp .+742 ; 0xd142 #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; ce5c: 20 91 ce 03 lds r18, 0x03CE ; 0x8003ce ce60: 22 30 cpi r18, 0x02 ; 2 ce62: 09 f4 brne .+2 ; 0xce66 ce64: 6e c1 rjmp .+732 ; 0xd142 if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb ce66: 20 91 ce 03 lds r18, 0x03CE ; 0x8003ce ce6a: 21 30 cpi r18, 0x01 ; 1 ce6c: 11 f4 brne .+4 ; 0xce72 ce6e: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce ce72: 2b 01 movw r4, r22 ce74: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; ce76: 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) ce7a: 10 91 58 12 lds r17, 0x1258 ; 0x801258 ce7e: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc ce82: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd ce86: 80 91 be 03 lds r24, 0x03BE ; 0x8003be ce8a: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf ce8e: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> ce92: 61 17 cp r22, r17 ce94: 31 f0 breq .+12 ; 0xcea2 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; ce96: 81 2f mov r24, r17 ce98: 90 e0 ldi r25, 0x00 ; 0 ce9a: 90 93 5a 12 sts 0x125A, r25 ; 0x80125a ce9e: 80 93 59 12 sts 0x1259, r24 ; 0x801259 setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); cea2: 0e 94 7e 64 call 0xc8fc ; 0xc8fc // Restore saved fan speed fanSpeed = saved_fan_speed; cea6: 80 91 54 12 lds r24, 0x1254 ; 0x801254 ceaa: 80 93 55 12 sts 0x1255, r24 ; 0x801255 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; ceae: 90 91 57 12 lds r25, 0x1257 ; 0x801257 ceb2: 80 91 56 12 lds r24, 0x1256 ; 0x801256 ceb6: 81 95 neg r24 ceb8: 89 27 eor r24, r25 ceba: 88 70 andi r24, 0x08 ; 8 cebc: 89 27 eor r24, r25 cebe: 80 93 57 12 sts 0x1257, r24 ; 0x801257 float e = saved_pos[E_AXIS] - e_move; cec2: a3 01 movw r20, r6 cec4: 92 01 movw r18, r4 cec6: 60 91 9c 02 lds r22, 0x029C ; 0x80029c ceca: 70 91 9d 02 lds r23, 0x029D ; 0x80029d cece: 80 91 9e 02 lds r24, 0x029E ; 0x80029e ced2: 90 91 9f 02 lds r25, 0x029F ; 0x80029f ced6: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> ceda: 6d 83 std Y+5, r22 ; 0x05 cedc: 7e 83 std Y+6, r23 ; 0x06 cede: 8f 83 std Y+7, r24 ; 0x07 cee0: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); cee2: ce 01 movw r24, r28 cee4: 05 96 adiw r24, 0x05 ; 5 cee6: 0f 94 00 3a call 0x27400 ; 0x27400 #ifdef FANCHECK fans_check_enabled = false; ceea: 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) ceee: 20 e0 ldi r18, 0x00 ; 0 cef0: 30 e0 ldi r19, 0x00 ; 0 cef2: 40 e8 ldi r20, 0x80 ; 128 cef4: 5f eb ldi r21, 0xBF ; 191 cef6: 60 91 90 02 lds r22, 0x0290 ; 0x800290 cefa: 70 91 91 02 lds r23, 0x0291 ; 0x800291 cefe: 80 91 92 02 lds r24, 0x0292 ; 0x800292 cf02: 90 91 93 02 lds r25, 0x0293 ; 0x800293 cf06: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> cf0a: 81 11 cpse r24, r1 cf0c: 20 c0 rjmp .+64 ; 0xcf4e { saved_pos[X_AXIS] = current_position[X_AXIS]; cf0e: 80 91 61 12 lds r24, 0x1261 ; 0x801261 cf12: 90 91 62 12 lds r25, 0x1262 ; 0x801262 cf16: a0 91 63 12 lds r26, 0x1263 ; 0x801263 cf1a: b0 91 64 12 lds r27, 0x1264 ; 0x801264 cf1e: 80 93 90 02 sts 0x0290, r24 ; 0x800290 cf22: 90 93 91 02 sts 0x0291, r25 ; 0x800291 cf26: a0 93 92 02 sts 0x0292, r26 ; 0x800292 cf2a: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_pos[Y_AXIS] = current_position[Y_AXIS]; cf2e: 80 91 65 12 lds r24, 0x1265 ; 0x801265 cf32: 90 91 66 12 lds r25, 0x1266 ; 0x801266 cf36: a0 91 67 12 lds r26, 0x1267 ; 0x801267 cf3a: b0 91 68 12 lds r27, 0x1268 ; 0x801268 cf3e: 80 93 94 02 sts 0x0294, r24 ; 0x800294 cf42: 90 93 95 02 sts 0x0295, r25 ; 0x800295 cf46: a0 93 96 02 sts 0x0296, r26 ; 0x800296 cf4a: 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); cf4e: a3 01 movw r20, r6 cf50: 92 01 movw r18, r4 cf52: 60 91 9c 02 lds r22, 0x029C ; 0x80029c cf56: 70 91 9d 02 lds r23, 0x029D ; 0x80029d cf5a: 80 91 9e 02 lds r24, 0x029E ; 0x80029e cf5e: 90 91 9f 02 lds r25, 0x029F ; 0x80029f cf62: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> cf66: 69 83 std Y+1, r22 ; 0x01 cf68: 7a 83 std Y+2, r23 ; 0x02 cf6a: 8b 83 std Y+3, r24 ; 0x03 cf6c: 9c 83 std Y+4, r25 ; 0x04 cf6e: e0 90 69 12 lds r14, 0x1269 ; 0x801269 cf72: f0 90 6a 12 lds r15, 0x126A ; 0x80126a cf76: 00 91 6b 12 lds r16, 0x126B ; 0x80126b cf7a: 10 91 6c 12 lds r17, 0x126C ; 0x80126c cf7e: 20 91 94 02 lds r18, 0x0294 ; 0x800294 cf82: 30 91 95 02 lds r19, 0x0295 ; 0x800295 cf86: 40 91 96 02 lds r20, 0x0296 ; 0x800296 cf8a: 50 91 97 02 lds r21, 0x0297 ; 0x800297 cf8e: 60 91 90 02 lds r22, 0x0290 ; 0x800290 cf92: 70 91 91 02 lds r23, 0x0291 ; 0x800291 cf96: 80 91 92 02 lds r24, 0x0292 ; 0x800292 cf9a: 90 91 93 02 lds r25, 0x0293 ; 0x800293 cf9e: 1f 92 push r1 cfa0: 1f 92 push r1 cfa2: 1f 92 push r1 cfa4: 1f 92 push r1 cfa6: e2 e6 ldi r30, 0x62 ; 98 cfa8: 8e 2e mov r8, r30 cfaa: e7 e2 ldi r30, 0x27 ; 39 cfac: 9e 2e mov r9, r30 cfae: e6 e7 ldi r30, 0x76 ; 118 cfb0: ae 2e mov r10, r30 cfb2: e2 e4 ldi r30, 0x42 ; 66 cfb4: be 2e mov r11, r30 cfb6: fe 01 movw r30, r28 cfb8: 31 96 adiw r30, 0x01 ; 1 cfba: 6f 01 movw r12, r30 cfbc: 0f 94 5a 3a call 0x274b4 ; 0x274b4 //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); cfc0: a3 01 movw r20, r6 cfc2: 92 01 movw r18, r4 cfc4: 60 91 9c 02 lds r22, 0x029C ; 0x80029c cfc8: 70 91 9d 02 lds r23, 0x029D ; 0x80029d cfcc: 80 91 9e 02 lds r24, 0x029E ; 0x80029e cfd0: 90 91 9f 02 lds r25, 0x029F ; 0x80029f cfd4: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> cfd8: 69 83 std Y+1, r22 ; 0x01 cfda: 7a 83 std Y+2, r23 ; 0x02 cfdc: 8b 83 std Y+3, r24 ; 0x03 cfde: 9c 83 std Y+4, r25 ; 0x04 cfe0: e0 90 98 02 lds r14, 0x0298 ; 0x800298 cfe4: f0 90 99 02 lds r15, 0x0299 ; 0x800299 cfe8: 00 91 9a 02 lds r16, 0x029A ; 0x80029a cfec: 10 91 9b 02 lds r17, 0x029B ; 0x80029b cff0: 20 91 94 02 lds r18, 0x0294 ; 0x800294 cff4: 30 91 95 02 lds r19, 0x0295 ; 0x800295 cff8: 40 91 96 02 lds r20, 0x0296 ; 0x800296 cffc: 50 91 97 02 lds r21, 0x0297 ; 0x800297 d000: 60 91 90 02 lds r22, 0x0290 ; 0x800290 d004: 70 91 91 02 lds r23, 0x0291 ; 0x800291 d008: 80 91 92 02 lds r24, 0x0292 ; 0x800292 d00c: 90 91 93 02 lds r25, 0x0293 ; 0x800293 d010: 1f 92 push r1 d012: 1f 92 push r1 d014: 1f 92 push r1 d016: 1f 92 push r1 d018: 0f 94 5a 3a call 0x274b4 ; 0x274b4 //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); d01c: e0 90 98 02 lds r14, 0x0298 ; 0x800298 d020: f0 90 99 02 lds r15, 0x0299 ; 0x800299 d024: 00 91 9a 02 lds r16, 0x029A ; 0x80029a d028: 10 91 9b 02 lds r17, 0x029B ; 0x80029b d02c: 20 91 94 02 lds r18, 0x0294 ; 0x800294 d030: 30 91 95 02 lds r19, 0x0295 ; 0x800295 d034: 40 91 96 02 lds r20, 0x0296 ; 0x800296 d038: 50 91 97 02 lds r21, 0x0297 ; 0x800297 d03c: 60 91 90 02 lds r22, 0x0290 ; 0x800290 d040: 70 91 91 02 lds r23, 0x0291 ; 0x800291 d044: 80 91 92 02 lds r24, 0x0292 ; 0x800292 d048: 90 91 93 02 lds r25, 0x0293 ; 0x800293 d04c: 1f 92 push r1 d04e: 1f 92 push r1 d050: 1f 92 push r1 d052: 1f 92 push r1 d054: 81 2c mov r8, r1 d056: 91 2c mov r9, r1 d058: f8 ee ldi r31, 0xE8 ; 232 d05a: af 2e mov r10, r31 d05c: f2 e4 ldi r31, 0x42 ; 66 d05e: bf 2e mov r11, r31 d060: ac e9 ldi r26, 0x9C ; 156 d062: ca 2e mov r12, r26 d064: a2 e0 ldi r26, 0x02 ; 2 d066: da 2e mov r13, r26 d068: 0f 94 5a 3a call 0x274b4 ; 0x274b4 st_synchronize(); d06c: 0f 94 5b 18 call 0x230b6 ; 0x230b6 #ifdef FANCHECK fans_check_enabled = true; d070: 11 e0 ldi r17, 0x01 ; 1 d072: 10 93 40 02 sts 0x0240, r17 ; 0x800240 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; d076: 60 91 4f 12 lds r22, 0x124F ; 0x80124f d07a: 70 91 50 12 lds r23, 0x1250 ; 0x801250 d07e: 90 e0 ldi r25, 0x00 ; 0 d080: 80 e0 ldi r24, 0x00 ; 0 d082: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> d086: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a d08a: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b d08e: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c d092: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedmultiply = saved_feedmultiply2; d096: 80 91 5f 12 lds r24, 0x125F ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.496> d09a: 90 91 60 12 lds r25, 0x1260 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.496+0x1> d09e: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f d0a2: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e memcpy(current_position, saved_pos, sizeof(saved_pos)); d0a6: 80 e1 ldi r24, 0x10 ; 16 d0a8: e0 e9 ldi r30, 0x90 ; 144 d0aa: f2 e0 ldi r31, 0x02 ; 2 d0ac: a1 e6 ldi r26, 0x61 ; 97 d0ae: b2 e1 ldi r27, 0x12 ; 18 d0b0: 01 90 ld r0, Z+ d0b2: 0d 92 st X+, r0 d0b4: 8a 95 dec r24 d0b6: e1 f7 brne .-8 ; 0xd0b0 set_destination_to_current(); d0b8: 0e 94 09 67 call 0xce12 ; 0xce12 //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing d0bc: 80 91 79 02 lds r24, 0x0279 ; 0x800279 d0c0: 0f b6 in r0, 0x3f ; 63 d0c2: f8 94 cli d0c4: de bf out 0x3e, r29 ; 62 d0c6: 0f be out 0x3f, r0 ; 63 d0c8: cd bf out 0x3d, r28 ; 61 d0ca: 81 11 cpse r24, r1 d0cc: 51 c0 rjmp .+162 ; 0xd170 card.setIndex(saved_sdpos); d0ce: 60 91 45 12 lds r22, 0x1245 ; 0x801245 d0d2: 70 91 46 12 lds r23, 0x1246 ; 0x801246 d0d6: 80 91 47 12 lds r24, 0x1247 ; 0x801247 d0da: 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);}; d0de: 60 93 eb 16 sts 0x16EB, r22 ; 0x8016eb d0e2: 70 93 ec 16 sts 0x16EC, r23 ; 0x8016ec d0e6: 80 93 ed 16 sts 0x16ED, r24 ; 0x8016ed d0ea: 90 93 ee 16 sts 0x16EE, r25 ; 0x8016ee d0ee: 0f 94 86 67 call 0x2cf0c ; 0x2cf0c sdpos_atomic = saved_sdpos; d0f2: 80 91 45 12 lds r24, 0x1245 ; 0x801245 d0f6: 90 91 46 12 lds r25, 0x1246 ; 0x801246 d0fa: a0 91 47 12 lds r26, 0x1247 ; 0x801247 d0fe: b0 91 48 12 lds r27, 0x1248 ; 0x801248 d102: 80 93 49 12 sts 0x1249, r24 ; 0x801249 d106: 90 93 4a 12 sts 0x124A, r25 ; 0x80124a d10a: a0 93 4b 12 sts 0x124B, r26 ; 0x80124b d10e: b0 93 4c 12 sts 0x124C, r27 ; 0x80124c card.sdprinting = true; d112: 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); d116: 60 e0 ldi r22, 0x00 ; 0 d118: 85 ea ldi r24, 0xA5 ; 165 d11a: 9f e0 ldi r25, 0x0F ; 15 d11c: 0f 94 62 a4 call 0x348c4 ; 0x348c4 d120: 60 e0 ldi r22, 0x00 ; 0 d122: 8f e7 ldi r24, 0x7F ; 127 d124: 9c e0 ldi r25, 0x0C ; 12 d126: 0f 94 62 a4 call 0x348c4 ; 0x348c4 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); d12a: 8a e8 ldi r24, 0x8A ; 138 d12c: 9c e6 ldi r25, 0x6C ; 108 d12e: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d132: 82 e0 ldi r24, 0x02 ; 2 d134: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; d138: 10 92 73 12 sts 0x1273, r1 ; 0x801273 planner_aborted = true; // unroll the stack d13c: 81 e0 ldi r24, 0x01 ; 1 d13e: 80 93 42 0d sts 0x0D42, r24 ; 0x800d42 } d142: 28 96 adiw r28, 0x08 ; 8 d144: 0f b6 in r0, 0x3f ; 63 d146: f8 94 cli d148: de bf out 0x3e, r29 ; 62 d14a: 0f be out 0x3f, r0 ; 63 d14c: cd bf out 0x3d, r28 ; 61 d14e: df 91 pop r29 d150: cf 91 pop r28 d152: 1f 91 pop r17 d154: 0f 91 pop r16 d156: ff 90 pop r15 d158: ef 90 pop r14 d15a: df 90 pop r13 d15c: cf 90 pop r12 d15e: bf 90 pop r11 d160: af 90 pop r10 d162: 9f 90 pop r9 d164: 8f 90 pop r8 d166: 7f 90 pop r7 d168: 6f 90 pop r6 d16a: 5f 90 pop r5 d16c: 4f 90 pop r4 d16e: 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 d170: 81 30 cpi r24, 0x01 ; 1 d172: 89 f6 brne .-94 ; 0xd116 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d174: 80 91 45 12 lds r24, 0x1245 ; 0x801245 d178: 90 91 46 12 lds r25, 0x1246 ; 0x801246 d17c: a0 91 47 12 lds r26, 0x1247 ; 0x801247 d180: b0 91 48 12 lds r27, 0x1248 ; 0x801248 d184: 80 93 3e 12 sts 0x123E, r24 ; 0x80123e d188: 90 93 3f 12 sts 0x123F, r25 ; 0x80123f d18c: a0 93 40 12 sts 0x1240, r26 ; 0x801240 d190: b0 93 41 12 sts 0x1241, r27 ; 0x801241 serial_count = 0; d194: 10 92 48 10 sts 0x1048, r1 ; 0x801048 d198: 10 92 47 10 sts 0x1047, r1 ; 0x801047 FlushSerialRequestResend(); d19c: 0e 94 37 56 call 0xac6e ; 0xac6e d1a0: ba cf rjmp .-140 ; 0xd116 0000d1a2 : 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) { d1a2: 3f 92 push r3 d1a4: 4f 92 push r4 d1a6: 5f 92 push r5 d1a8: 6f 92 push r6 d1aa: 7f 92 push r7 d1ac: 8f 92 push r8 d1ae: 9f 92 push r9 d1b0: af 92 push r10 d1b2: bf 92 push r11 d1b4: cf 92 push r12 d1b6: df 92 push r13 d1b8: ef 92 push r14 d1ba: ff 92 push r15 d1bc: 0f 93 push r16 d1be: 1f 93 push r17 d1c0: cf 93 push r28 d1c2: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d1c4: 30 90 a2 04 lds r3, 0x04A2 ; 0x8004a2 d1c8: 33 20 and r3, r3 d1ca: 09 f4 brne .+2 ; 0xd1ce d1cc: 80 c0 rjmp .+256 ; 0xd2ce d1ce: 8b 01 movw r16, r22 d1d0: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d1d2: 31 fe sbrs r3, 1 d1d4: 54 c0 rjmp .+168 ; 0xd27e // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d1d6: 88 80 ld r8, Y d1d8: 99 80 ldd r9, Y+1 ; 0x01 d1da: aa 80 ldd r10, Y+2 ; 0x02 d1dc: bb 80 ldd r11, Y+3 ; 0x03 d1de: fb 01 movw r30, r22 d1e0: c0 80 ld r12, Z d1e2: d1 80 ldd r13, Z+1 ; 0x01 d1e4: e2 80 ldd r14, Z+2 ; 0x02 d1e6: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d1e8: 20 91 77 03 lds r18, 0x0377 ; 0x800377 d1ec: 30 91 78 03 lds r19, 0x0378 ; 0x800378 d1f0: 40 91 79 03 lds r20, 0x0379 ; 0x800379 d1f4: 50 91 7a 03 lds r21, 0x037A ; 0x80037a d1f8: c5 01 movw r24, r10 d1fa: b4 01 movw r22, r8 d1fc: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d200: 2b 01 movw r4, r22 d202: 3c 01 movw r6, r24 d204: 20 91 7b 03 lds r18, 0x037B ; 0x80037b d208: 30 91 7c 03 lds r19, 0x037C ; 0x80037c d20c: 40 91 7d 03 lds r20, 0x037D ; 0x80037d d210: 50 91 7e 03 lds r21, 0x037E ; 0x80037e d214: c7 01 movw r24, r14 d216: b6 01 movw r22, r12 d218: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d21c: 9b 01 movw r18, r22 d21e: ac 01 movw r20, r24 d220: c3 01 movw r24, r6 d222: b2 01 movw r22, r4 d224: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> d228: 2b 01 movw r4, r22 d22a: 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; d22c: 20 91 6f 03 lds r18, 0x036F ; 0x80036f d230: 30 91 70 03 lds r19, 0x0370 ; 0x800370 d234: 40 91 71 03 lds r20, 0x0371 ; 0x800371 d238: 50 91 72 03 lds r21, 0x0372 ; 0x800372 d23c: c5 01 movw r24, r10 d23e: b4 01 movw r22, r8 d240: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d244: 4b 01 movw r8, r22 d246: 5c 01 movw r10, r24 d248: 20 91 73 03 lds r18, 0x0373 ; 0x800373 d24c: 30 91 74 03 lds r19, 0x0374 ; 0x800374 d250: 40 91 75 03 lds r20, 0x0375 ; 0x800375 d254: 50 91 76 03 lds r21, 0x0376 ; 0x800376 d258: c7 01 movw r24, r14 d25a: b6 01 movw r22, r12 d25c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d260: 9b 01 movw r18, r22 d262: ac 01 movw r20, r24 d264: c5 01 movw r24, r10 d266: b4 01 movw r22, r8 d268: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; d26c: 68 83 st Y, r22 d26e: 79 83 std Y+1, r23 ; 0x01 d270: 8a 83 std Y+2, r24 ; 0x02 d272: 9b 83 std Y+3, r25 ; 0x03 y = out_y; d274: f8 01 movw r30, r16 d276: 40 82 st Z, r4 d278: 51 82 std Z+1, r5 ; 0x01 d27a: 62 82 std Z+2, r6 ; 0x02 d27c: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d27e: 30 fe sbrs r3, 0 d280: 26 c0 rjmp .+76 ; 0xd2ce // Then add the offset. x += world2machine_shift[0]; d282: 20 91 9a 04 lds r18, 0x049A ; 0x80049a d286: 30 91 9b 04 lds r19, 0x049B ; 0x80049b d28a: 40 91 9c 04 lds r20, 0x049C ; 0x80049c d28e: 50 91 9d 04 lds r21, 0x049D ; 0x80049d d292: 68 81 ld r22, Y d294: 79 81 ldd r23, Y+1 ; 0x01 d296: 8a 81 ldd r24, Y+2 ; 0x02 d298: 9b 81 ldd r25, Y+3 ; 0x03 d29a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> d29e: 68 83 st Y, r22 d2a0: 79 83 std Y+1, r23 ; 0x01 d2a2: 8a 83 std Y+2, r24 ; 0x02 d2a4: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d2a6: 20 91 9e 04 lds r18, 0x049E ; 0x80049e d2aa: 30 91 9f 04 lds r19, 0x049F ; 0x80049f d2ae: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 d2b2: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 d2b6: f8 01 movw r30, r16 d2b8: 60 81 ld r22, Z d2ba: 71 81 ldd r23, Z+1 ; 0x01 d2bc: 82 81 ldd r24, Z+2 ; 0x02 d2be: 93 81 ldd r25, Z+3 ; 0x03 d2c0: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> d2c4: f8 01 movw r30, r16 d2c6: 60 83 st Z, r22 d2c8: 71 83 std Z+1, r23 ; 0x01 d2ca: 82 83 std Z+2, r24 ; 0x02 d2cc: 93 83 std Z+3, r25 ; 0x03 } } } d2ce: df 91 pop r29 d2d0: cf 91 pop r28 d2d2: 1f 91 pop r17 d2d4: 0f 91 pop r16 d2d6: ff 90 pop r15 d2d8: ef 90 pop r14 d2da: df 90 pop r13 d2dc: cf 90 pop r12 d2de: bf 90 pop r11 d2e0: af 90 pop r10 d2e2: 9f 90 pop r9 d2e4: 8f 90 pop r8 d2e6: 7f 90 pop r7 d2e8: 6f 90 pop r6 d2ea: 5f 90 pop r5 d2ec: 4f 90 pop r4 d2ee: 3f 90 pop r3 d2f0: 08 95 ret 0000d2f2 : } } } inline bool world2machine_clamp(float &x, float &y) { d2f2: 2f 92 push r2 d2f4: 3f 92 push r3 d2f6: 4f 92 push r4 d2f8: 5f 92 push r5 d2fa: 6f 92 push r6 d2fc: 7f 92 push r7 d2fe: 8f 92 push r8 d300: 9f 92 push r9 d302: af 92 push r10 d304: bf 92 push r11 d306: cf 92 push r12 d308: df 92 push r13 d30a: ef 92 push r14 d30c: ff 92 push r15 d30e: 0f 93 push r16 d310: 1f 93 push r17 d312: cf 93 push r28 d314: df 93 push r29 d316: 00 d0 rcall .+0 ; 0xd318 d318: 00 d0 rcall .+0 ; 0xd31a d31a: 1f 92 push r1 d31c: 1f 92 push r1 d31e: cd b7 in r28, 0x3d ; 61 d320: de b7 in r29, 0x3e ; 62 d322: 8c 01 movw r16, r24 d324: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d326: fc 01 movw r30, r24 d328: 80 81 ld r24, Z d32a: 91 81 ldd r25, Z+1 ; 0x01 d32c: a2 81 ldd r26, Z+2 ; 0x02 d32e: b3 81 ldd r27, Z+3 ; 0x03 d330: 89 83 std Y+1, r24 ; 0x01 d332: 9a 83 std Y+2, r25 ; 0x02 d334: ab 83 std Y+3, r26 ; 0x03 d336: bc 83 std Y+4, r27 ; 0x04 out_y = y; d338: fb 01 movw r30, r22 d33a: 80 81 ld r24, Z d33c: 91 81 ldd r25, Z+1 ; 0x01 d33e: a2 81 ldd r26, Z+2 ; 0x02 d340: b3 81 ldd r27, Z+3 ; 0x03 d342: 8d 83 std Y+5, r24 ; 0x05 d344: 9e 83 std Y+6, r25 ; 0x06 d346: af 83 std Y+7, r26 ; 0x07 d348: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d34a: be 01 movw r22, r28 d34c: 6b 5f subi r22, 0xFB ; 251 d34e: 7f 4f sbci r23, 0xFF ; 255 d350: ce 01 movw r24, r28 d352: 01 96 adiw r24, 0x01 ; 1 d354: 0e 94 d1 68 call 0xd1a2 ; 0xd1a2 inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d358: c9 80 ldd r12, Y+1 ; 0x01 d35a: da 80 ldd r13, Y+2 ; 0x02 d35c: eb 80 ldd r14, Y+3 ; 0x03 d35e: fc 80 ldd r15, Y+4 ; 0x04 d360: 20 e0 ldi r18, 0x00 ; 0 d362: 30 e0 ldi r19, 0x00 ; 0 d364: a9 01 movw r20, r18 d366: c7 01 movw r24, r14 d368: b6 01 movw r22, r12 d36a: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> d36e: 87 ff sbrs r24, 7 d370: 35 c0 rjmp .+106 ; 0xd3dc tmpx = X_MIN_POS; d372: 19 82 std Y+1, r1 ; 0x01 d374: 1a 82 std Y+2, r1 ; 0x02 d376: 1b 82 std Y+3, r1 ; 0x03 d378: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d37a: ff 24 eor r15, r15 d37c: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d37e: 8d 80 ldd r8, Y+5 ; 0x05 d380: 9e 80 ldd r9, Y+6 ; 0x06 d382: af 80 ldd r10, Y+7 ; 0x07 d384: b8 84 ldd r11, Y+8 ; 0x08 d386: 20 e0 ldi r18, 0x00 ; 0 d388: 30 e0 ldi r19, 0x00 ; 0 d38a: 40 e8 ldi r20, 0x80 ; 128 d38c: 50 ec ldi r21, 0xC0 ; 192 d38e: c5 01 movw r24, r10 d390: b4 01 movw r22, r8 d392: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> d396: 87 ff sbrs r24, 7 d398: 35 c0 rjmp .+106 ; 0xd404 tmpy = Y_MIN_POS; d39a: 80 e0 ldi r24, 0x00 ; 0 d39c: 90 e0 ldi r25, 0x00 ; 0 d39e: a0 e8 ldi r26, 0x80 ; 128 d3a0: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d3a2: 8d 83 std Y+5, r24 ; 0x05 d3a4: 9e 83 std Y+6, r25 ; 0x06 d3a6: af 83 std Y+7, r26 ; 0x07 d3a8: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d3aa: cd 80 ldd r12, Y+5 ; 0x05 d3ac: de 80 ldd r13, Y+6 ; 0x06 d3ae: ef 80 ldd r14, Y+7 ; 0x07 d3b0: f8 84 ldd r15, Y+8 ; 0x08 d3b2: 89 80 ldd r8, Y+1 ; 0x01 d3b4: 9a 80 ldd r9, Y+2 ; 0x02 d3b6: ab 80 ldd r10, Y+3 ; 0x03 d3b8: 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) { d3ba: 70 90 a2 04 lds r7, 0x04A2 ; 0x8004a2 d3be: 71 10 cpse r7, r1 d3c0: 4c c0 rjmp .+152 ; 0xd45a // No correction. out_x = x; d3c2: f8 01 movw r30, r16 d3c4: 80 82 st Z, r8 d3c6: 91 82 std Z+1, r9 ; 0x01 d3c8: a2 82 std Z+2, r10 ; 0x02 d3ca: b3 82 std Z+3, r11 ; 0x03 out_y = y; d3cc: f1 01 movw r30, r2 d3ce: c0 82 st Z, r12 d3d0: d1 82 std Z+1, r13 ; 0x01 d3d2: e2 82 std Z+2, r14 ; 0x02 d3d4: 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) { d3d6: ff 24 eor r15, r15 d3d8: f3 94 inc r15 d3da: 25 c0 rjmp .+74 ; 0xd426 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) { d3dc: 20 e0 ldi r18, 0x00 ; 0 d3de: 30 e0 ldi r19, 0x00 ; 0 d3e0: 4a e7 ldi r20, 0x7A ; 122 d3e2: 53 e4 ldi r21, 0x43 ; 67 d3e4: c7 01 movw r24, r14 d3e6: b6 01 movw r22, r12 d3e8: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d3ec: 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) { d3ee: 18 16 cp r1, r24 d3f0: 34 f6 brge .-116 ; 0xd37e tmpx = X_MAX_POS; d3f2: 80 e0 ldi r24, 0x00 ; 0 d3f4: 90 e0 ldi r25, 0x00 ; 0 d3f6: aa e7 ldi r26, 0x7A ; 122 d3f8: b3 e4 ldi r27, 0x43 ; 67 d3fa: 89 83 std Y+1, r24 ; 0x01 d3fc: 9a 83 std Y+2, r25 ; 0x02 d3fe: ab 83 std Y+3, r26 ; 0x03 d400: bc 83 std Y+4, r27 ; 0x04 d402: bb cf rjmp .-138 ; 0xd37a } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d404: 20 e0 ldi r18, 0x00 ; 0 d406: 30 e0 ldi r19, 0x00 ; 0 d408: 42 e5 ldi r20, 0x52 ; 82 d40a: 53 e4 ldi r21, 0x43 ; 67 d40c: c5 01 movw r24, r10 d40e: b4 01 movw r22, r8 d410: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> d414: 18 16 cp r1, r24 d416: 2c f4 brge .+10 ; 0xd422 tmpy = Y_MAX_POS; d418: 80 e0 ldi r24, 0x00 ; 0 d41a: 90 e0 ldi r25, 0x00 ; 0 d41c: a2 e5 ldi r26, 0x52 ; 82 d41e: b3 e4 ldi r27, 0x43 ; 67 d420: c0 cf rjmp .-128 ; 0xd3a2 clamped = true; } if (clamped) d422: f1 10 cpse r15, r1 d424: c2 cf rjmp .-124 ; 0xd3aa machine2world(tmpx, tmpy, x, y); return clamped; } d426: 8f 2d mov r24, r15 d428: 28 96 adiw r28, 0x08 ; 8 d42a: 0f b6 in r0, 0x3f ; 63 d42c: f8 94 cli d42e: de bf out 0x3e, r29 ; 62 d430: 0f be out 0x3f, r0 ; 63 d432: cd bf out 0x3d, r28 ; 61 d434: df 91 pop r29 d436: cf 91 pop r28 d438: 1f 91 pop r17 d43a: 0f 91 pop r16 d43c: ff 90 pop r15 d43e: ef 90 pop r14 d440: df 90 pop r13 d442: cf 90 pop r12 d444: bf 90 pop r11 d446: af 90 pop r10 d448: 9f 90 pop r9 d44a: 8f 90 pop r8 d44c: 7f 90 pop r7 d44e: 6f 90 pop r6 d450: 5f 90 pop r5 d452: 4f 90 pop r4 d454: 3f 90 pop r3 d456: 2f 90 pop r2 d458: 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) { d45a: 70 fe sbrs r7, 0 d45c: 1c c0 rjmp .+56 ; 0xd496 // Then add the offset. x -= world2machine_shift[0]; d45e: 20 91 9a 04 lds r18, 0x049A ; 0x80049a d462: 30 91 9b 04 lds r19, 0x049B ; 0x80049b d466: 40 91 9c 04 lds r20, 0x049C ; 0x80049c d46a: 50 91 9d 04 lds r21, 0x049D ; 0x80049d d46e: c5 01 movw r24, r10 d470: b4 01 movw r22, r8 d472: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> d476: 4b 01 movw r8, r22 d478: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d47a: 20 91 9e 04 lds r18, 0x049E ; 0x80049e d47e: 30 91 9f 04 lds r19, 0x049F ; 0x80049f d482: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 d486: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 d48a: c7 01 movw r24, r14 d48c: b6 01 movw r22, r12 d48e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> d492: 6b 01 movw r12, r22 d494: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d496: 71 fe sbrs r7, 1 d498: 9e cf rjmp .-196 ; 0xd3d6 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d49a: 20 91 8a 04 lds r18, 0x048A ; 0x80048a d49e: 30 91 8b 04 lds r19, 0x048B ; 0x80048b d4a2: 40 91 8c 04 lds r20, 0x048C ; 0x80048c d4a6: 50 91 8d 04 lds r21, 0x048D ; 0x80048d d4aa: c5 01 movw r24, r10 d4ac: b4 01 movw r22, r8 d4ae: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d4b2: 2b 01 movw r4, r22 d4b4: 3c 01 movw r6, r24 d4b6: 20 91 8e 04 lds r18, 0x048E ; 0x80048e d4ba: 30 91 8f 04 lds r19, 0x048F ; 0x80048f d4be: 40 91 90 04 lds r20, 0x0490 ; 0x800490 d4c2: 50 91 91 04 lds r21, 0x0491 ; 0x800491 d4c6: c7 01 movw r24, r14 d4c8: b6 01 movw r22, r12 d4ca: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d4ce: 9b 01 movw r18, r22 d4d0: ac 01 movw r20, r24 d4d2: c3 01 movw r24, r6 d4d4: b2 01 movw r22, r4 d4d6: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> d4da: f8 01 movw r30, r16 d4dc: 60 83 st Z, r22 d4de: 71 83 std Z+1, r23 ; 0x01 d4e0: 82 83 std Z+2, r24 ; 0x02 d4e2: 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; d4e4: 20 91 92 04 lds r18, 0x0492 ; 0x800492 d4e8: 30 91 93 04 lds r19, 0x0493 ; 0x800493 d4ec: 40 91 94 04 lds r20, 0x0494 ; 0x800494 d4f0: 50 91 95 04 lds r21, 0x0495 ; 0x800495 d4f4: c5 01 movw r24, r10 d4f6: b4 01 movw r22, r8 d4f8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d4fc: 4b 01 movw r8, r22 d4fe: 5c 01 movw r10, r24 d500: 20 91 96 04 lds r18, 0x0496 ; 0x800496 d504: 30 91 97 04 lds r19, 0x0497 ; 0x800497 d508: 40 91 98 04 lds r20, 0x0498 ; 0x800498 d50c: 50 91 99 04 lds r21, 0x0499 ; 0x800499 d510: c7 01 movw r24, r14 d512: b6 01 movw r22, r12 d514: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d518: 9b 01 movw r18, r22 d51a: ac 01 movw r20, r24 d51c: c5 01 movw r24, r10 d51e: b4 01 movw r22, r8 d520: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> d524: f1 01 movw r30, r2 d526: 60 83 st Z, r22 d528: 71 83 std Z+1, r23 ; 0x01 d52a: 82 83 std Z+2, r24 ; 0x02 d52c: 93 83 std Z+3, r25 ; 0x03 d52e: 53 cf rjmp .-346 ; 0xd3d6 0000d530 : return sampled; } void go_home_with_z_lift() { d530: cf 93 push r28 d532: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); d534: 0e 94 9c 65 call 0xcb38 ; 0xcb38 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; d538: c1 e6 ldi r28, 0x61 ; 97 d53a: d2 e1 ldi r29, 0x12 ; 18 d53c: 80 e0 ldi r24, 0x00 ; 0 d53e: 90 e0 ldi r25, 0x00 ; 0 d540: a0 ea ldi r26, 0xA0 ; 160 d542: b0 e4 ldi r27, 0x40 ; 64 d544: 88 87 std Y+8, r24 ; 0x08 d546: 99 87 std Y+9, r25 ; 0x09 d548: aa 87 std Y+10, r26 ; 0x0a d54a: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); d54c: 65 e5 ldi r22, 0x55 ; 85 d54e: 75 e5 ldi r23, 0x55 ; 85 d550: 85 e5 ldi r24, 0x55 ; 85 d552: 91 e4 ldi r25, 0x41 ; 65 d554: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; d558: 8d ec ldi r24, 0xCD ; 205 d55a: 9c ec ldi r25, 0xCC ; 204 d55c: ac e4 ldi r26, 0x4C ; 76 d55e: be e3 ldi r27, 0x3E ; 62 d560: 88 83 st Y, r24 d562: 99 83 std Y+1, r25 ; 0x01 d564: aa 83 std Y+2, r26 ; 0x02 d566: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; d568: 83 e3 ldi r24, 0x33 ; 51 d56a: 93 e3 ldi r25, 0x33 ; 51 d56c: a3 e7 ldi r26, 0x73 ; 115 d56e: b0 ec ldi r27, 0xC0 ; 192 d570: 8c 83 std Y+4, r24 ; 0x04 d572: 9d 83 std Y+5, r25 ; 0x05 d574: ae 83 std Y+6, r26 ; 0x06 d576: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); d578: 65 e6 ldi r22, 0x65 ; 101 d57a: 72 e1 ldi r23, 0x12 ; 18 d57c: ce 01 movw r24, r28 d57e: 0e 94 79 69 call 0xd2f2 ; 0xd2f2 go_to_current((3 * homing_feedrate[X_AXIS]) / 60); d582: 60 e0 ldi r22, 0x00 ; 0 d584: 70 e0 ldi r23, 0x00 ; 0 d586: 86 e1 ldi r24, 0x16 ; 22 d588: 93 e4 ldi r25, 0x43 ; 67 d58a: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; d58e: 8a e9 ldi r24, 0x9A ; 154 d590: 99 e9 ldi r25, 0x99 ; 153 d592: a9 e1 ldi r26, 0x19 ; 25 d594: be e3 ldi r27, 0x3E ; 62 d596: 88 87 std Y+8, r24 ; 0x08 d598: 99 87 std Y+9, r25 ; 0x09 d59a: aa 87 std Y+10, r26 ; 0x0a d59c: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); d59e: 65 e5 ldi r22, 0x55 ; 85 d5a0: 75 e5 ldi r23, 0x55 ; 85 d5a2: 85 e5 ldi r24, 0x55 ; 85 d5a4: 91 e4 ldi r25, 0x41 ; 65 } d5a6: df 91 pop r29 d5a8: 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); d5aa: 0d 94 5a 4e jmp 0x29cb4 ; 0x29cb4 0000d5ae : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { d5ae: cf 92 push r12 d5b0: df 92 push r13 d5b2: ef 92 push r14 d5b4: ff 92 push r15 d5b6: cf 93 push r28 d5b8: df 93 push r29 d5ba: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); d5bc: bc 01 movw r22, r24 d5be: 6c 5f subi r22, 0xFC ; 252 d5c0: 7f 4f sbci r23, 0xFF ; 255 d5c2: 0e 94 79 69 call 0xd2f2 ; 0xd2f2 // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; d5c6: c0 90 2c 02 lds r12, 0x022C ; 0x80022c d5ca: d0 90 2d 02 lds r13, 0x022D ; 0x80022d d5ce: e0 90 2e 02 lds r14, 0x022E ; 0x80022e d5d2: f0 90 2f 02 lds r15, 0x022F ; 0x80022f d5d6: a7 01 movw r20, r14 d5d8: 96 01 movw r18, r12 d5da: 68 85 ldd r22, Y+8 ; 0x08 d5dc: 79 85 ldd r23, Y+9 ; 0x09 d5de: 8a 85 ldd r24, Y+10 ; 0x0a d5e0: 9b 85 ldd r25, Y+11 ; 0x0b d5e2: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> d5e6: 87 ff sbrs r24, 7 d5e8: 04 c0 rjmp .+8 ; 0xd5f2 d5ea: c8 86 std Y+8, r12 ; 0x08 d5ec: d9 86 std Y+9, r13 ; 0x09 d5ee: ea 86 std Y+10, r14 ; 0x0a d5f0: 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]; d5f2: c0 90 20 02 lds r12, 0x0220 ; 0x800220 d5f6: d0 90 21 02 lds r13, 0x0221 ; 0x800221 d5fa: e0 90 22 02 lds r14, 0x0222 ; 0x800222 d5fe: f0 90 23 02 lds r15, 0x0223 ; 0x800223 d602: a7 01 movw r20, r14 d604: 96 01 movw r18, r12 d606: 68 85 ldd r22, Y+8 ; 0x08 d608: 79 85 ldd r23, Y+9 ; 0x09 d60a: 8a 85 ldd r24, Y+10 ; 0x0a d60c: 9b 85 ldd r25, Y+11 ; 0x0b d60e: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> d612: 18 16 cp r1, r24 d614: 24 f4 brge .+8 ; 0xd61e d616: c8 86 std Y+8, r12 ; 0x08 d618: d9 86 std Y+9, r13 ; 0x09 d61a: ea 86 std Y+10, r14 ; 0x0a d61c: fb 86 std Y+11, r15 ; 0x0b } } d61e: df 91 pop r29 d620: cf 91 pop r28 d622: ff 90 pop r15 d624: ef 90 pop r14 d626: df 90 pop r13 d628: cf 90 pop r12 d62a: 08 95 ret 0000d62c : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { d62c: 2f 92 push r2 d62e: 3f 92 push r3 d630: 4f 92 push r4 d632: 5f 92 push r5 d634: 6f 92 push r6 d636: 7f 92 push r7 d638: 8f 92 push r8 d63a: 9f 92 push r9 d63c: af 92 push r10 d63e: bf 92 push r11 d640: cf 92 push r12 d642: df 92 push r13 d644: ef 92 push r14 d646: ff 92 push r15 d648: 0f 93 push r16 d64a: 1f 93 push r17 d64c: cf 93 push r28 d64e: df 93 push r29 d650: cd b7 in r28, 0x3d ; 61 d652: de b7 in r29, 0x3e ; 62 d654: a2 97 sbiw r28, 0x22 ; 34 d656: 0f b6 in r0, 0x3f ; 63 d658: f8 94 cli d65a: de bf out 0x3e, r29 ; 62 d65c: 0f be out 0x3f, r0 ; 63 d65e: cd bf out 0x3d, r28 ; 61 d660: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); d662: 89 e2 ldi r24, 0x29 ; 41 d664: 96 e0 ldi r25, 0x06 ; 6 d666: 0e 94 d7 6a call 0xd5ae ; 0xd5ae previous_millis_cmd.start(); d66a: 88 e4 ldi r24, 0x48 ; 72 d66c: 93 e0 ldi r25, 0x03 ; 3 d66e: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::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])) { d672: 40 90 61 12 lds r4, 0x1261 ; 0x801261 d676: 50 90 62 12 lds r5, 0x1262 ; 0x801262 d67a: 60 90 63 12 lds r6, 0x1263 ; 0x801263 d67e: 70 90 64 12 lds r7, 0x1264 ; 0x801264 d682: c0 90 29 06 lds r12, 0x0629 ; 0x800629 d686: d0 90 2a 06 lds r13, 0x062A ; 0x80062a d68a: e0 90 2b 06 lds r14, 0x062B ; 0x80062b d68e: f0 90 2c 06 lds r15, 0x062C ; 0x80062c d692: a7 01 movw r20, r14 d694: 96 01 movw r18, r12 d696: c3 01 movw r24, r6 d698: b2 01 movw r22, r4 d69a: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> d69e: 81 11 cpse r24, r1 d6a0: 3f c0 rjmp .+126 ; 0xd720 d6a2: 20 91 2d 06 lds r18, 0x062D ; 0x80062d d6a6: 30 91 2e 06 lds r19, 0x062E ; 0x80062e d6aa: 40 91 2f 06 lds r20, 0x062F ; 0x80062f d6ae: 50 91 30 06 lds r21, 0x0630 ; 0x800630 d6b2: 60 91 65 12 lds r22, 0x1265 ; 0x801265 d6b6: 70 91 66 12 lds r23, 0x1266 ; 0x801266 d6ba: 80 91 67 12 lds r24, 0x1267 ; 0x801267 d6be: 90 91 68 12 lds r25, 0x1268 ; 0x801268 d6c2: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> d6c6: 81 11 cpse r24, r1 d6c8: 2b c0 rjmp .+86 ; 0xd720 plan_buffer_line_destinationXYZE(feedrate/60); d6ca: 20 e0 ldi r18, 0x00 ; 0 d6cc: 30 e0 ldi r19, 0x00 ; 0 d6ce: 40 e7 ldi r20, 0x70 ; 112 d6d0: 52 e4 ldi r21, 0x42 ; 66 d6d2: 60 91 7a 02 lds r22, 0x027A ; 0x80027a d6d6: 70 91 7b 02 lds r23, 0x027B ; 0x80027b d6da: 80 91 7c 02 lds r24, 0x027C ; 0x80027c d6de: 90 91 7d 02 lds r25, 0x027D ; 0x80027d d6e2: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> d6e6: 0f 94 75 49 call 0x292ea ; 0x292ea #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); d6ea: 0e 94 73 55 call 0xaae6 ; 0xaae6 } d6ee: a2 96 adiw r28, 0x22 ; 34 d6f0: 0f b6 in r0, 0x3f ; 63 d6f2: f8 94 cli d6f4: de bf out 0x3e, r29 ; 62 d6f6: 0f be out 0x3f, r0 ; 63 d6f8: cd bf out 0x3d, r28 ; 61 d6fa: df 91 pop r29 d6fc: cf 91 pop r28 d6fe: 1f 91 pop r17 d700: 0f 91 pop r16 d702: ff 90 pop r15 d704: ef 90 pop r14 d706: df 90 pop r13 d708: cf 90 pop r12 d70a: bf 90 pop r11 d70c: af 90 pop r10 d70e: 9f 90 pop r9 d710: 8f 90 pop r8 d712: 7f 90 pop r7 d714: 6f 90 pop r6 d716: 5f 90 pop r5 d718: 4f 90 pop r4 d71a: 3f 90 pop r3 d71c: 2f 90 pop r2 d71e: 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); d720: 60 91 8e 02 lds r22, 0x028E ; 0x80028e d724: 70 91 8f 02 lds r23, 0x028F ; 0x80028f d728: 07 2e mov r0, r23 d72a: 00 0c add r0, r0 d72c: 88 0b sbc r24, r24 d72e: 99 0b sbc r25, r25 d730: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> d734: 20 91 7a 02 lds r18, 0x027A ; 0x80027a d738: 30 91 7b 02 lds r19, 0x027B ; 0x80027b d73c: 40 91 7c 02 lds r20, 0x027C ; 0x80027c d740: 50 91 7d 02 lds r21, 0x027D ; 0x80027d d744: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d748: 2e e3 ldi r18, 0x3E ; 62 d74a: 33 ec ldi r19, 0xC3 ; 195 d74c: 4e e2 ldi r20, 0x2E ; 46 d74e: 59 e3 ldi r21, 0x39 ; 57 d750: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d754: 6f 83 std Y+7, r22 ; 0x07 d756: 78 87 std Y+8, r23 ; 0x08 d758: 89 87 std Y+9, r24 ; 0x09 d75a: 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) { d75c: 80 91 09 13 lds r24, 0x1309 ; 0x801309 d760: 88 23 and r24, r24 d762: 09 f4 brne .+2 ; 0xd766 d764: 0f c1 rjmp .+542 ; 0xd984 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]; d766: a3 01 movw r20, r6 d768: 92 01 movw r18, r4 d76a: c7 01 movw r24, r14 d76c: b6 01 movw r22, r12 d76e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> d772: 2b 01 movw r4, r22 d774: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; d776: 20 91 65 12 lds r18, 0x1265 ; 0x801265 d77a: 30 91 66 12 lds r19, 0x1266 ; 0x801266 d77e: 40 91 67 12 lds r20, 0x1267 ; 0x801267 d782: 50 91 68 12 lds r21, 0x1268 ; 0x801268 d786: 60 91 2d 06 lds r22, 0x062D ; 0x80062d d78a: 70 91 2e 06 lds r23, 0x062E ; 0x80062e d78e: 80 91 2f 06 lds r24, 0x062F ; 0x80062f d792: 90 91 30 06 lds r25, 0x0630 ; 0x800630 d796: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> d79a: 6b 87 std Y+11, r22 ; 0x0b d79c: 7c 87 std Y+12, r23 ; 0x0c d79e: 8d 87 std Y+13, r24 ; 0x0d d7a0: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); d7a2: c3 01 movw r24, r6 d7a4: b2 01 movw r22, r4 d7a6: 9f 77 andi r25, 0x7F ; 127 d7a8: 2b 85 ldd r18, Y+11 ; 0x0b d7aa: 3c 85 ldd r19, Y+12 ; 0x0c d7ac: 4d 85 ldd r20, Y+13 ; 0x0d d7ae: 5e 85 ldd r21, Y+14 ; 0x0e d7b0: 5f 77 andi r21, 0x7F ; 127 d7b2: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> d7b6: 6b 01 movw r12, r22 d7b8: 7c 01 movw r14, r24 if (len > 0) d7ba: 20 e0 ldi r18, 0x00 ; 0 d7bc: 30 e0 ldi r19, 0x00 ; 0 d7be: a9 01 movw r20, r18 d7c0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> d7c4: 18 16 cp r1, r24 d7c6: 0c f0 brlt .+2 ; 0xd7ca d7c8: dd c0 rjmp .+442 ; 0xd984 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); d7ca: 20 e0 ldi r18, 0x00 ; 0 d7cc: 30 e0 ldi r19, 0x00 ; 0 d7ce: 40 ef ldi r20, 0xF0 ; 240 d7d0: 51 e4 ldi r21, 0x41 ; 65 d7d2: c7 01 movw r24, r14 d7d4: b6 01 movw r22, r12 d7d6: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> d7da: 0f 94 44 a6 call 0x34c88 ; 0x34c88 d7de: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> d7e2: 7e 83 std Y+6, r23 ; 0x06 d7e4: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { d7e6: 62 30 cpi r22, 0x02 ; 2 d7e8: 71 05 cpc r23, r1 d7ea: 08 f4 brcc .+2 ; 0xd7ee d7ec: cb c0 rjmp .+406 ; 0xd984 d7ee: 21 14 cp r2, r1 d7f0: 31 04 cpc r3, r1 d7f2: 09 f4 brne .+2 ; 0xd7f6 d7f4: c7 c0 rjmp .+398 ; 0xd984 float dz = z - current_position[Z_AXIS]; d7f6: 20 91 69 12 lds r18, 0x1269 ; 0x801269 d7fa: 30 91 6a 12 lds r19, 0x126A ; 0x80126a d7fe: 40 91 6b 12 lds r20, 0x126B ; 0x80126b d802: 50 91 6c 12 lds r21, 0x126C ; 0x80126c d806: 60 91 31 06 lds r22, 0x0631 ; 0x800631 d80a: 70 91 32 06 lds r23, 0x0632 ; 0x800632 d80e: 80 91 33 06 lds r24, 0x0633 ; 0x800633 d812: 90 91 34 06 lds r25, 0x0634 ; 0x800634 d816: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> d81a: 6f 87 std Y+15, r22 ; 0x0f d81c: 78 8b std Y+16, r23 ; 0x10 d81e: 89 8b std Y+17, r24 ; 0x11 d820: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; d822: 20 91 6d 12 lds r18, 0x126D ; 0x80126d d826: 30 91 6e 12 lds r19, 0x126E ; 0x80126e d82a: 40 91 6f 12 lds r20, 0x126F ; 0x80126f d82e: 50 91 70 12 lds r21, 0x1270 ; 0x801270 d832: 60 91 35 06 lds r22, 0x0635 ; 0x800635 d836: 70 91 36 06 lds r23, 0x0636 ; 0x800636 d83a: 80 91 37 06 lds r24, 0x0637 ; 0x800637 d83e: 90 91 38 06 lds r25, 0x0638 ; 0x800638 d842: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> d846: 6b 8b std Y+19, r22 ; 0x13 d848: 7c 8b std Y+20, r23 ; 0x14 d84a: 8d 8b std Y+21, r24 ; 0x15 d84c: 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); d84e: ad 81 ldd r26, Y+5 ; 0x05 d850: be 81 ldd r27, Y+6 ; 0x06 d852: cd 01 movw r24, r26 d854: b0 e0 ldi r27, 0x00 ; 0 d856: a0 e0 ldi r26, 0x00 ; 0 d858: 8f 8f std Y+31, r24 ; 0x1f d85a: 98 a3 std Y+32, r25 ; 0x20 d85c: a9 a3 std Y+33, r26 ; 0x21 d85e: 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) { d860: 2d 81 ldd r18, Y+5 ; 0x05 d862: 3e 81 ldd r19, Y+6 ; 0x06 d864: 22 16 cp r2, r18 d866: 33 06 cpc r3, r19 d868: 08 f0 brcs .+2 ; 0xd86c d86a: 8c c0 rjmp .+280 ; 0xd984 float t = float(i) / float(n_segments); d86c: b1 01 movw r22, r2 d86e: 90 e0 ldi r25, 0x00 ; 0 d870: 80 e0 ldi r24, 0x00 ; 0 d872: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> d876: 6b 01 movw r12, r22 d878: 7c 01 movw r14, r24 d87a: 6f 8d ldd r22, Y+31 ; 0x1f d87c: 78 a1 ldd r23, Y+32 ; 0x20 d87e: 89 a1 ldd r24, Y+33 ; 0x21 d880: 9a a1 ldd r25, Y+34 ; 0x22 d882: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> d886: 9b 01 movw r18, r22 d888: ac 01 movw r20, r24 d88a: c7 01 movw r24, r14 d88c: b6 01 movw r22, r12 d88e: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> d892: 6b 01 movw r12, r22 d894: 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, d896: ac 01 movw r20, r24 d898: 9b 01 movw r18, r22 d89a: 6b 89 ldd r22, Y+19 ; 0x13 d89c: 7c 89 ldd r23, Y+20 ; 0x14 d89e: 8d 89 ldd r24, Y+21 ; 0x15 d8a0: 9e 89 ldd r25, Y+22 ; 0x16 d8a2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d8a6: 9b 01 movw r18, r22 d8a8: ac 01 movw r20, r24 d8aa: 60 91 6d 12 lds r22, 0x126D ; 0x80126d d8ae: 70 91 6e 12 lds r23, 0x126E ; 0x80126e d8b2: 80 91 6f 12 lds r24, 0x126F ; 0x80126f d8b6: 90 91 70 12 lds r25, 0x1270 ; 0x801270 d8ba: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> d8be: 69 83 std Y+1, r22 ; 0x01 d8c0: 7a 83 std Y+2, r23 ; 0x02 d8c2: 8b 83 std Y+3, r24 ; 0x03 d8c4: 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, d8c6: a7 01 movw r20, r14 d8c8: 96 01 movw r18, r12 d8ca: 6f 85 ldd r22, Y+15 ; 0x0f d8cc: 78 89 ldd r23, Y+16 ; 0x10 d8ce: 89 89 ldd r24, Y+17 ; 0x11 d8d0: 9a 89 ldd r25, Y+18 ; 0x12 d8d2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__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, d8d6: 20 91 69 12 lds r18, 0x1269 ; 0x801269 d8da: 30 91 6a 12 lds r19, 0x126A ; 0x80126a d8de: 40 91 6b 12 lds r20, 0x126B ; 0x80126b d8e2: 50 91 6c 12 lds r21, 0x126C ; 0x80126c d8e6: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> d8ea: 6f 8b std Y+23, r22 ; 0x17 d8ec: 78 8f std Y+24, r23 ; 0x18 d8ee: 89 8f std Y+25, r24 ; 0x19 d8f0: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, d8f2: a7 01 movw r20, r14 d8f4: 96 01 movw r18, r12 d8f6: 6b 85 ldd r22, Y+11 ; 0x0b d8f8: 7c 85 ldd r23, Y+12 ; 0x0c d8fa: 8d 85 ldd r24, Y+13 ; 0x0d d8fc: 9e 85 ldd r25, Y+14 ; 0x0e d8fe: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__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, d902: 20 91 65 12 lds r18, 0x1265 ; 0x801265 d906: 30 91 66 12 lds r19, 0x1266 ; 0x801266 d90a: 40 91 67 12 lds r20, 0x1267 ; 0x801267 d90e: 50 91 68 12 lds r21, 0x1268 ; 0x801268 d912: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> d916: 6b 8f std Y+27, r22 ; 0x1b d918: 7c 8f std Y+28, r23 ; 0x1c d91a: 8d 8f std Y+29, r24 ; 0x1d d91c: 9e 8f std Y+30, r25 ; 0x1e d91e: a7 01 movw r20, r14 d920: 96 01 movw r18, r12 d922: c3 01 movw r24, r6 d924: b2 01 movw r22, r4 d926: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> d92a: 20 91 61 12 lds r18, 0x1261 ; 0x801261 d92e: 30 91 62 12 lds r19, 0x1262 ; 0x801262 d932: 40 91 63 12 lds r20, 0x1263 ; 0x801263 d936: 50 91 64 12 lds r21, 0x1264 ; 0x801264 d93a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> d93e: 3f 92 push r3 d940: 2f 92 push r2 d942: a1 e6 ldi r26, 0x61 ; 97 d944: b2 e1 ldi r27, 0x12 ; 18 d946: bf 93 push r27 d948: af 93 push r26 d94a: 8f 80 ldd r8, Y+7 ; 0x07 d94c: 98 84 ldd r9, Y+8 ; 0x08 d94e: a9 84 ldd r10, Y+9 ; 0x09 d950: ba 84 ldd r11, Y+10 ; 0x0a d952: de 01 movw r26, r28 d954: 11 96 adiw r26, 0x01 ; 1 d956: 6d 01 movw r12, r26 d958: ef 88 ldd r14, Y+23 ; 0x17 d95a: f8 8c ldd r15, Y+24 ; 0x18 d95c: 09 8d ldd r16, Y+25 ; 0x19 d95e: 1a 8d ldd r17, Y+26 ; 0x1a d960: 2b 8d ldd r18, Y+27 ; 0x1b d962: 3c 8d ldd r19, Y+28 ; 0x1c d964: 4d 8d ldd r20, Y+29 ; 0x1d d966: 5e 8d ldd r21, Y+30 ; 0x1e d968: 0f 94 5a 3a call 0x274b4 ; 0x274b4 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) d96c: 0f 90 pop r0 d96e: 0f 90 pop r0 d970: 0f 90 pop r0 d972: 0f 90 pop r0 d974: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 d978: 81 11 cpse r24, r1 d97a: b7 ce rjmp .-658 ; 0xd6ea 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) { d97c: bf ef ldi r27, 0xFF ; 255 d97e: 2b 1a sub r2, r27 d980: 3b 0a sbc r3, r27 d982: 6e cf rjmp .-292 ; 0xd860 if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); d984: e0 90 31 06 lds r14, 0x0631 ; 0x800631 d988: f0 90 32 06 lds r15, 0x0632 ; 0x800632 d98c: 00 91 33 06 lds r16, 0x0633 ; 0x800633 d990: 10 91 34 06 lds r17, 0x0634 ; 0x800634 d994: 20 91 2d 06 lds r18, 0x062D ; 0x80062d d998: 30 91 2e 06 lds r19, 0x062E ; 0x80062e d99c: 40 91 2f 06 lds r20, 0x062F ; 0x80062f d9a0: 50 91 30 06 lds r21, 0x0630 ; 0x800630 d9a4: 60 91 29 06 lds r22, 0x0629 ; 0x800629 d9a8: 70 91 2a 06 lds r23, 0x062A ; 0x80062a d9ac: 80 91 2b 06 lds r24, 0x062B ; 0x80062b d9b0: 90 91 2c 06 lds r25, 0x062C ; 0x80062c d9b4: 1f 92 push r1 d9b6: 1f 92 push r1 d9b8: e1 e6 ldi r30, 0x61 ; 97 d9ba: f2 e1 ldi r31, 0x12 ; 18 d9bc: ff 93 push r31 d9be: ef 93 push r30 d9c0: 8f 80 ldd r8, Y+7 ; 0x07 d9c2: 98 84 ldd r9, Y+8 ; 0x08 d9c4: a9 84 ldd r10, Y+9 ; 0x09 d9c6: ba 84 ldd r11, Y+10 ; 0x0a d9c8: e5 e3 ldi r30, 0x35 ; 53 d9ca: ce 2e mov r12, r30 d9cc: e6 e0 ldi r30, 0x06 ; 6 d9ce: de 2e mov r13, r30 d9d0: 0f 94 5a 3a call 0x274b4 ; 0x274b4 d9d4: 0f 90 pop r0 d9d6: 0f 90 pop r0 d9d8: 0f 90 pop r0 d9da: 0f 90 pop r0 d9dc: 86 ce rjmp .-756 ; 0xd6ea 0000d9de : /// @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) { d9de: cf 92 push r12 d9e0: df 92 push r13 d9e2: ef 92 push r14 d9e4: ff 92 push r15 d9e6: cf 93 push r28 float travel_z = current_position[Z_AXIS]; d9e8: c0 90 69 12 lds r12, 0x1269 ; 0x801269 d9ec: d0 90 6a 12 lds r13, 0x126A ; 0x80126a d9f0: e0 90 6b 12 lds r14, 0x126B ; 0x80126b d9f4: f0 90 6c 12 lds r15, 0x126C ; 0x80126c // Prepare to move Z axis current_position[Z_AXIS] += delta; d9f8: a7 01 movw r20, r14 d9fa: 96 01 movw r18, r12 d9fc: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> da00: 60 93 69 12 sts 0x1269, r22 ; 0x801269 da04: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a da08: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b da0c: 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); da10: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) da12: 90 91 3b 06 lds r25, 0x063B ; 0x80063b da16: 91 11 cpse r25, r1 da18: 02 c0 rjmp .+4 ; 0xda1e da1a: 84 ff sbrs r24, 4 da1c: 26 c0 rjmp .+76 ; 0xda6a { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); da1e: 81 e6 ldi r24, 0x61 ; 97 da20: 92 e1 ldi r25, 0x12 ; 18 da22: 0e 94 d7 6a call 0xd5ae ; 0xd5ae plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); da26: 60 91 83 0d lds r22, 0x0D83 ; 0x800d83 da2a: 70 91 84 0d lds r23, 0x0D84 ; 0x800d84 da2e: 80 91 85 0d lds r24, 0x0D85 ; 0x800d85 da32: 90 91 86 0d lds r25, 0x0D86 ; 0x800d86 da36: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); da3a: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; da3e: a7 01 movw r20, r14 da40: 96 01 movw r18, r12 da42: 60 91 69 12 lds r22, 0x1269 ; 0x801269 da46: 70 91 6a 12 lds r23, 0x126A ; 0x80126a da4a: 80 91 6b 12 lds r24, 0x126B ; 0x80126b da4e: 90 91 6c 12 lds r25, 0x126C ; 0x80126c da52: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> da56: 6b 01 movw r12, r22 da58: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } da5a: c7 01 movw r24, r14 da5c: b6 01 movw r22, r12 da5e: cf 91 pop r28 da60: ff 90 pop r15 da62: ef 90 pop r14 da64: df 90 pop r13 da66: cf 90 pop r12 da68: 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(); da6a: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); da6c: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); da70: 81 e0 ldi r24, 0x01 ; 1 da72: 0f 94 e1 22 call 0x245c2 ; 0x245c2 da76: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); da78: 65 e5 ldi r22, 0x55 ; 85 da7a: 75 e5 ldi r23, 0x55 ; 85 da7c: 85 e5 ldi r24, 0x55 ; 85 da7e: 91 e4 ldi r25, 0x41 ; 65 da80: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); da84: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; da88: 82 e0 ldi r24, 0x02 ; 2 da8a: 0f 94 47 18 call 0x2308e ; 0x2308e da8e: a7 01 movw r20, r14 da90: 96 01 movw r18, r12 da92: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> da96: 6b 01 movw r12, r22 da98: 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); da9a: 8c 2f mov r24, r28 da9c: 0f 94 e1 22 call 0x245c2 ; 0x245c2 daa0: dc cf rjmp .-72 ; 0xda5a 0000daa2 : // // 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) { daa2: 8f 92 push r8 daa4: 9f 92 push r9 daa6: af 92 push r10 daa8: bf 92 push r11 daaa: cf 92 push r12 daac: df 92 push r13 daae: ef 92 push r14 dab0: ff 92 push r15 dab2: 4b 01 movw r8, r22 dab4: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) dab6: c0 90 69 12 lds r12, 0x1269 ; 0x801269 daba: d0 90 6a 12 lds r13, 0x126A ; 0x80126a dabe: e0 90 6b 12 lds r14, 0x126B ; 0x80126b dac2: f0 90 6c 12 lds r15, 0x126C ; 0x80126c dac6: ac 01 movw r20, r24 dac8: 9b 01 movw r18, r22 daca: c7 01 movw r24, r14 dacc: b6 01 movw r22, r12 dace: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> dad2: 87 ff sbrs r24, 7 dad4: 11 c0 rjmp .+34 ; 0xdaf8 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); dad6: a5 01 movw r20, r10 dad8: 94 01 movw r18, r8 dada: c7 01 movw r24, r14 dadc: b6 01 movw r22, r12 dade: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> dae2: 9f 77 andi r25, 0x7F ; 127 } dae4: ff 90 pop r15 dae6: ef 90 pop r14 dae8: df 90 pop r13 daea: cf 90 pop r12 daec: bf 90 pop r11 daee: af 90 pop r10 daf0: 9f 90 pop r9 daf2: 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)); daf4: 0c 94 ef 6c jmp 0xd9de ; 0xd9de } daf8: ff 90 pop r15 dafa: ef 90 pop r14 dafc: df 90 pop r13 dafe: cf 90 pop r12 db00: bf 90 pop r11 db02: af 90 pop r10 db04: 9f 90 pop r9 db06: 8f 90 pop r8 db08: 08 95 ret 0000db0a : #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 { db0a: 2f 92 push r2 db0c: 3f 92 push r3 db0e: 4f 92 push r4 db10: 5f 92 push r5 db12: 6f 92 push r6 db14: 7f 92 push r7 db16: 8f 92 push r8 db18: 9f 92 push r9 db1a: af 92 push r10 db1c: bf 92 push r11 db1e: cf 92 push r12 db20: df 92 push r13 db22: ef 92 push r14 db24: ff 92 push r15 db26: 0f 93 push r16 db28: 1f 93 push r17 db2a: cf 93 push r28 db2c: df 93 push r29 db2e: 00 d0 rcall .+0 ; 0xdb30 db30: 1f 92 push r1 db32: 1f 92 push r1 db34: cd b7 in r28, 0x3d ; 61 db36: de b7 in r29, 0x3e ; 62 db38: d8 2e mov r13, r24 db3a: 2a 01 movw r4, r20 db3c: 3b 01 movw r6, r22 db3e: 32 2e mov r3, r18 db40: e9 82 std Y+1, r14 ; 0x01 db42: fa 82 std Y+2, r15 ; 0x02 db44: 0b 83 std Y+3, r16 ; 0x03 db46: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); db48: 0f 94 5b 18 call 0x230b6 ; 0x230b6 homing_flag = true; db4c: 81 e0 ldi r24, 0x01 ; 1 db4e: 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; db52: fc 2c mov r15, r12 db54: e3 2c mov r14, r3 db56: d3 10 cpse r13, r3 db58: 10 c0 rjmp .+32 ; 0xdb7a db5a: ed 2c mov r14, r13 db5c: dc 10 cpse r13, r12 db5e: 0d c0 rjmp .+26 ; 0xdb7a // 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); db60: 60 e0 ldi r22, 0x00 ; 0 db62: 70 e0 ldi r23, 0x00 ; 0 db64: 80 ea ldi r24, 0xA0 ; 160 db66: 90 e4 ldi r25, 0x40 ; 64 db68: 0e 94 51 6d call 0xdaa2 ; 0xdaa2 // 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; db6c: ff 24 eor r15, r15 db6e: f3 94 inc r15 db70: ee 24 eor r14, r14 db72: e3 94 inc r14 db74: 22 24 eor r2, r2 db76: 23 94 inc r2 db78: 01 c0 rjmp .+2 ; 0xdb7c 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; db7a: 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(); db7c: 0e 94 88 62 call 0xc510 ; 0xc510 // 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; db80: 80 91 09 13 lds r24, 0x1309 ; 0x801309 db84: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; db86: 10 92 09 13 sts 0x1309, r1 ; 0x801309 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); db8a: 82 e0 ldi r24, 0x02 ; 2 db8c: 0f 94 47 18 call 0x2308e ; 0x2308e db90: 60 93 69 12 sts 0x1269, r22 ; 0x801269 db94: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a db98: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b db9c: 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) dba0: f1 10 cpse r15, r1 babystep_undo(); dba2: 0f 94 48 52 call 0x2a490 ; 0x2a490 int l_feedmultiply = setup_for_endstop_move(); dba6: 81 e0 ldi r24, 0x01 ; 1 dba8: 0e 94 c1 65 call 0xcb82 ; 0xcb82 dbac: 8c 01 movw r16, r24 set_destination_to_current(); dbae: 0e 94 09 67 call 0xce12 ; 0xce12 feedrate = 0.0; dbb2: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a dbb6: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b dbba: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c dbbe: 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); dbc2: 22 20 and r2, r2 dbc4: 19 f0 breq .+6 ; 0xdbcc dbc6: 80 e0 ldi r24, 0x00 ; 0 dbc8: 0f 94 0c 7a call 0x2f418 ; 0x2f418 if(home_y) homeaxis(Y_AXIS); dbcc: ee 20 and r14, r14 dbce: 19 f0 breq .+6 ; 0xdbd6 dbd0: 81 e0 ldi r24, 0x01 ; 1 dbd2: 0f 94 0c 7a call 0x2f418 ; 0x2f418 #endif //TMC2130 if(home_x_axis && home_x_value != 0) dbd6: dd 20 and r13, r13 dbd8: e9 f0 breq .+58 ; 0xdc14 dbda: 41 14 cp r4, r1 dbdc: 51 04 cpc r5, r1 dbde: 61 04 cpc r6, r1 dbe0: 71 04 cpc r7, r1 dbe2: c1 f0 breq .+48 ; 0xdc14 current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; dbe4: c3 01 movw r24, r6 dbe6: b2 01 movw r22, r4 dbe8: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> dbec: 9b 01 movw r18, r22 dbee: ac 01 movw r20, r24 dbf0: 60 91 bf 0d lds r22, 0x0DBF ; 0x800dbf dbf4: 70 91 c0 0d lds r23, 0x0DC0 ; 0x800dc0 dbf8: 80 91 c1 0d lds r24, 0x0DC1 ; 0x800dc1 dbfc: 90 91 c2 0d lds r25, 0x0DC2 ; 0x800dc2 dc00: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> dc04: 60 93 61 12 sts 0x1261, r22 ; 0x801261 dc08: 70 93 62 12 sts 0x1262, r23 ; 0x801262 dc0c: 80 93 63 12 sts 0x1263, r24 ; 0x801263 dc10: 90 93 64 12 sts 0x1264, r25 ; 0x801264 if(home_y_axis && home_y_value != 0) dc14: 33 20 and r3, r3 dc16: 01 f1 breq .+64 ; 0xdc58 dc18: 89 81 ldd r24, Y+1 ; 0x01 dc1a: 9a 81 ldd r25, Y+2 ; 0x02 dc1c: ab 81 ldd r26, Y+3 ; 0x03 dc1e: bc 81 ldd r27, Y+4 ; 0x04 dc20: 00 97 sbiw r24, 0x00 ; 0 dc22: a1 05 cpc r26, r1 dc24: b1 05 cpc r27, r1 dc26: c1 f0 breq .+48 ; 0xdc58 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; dc28: bc 01 movw r22, r24 dc2a: cd 01 movw r24, r26 dc2c: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> dc30: 9b 01 movw r18, r22 dc32: ac 01 movw r20, r24 dc34: 60 91 c3 0d lds r22, 0x0DC3 ; 0x800dc3 dc38: 70 91 c4 0d lds r23, 0x0DC4 ; 0x800dc4 dc3c: 80 91 c5 0d lds r24, 0x0DC5 ; 0x800dc5 dc40: 90 91 c6 0d lds r25, 0x0DC6 ; 0x800dc6 dc44: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> dc48: 60 93 65 12 sts 0x1265, r22 ; 0x801265 dc4c: 70 93 66 12 sts 0x1266, r23 ; 0x801266 dc50: 80 93 67 12 sts 0x1267, r24 ; 0x801267 dc54: 90 93 68 12 sts 0x1268, r25 ; 0x801268 #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { dc58: ff 20 and r15, r15 dc5a: 09 f4 brne .+2 ; 0xdc5e dc5c: 99 c0 rjmp .+306 ; 0xdd90 #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); dc5e: 60 e0 ldi r22, 0x00 ; 0 dc60: 70 e0 ldi r23, 0x00 ; 0 dc62: 80 ea ldi r24, 0xA0 ; 160 dc64: 90 e4 ldi r25, 0x40 ; 64 dc66: 0e 94 51 6d call 0xdaa2 ; 0xdaa2 if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); dc6a: 80 91 39 06 lds r24, 0x0639 ; 0x800639 dc6e: 81 11 cpse r24, r1 dc70: 02 c0 rjmp .+4 ; 0xdc76 dc72: 0f 94 0c 7a call 0x2f418 ; 0x2f418 if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); dc76: 80 91 3a 06 lds r24, 0x063A ; 0x80063a dc7a: 81 11 cpse r24, r1 dc7c: 03 c0 rjmp .+6 ; 0xdc84 dc7e: 81 e0 ldi r24, 0x01 ; 1 dc80: 0f 94 0c 7a call 0x2f418 ; 0x2f418 // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); dc84: 0e 94 21 61 call 0xc242 ; 0xc242 world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); dc88: e5 e0 ldi r30, 0x05 ; 5 dc8a: fd e9 ldi r31, 0x9D ; 157 dc8c: 85 91 lpm r24, Z+ dc8e: 95 91 lpm r25, Z+ dc90: a5 91 lpm r26, Z+ dc92: b4 91 lpm r27, Z dc94: e1 e0 ldi r30, 0x01 ; 1 dc96: fd e9 ldi r31, 0x9D ; 157 dc98: 45 91 lpm r20, Z+ dc9a: 55 91 lpm r21, Z+ dc9c: 65 91 lpm r22, Z+ dc9e: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; dca0: 40 93 29 06 sts 0x0629, r20 ; 0x800629 dca4: 50 93 2a 06 sts 0x062A, r21 ; 0x80062a dca8: 60 93 2b 06 sts 0x062B, r22 ; 0x80062b dcac: 70 93 2c 06 sts 0x062C, r23 ; 0x80062c out_y = y; dcb0: 80 93 2d 06 sts 0x062D, r24 ; 0x80062d dcb4: 90 93 2e 06 sts 0x062E, r25 ; 0x80062e dcb8: a0 93 2f 06 sts 0x062F, r26 ; 0x80062f dcbc: b0 93 30 06 sts 0x0630, r27 ; 0x800630 world2machine(out_x, out_y); dcc0: 6d e2 ldi r22, 0x2D ; 45 dcc2: 76 e0 ldi r23, 0x06 ; 6 dcc4: 89 e2 ldi r24, 0x29 ; 41 dcc6: 96 e0 ldi r25, 0x06 ; 6 dcc8: 0e 94 d1 68 call 0xd1a2 ; 0xd1a2 world2machine_reset(); dccc: 0e 94 4f 62 call 0xc49e ; 0xc49e if (destination[Y_AXIS] < Y_MIN_POS) dcd0: 20 e0 ldi r18, 0x00 ; 0 dcd2: 30 e0 ldi r19, 0x00 ; 0 dcd4: 40 e8 ldi r20, 0x80 ; 128 dcd6: 50 ec ldi r21, 0xC0 ; 192 dcd8: 60 91 2d 06 lds r22, 0x062D ; 0x80062d dcdc: 70 91 2e 06 lds r23, 0x062E ; 0x80062e dce0: 80 91 2f 06 lds r24, 0x062F ; 0x80062f dce4: 90 91 30 06 lds r25, 0x0630 ; 0x800630 dce8: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> dcec: 87 ff sbrs r24, 7 dcee: 0c c0 rjmp .+24 ; 0xdd08 destination[Y_AXIS] = Y_MIN_POS; dcf0: 80 e0 ldi r24, 0x00 ; 0 dcf2: 90 e0 ldi r25, 0x00 ; 0 dcf4: a0 e8 ldi r26, 0x80 ; 128 dcf6: b0 ec ldi r27, 0xC0 ; 192 dcf8: 80 93 2d 06 sts 0x062D, r24 ; 0x80062d dcfc: 90 93 2e 06 sts 0x062E, r25 ; 0x80062e dd00: a0 93 2f 06 sts 0x062F, r26 ; 0x80062f dd04: b0 93 30 06 sts 0x0630, r27 ; 0x800630 feedrate = homing_feedrate[X_AXIS] / 20; dd08: 80 e0 ldi r24, 0x00 ; 0 dd0a: 90 e0 ldi r25, 0x00 ; 0 dd0c: a6 e1 ldi r26, 0x16 ; 22 dd0e: b3 e4 ldi r27, 0x43 ; 67 dd10: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a dd14: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b dd18: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c dd1c: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d dd20: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.386> #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(); dd24: 0f 94 68 48 call 0x290d0 ; 0x290d0 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); dd28: 60 91 7a 02 lds r22, 0x027A ; 0x80027a dd2c: 70 91 7b 02 lds r23, 0x027B ; 0x80027b dd30: 80 91 7c 02 lds r24, 0x027C ; 0x80027c dd34: 90 91 7d 02 lds r25, 0x027D ; 0x80027d dd38: 0f 94 75 49 call 0x292ea ; 0x292ea st_synchronize(); dd3c: 0f 94 5b 18 call 0x230b6 ; 0x230b6 current_position[X_AXIS] = destination[X_AXIS]; dd40: 80 91 29 06 lds r24, 0x0629 ; 0x800629 dd44: 90 91 2a 06 lds r25, 0x062A ; 0x80062a dd48: a0 91 2b 06 lds r26, 0x062B ; 0x80062b dd4c: b0 91 2c 06 lds r27, 0x062C ; 0x80062c dd50: 80 93 61 12 sts 0x1261, r24 ; 0x801261 dd54: 90 93 62 12 sts 0x1262, r25 ; 0x801262 dd58: a0 93 63 12 sts 0x1263, r26 ; 0x801263 dd5c: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = destination[Y_AXIS]; dd60: 80 91 2d 06 lds r24, 0x062D ; 0x80062d dd64: 90 91 2e 06 lds r25, 0x062E ; 0x80062e dd68: a0 91 2f 06 lds r26, 0x062F ; 0x80062f dd6c: b0 91 30 06 lds r27, 0x0630 ; 0x800630 dd70: 80 93 65 12 sts 0x1265, r24 ; 0x801265 dd74: 90 93 66 12 sts 0x1266, r25 ; 0x801266 dd78: a0 93 67 12 sts 0x1267, r26 ; 0x801267 dd7c: b0 93 68 12 sts 0x1268, r27 ; 0x801268 dd80: 81 e0 ldi r24, 0x01 ; 1 dd82: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.386> enable_endstops(true); endstops_hit_on_purpose(); dd86: 0f 94 fd 22 call 0x245fa ; 0x245fa homeaxis(Z_AXIS); dd8a: 82 e0 ldi r24, 0x02 ; 2 dd8c: 0f 94 0c 7a call 0x2f418 ; 0x2f418 homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) dd90: cc 20 and r12, r12 dd92: e9 f0 breq .+58 ; 0xddce dd94: 81 14 cp r8, r1 dd96: 91 04 cpc r9, r1 dd98: a1 04 cpc r10, r1 dd9a: b1 04 cpc r11, r1 dd9c: c1 f0 breq .+48 ; 0xddce current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; dd9e: c5 01 movw r24, r10 dda0: b4 01 movw r22, r8 dda2: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> dda6: 9b 01 movw r18, r22 dda8: ac 01 movw r20, r24 ddaa: 60 91 c7 0d lds r22, 0x0DC7 ; 0x800dc7 ddae: 70 91 c8 0d lds r23, 0x0DC8 ; 0x800dc8 ddb2: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 ddb6: 90 91 ca 0d lds r25, 0x0DCA ; 0x800dca ddba: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> ddbe: 60 93 69 12 sts 0x1269, r22 ; 0x801269 ddc2: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a ddc6: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b ddca: 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(); ddce: 0f 94 68 48 call 0x290d0 ; 0x290d0 clean_up_after_endstop_move(l_feedmultiply); ddd2: c8 01 movw r24, r16 ddd4: 0e 94 a7 65 call 0xcb4e ; 0xcb4e endstops_hit_on_purpose(); ddd8: 0f 94 fd 22 call 0x245fa ; 0x245fa // Load the machine correction matrix world2machine_initialize(); dddc: 0e 94 21 61 call 0xc242 ; 0xc242 // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); dde0: 0e 94 5d 5f call 0xbeba ; 0xbeba #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) dde4: d1 10 cpse r13, r1 dde6: 07 c0 rjmp .+14 ; 0xddf6 dde8: 31 10 cpse r3, r1 ddea: 05 c0 rjmp .+10 ; 0xddf6 ddec: 8b 8d ldd r24, Y+27 ; 0x1b ddee: 81 11 cpse r24, r1 ddf0: 02 c0 rjmp .+4 ; 0xddf6 ddf2: cc 20 and r12, r12 ddf4: 39 f1 breq .+78 ; 0xde44 { if (! home_z && mbl_was_active) { ddf6: f1 10 cpse r15, r1 ddf8: 25 c0 rjmp .+74 ; 0xde44 ddfa: 9d 81 ldd r25, Y+5 ; 0x05 ddfc: 99 23 and r25, r25 ddfe: 11 f1 breq .+68 ; 0xde44 // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; de00: 81 e0 ldi r24, 0x01 ; 1 de02: 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)); de06: 0f 94 47 18 call 0x2308e ; 0x2308e de0a: 6b 01 movw r12, r22 de0c: 7c 01 movw r14, r24 de0e: 80 e0 ldi r24, 0x00 ; 0 de10: 0f 94 47 18 call 0x2308e ; 0x2308e de14: a7 01 movw r20, r14 de16: 96 01 movw r18, r12 de18: 0f 94 d6 91 call 0x323ac ; 0x323ac de1c: 9b 01 movw r18, r22 de1e: ac 01 movw r20, r24 de20: 60 91 69 12 lds r22, 0x1269 ; 0x801269 de24: 70 91 6a 12 lds r23, 0x126A ; 0x80126a de28: 80 91 6b 12 lds r24, 0x126B ; 0x80126b de2c: 90 91 6c 12 lds r25, 0x126C ; 0x80126c de30: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> de34: 60 93 69 12 sts 0x1269, r22 ; 0x801269 de38: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a de3c: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b de40: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c } } #endif prusa_statistics(20); de44: 84 e1 ldi r24, 0x14 ; 20 de46: 0f 94 a0 2f call 0x25f40 ; 0x25f40 st_synchronize(); de4a: 0f 94 5b 18 call 0x230b6 ; 0x230b6 homing_flag = false; de4e: 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 } de52: 0f 90 pop r0 de54: 0f 90 pop r0 de56: 0f 90 pop r0 de58: 0f 90 pop r0 de5a: 0f 90 pop r0 de5c: df 91 pop r29 de5e: cf 91 pop r28 de60: 1f 91 pop r17 de62: 0f 91 pop r16 de64: ff 90 pop r15 de66: ef 90 pop r14 de68: df 90 pop r13 de6a: cf 90 pop r12 de6c: bf 90 pop r11 de6e: af 90 pop r10 de70: 9f 90 pop r9 de72: 8f 90 pop r8 de74: 7f 90 pop r7 de76: 6f 90 pop r6 de78: 5f 90 pop r5 de7a: 4f 90 pop r4 de7c: 3f 90 pop r3 de7e: 2f 90 pop r2 de80: 08 95 ret 0000de82 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { de82: e1 e3 ldi r30, 0x31 ; 49 de84: f3 e0 ldi r31, 0x03 ; 3 } else { //character is no longer used (or invalid?), mark it as unused #ifdef DEBUG_CUSTOM_CHARACTERS printf_P(PSTR("discarded char %02x at slot %u\n"), c, i); #endif // DEBUG_CUSTOM_CHARACTERS lcd_custom_characters[i] = 0x7F; de86: 9f e7 ldi r25, 0x7F ; 127 } void lcd_frame_start() { // check all custom characters and discard unused ones for (uint8_t i = 0; i < 8; i++) { uint8_t c = lcd_custom_characters[i]; de88: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty de8a: 8f 37 cpi r24, 0x7F ; 127 de8c: 31 f0 breq .+12 ; 0xde9a de8e: df 01 movw r26, r30 de90: 11 97 sbiw r26, 0x01 ; 1 continue; } else if (c & 0x80) { //slot was used on the last frame update, mark it as potentially unused this time de92: 87 ff sbrs r24, 7 de94: 07 c0 rjmp .+14 ; 0xdea4 lcd_custom_characters[i] = c & 0x7F; de96: 8f 77 andi r24, 0x7F ; 127 de98: 8c 93 st X, r24 memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { // check all custom characters and discard unused ones for (uint8_t i = 0; i < 8; i++) { de9a: 83 e0 ldi r24, 0x03 ; 3 de9c: e9 33 cpi r30, 0x39 ; 57 de9e: f8 07 cpc r31, r24 dea0: 99 f7 brne .-26 ; 0xde88 for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } dea2: 08 95 ret } else { //character is no longer used (or invalid?), mark it as unused #ifdef DEBUG_CUSTOM_CHARACTERS printf_P(PSTR("discarded char %02x at slot %u\n"), c, i); #endif // DEBUG_CUSTOM_CHARACTERS lcd_custom_characters[i] = 0x7F; dea4: 9c 93 st X, r25 dea6: f9 cf rjmp .-14 ; 0xde9a 0000dea8 : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) dea8: 90 91 59 02 lds r25, 0x0259 ; 0x800259 deac: 98 17 cp r25, r24 deae: 10 f4 brcc .+4 ; 0xdeb4 lcd_draw_update = lcdDrawUpdateOverride; deb0: 80 93 59 02 sts 0x0259, r24 ; 0x800259 if (!lcd_update_enabled) return; deb4: 80 91 5a 02 lds r24, 0x025A ; 0x80025a deb8: 88 23 and r24, r24 deba: 39 f0 breq .+14 ; 0xdeca if (lcd_lcdupdate_func) debc: e0 91 04 04 lds r30, 0x0404 ; 0x800404 dec0: f0 91 05 04 lds r31, 0x0405 ; 0x800405 dec4: 30 97 sbiw r30, 0x00 ; 0 dec6: 09 f0 breq .+2 ; 0xdeca lcd_lcdupdate_func(); dec8: 19 94 eijmp } deca: 08 95 ret 0000decc : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { decc: cf 93 push r28 dece: df 93 push r29 ded0: cd b7 in r28, 0x3d ; 61 ded2: de b7 in r29, 0x3e ; 62 ded4: ae 01 movw r20, r28 ded6: 4a 5f subi r20, 0xFA ; 250 ded8: 5f 4f sbci r21, 0xFF ; 255 deda: fa 01 movw r30, r20 dedc: 61 91 ld r22, Z+ dede: 71 91 ld r23, Z+ dee0: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); dee2: 82 ef ldi r24, 0xF2 ; 242 dee4: 93 e0 ldi r25, 0x03 ; 3 dee6: 0f 94 85 a3 call 0x3470a ; 0x3470a va_end(args); return ret; } deea: df 91 pop r29 deec: cf 91 pop r28 deee: 08 95 ret 0000def0 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); def0: 62 ef ldi r22, 0xF2 ; 242 def2: 73 e0 ldi r23, 0x03 ; 3 def4: 0d 94 d6 a2 jmp 0x345ac ; 0x345ac 0000def8 : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); def8: 62 ef ldi r22, 0xF2 ; 242 defa: 73 e0 ldi r23, 0x03 ; 3 defc: 08 2e mov r0, r24 defe: 00 0c add r0, r0 df00: 99 0b sbc r25, r25 df02: 0d 94 a6 a2 jmp 0x3454c ; 0x3454c 0000df06 : va_end(args); return ret; } void lcd_space(uint8_t n) { df06: cf 93 push r28 df08: c8 2f mov r28, r24 while (n--) lcd_putc(' '); df0a: c1 50 subi r28, 0x01 ; 1 df0c: 20 f0 brcs .+8 ; 0xdf16 df0e: 80 e2 ldi r24, 0x20 ; 32 df10: 0e 94 7c 6f call 0xdef8 ; 0xdef8 df14: fa cf rjmp .-12 ; 0xdf0a } df16: cf 91 pop r28 df18: 08 95 ret 0000df1a : /// @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) { df1a: 0f 93 push r16 df1c: 1f 93 push r17 df1e: cf 93 push r28 df20: df 93 push r29 df22: eb 01 movw r28, r22 df24: 14 2f mov r17, r20 df26: 05 2f mov r16, r21 lcd_putc(chr); df28: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_puts_P(str); df2c: ce 01 movw r24, r28 df2e: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_putc(':'); df32: 8a e3 ldi r24, 0x3A ; 58 df34: 0e 94 7c 6f call 0xdef8 ; 0xdef8 #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); df38: ce 01 movw r24, r28 df3a: 0f 94 fc a1 call 0x343f8 ; 0x343f8 <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); df3e: 9e e0 ldi r25, 0x0E ; 14 df40: 98 1b sub r25, r24 df42: 89 2f mov r24, r25 df44: 0e 94 83 6f call 0xdf06 ; 0xdf06 // Right adjusted value lcd_printf_P(PSTR("%4d"), val); df48: 0f 93 push r16 df4a: 1f 93 push r17 df4c: 84 e0 ldi r24, 0x04 ; 4 df4e: 92 e8 ldi r25, 0x82 ; 130 df50: 9f 93 push r25 df52: 8f 93 push r24 df54: 0e 94 66 6f call 0xdecc ; 0xdecc df58: 0f 90 pop r0 df5a: 0f 90 pop r0 df5c: 0f 90 pop r0 df5e: 0f 90 pop r0 } df60: df 91 pop r29 df62: cf 91 pop r28 df64: 1f 91 pop r17 df66: 0f 91 pop r16 df68: 08 95 ret 0000df6a : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { df6a: cf 93 push r28 df6c: c8 2f mov r28, r24 df6e: 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); df70: 64 30 cpi r22, 0x04 ; 4 df72: 08 f0 brcs .+2 ; 0xdf76 df74: 83 e0 ldi r24, 0x03 ; 3 df76: 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); df7a: 0e 94 7d 55 call 0xaafa ; 0xaafa df7e: 8c 0f add r24, r28 lcd_ddram_address = addr; df80: 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); df84: 44 e6 ldi r20, 0x64 ; 100 df86: 50 e0 ldi r21, 0x00 ; 0 df88: 60 e0 ldi r22, 0x00 ; 0 df8a: 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); } df8c: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df8e: 0c 94 0f 5e jmp 0xbc1e ; 0xbc1e 0000df92 : 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) { df92: 7f 92 push r7 df94: 8f 92 push r8 df96: 9f 92 push r9 df98: af 92 push r10 df9a: bf 92 push r11 df9c: cf 92 push r12 df9e: df 92 push r13 dfa0: ef 92 push r14 dfa2: ff 92 push r15 dfa4: 0f 93 push r16 dfa6: 1f 93 push r17 dfa8: cf 93 push r28 dfaa: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) dfac: e0 91 63 04 lds r30, 0x0463 ; 0x800463 dfb0: 50 91 62 04 lds r21, 0x0462 ; 0x800462 dfb4: e5 13 cpse r30, r21 dfb6: 73 c0 rjmp .+230 ; 0xe09e { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); dfb8: fb 01 movw r30, r22 dfba: 48 30 cpi r20, 0x08 ; 8 dfbc: 09 f0 breq .+2 ; 0xdfc0 dfbe: 6c c0 rjmp .+216 ; 0xe098 dfc0: c0 81 ld r28, Z dfc2: d0 e0 ldi r29, 0x00 ; 0 dfc4: 49 01 movw r8, r18 dfc6: 74 2e mov r7, r20 dfc8: 6b 01 movw r12, r22 dfca: 5c 01 movw r10, r24 if (lcd_draw_update) dfcc: 80 91 59 02 lds r24, 0x0259 ; 0x800259 dfd0: 88 23 and r24, r24 dfd2: 59 f0 breq .+22 ; 0xdfea { lcd_set_cursor(0, menu_row); dfd4: 60 91 60 04 lds r22, 0x0460 ; 0x800460 dfd8: 80 e0 ldi r24, 0x00 ; 0 dfda: 0e 94 b5 6f call 0xdf6a ; 0xdf6a menu_draw_P(menu_selection_mark(), str, cur_val); dfde: 0e 94 c1 62 call 0xc582 ; 0xc582 dfe2: ae 01 movw r20, r28 dfe4: b5 01 movw r22, r10 dfe6: 0e 94 8d 6f call 0xdf1a ; 0xdf1a } if (menu_clicked && (lcd_encoder == menu_item)) dfea: 80 91 61 04 lds r24, 0x0461 ; 0x800461 dfee: 88 23 and r24, r24 dff0: 09 f4 brne .+2 ; 0xdff4 dff2: 55 c0 rjmp .+170 ; 0xe09e dff4: 90 91 63 04 lds r25, 0x0463 ; 0x800463 dff8: 20 91 1e 06 lds r18, 0x061E ; 0x80061e dffc: 30 91 1f 06 lds r19, 0x061F ; 0x80061f e000: 92 17 cp r25, r18 e002: 13 06 cpc r1, r19 e004: 09 f0 breq .+2 ; 0xe008 e006: 4b c0 rjmp .+150 ; 0xe09e } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) e008: 80 91 df 03 lds r24, 0x03DF ; 0x8003df e00c: 87 30 cpi r24, 0x07 ; 7 e00e: d8 f4 brcc .+54 ; 0xe046 { menu_stack[menu_depth].menu = menu_menu; e010: 28 2f mov r18, r24 e012: 30 e0 ldi r19, 0x00 ; 0 e014: f9 01 movw r30, r18 e016: ee 0f add r30, r30 e018: ff 1f adc r31, r31 e01a: e2 0f add r30, r18 e01c: f3 1f adc r31, r19 e01e: e9 5a subi r30, 0xA9 ; 169 e020: fc 4f sbci r31, 0xFC ; 252 e022: 20 91 02 04 lds r18, 0x0402 ; 0x800402 e026: 30 91 03 04 lds r19, 0x0403 ; 0x800403 e02a: 31 83 std Z+1, r19 ; 0x01 e02c: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; e02e: 8f 5f subi r24, 0xFF ; 255 e030: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df e034: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); e036: 20 e0 ldi r18, 0x00 ; 0 e038: 40 e0 ldi r20, 0x00 ; 0 e03a: 70 e0 ldi r23, 0x00 ; 0 e03c: 60 e0 ldi r22, 0x00 ; 0 e03e: 8d ed ldi r24, 0xDD ; 221 e040: 93 e7 ldi r25, 0x73 ; 115 e042: 0e 94 12 63 call 0xc624 ; 0xc624 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; e046: b0 92 97 03 sts 0x0397, r11 ; 0x800397 e04a: a0 92 96 03 sts 0x0396, r10 ; 0x800396 _md->editValuePtr = pval; e04e: d0 92 9a 03 sts 0x039A, r13 ; 0x80039a e052: c0 92 99 03 sts 0x0399, r12 ; 0x800399 _md->editValueBits = pbits; e056: 70 92 98 03 sts 0x0398, r7 ; 0x800398 _md->currentValue = cur_val; e05a: d0 93 9c 03 sts 0x039C, r29 ; 0x80039c e05e: c0 93 9b 03 sts 0x039B, r28 ; 0x80039b _md->minEditValue = min_val; e062: 90 92 9e 03 sts 0x039E, r9 ; 0x80039e e066: 80 92 9d 03 sts 0x039D, r8 ; 0x80039d _md->maxEditValue = max_val; e06a: 10 93 a0 03 sts 0x03A0, r17 ; 0x8003a0 e06e: 00 93 9f 03 sts 0x039F, r16 ; 0x80039f _md->minJumpValue = jmp_val; e072: f0 92 a2 03 sts 0x03A2, r15 ; 0x8003a2 e076: e0 92 a1 03 sts 0x03A1, r14 ; 0x8003a1 menu_item_ret(); return; } } menu_item++; } e07a: df 91 pop r29 e07c: cf 91 pop r28 e07e: 1f 91 pop r17 e080: 0f 91 pop r16 e082: ff 90 pop r15 e084: ef 90 pop r14 e086: df 90 pop r13 e088: cf 90 pop r12 e08a: bf 90 pop r11 e08c: af 90 pop r10 e08e: 9f 90 pop r9 e090: 8f 90 pop r8 e092: 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(); e094: 0c 94 ce 62 jmp 0xc59c ; 0xc59c 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)); e098: c0 81 ld r28, Z e09a: d1 81 ldd r29, Z+1 ; 0x01 e09c: 93 cf rjmp .-218 ; 0xdfc4 _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; e09e: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e0a2: 8f 5f subi r24, 0xFF ; 255 e0a4: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e0a8: df 91 pop r29 e0aa: cf 91 pop r28 e0ac: 1f 91 pop r17 e0ae: 0f 91 pop r16 e0b0: ff 90 pop r15 e0b2: ef 90 pop r14 e0b4: df 90 pop r13 e0b6: cf 90 pop r12 e0b8: bf 90 pop r11 e0ba: af 90 pop r10 e0bc: 9f 90 pop r9 e0be: 8f 90 pop r8 e0c0: 7f 90 pop r7 e0c2: 08 95 ret 0000e0c4 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { e0c4: cf 93 push r28 e0c6: df 93 push r29 e0c8: ea 01 movw r28, r20 lcd_set_cursor(c, r); e0ca: 0e 94 b5 6f call 0xdf6a ; 0xdf6a return fputs_P(str, lcdout); e0ce: 62 ef ldi r22, 0xF2 ; 242 e0d0: 73 e0 ldi r23, 0x03 ; 3 e0d2: ce 01 movw r24, r28 } e0d4: df 91 pop r29 e0d6: 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); e0d8: 0d 94 d6 a2 jmp 0x345ac ; 0x345ac 0000e0dc : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { e0dc: cf 93 push r28 e0de: c4 2f mov r28, r20 lcd_set_cursor(c, r); e0e0: 0e 94 b5 6f call 0xdf6a ; 0xdf6a return fputc(ch, lcdout); e0e4: 62 ef ldi r22, 0xF2 ; 242 e0e6: 73 e0 ldi r23, 0x03 ; 3 e0e8: 8c 2f mov r24, r28 e0ea: cc 0f add r28, r28 e0ec: 99 0b sbc r25, r25 } e0ee: 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); e0f0: 0d 94 a6 a2 jmp 0x3454c ; 0x3454c 0000e0f4 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); e0f4: 60 e0 ldi r22, 0x00 ; 0 e0f6: 80 e0 ldi r24, 0x00 ; 0 e0f8: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_ddram_address = 0; e0fc: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f } e100: 08 95 ret 0000e102 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e102: 40 e4 ldi r20, 0x40 ; 64 e104: 56 e0 ldi r21, 0x06 ; 6 e106: 60 e0 ldi r22, 0x00 ; 0 e108: 81 e0 ldi r24, 0x01 ; 1 e10a: 0e 94 0f 5e call 0xbc1e ; 0xbc1e // 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; e10e: 10 92 30 03 sts 0x0330, r1 ; 0x800330 lcd_ddram_address = 0; e112: 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)); e116: 48 e0 ldi r20, 0x08 ; 8 e118: 50 e0 ldi r21, 0x00 ; 0 e11a: 6f e7 ldi r22, 0x7F ; 127 e11c: 70 e0 ldi r23, 0x00 ; 0 e11e: 81 e3 ldi r24, 0x31 ; 49 e120: 93 e0 ldi r25, 0x03 ; 3 e122: 0d 94 70 aa jmp 0x354e0 ; 0x354e0 0000e126 : } 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) e126: 90 91 5a 02 lds r25, 0x025A ; 0x80025a e12a: 98 17 cp r25, r24 e12c: 09 f1 breq .+66 ; 0xe170 { lcd_update_enabled = enabled; e12e: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a if (enabled) e132: 88 23 and r24, r24 e134: e9 f0 breq .+58 ; 0xe170 { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; e136: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e13a: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e lcd_encoder_diff = 0; e13e: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.500> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); e142: 83 ee ldi r24, 0xE3 ; 227 e144: 93 e0 ldi r25, 0x03 ; 3 e146: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; e14a: 0f 94 01 0b call 0x21602 ; 0x21602 e14e: 61 50 subi r22, 0x01 ; 1 e150: 71 09 sbc r23, r1 e152: 81 09 sbc r24, r1 e154: 91 09 sbc r25, r1 e156: 60 93 c5 03 sts 0x03C5, r22 ; 0x8003c5 e15a: 70 93 c6 03 sts 0x03C6, r23 ; 0x8003c6 e15e: 80 93 c7 03 sts 0x03C7, r24 ; 0x8003c7 e162: 90 93 c8 03 sts 0x03C8, r25 ; 0x8003c8 // Full update. lcd_clear(); e166: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_update(2); e16a: 82 e0 ldi r24, 0x02 ; 2 e16c: 0c 94 54 6f jmp 0xdea8 ; 0xdea8 } else { // Clear the LCD always, or let it to the caller? } } } e170: 08 95 ret 0000e172 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { e172: cf 93 push r28 e174: c8 2f mov r28, r24 lcd_currline = 0; e176: 10 92 30 03 sts 0x0330, r1 ; 0x800330 lcd_ddram_address = 0; e17a: 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)); e17e: 48 e0 ldi r20, 0x08 ; 8 e180: 50 e0 ldi r21, 0x00 ; 0 e182: 6f e7 ldi r22, 0x7F ; 127 e184: 70 e0 ldi r23, 0x00 ; 0 e186: 81 e3 ldi r24, 0x31 ; 49 e188: 93 e0 ldi r25, 0x03 ; 3 e18a: 0f 94 70 aa call 0x354e0 ; 0x354e0 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 e18e: 44 e9 ldi r20, 0x94 ; 148 e190: 51 e1 ldi r21, 0x11 ; 17 e192: 62 e0 ldi r22, 0x02 ; 2 e194: 80 e3 ldi r24, 0x30 ; 48 e196: 0e 94 0f 5e call 0xbc1e ; 0xbc1e // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e19a: 46 e9 ldi r20, 0x96 ; 150 e19c: 50 e0 ldi r21, 0x00 ; 0 e19e: 62 e0 ldi r22, 0x02 ; 2 e1a0: 80 e3 ldi r24, 0x30 ; 48 e1a2: 0e 94 0f 5e call 0xbc1e ; 0xbc1e // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e1a6: 46 e9 ldi r20, 0x96 ; 150 e1a8: 50 e0 ldi r21, 0x00 ; 0 e1aa: 62 e0 ldi r22, 0x02 ; 2 e1ac: 80 e3 ldi r24, 0x30 ; 48 e1ae: 0e 94 0f 5e call 0xbc1e ; 0xbc1e #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); e1b2: 46 e9 ldi r20, 0x96 ; 150 e1b4: 50 e0 ldi r21, 0x00 ; 0 e1b6: 62 e0 ldi r22, 0x02 ; 2 e1b8: 80 e2 ldi r24, 0x20 ; 32 e1ba: 0e 94 0f 5e call 0xbc1e ; 0xbc1e #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); e1be: 80 91 00 04 lds r24, 0x0400 ; 0x800400 <_ZL19lcd_displayfunction.lto_priv.511> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e1c2: 44 e6 ldi r20, 0x64 ; 100 e1c4: 50 e0 ldi r21, 0x00 ; 0 e1c6: 60 e0 ldi r22, 0x00 ; 0 e1c8: 80 62 ori r24, 0x20 ; 32 e1ca: 0e 94 0f 5e call 0xbc1e ; 0xbc1e } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; e1ce: 84 e0 ldi r24, 0x04 ; 4 e1d0: 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); e1d4: 44 e6 ldi r20, 0x64 ; 100 e1d6: 50 e0 ldi r21, 0x00 ; 0 e1d8: 60 e0 ldi r22, 0x00 ; 0 e1da: 8c e0 ldi r24, 0x0C ; 12 e1dc: 0e 94 0f 5e call 0xbc1e ; 0xbc1e 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(); e1e0: c1 11 cpse r28, r1 e1e2: 0e 94 81 70 call 0xe102 ; 0xe102 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e1e6: 44 e6 ldi r20, 0x64 ; 100 e1e8: 50 e0 ldi r21, 0x00 ; 0 e1ea: 60 e0 ldi r22, 0x00 ; 0 e1ec: 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); } e1ee: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e1f0: 0c 94 0f 5e jmp 0xbc1e ; 0xbc1e 0000e1f4 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); e1f4: 81 e0 ldi r24, 0x01 ; 1 e1f6: 0c 94 b9 70 jmp 0xe172 ; 0xe172 0000e1fa : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { e1fa: cf 92 push r12 e1fc: df 92 push r13 e1fe: ff 92 push r15 e200: 0f 93 push r16 e202: 1f 93 push r17 e204: cf 93 push r28 e206: df 93 push r29 e208: 00 d0 rcall .+0 ; 0xe20a e20a: 00 d0 rcall .+0 ; 0xe20c e20c: 1f 92 push r1 e20e: 1f 92 push r1 e210: cd b7 in r28, 0x3d ; 61 e212: de b7 in r29, 0x3e ; 62 if (value == '\n') { e214: 8a 30 cpi r24, 0x0A ; 10 e216: d9 f4 brne .+54 ; 0xe24e if (lcd_currline > 3) lcd_currline = -1; e218: 80 91 30 03 lds r24, 0x0330 ; 0x800330 e21c: 84 30 cpi r24, 0x04 ; 4 e21e: 18 f0 brcs .+6 ; 0xe226 e220: 8f ef ldi r24, 0xFF ; 255 e222: 80 93 30 03 sts 0x0330, r24 ; 0x800330 lcd_set_cursor(0, lcd_currline + 1); // LF e226: 60 91 30 03 lds r22, 0x0330 ; 0x800330 e22a: 6f 5f subi r22, 0xFF ; 255 e22c: 80 e0 ldi r24, 0x00 ; 0 e22e: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } e232: 28 96 adiw r28, 0x08 ; 8 e234: 0f b6 in r0, 0x3f ; 63 e236: f8 94 cli e238: de bf out 0x3e, r29 ; 62 e23a: 0f be out 0x3f, r0 ; 63 e23c: cd bf out 0x3d, r28 ; 61 e23e: df 91 pop r29 e240: cf 91 pop r28 e242: 1f 91 pop r17 e244: 0f 91 pop r16 e246: ff 90 pop r15 e248: df 90 pop r13 e24a: cf 90 pop r12 e24c: 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))) { e24e: 90 e8 ldi r25, 0x80 ; 128 e250: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); e252: 44 e6 ldi r20, 0x64 ; 100 e254: 50 e0 ldi r21, 0x00 ; 0 e256: 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))) { e258: 9a 34 cpi r25, 0x4A ; 74 e25a: 08 f5 brcc .+66 ; 0xe29e // 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. e25c: 48 2f mov r20, r24 e25e: 40 58 subi r20, 0x80 ; 128 e260: 55 0b sbc r21, r21 e262: 9a 01 movw r18, r20 e264: 96 e0 ldi r25, 0x06 ; 6 e266: 92 9f mul r25, r18 e268: a0 01 movw r20, r0 e26a: 93 9f mul r25, r19 e26c: 50 0d add r21, r0 e26e: 11 24 eor r1, r1 e270: fa 01 movw r30, r20 e272: ea 5b subi r30, 0xBA ; 186 e274: fa 48 sbci r31, 0x8A ; 138 e276: f4 90 lpm r15, Z e278: e1 e3 ldi r30, 0x31 ; 49 e27a: f3 e0 ldi r31, 0x03 ; 3 e27c: 30 e0 ldi r19, 0x00 ; 0 e27e: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; e280: 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)) { e282: 61 91 ld r22, Z+ e284: 78 2f mov r23, r24 e286: 76 27 eor r23, r22 e288: 7f 77 andi r23, 0x7F ; 127 e28a: 89 f4 brne .+34 ; 0xe2ae lcd_custom_characters[i] = c; // mark the custom character as used e28c: f9 01 movw r30, r18 e28e: ef 5c subi r30, 0xCF ; 207 e290: fc 4f sbci r31, 0xFC ; 252 e292: 80 83 st Z, r24 e294: 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); e296: 44 e6 ldi r20, 0x64 ; 100 e298: 50 e0 ldi r21, 0x00 ; 0 e29a: 61 e0 ldi r22, 0x01 ; 1 e29c: 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); e29e: 0e 94 0f 5e call 0xbc1e ; 0xbc1e lcd_ddram_address++; // no need for preventing ddram overflow e2a2: 80 91 2f 03 lds r24, 0x032F ; 0x80032f e2a6: 8f 5f subi r24, 0xFF ; 255 e2a8: 80 93 2f 03 sts 0x032F, r24 ; 0x80032f e2ac: c2 cf rjmp .-124 ; 0xe232 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 e2ae: 6f 37 cpi r22, 0x7F ; 127 e2b0: 09 f0 breq .+2 ; 0xe2b4 e2b2: 3c c0 rjmp .+120 ; 0xe32c lcd_custom_characters[i] = c; // mark the custom character as used e2b4: f9 01 movw r30, r18 e2b6: ef 5c subi r30, 0xCF ; 207 e2b8: fc 4f sbci r31, 0xFC ; 252 e2ba: 80 83 st Z, r24 slotToUse = i; e2bc: 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; e2be: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); e2c0: fa 01 movw r30, r20 e2c2: ef 5b subi r30, 0xBF ; 191 e2c4: fa 48 sbci r31, 0x8A ; 138 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); e2c6: 8e 01 movw r16, r28 e2c8: 0f 5f subi r16, 0xFF ; 255 e2ca: 1f 4f sbci r17, 0xFF ; 255 e2cc: d8 01 movw r26, r16 e2ce: 95 91 lpm r25, Z+ e2d0: 88 e0 ldi r24, 0x08 ; 8 e2d2: 18 2e mov r1, r24 0000e2d4 : e2d4: 10 fe sbrs r1, 0 e2d6: 05 90 lpm r0, Z+ e2d8: 02 94 swap r0 e2da: 80 2d mov r24, r0 e2dc: 97 95 ror r25 e2de: 88 1f adc r24, r24 e2e0: 8d 93 st X+, r24 e2e2: 1a 94 dec r1 e2e4: b9 f7 brne .-18 ; 0xe2d4 lcd_command(LCD_SETCGRAMADDR | (location << 3)); e2e6: bf 2d mov r27, r15 e2e8: e8 e0 ldi r30, 0x08 ; 8 e2ea: be 02 muls r27, r30 e2ec: c0 01 movw r24, r0 e2ee: 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); e2f0: 44 e6 ldi r20, 0x64 ; 100 e2f2: 50 e0 ldi r21, 0x00 ; 0 e2f4: 60 e0 ldi r22, 0x00 ; 0 e2f6: 80 64 ori r24, 0x40 ; 64 e2f8: 0e 94 0f 5e call 0xbc1e ; 0xbc1e e2fc: 6e 01 movw r12, r28 e2fe: f9 e0 ldi r31, 0x09 ; 9 e300: cf 0e add r12, r31 e302: 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); e304: 44 e6 ldi r20, 0x64 ; 100 e306: 50 e0 ldi r21, 0x00 ; 0 e308: 61 e0 ldi r22, 0x01 ; 1 e30a: d8 01 movw r26, r16 e30c: 8d 91 ld r24, X+ e30e: 8d 01 movw r16, r26 e310: 0e 94 0f 5e call 0xbc1e ; 0xbc1e : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { e314: c0 16 cp r12, r16 e316: d1 06 cpc r13, r17 e318: a9 f7 brne .-22 ; 0xe304 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address e31a: 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); e31e: 44 e6 ldi r20, 0x64 ; 100 e320: 50 e0 ldi r21, 0x00 ; 0 e322: 60 e0 ldi r22, 0x00 ; 0 e324: 80 68 ori r24, 0x80 ; 128 e326: 0e 94 0f 5e call 0xbc1e ; 0xbc1e e32a: b5 cf rjmp .-150 ; 0xe296 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 e32c: 67 ff sbrs r22, 7 slotToUse = i; e32e: 92 2f mov r25, r18 e330: 2f 5f subi r18, 0xFF ; 255 e332: 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++) { e334: 28 30 cpi r18, 0x08 ; 8 e336: 31 05 cpc r19, r1 e338: 09 f0 breq .+2 ; 0xe33c e33a: a3 cf rjmp .-186 ; 0xe282 } // 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) { e33c: 9f 3f cpi r25, 0xFF ; 255 e33e: 09 f0 breq .+2 ; 0xe342 e340: be cf rjmp .-132 ; 0xe2be e342: a9 cf rjmp .-174 ; 0xe296 0000e344 : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { e344: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; e346: 24 e1 ldi r18, 0x14 ; 20 e348: ac 01 movw r20, r24 e34a: 24 9f mul r18, r20 e34c: c0 01 movw r24, r0 e34e: 25 9f mul r18, r21 e350: 90 0d add r25, r0 e352: 11 24 eor r1, r1 e354: 60 91 6d 03 lds r22, 0x036D ; 0x80036d e358: 70 91 6e 03 lds r23, 0x036E ; 0x80036e e35c: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__udivmodhi4> e360: c6 2f mov r28, r22 e362: 65 31 cpi r22, 0x15 ; 21 e364: 08 f0 brcs .+2 ; 0xe368 e366: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) e368: 80 91 6c 03 lds r24, 0x036C ; 0x80036c e36c: 8c 17 cp r24, r28 e36e: 48 f4 brcc .+18 ; 0xe382 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e370: 8f ef ldi r24, 0xFF ; 255 e372: 0e 94 fd 70 call 0xe1fa ; 0xe1fa { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; e376: 80 91 6c 03 lds r24, 0x036C ; 0x80036c e37a: 8f 5f subi r24, 0xFF ; 255 e37c: 80 93 6c 03 sts 0x036C, r24 ; 0x80036c e380: f3 cf rjmp .-26 ; 0xe368 } } e382: cf 91 pop r28 e384: 08 95 ret 0000e386 : void menu_progressbar_finish(void) { progressbar_total = 1; e386: 81 e0 ldi r24, 0x01 ; 1 e388: 90 e0 ldi r25, 0x00 ; 0 e38a: 90 93 6e 03 sts 0x036E, r25 ; 0x80036e e38e: 80 93 6d 03 sts 0x036D, r24 ; 0x80036d menu_progressbar_update(1); e392: 0e 94 a2 71 call 0xe344 ; 0xe344 _delay(300); e396: 6c e2 ldi r22, 0x2C ; 44 e398: 71 e0 ldi r23, 0x01 ; 1 e39a: 80 e0 ldi r24, 0x00 ; 0 e39c: 90 e0 ldi r25, 0x00 ; 0 e39e: 0d 94 ce 0a jmp 0x2159c ; 0x2159c 0000e3a2 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { e3a2: 8f 92 push r8 e3a4: 9f 92 push r9 e3a6: af 92 push r10 e3a8: bf 92 push r11 e3aa: ef 92 push r14 e3ac: ff 92 push r15 e3ae: 0f 93 push r16 e3b0: 1f 93 push r17 e3b2: cf 93 push r28 e3b4: df 93 push r29 e3b6: cd b7 in r28, 0x3d ; 61 e3b8: de b7 in r29, 0x3e ; 62 e3ba: a0 97 sbiw r28, 0x20 ; 32 e3bc: 0f b6 in r0, 0x3f ; 63 e3be: f8 94 cli e3c0: de bf out 0x3e, r29 ; 62 e3c2: 0f be out 0x3f, r0 ; 63 e3c4: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) e3c6: 61 15 cp r22, r1 e3c8: 71 05 cpc r23, r1 e3ca: 81 05 cpc r24, r1 e3cc: 91 05 cpc r25, r1 e3ce: 99 f4 brne .+38 ; 0xe3f6 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e3d0: 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)); } e3d2: a0 96 adiw r28, 0x20 ; 32 e3d4: 0f b6 in r0, 0x3f ; 63 e3d6: f8 94 cli e3d8: de bf out 0x3e, r29 ; 62 e3da: 0f be out 0x3f, r0 ; 63 e3dc: cd bf out 0x3d, r28 ; 61 e3de: df 91 pop r29 e3e0: cf 91 pop r28 e3e2: 1f 91 pop r17 e3e4: 0f 91 pop r16 e3e6: ff 90 pop r15 e3e8: ef 90 pop r14 e3ea: bf 90 pop r11 e3ec: af 90 pop r10 e3ee: 9f 90 pop r9 e3f0: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e3f2: 0c 94 fd 70 jmp 0xe1fa ; 0xe1fa } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; e3f6: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e3f8: 84 2e mov r8, r20 e3fa: 91 2c mov r9, r1 e3fc: b1 2c mov r11, r1 e3fe: a1 2c mov r10, r1 e400: 9e 01 movw r18, r28 e402: 2f 5f subi r18, 0xFF ; 255 e404: 3f 4f sbci r19, 0xFF ; 255 e406: 79 01 movw r14, r18 e408: a5 01 movw r20, r10 e40a: 94 01 movw r18, r8 e40c: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> e410: f7 01 movw r30, r14 e412: e0 0f add r30, r16 e414: f1 1d adc r31, r1 e416: 60 83 st Z, r22 n /= base; e418: b9 01 movw r22, r18 e41a: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e41c: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) e41e: 61 15 cp r22, r1 e420: 71 05 cpc r23, r1 e422: 81 05 cpc r24, r1 e424: 91 05 cpc r25, r1 e426: 81 f7 brne .-32 ; 0xe408 e428: 0e 0d add r16, r14 e42a: 1f 2d mov r17, r15 e42c: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) e42e: e0 16 cp r14, r16 e430: f1 06 cpc r15, r17 e432: 59 f0 breq .+22 ; 0xe44a lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); e434: f8 01 movw r30, r16 e436: 82 91 ld r24, -Z e438: 8f 01 movw r16, r30 e43a: 8a 30 cpi r24, 0x0A ; 10 e43c: 20 f4 brcc .+8 ; 0xe446 e43e: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e440: 0e 94 fd 70 call 0xe1fa ; 0xe1fa e444: f4 cf rjmp .-24 ; 0xe42e { 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)); e446: 89 5c subi r24, 0xC9 ; 201 e448: fb cf rjmp .-10 ; 0xe440 } e44a: a0 96 adiw r28, 0x20 ; 32 e44c: 0f b6 in r0, 0x3f ; 63 e44e: f8 94 cli e450: de bf out 0x3e, r29 ; 62 e452: 0f be out 0x3f, r0 ; 63 e454: cd bf out 0x3d, r28 ; 61 e456: df 91 pop r29 e458: cf 91 pop r28 e45a: 1f 91 pop r17 e45c: 0f 91 pop r16 e45e: ff 90 pop r15 e460: ef 90 pop r14 e462: bf 90 pop r11 e464: af 90 pop r10 e466: 9f 90 pop r9 e468: 8f 90 pop r8 e46a: 08 95 ret 0000e46c : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e46c: cf 92 push r12 e46e: df 92 push r13 e470: ef 92 push r14 e472: ff 92 push r15 e474: 6b 01 movw r12, r22 e476: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e478: f7 fe sbrs r15, 7 e47a: 0b c0 rjmp .+22 ; 0xe492 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e47c: 8d e2 ldi r24, 0x2D ; 45 e47e: 0e 94 fd 70 call 0xe1fa ; 0xe1fa else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e482: f0 94 com r15 e484: e0 94 com r14 e486: d0 94 com r13 e488: c0 94 com r12 e48a: c1 1c adc r12, r1 e48c: d1 1c adc r13, r1 e48e: e1 1c adc r14, r1 e490: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e492: 4a e0 ldi r20, 0x0A ; 10 e494: c7 01 movw r24, r14 e496: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e498: ff 90 pop r15 e49a: ef 90 pop r14 e49c: df 90 pop r13 e49e: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e4a0: 0c 94 d1 71 jmp 0xe3a2 ; 0xe3a2 0000e4a4 : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e4a4: 0f 93 push r16 e4a6: 1f 93 push r17 e4a8: cf 93 push r28 e4aa: 8c 01 movw r16, r24 e4ac: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e4ae: cc 23 and r28, r28 e4b0: 59 f0 breq .+22 ; 0xe4c8 e4b2: f8 01 movw r30, r16 e4b4: 24 91 lpm r18, Z e4b6: 22 23 and r18, r18 e4b8: 39 f0 breq .+14 ; 0xe4c8 lcd_write(pgm_read_byte(s++)); e4ba: 0f 5f subi r16, 0xFF ; 255 e4bc: 1f 4f sbci r17, 0xFF ; 255 e4be: 84 91 lpm r24, Z e4c0: 0e 94 fd 70 call 0xe1fa ; 0xe1fa --len; e4c4: c1 50 subi r28, 0x01 ; 1 e4c6: f3 cf rjmp .-26 ; 0xe4ae } lcd_space(len); e4c8: 8c 2f mov r24, r28 e4ca: 0e 94 83 6f call 0xdf06 ; 0xdf06 return len; } e4ce: 8c 2f mov r24, r28 e4d0: cf 91 pop r28 e4d2: 1f 91 pop r17 e4d4: 0f 91 pop r16 e4d6: 08 95 ret 0000e4d8 : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { e4d8: 0f 93 push r16 e4da: 1f 93 push r17 e4dc: cf 93 push r28 e4de: df 93 push r29 e4e0: 8c 01 movw r16, r24 e4e2: eb 01 movw r28, r22 lcd_clear(); e4e4: 0e 94 81 70 call 0xe102 ; 0xe102 progressbar_block_count = 0; e4e8: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c progressbar_total = total; e4ec: 10 93 6e 03 sts 0x036E, r17 ; 0x80036e e4f0: 00 93 6d 03 sts 0x036D, r16 ; 0x80036d lcd_set_cursor(0, 1); e4f4: 61 e0 ldi r22, 0x01 ; 1 e4f6: 80 e0 ldi r24, 0x00 ; 0 e4f8: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print_pad_P(title, LCD_WIDTH); e4fc: 64 e1 ldi r22, 0x14 ; 20 e4fe: ce 01 movw r24, r28 e500: 0e 94 52 72 call 0xe4a4 ; 0xe4a4 lcd_set_cursor(0, 2); e504: 62 e0 ldi r22, 0x02 ; 2 e506: 80 e0 ldi r24, 0x00 ; 0 } e508: df 91 pop r29 e50a: cf 91 pop r28 e50c: 1f 91 pop r17 e50e: 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); e510: 0c 94 b5 6f jmp 0xdf6a ; 0xdf6a 0000e514 : //! @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) { e514: ef 92 push r14 e516: ff 92 push r15 e518: 0f 93 push r16 e51a: 1f 93 push r17 e51c: cf 93 push r28 e51e: df 93 push r29 if (menu_item == menu_line) e520: 70 91 63 04 lds r23, 0x0463 ; 0x800463 e524: 30 91 62 04 lds r19, 0x0462 ; 0x800462 e528: 73 13 cpse r23, r19 e52a: 3f c0 rjmp .+126 ; 0xe5aa e52c: 12 2f mov r17, r18 e52e: ea 01 movw r28, r20 e530: 06 2f mov r16, r22 e532: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); e534: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e538: 88 23 and r24, r24 e53a: d1 f0 breq .+52 ; 0xe570 } 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()); e53c: 0e 94 c1 62 call 0xc582 ; 0xc582 e540: 48 2f mov r20, r24 e542: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e546: 80 e0 ldi r24, 0x00 ; 0 e548: 0e 94 6e 70 call 0xe0dc ; 0xe0dc uint8_t len = lcd_print_pad_P(str, max_strlen); e54c: 61 e1 ldi r22, 0x11 ; 17 e54e: c7 01 movw r24, r14 e550: 0e 94 52 72 call 0xe4a4 ; 0xe4a4 lcd_putc_at((max_strlen - len) + 2, menu_row, num); e554: 40 2f mov r20, r16 e556: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e55a: 93 e1 ldi r25, 0x13 ; 19 e55c: 98 1b sub r25, r24 e55e: 89 2f mov r24, r25 e560: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); e564: 40 e2 ldi r20, 0x20 ; 32 e566: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e56a: 83 e1 ldi r24, 0x13 ; 19 e56c: 0e 94 6e 70 call 0xe0dc ; 0xe0dc 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)) e570: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e574: 88 23 and r24, r24 e576: c9 f0 breq .+50 ; 0xe5aa e578: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e57c: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e580: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e584: 28 17 cp r18, r24 e586: 19 06 cpc r1, r25 e588: 81 f4 brne .+32 ; 0xe5aa { lcd_update_enabled = 0; e58a: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(fn_par); e58e: 81 2f mov r24, r17 e590: fe 01 movw r30, r28 e592: 19 95 eicall lcd_update_enabled = 1; e594: 81 e0 ldi r24, 0x01 ; 1 e596: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a menu_item_ret(); return; } } menu_item++; } e59a: df 91 pop r29 e59c: cf 91 pop r28 e59e: 1f 91 pop r17 e5a0: 0f 91 pop r16 e5a2: ff 90 pop r15 e5a4: 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(); e5a6: 0c 94 ce 62 jmp 0xc59c ; 0xc59c return; } } menu_item++; e5aa: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e5ae: 8f 5f subi r24, 0xFF ; 255 e5b0: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e5b4: df 91 pop r29 e5b6: cf 91 pop r28 e5b8: 1f 91 pop r17 e5ba: 0f 91 pop r16 e5bc: ff 90 pop r15 e5be: ef 90 pop r14 e5c0: 08 95 ret 0000e5c2 : static char menu_selection_mark(){ return (lcd_encoder == menu_item)?'>':' '; } static void menu_draw_item_puts_P(char type_char, const char* str) { e5c2: 0f 93 push r16 e5c4: 1f 93 push r17 e5c6: cf 93 push r28 e5c8: c8 2f mov r28, r24 e5ca: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); e5cc: 0e 94 c1 62 call 0xc582 ; 0xc582 e5d0: 48 2f mov r20, r24 e5d2: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e5d6: 80 e0 ldi r24, 0x00 ; 0 e5d8: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_print_pad_P(str, LCD_WIDTH - 2); e5dc: 62 e1 ldi r22, 0x12 ; 18 e5de: c8 01 movw r24, r16 e5e0: 0e 94 52 72 call 0xe4a4 ; 0xe4a4 lcd_putc(type_char); e5e4: 8c 2f mov r24, r28 } e5e6: cf 91 pop r28 e5e8: 1f 91 pop r17 e5ea: 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); e5ec: 0c 94 7c 6f jmp 0xdef8 ; 0xdef8 0000e5f0 : 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) { e5f0: cf 93 push r28 e5f2: df 93 push r29 if (menu_item == menu_line) e5f4: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e5f8: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e5fc: 32 13 cpse r19, r18 e5fe: 21 c0 rjmp .+66 ; 0xe642 e600: eb 01 movw r28, r22 e602: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); e604: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e608: 88 23 and r24, r24 e60a: 19 f0 breq .+6 ; 0xe612 e60c: 80 e2 ldi r24, 0x20 ; 32 e60e: 0e 94 e1 72 call 0xe5c2 ; 0xe5c2 if (menu_clicked && (lcd_encoder == menu_item)) e612: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e616: 88 23 and r24, r24 e618: a1 f0 breq .+40 ; 0xe642 e61a: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e61e: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e622: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e626: 28 17 cp r18, r24 e628: 19 06 cpc r1, r25 e62a: 59 f4 brne .+22 ; 0xe642 { lcd_update_enabled = 0; e62c: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(); e630: fe 01 movw r30, r28 e632: 19 95 eicall lcd_update_enabled = 1; e634: 81 e0 ldi r24, 0x01 ; 1 e636: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a menu_item_ret(); return; } } menu_item++; } e63a: df 91 pop r29 e63c: 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(); e63e: 0c 94 ce 62 jmp 0xc59c ; 0xc59c return; } } menu_item++; e642: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e646: 8f 5f subi r24, 0xFF ; 255 e648: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e64c: df 91 pop r29 e64e: cf 91 pop r28 e650: 08 95 ret 0000e652 : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) e652: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e656: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e65a: 32 13 cpse r19, r18 e65c: 19 c0 rjmp .+50 ; 0xe690 e65e: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); e660: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e664: 88 23 and r24, r24 e666: 19 f0 breq .+6 ; 0xe66e e668: 83 e8 ldi r24, 0x83 ; 131 e66a: 0e 94 e1 72 call 0xe5c2 ; 0xe5c2 if (menu_clicked && (lcd_encoder == menu_item)) e66e: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e672: 88 23 and r24, r24 e674: 69 f0 breq .+26 ; 0xe690 e676: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e67a: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e67e: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e682: 28 17 cp r18, r24 e684: 19 06 cpc r1, r25 e686: 21 f4 brne .+8 ; 0xe690 { menu_back(); e688: 0e 94 76 63 call 0xc6ec ; 0xc6ec menu_item_ret(); e68c: 0c 94 ce 62 jmp 0xc59c ; 0xc59c return; } } menu_item++; e690: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e694: 8f 5f subi r24, 0xFF ; 255 e696: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e69a: 08 95 ret 0000e69c : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { e69c: cf 93 push r28 e69e: df 93 push r29 if (menu_item == menu_line) e6a0: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e6a4: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e6a8: 32 13 cpse r19, r18 e6aa: 1e c0 rjmp .+60 ; 0xe6e8 e6ac: eb 01 movw r28, r22 e6ae: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); e6b0: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e6b4: 88 23 and r24, r24 e6b6: 19 f0 breq .+6 ; 0xe6be e6b8: 8e e7 ldi r24, 0x7E ; 126 e6ba: 0e 94 e1 72 call 0xe5c2 ; 0xe5c2 if (menu_clicked && (lcd_encoder == menu_item)) e6be: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e6c2: 88 23 and r24, r24 e6c4: 89 f0 breq .+34 ; 0xe6e8 e6c6: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e6ca: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e6ce: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e6d2: 28 17 cp r18, r24 e6d4: 19 06 cpc r1, r25 e6d6: 41 f4 brne .+16 ; 0xe6e8 { menu_submenu(submenu); e6d8: 60 e0 ldi r22, 0x00 ; 0 e6da: ce 01 movw r24, r28 e6dc: 0e 94 38 63 call 0xc670 ; 0xc670 menu_item_ret(); return; } } menu_item++; } e6e0: df 91 pop r29 e6e2: 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(); e6e4: 0c 94 ce 62 jmp 0xc59c ; 0xc59c return; } } menu_item++; e6e8: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e6ec: 8f 5f subi r24, 0xFF ; 255 e6ee: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e6f2: df 91 pop r29 e6f4: cf 91 pop r28 e6f6: 08 95 ret 0000e6f8 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) e6f8: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e6fc: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e700: 32 13 cpse r19, r18 e702: 19 c0 rjmp .+50 ; 0xe736 e704: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); e706: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e70a: 88 23 and r24, r24 e70c: 19 f0 breq .+6 ; 0xe714 e70e: 80 e2 ldi r24, 0x20 ; 32 e710: 0e 94 e1 72 call 0xe5c2 ; 0xe5c2 if (menu_clicked && (lcd_encoder == menu_item)) e714: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e718: 88 23 and r24, r24 e71a: 69 f0 breq .+26 ; 0xe736 e71c: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e720: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e724: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e728: 28 17 cp r18, r24 e72a: 19 06 cpc r1, r25 e72c: 21 f4 brne .+8 ; 0xe736 { menu_item_ret(); e72e: 0e 94 ce 62 call 0xc59c ; 0xc59c return 1; e732: 81 e0 ldi r24, 0x01 ; 1 e734: 08 95 ret } } menu_item++; e736: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e73a: 8f 5f subi r24, 0xFF ; 255 e73c: 80 93 63 04 sts 0x0463, r24 ; 0x800463 return 0; e740: 80 e0 ldi r24, 0x00 ; 0 } e742: 08 95 ret 0000e744 : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e744: 0f 93 push r16 e746: 1f 93 push r17 e748: cf 93 push r28 e74a: 8c 01 movw r16, r24 e74c: c6 2f mov r28, r22 while (len && *s) { e74e: cc 23 and r28, r28 e750: 49 f0 breq .+18 ; 0xe764 e752: f8 01 movw r30, r16 e754: 81 91 ld r24, Z+ e756: 8f 01 movw r16, r30 e758: 88 23 and r24, r24 e75a: 21 f0 breq .+8 ; 0xe764 lcd_write(*(s++)); e75c: 0e 94 fd 70 call 0xe1fa ; 0xe1fa --len; e760: c1 50 subi r28, 0x01 ; 1 e762: f5 cf rjmp .-22 ; 0xe74e } lcd_space(len); e764: 8c 2f mov r24, r28 e766: 0e 94 83 6f call 0xdf06 ; 0xdf06 return len; } e76a: 8c 2f mov r24, r28 e76c: cf 91 pop r28 e76e: 1f 91 pop r17 e770: 0f 91 pop r16 e772: 08 95 ret 0000e774 : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { e774: cf 93 push r28 e776: df 93 push r29 e778: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e77a: 89 91 ld r24, Y+ e77c: 88 23 and r24, r24 e77e: 19 f0 breq .+6 ; 0xe786 e780: 0e 94 fd 70 call 0xe1fa ; 0xe1fa e784: fa cf rjmp .-12 ; 0xe77a } e786: df 91 pop r29 e788: cf 91 pop r28 e78a: 08 95 ret 0000e78c : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e78c: 0e 94 fd 70 call 0xe1fa ; 0xe1fa return 0; } e790: 90 e0 ldi r25, 0x00 ; 0 e792: 80 e0 ldi r24, 0x00 ; 0 e794: 08 95 ret 0000e796 : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e796: 10 92 95 03 sts 0x0395, r1 ; 0x800395 lcd_longpress_trigger = 0; e79a: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 } e79e: 08 95 ret 0000e7a0 : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e7a0: cf 93 push r28 bool clicked = LCD_CLICKED; e7a2: 80 91 95 03 lds r24, 0x0395 ; 0x800395 e7a6: c1 e0 ldi r28, 0x01 ; 1 e7a8: 81 11 cpse r24, r1 e7aa: 04 c0 rjmp .+8 ; 0xe7b4 e7ac: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e7ae: 8c 2f mov r24, r28 e7b0: cf 91 pop r28 e7b2: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e7b4: 0e 94 cb 73 call 0xe796 ; 0xe796 e7b8: fa cf rjmp .-12 ; 0xe7ae 0000e7ba <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) e7ba: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e7be: 88 23 and r24, r24 e7c0: 09 f4 brne .+2 ; 0xe7c4 <_menu_edit_P()+0xa> e7c2: 52 c0 rjmp .+164 ; 0xe868 <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { e7c4: 20 91 a1 03 lds r18, 0x03A1 ; 0x8003a1 e7c8: 30 91 a2 03 lds r19, 0x03A2 ; 0x8003a2 e7cc: 80 91 9d 03 lds r24, 0x039D ; 0x80039d e7d0: 90 91 9e 03 lds r25, 0x039E ; 0x80039e e7d4: 21 15 cp r18, r1 e7d6: 31 05 cpc r19, r1 e7d8: d9 f0 breq .+54 ; 0xe810 <_menu_edit_P()+0x56> e7da: 40 91 1e 06 lds r20, 0x061E ; 0x80061e e7de: 50 91 1f 06 lds r21, 0x061F ; 0x80061f e7e2: 41 15 cp r20, r1 e7e4: 51 05 cpc r21, r1 e7e6: a1 f0 breq .+40 ; 0xe810 <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { e7e8: 7c f0 brlt .+30 ; 0xe808 <_menu_edit_P()+0x4e> e7ea: 40 91 9b 03 lds r20, 0x039B ; 0x80039b e7ee: 50 91 9c 03 lds r21, 0x039C ; 0x80039c e7f2: 48 17 cp r20, r24 e7f4: 59 07 cpc r21, r25 e7f6: 41 f4 brne .+16 ; 0xe808 <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; e7f8: 30 93 9c 03 sts 0x039C, r19 ; 0x80039c e7fc: 20 93 9b 03 sts 0x039B, r18 ; 0x80039b lcd_encoder = 0; e800: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e804: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; e808: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 e80c: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 } _md->currentValue += lcd_encoder; e810: 20 91 9b 03 lds r18, 0x039B ; 0x80039b e814: 30 91 9c 03 lds r19, 0x039C ; 0x80039c e818: 40 91 1e 06 lds r20, 0x061E ; 0x80061e e81c: 50 91 1f 06 lds r21, 0x061F ; 0x80061f e820: 24 0f add r18, r20 e822: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event e824: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e828: 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); e82c: 28 17 cp r18, r24 e82e: 39 07 cpc r19, r25 e830: 44 f0 brlt .+16 ; 0xe842 <_menu_edit_P()+0x88> e832: 80 91 9f 03 lds r24, 0x039F ; 0x80039f e836: 90 91 a0 03 lds r25, 0x03A0 ; 0x8003a0 e83a: 28 17 cp r18, r24 e83c: 39 07 cpc r19, r25 e83e: 0c f4 brge .+2 ; 0xe842 <_menu_edit_P()+0x88> e840: c9 01 movw r24, r18 e842: 90 93 9c 03 sts 0x039C, r25 ; 0x80039c e846: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b lcd_set_cursor(0, 1); e84a: 61 e0 ldi r22, 0x01 ; 1 e84c: 80 e0 ldi r24, 0x00 ; 0 e84e: 0e 94 b5 6f call 0xdf6a ; 0xdf6a menu_draw_P(' ', _md->editLabel, _md->currentValue); e852: 40 91 9b 03 lds r20, 0x039B ; 0x80039b e856: 50 91 9c 03 lds r21, 0x039C ; 0x80039c e85a: 60 91 96 03 lds r22, 0x0396 ; 0x800396 e85e: 70 91 97 03 lds r23, 0x0397 ; 0x800397 e862: 80 e2 ldi r24, 0x20 ; 32 e864: 0e 94 8d 6f call 0xdf1a ; 0xdf1a } if (lcd_clicked()) e868: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 e86c: 88 23 and r24, r24 e86e: 41 f1 breq .+80 ; 0xe8c0 <_menu_edit_P()+0x106> e870: e0 91 99 03 lds r30, 0x0399 ; 0x800399 e874: f0 91 9a 03 lds r31, 0x039A ; 0x80039a e878: 80 91 9b 03 lds r24, 0x039B ; 0x80039b e87c: 90 91 9c 03 lds r25, 0x039C ; 0x80039c { if (_md->editValueBits == 8) e880: 20 91 98 03 lds r18, 0x0398 ; 0x800398 *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; e884: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) e886: 28 30 cpi r18, 0x08 ; 8 e888: c9 f4 brne .+50 ; 0xe8bc <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) e88a: 80 91 df 03 lds r24, 0x03DF ; 0x8003df e88e: 88 23 and r24, r24 e890: b9 f0 breq .+46 ; 0xe8c0 <_menu_edit_P()+0x106> { menu_depth--; e892: 81 50 subi r24, 0x01 ; 1 e894: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); e898: 90 e0 ldi r25, 0x00 ; 0 e89a: fc 01 movw r30, r24 e89c: ee 0f add r30, r30 e89e: ff 1f adc r31, r31 e8a0: e8 0f add r30, r24 e8a2: f9 1f adc r31, r25 e8a4: e9 5a subi r30, 0xA9 ; 169 e8a6: fc 4f sbci r31, 0xFC ; 252 e8a8: 62 81 ldd r22, Z+2 ; 0x02 e8aa: 06 2e mov r0, r22 e8ac: 00 0c add r0, r0 e8ae: 77 0b sbc r23, r23 e8b0: 20 e0 ldi r18, 0x00 ; 0 e8b2: 40 e0 ldi r20, 0x00 ; 0 e8b4: 80 81 ld r24, Z e8b6: 91 81 ldd r25, Z+1 ; 0x01 e8b8: 0c 94 12 63 jmp 0xc624 ; 0xc624 if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; e8bc: 91 83 std Z+1, r25 ; 0x01 e8be: e5 cf rjmp .-54 ; 0xe88a <_menu_edit_P()+0xd0> menu_back_no_reset(); } } e8c0: 08 95 ret 0000e8c2 : } } void menu_back_if_clicked(void) { if (lcd_clicked()) e8c2: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 e8c6: 81 11 cpse r24, r1 menu_back(); e8c8: 0c 94 76 63 jmp 0xc6ec ; 0xc6ec } e8cc: 08 95 ret 0000e8ce : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) e8ce: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e8d2: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e8d6: 97 ff sbrs r25, 7 e8d8: 07 c0 rjmp .+14 ; 0xe8e8 { lcd_encoder = 0; e8da: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e8de: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e Sound_MakeSound(e_SOUND_TYPE_BlindAlert); e8e2: 87 e0 ldi r24, 0x07 ; 7 e8e4: 0f 94 06 23 call 0x2460c ; 0x2460c } if (lcd_encoder < menu_top) e8e8: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e8ec: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e8f0: 20 91 92 03 lds r18, 0x0392 ; 0x800392 e8f4: 28 17 cp r18, r24 e8f6: 19 06 cpc r1, r25 e8f8: 19 f0 breq .+6 ; 0xe900 e8fa: 14 f0 brlt .+4 ; 0xe900 menu_top = lcd_encoder; e8fc: 80 93 92 03 sts 0x0392, r24 ; 0x800392 menu_line = menu_top; e900: 80 91 92 03 lds r24, 0x0392 ; 0x800392 e904: 80 93 62 04 sts 0x0462, r24 ; 0x800462 menu_clicked = lcd_clicked(); // Consume click event e908: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 e90c: 80 93 61 04 sts 0x0461, r24 ; 0x800461 } e910: 08 95 ret 0000e912 : 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); e912: 8e ef ldi r24, 0xFE ; 254 e914: 9f e0 ldi r25, 0x0F ; 15 e916: 0f 94 3e a4 call 0x3487c ; 0x3487c return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e91a: 8e 3f cpi r24, 0xFE ; 254 e91c: 39 f0 breq .+14 ; 0xe92c e91e: 91 e0 ldi r25, 0x01 ; 1 e920: 20 91 2d 03 lds r18, 0x032D ; 0x80032d e924: 28 13 cpse r18, r24 e926: 90 e0 ldi r25, 0x00 ; 0 e928: 89 2f mov r24, r25 e92a: 08 95 ret e92c: 80 e0 ldi r24, 0x00 ; 0 } e92e: 08 95 ret 0000e930 : return _n("??"); } void lang_reset(void) { lang_selected = 0; e930: 10 92 2d 03 sts 0x032D, r1 ; 0x80032d eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e934: 6e ef ldi r22, 0xFE ; 254 e936: 8e ef ldi r24, 0xFE ; 254 e938: 9f e0 ldi r25, 0x0F ; 15 e93a: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 0000e93e : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e93e: 85 37 cpi r24, 0x75 ; 117 e940: 28 e6 ldi r18, 0x68 ; 104 e942: 92 07 cpc r25, r18 e944: 09 f4 brne .+2 ; 0xe948 e946: 59 c0 rjmp .+178 ; 0xe9fa e948: f8 f4 brcc .+62 ; 0xe988 e94a: 8e 36 cpi r24, 0x6E ; 110 e94c: 25 e6 ldi r18, 0x65 ; 101 e94e: 92 07 cpc r25, r18 e950: 09 f4 brne .+2 ; 0xe954 e952: 59 c0 rjmp .+178 ; 0xea06 e954: 50 f4 brcc .+20 ; 0xe96a e956: 83 37 cpi r24, 0x73 ; 115 e958: 23 e6 ldi r18, 0x63 ; 99 e95a: 92 07 cpc r25, r18 e95c: b1 f1 breq .+108 ; 0xe9ca e95e: 85 36 cpi r24, 0x65 ; 101 e960: 94 46 sbci r25, 0x64 ; 100 e962: b1 f1 breq .+108 ; 0xe9d0 //#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("??"); e964: 84 e6 ldi r24, 0x64 ; 100 e966: 94 e6 ldi r25, 0x64 ; 100 e968: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e96a: 82 37 cpi r24, 0x72 ; 114 e96c: 26 e6 ldi r18, 0x66 ; 102 e96e: 92 07 cpc r25, r18 e970: 91 f1 breq .+100 ; 0xe9d6 e972: 82 37 cpi r24, 0x72 ; 114 e974: 28 e6 ldi r18, 0x68 ; 104 e976: 92 07 cpc r25, r18 e978: 09 f4 brne .+2 ; 0xe97c e97a: 42 c0 rjmp .+132 ; 0xea00 e97c: 83 37 cpi r24, 0x73 ; 115 e97e: 95 46 sbci r25, 0x65 ; 101 e980: 89 f7 brne .-30 ; 0xe964 { 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"); e982: 8b eb ldi r24, 0xBB ; 187 e984: 94 e6 ldi r25, 0x64 ; 100 e986: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e988: 8c 36 cpi r24, 0x6C ; 108 e98a: 20 e7 ldi r18, 0x70 ; 112 e98c: 92 07 cpc r25, r18 e98e: 31 f1 breq .+76 ; 0xe9dc e990: 70 f4 brcc .+28 ; 0xe9ae e992: 8c 36 cpi r24, 0x6C ; 108 e994: 2e e6 ldi r18, 0x6E ; 110 e996: 92 07 cpc r25, r18 e998: 21 f1 breq .+72 ; 0xe9e2 e99a: 8f 36 cpi r24, 0x6F ; 111 e99c: 2e e6 ldi r18, 0x6E ; 110 e99e: 92 07 cpc r25, r18 e9a0: 31 f1 breq .+76 ; 0xe9ee e9a2: 84 37 cpi r24, 0x74 ; 116 e9a4: 99 46 sbci r25, 0x69 ; 105 e9a6: f1 f6 brne .-68 ; 0xe964 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"); e9a8: 89 ea ldi r24, 0xA9 ; 169 e9aa: 94 e6 ldi r25, 0x64 ; 100 e9ac: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e9ae: 8b 36 cpi r24, 0x6B ; 107 e9b0: 23 e7 ldi r18, 0x73 ; 115 e9b2: 92 07 cpc r25, r18 e9b4: f9 f0 breq .+62 ; 0xe9f4 e9b6: 86 37 cpi r24, 0x76 ; 118 e9b8: 23 e7 ldi r18, 0x73 ; 115 e9ba: 92 07 cpc r25, r18 e9bc: a9 f0 breq .+42 ; 0xe9e8 e9be: 8f 36 cpi r24, 0x6F ; 111 e9c0: 92 47 sbci r25, 0x72 ; 114 e9c2: 81 f6 brne .-96 ; 0xe964 #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 e9c4: 87 e6 ldi r24, 0x67 ; 103 e9c6: 94 e6 ldi r25, 0x64 ; 100 e9c8: 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"); e9ca: 8b ec ldi r24, 0xCB ; 203 e9cc: 94 e6 ldi r25, 0x64 ; 100 e9ce: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e9d0: 83 ec ldi r24, 0xC3 ; 195 e9d2: 94 e6 ldi r25, 0x64 ; 100 e9d4: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e9d6: 82 eb ldi r24, 0xB2 ; 178 e9d8: 94 e6 ldi r25, 0x64 ; 100 e9da: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e9dc: 82 ea ldi r24, 0xA2 ; 162 e9de: 94 e6 ldi r25, 0x64 ; 100 e9e0: 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 e9e2: 87 e9 ldi r24, 0x97 ; 151 e9e4: 94 e6 ldi r25, 0x64 ; 100 e9e6: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e9e8: 8f e8 ldi r24, 0x8F ; 143 e9ea: 94 e6 ldi r25, 0x64 ; 100 e9ec: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e9ee: 89 e8 ldi r24, 0x89 ; 137 e9f0: 94 e6 ldi r25, 0x64 ; 100 e9f2: 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 e9f4: 8e e7 ldi r24, 0x7E ; 126 e9f6: 94 e6 ldi r25, 0x64 ; 100 e9f8: 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 e9fa: 87 e7 ldi r24, 0x77 ; 119 e9fc: 94 e6 ldi r25, 0x64 ; 100 e9fe: 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 ea00: 8e e6 ldi r24, 0x6E ; 110 ea02: 94 e6 ldi r25, 0x64 ; 100 ea04: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); ea06: 83 ed ldi r24, 0xD3 ; 211 ea08: 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("??"); } ea0a: 08 95 ret 0000ea0c : return (sum == lt_sum); } uint8_t lang_get_count() { if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) ea0c: ed e3 ldi r30, 0x3D ; 61 ea0e: f5 e7 ldi r31, 0x75 ; 117 ea10: 85 91 lpm r24, Z+ ea12: 95 91 lpm r25, Z+ ea14: a5 91 lpm r26, Z+ ea16: b4 91 lpm r27, Z ea18: 8f 3f cpi r24, 0xFF ; 255 ea1a: 9f 4f sbci r25, 0xFF ; 255 ea1c: af 4f sbci r26, 0xFF ; 255 ea1e: bf 4f sbci r27, 0xFF ; 255 ea20: b1 f0 breq .+44 ; 0xea4e 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; ea22: 20 e0 ldi r18, 0x00 ; 0 ea24: 31 e0 ldi r19, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) ea26: 81 e0 ldi r24, 0x01 ; 1 while (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid ea28: f9 01 movw r30, r18 ea2a: 45 91 lpm r20, Z+ ea2c: 55 91 lpm r21, Z+ ea2e: 65 91 lpm r22, Z+ ea30: 74 91 lpm r23, Z ea32: 45 3a cpi r20, 0xA5 ; 165 ea34: 5a 45 sbci r21, 0x5A ; 90 ea36: 64 4b sbci r22, 0xB4 ; 180 ea38: 7b 44 sbci r23, 0x4B ; 75 ea3a: 09 f0 breq .+2 ; 0xea3e ea3c: 08 95 ret { table += pgm_read_word((uint16_t*)(table + 4)); ea3e: f9 01 movw r30, r18 ea40: 34 96 adiw r30, 0x04 ; 4 ea42: 45 91 lpm r20, Z+ ea44: 54 91 lpm r21, Z ea46: 24 0f add r18, r20 ea48: 35 1f adc r19, r21 count++; ea4a: 8f 5f subi r24, 0xFF ; 255 ea4c: ed cf rjmp .-38 ; 0xea28 } 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 ea4e: 81 e0 ldi r24, 0x01 ; 1 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } ea50: 08 95 ret 0000ea52 : 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) { ea52: 0f 93 push r16 ea54: 1f 93 push r17 if (lang == LANG_ID_PRI) //primary language ea56: 81 11 cpse r24, r1 ea58: 13 c0 rjmp .+38 ; 0xea80 { lang_table = 0; ea5a: 10 92 2c 03 sts 0x032C, r1 ; 0x80032c ea5e: 10 92 2b 03 sts 0x032B, r1 ; 0x80032b lang_selected = lang; ea62: 10 92 2d 03 sts 0x032D, r1 ; 0x80032d lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) ea66: 90 91 2d 03 lds r25, 0x032D ; 0x80032d ea6a: 98 13 cpse r25, r24 ea6c: 5c c0 rjmp .+184 ; 0xeb26 ea6e: 68 2f mov r22, r24 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); ea70: 8e ef ldi r24, 0xFE ; 254 ea72: 9f e0 ldi r25, 0x0F ; 15 ea74: 0f 94 62 a4 call 0x348c4 ; 0x348c4 return 1; ea78: 81 e0 ldi r24, 0x01 ; 1 } return 0; } ea7a: 1f 91 pop r17 ea7c: 0f 91 pop r16 ea7e: 08 95 ret lang_selected = lang; // set language id } } } #else //XFLASH if (lang == LANG_ID_SEC) ea80: 81 30 cpi r24, 0x01 ; 1 ea82: 89 f7 brne .-30 ; 0xea66 { uint16_t table = _SEC_LANG_TABLE; if (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid ea84: e0 e0 ldi r30, 0x00 ; 0 ea86: f1 e0 ldi r31, 0x01 ; 1 ea88: 45 91 lpm r20, Z+ ea8a: 55 91 lpm r21, Z+ ea8c: 65 91 lpm r22, Z+ ea8e: 74 91 lpm r23, Z ea90: 45 3a cpi r20, 0xA5 ; 165 ea92: 5a 45 sbci r21, 0x5A ; 90 ea94: 64 4b sbci r22, 0xB4 ; 180 ea96: 7b 44 sbci r23, 0x4B ; 75 ea98: 31 f7 brne .-52 ; 0xea66 } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); ea9a: e4 e0 ldi r30, 0x04 ; 4 ea9c: f1 e0 ldi r31, 0x01 ; 1 ea9e: a5 91 lpm r26, Z+ eaa0: b4 91 lpm r27, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); eaa2: e8 e0 ldi r30, 0x08 ; 8 eaa4: f1 e0 ldi r31, 0x01 ; 1 eaa6: 65 91 lpm r22, Z+ eaa8: 74 91 lpm r23, Z uint16_t i; for (i = 0; i < size; i++) eaaa: 50 e0 ldi r21, 0x00 ; 0 eaac: 40 e0 ldi r20, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; eaae: 30 e0 ldi r19, 0x00 ; 0 eab0: 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++) eab2: a4 17 cp r26, r20 eab4: b5 07 cpc r27, r21 eab6: 29 f5 brne .+74 ; 0xeb02 sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum eab8: 26 1b sub r18, r22 eaba: 37 0b sbc r19, r23 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes eabc: 32 27 eor r19, r18 eabe: 23 27 eor r18, r19 eac0: 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)) eac2: 62 17 cp r22, r18 eac4: 73 07 cpc r23, r19 eac6: 09 f0 breq .+2 ; 0xeaca eac8: ce cf rjmp .-100 ; 0xea66 if (pgm_read_dword(((uint32_t*)(table + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid eaca: ec e0 ldi r30, 0x0C ; 12 eacc: f1 e0 ldi r31, 0x01 ; 1 eace: 05 91 lpm r16, Z+ ead0: 15 91 lpm r17, Z+ ead2: 25 91 lpm r18, Z+ ead4: 34 91 lpm r19, Z ead6: ed e3 ldi r30, 0x3D ; 61 ead8: f5 e7 ldi r31, 0x75 ; 117 eada: 45 91 lpm r20, Z+ eadc: 55 91 lpm r21, Z+ eade: 65 91 lpm r22, Z+ eae0: 74 91 lpm r23, Z eae2: 04 17 cp r16, r20 eae4: 15 07 cpc r17, r21 eae6: 26 07 cpc r18, r22 eae8: 37 07 cpc r19, r23 eaea: 09 f0 breq .+2 ; 0xeaee eaec: bc cf rjmp .-136 ; 0xea66 { lang_table = (lang_table_t*)table; // set table pointer eaee: 20 e0 ldi r18, 0x00 ; 0 eaf0: 31 e0 ldi r19, 0x01 ; 1 eaf2: 30 93 2c 03 sts 0x032C, r19 ; 0x80032c eaf6: 20 93 2b 03 sts 0x032B, r18 ; 0x80032b lang_selected = lang; // set language id eafa: 91 e0 ldi r25, 0x01 ; 1 eafc: 90 93 2d 03 sts 0x032D, r25 ; 0x80032d eb00: b2 cf rjmp .-156 ; 0xea66 { 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); eb02: fa 01 movw r30, r20 eb04: e0 50 subi r30, 0x00 ; 0 eb06: ff 4f sbci r31, 0xFF ; 255 eb08: e4 91 lpm r30, Z eb0a: f0 e0 ldi r31, 0x00 ; 0 eb0c: 98 e0 ldi r25, 0x08 ; 8 eb0e: 40 fd sbrc r20, 0 eb10: 90 e0 ldi r25, 0x00 ; 0 eb12: 02 c0 rjmp .+4 ; 0xeb18 eb14: ee 0f add r30, r30 eb16: ff 1f adc r31, r31 eb18: 9a 95 dec r25 eb1a: e2 f7 brpl .-8 ; 0xeb14 eb1c: 2e 0f add r18, r30 eb1e: 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++) eb20: 4f 5f subi r20, 0xFF ; 255 eb22: 5f 4f sbci r21, 0xFF ; 255 eb24: c6 cf rjmp .-116 ; 0xeab2 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; eb26: 80 e0 ldi r24, 0x00 ; 0 eb28: a8 cf rjmp .-176 ; 0xea7a 0000eb2a : //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. eb2a: 20 91 2d 03 lds r18, 0x032D ; 0x80032d eb2e: 21 11 cpse r18, r1 eb30: 04 c0 rjmp .+8 ; 0xeb3a eb32: fc 01 movw r30, r24 eb34: 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 } eb36: cf 01 movw r24, r30 eb38: 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. eb3a: 40 91 2b 03 lds r20, 0x032B ; 0x80032b eb3e: 50 91 2c 03 lds r21, 0x032C ; 0x80032c eb42: 41 15 cp r20, r1 eb44: 51 05 cpc r21, r1 eb46: a9 f3 breq .-22 ; 0xeb32 uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id eb48: fc 01 movw r30, r24 eb4a: 25 91 lpm r18, Z+ eb4c: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. eb4e: 2f 3f cpi r18, 0xFF ; 255 eb50: 32 07 cpc r19, r18 eb52: 79 f3 breq .-34 ; 0xeb32 ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset eb54: f9 01 movw r30, r18 eb56: 38 96 adiw r30, 0x08 ; 8 eb58: ee 0f add r30, r30 eb5a: ff 1f adc r31, r31 eb5c: e4 0f add r30, r20 eb5e: f5 1f adc r31, r21 eb60: 25 91 lpm r18, Z+ eb62: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character eb64: fa 01 movw r30, r20 eb66: e2 0f add r30, r18 eb68: f3 1f adc r31, r19 eb6a: 24 91 lpm r18, Z eb6c: 22 23 and r18, r18 eb6e: 09 f3 breq .-62 ; 0xeb32 eb70: e2 cf rjmp .-60 ; 0xeb36 0000eb72 : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { eb72: 8f 92 push r8 eb74: 9f 92 push r9 eb76: af 92 push r10 eb78: bf 92 push r11 eb7a: cf 92 push r12 eb7c: df 92 push r13 eb7e: ef 92 push r14 eb80: ff 92 push r15 eb82: 0f 93 push r16 eb84: 1f 93 push r17 eb86: cf 93 push r28 eb88: df 93 push r29 if (menu_item == menu_line) eb8a: e0 91 63 04 lds r30, 0x0463 ; 0x800463 eb8e: 30 91 62 04 lds r19, 0x0462 ; 0x800462 eb92: e3 13 cpse r30, r19 eb94: 73 c0 rjmp .+230 ; 0xec7c eb96: c2 2f mov r28, r18 eb98: 6a 01 movw r12, r20 eb9a: 7b 01 movw r14, r22 eb9c: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); eb9e: 80 91 59 02 lds r24, 0x0259 ; 0x800259 eba2: 88 23 and r24, r24 eba4: a1 f1 breq .+104 ; 0xec0e eba6: 0e 94 c1 62 call 0xc582 ; 0xc582 ebaa: 01 e0 ldi r16, 0x01 ; 1 ebac: 8e 33 cpi r24, 0x3E ; 62 ebae: 09 f0 breq .+2 ; 0xebb2 ebb0: 00 e0 ldi r16, 0x00 ; 0 ebb2: 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; ebb4: 80 2f mov r24, r16 ebb6: 82 70 andi r24, 0x02 ; 2 ebb8: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; ebba: e1 14 cp r14, r1 ebbc: f1 04 cpc r15, r1 ebbe: 09 f4 brne .+2 ; 0xebc2 ebc0: 6f c0 rjmp .+222 ; 0xeca0 ebc2: e7 01 movw r28, r14 ebc4: 90 e2 ldi r25, 0x20 ; 32 ebc6: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); ebc8: 88 20 and r8, r8 ebca: 09 f4 brne .+2 ; 0xebce ebcc: 41 c0 rjmp .+130 ; 0xec50 ebce: ce 01 movw r24, r28 ebd0: 0f 94 fc a1 call 0x343f8 ; 0x343f8 <__strlen_P> ebd4: 14 e0 ldi r17, 0x04 ; 4 ebd6: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); ebd8: 4e e3 ldi r20, 0x3E ; 62 ebda: 00 ff sbrs r16, 0 ebdc: 40 e2 ldi r20, 0x20 ; 32 ebde: 60 91 60 04 lds r22, 0x0460 ; 0x800460 ebe2: 80 e0 ldi r24, 0x00 ; 0 ebe4: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_print_pad_P(str, LCD_WIDTH - len); ebe8: 64 e1 ldi r22, 0x14 ; 20 ebea: 61 1b sub r22, r17 ebec: c5 01 movw r24, r10 ebee: 0e 94 52 72 call 0xe4a4 ; 0xe4a4 lcd_putc('['); ebf2: 8b e5 ldi r24, 0x5B ; 91 ebf4: 0e 94 7c 6f call 0xdef8 ; 0xdef8 if (is_progmem) { lcd_puts_P(toggle); ebf8: 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) ebfa: 88 20 and r8, r8 ebfc: 89 f1 breq .+98 ; 0xec60 { lcd_puts_P(toggle); ebfe: 0e 94 78 6f call 0xdef0 ; 0xdef0 } else { lcd_print(toggle); } lcd_putc(']'); ec02: 8d e5 ldi r24, 0x5D ; 93 ec04: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_putc(eol); ec08: 89 2d mov r24, r9 ec0a: 0e 94 7c 6f call 0xdef8 ; 0xdef8 void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { if (menu_item == menu_line) { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); if (menu_clicked && (lcd_encoder == menu_item)) ec0e: 80 91 61 04 lds r24, 0x0461 ; 0x800461 ec12: 88 23 and r24, r24 ec14: 99 f1 breq .+102 ; 0xec7c ec16: 20 91 63 04 lds r18, 0x0463 ; 0x800463 ec1a: 80 91 1e 06 lds r24, 0x061E ; 0x80061e ec1e: 90 91 1f 06 lds r25, 0x061F ; 0x80061f ec22: 28 17 cp r18, r24 ec24: 19 06 cpc r1, r25 ec26: 51 f5 brne .+84 ; 0xec7c { if (toggle == NULL) // print N/A warning message ec28: ef 28 or r14, r15 ec2a: e9 f4 brne .+58 ; 0xec66 { menu_submenu(func); ec2c: 60 e0 ldi r22, 0x00 ; 0 ec2e: c6 01 movw r24, r12 ec30: 0e 94 38 63 call 0xc670 ; 0xc670 menu_item_ret(); return; } } menu_item++; } ec34: df 91 pop r29 ec36: cf 91 pop r28 ec38: 1f 91 pop r17 ec3a: 0f 91 pop r16 ec3c: ff 90 pop r15 ec3e: ef 90 pop r14 ec40: df 90 pop r13 ec42: cf 90 pop r12 ec44: bf 90 pop r11 ec46: af 90 pop r10 ec48: 9f 90 pop r9 ec4a: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); ec4c: 0c 94 ce 62 jmp 0xc59c ; 0xc59c //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)); ec50: fe 01 movw r30, r28 ec52: 01 90 ld r0, Z+ ec54: 00 20 and r0, r0 ec56: e9 f7 brne .-6 ; 0xec52 ec58: ec 1b sub r30, r28 ec5a: 13 e0 ldi r17, 0x03 ; 3 ec5c: 1e 0f add r17, r30 ec5e: bc cf rjmp .-136 ; 0xebd8 lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); ec60: 0e 94 ba 73 call 0xe774 ; 0xe774 ec64: ce cf rjmp .-100 ; 0xec02 { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; ec66: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(); ec6a: c1 14 cp r12, r1 ec6c: d1 04 cpc r13, r1 ec6e: 11 f0 breq .+4 ; 0xec74 ec70: f6 01 movw r30, r12 ec72: 19 95 eicall lcd_update_enabled = 1; ec74: 81 e0 ldi r24, 0x01 ; 1 ec76: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a ec7a: dc cf rjmp .-72 ; 0xec34 } menu_item_ret(); return; } } menu_item++; ec7c: 80 91 63 04 lds r24, 0x0463 ; 0x800463 ec80: 8f 5f subi r24, 0xFF ; 255 ec82: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } ec86: df 91 pop r29 ec88: cf 91 pop r28 ec8a: 1f 91 pop r17 ec8c: 0f 91 pop r16 ec8e: ff 90 pop r15 ec90: ef 90 pop r14 ec92: df 90 pop r13 ec94: cf 90 pop r12 ec96: bf 90 pop r11 ec98: af 90 pop r10 ec9a: 9f 90 pop r9 ec9c: 8f 90 pop r8 ec9e: 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); eca0: 8c e7 ldi r24, 0x7C ; 124 eca2: 98 e4 ldi r25, 0x48 ; 72 eca4: 0e 94 95 75 call 0xeb2a ; 0xeb2a eca8: 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] : ' '; ecaa: 8e e7 ldi r24, 0x7E ; 126 ecac: 98 2e mov r9, r24 ecae: 8c cf rjmp .-232 ; 0xebc8 0000ecb0 : //! @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) { ecb0: 0f 93 push r16 ecb2: 1f 93 push r17 ecb4: cf 93 push r28 ecb6: df 93 push r29 ecb8: 8c 01 movw r16, r24 ecba: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); ecbc: 87 ee ldi r24, 0xE7 ; 231 ecbe: 9e e4 ldi r25, 0x4E ; 78 ecc0: 0e 94 95 75 call 0xeb2a ; 0xeb2a ecc4: 9f 93 push r25 ecc6: 8f 93 push r24 ecc8: 8d ef ldi r24, 0xFD ; 253 ecca: 91 e8 ldi r25, 0x81 ; 129 eccc: 9f 93 push r25 ecce: 8f 93 push r24 ecd0: df 93 push r29 ecd2: cf 93 push r28 ecd4: 0f 94 55 a3 call 0x346aa ; 0x346aa eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); ecd8: c8 0f add r28, r24 ecda: d1 1d adc r29, r1 ecdc: 47 e0 ldi r20, 0x07 ; 7 ecde: 50 e0 ldi r21, 0x00 ; 0 ece0: b8 01 movw r22, r16 ece2: ce 01 movw r24, r28 ece4: 0f 94 2e a4 call 0x3485c ; 0x3485c //index += 7; buffer.c[index + 7] = '\0'; ece8: 1f 82 std Y+7, r1 ; 0x07 ecea: 0f 90 pop r0 ecec: 0f 90 pop r0 ecee: 0f 90 pop r0 ecf0: 0f 90 pop r0 ecf2: 0f 90 pop r0 ecf4: 0f 90 pop r0 } ecf6: df 91 pop r29 ecf8: cf 91 pop r28 ecfa: 1f 91 pop r17 ecfc: 0f 91 pop r16 ecfe: 08 95 ret 0000ed00 : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { ed00: 0f 93 push r16 ed02: 1f 93 push r17 ed04: cf 93 push r28 ed06: df 93 push r29 ed08: cd b7 in r28, 0x3d ; 61 ed0a: de b7 in r29, 0x3e ; 62 ed0c: 63 97 sbiw r28, 0x13 ; 19 ed0e: 0f b6 in r0, 0x3f ; 63 ed10: f8 94 cli ed12: de bf out 0x3e, r29 ; 62 ed14: 0f be out 0x3f, r0 ; 63 ed16: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) ed18: 30 91 63 04 lds r19, 0x0463 ; 0x800463 ed1c: 20 91 62 04 lds r18, 0x0462 ; 0x800462 ed20: 32 13 cpse r19, r18 ed22: 38 c0 rjmp .+112 ; 0xed94 ed24: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); ed26: 20 91 59 02 lds r18, 0x0259 ; 0x800259 ed2a: 22 23 and r18, r18 ed2c: a9 f0 breq .+42 ; 0xed58 static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); ed2e: be 01 movw r22, r28 ed30: 6f 5f subi r22, 0xFF ; 255 ed32: 7f 4f sbci r23, 0xFF ; 255 ed34: 0e 94 58 76 call 0xecb0 ; 0xecb0 lcd_putc_at(0, menu_row, menu_selection_mark()); ed38: 0e 94 c1 62 call 0xc582 ; 0xc582 ed3c: 48 2f mov r20, r24 ed3e: 60 91 60 04 lds r22, 0x0460 ; 0x800460 ed42: 80 e0 ldi r24, 0x00 ; 0 ed44: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_print_pad(buffer.c, LCD_WIDTH - 2); ed48: 62 e1 ldi r22, 0x12 ; 18 ed4a: ce 01 movw r24, r28 ed4c: 01 96 adiw r24, 0x01 ; 1 ed4e: 0e 94 a2 73 call 0xe744 ; 0xe744 lcd_putc(type_char); ed52: 8e e7 ldi r24, 0x7E ; 126 ed54: 0e 94 7c 6f call 0xdef8 ; 0xdef8 void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { if (menu_item == menu_line) { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); if (menu_clicked && (lcd_encoder == menu_item)) ed58: 80 91 61 04 lds r24, 0x0461 ; 0x800461 ed5c: 88 23 and r24, r24 ed5e: d1 f0 breq .+52 ; 0xed94 ed60: 20 91 63 04 lds r18, 0x0463 ; 0x800463 ed64: 80 91 1e 06 lds r24, 0x061E ; 0x80061e ed68: 90 91 1f 06 lds r25, 0x061F ; 0x80061f ed6c: 28 17 cp r18, r24 ed6e: 19 06 cpc r1, r25 ed70: 89 f4 brne .+34 ; 0xed94 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); ed72: 60 e0 ldi r22, 0x00 ; 0 ed74: c8 01 movw r24, r16 ed76: 0e 94 38 63 call 0xc670 ; 0xc670 menu_item_ret(); ed7a: 0e 94 ce 62 call 0xc59c ; 0xc59c menu_item_ret(); return; } } menu_item++; } ed7e: 63 96 adiw r28, 0x13 ; 19 ed80: 0f b6 in r0, 0x3f ; 63 ed82: f8 94 cli ed84: de bf out 0x3e, r29 ; 62 ed86: 0f be out 0x3f, r0 ; 63 ed88: cd bf out 0x3d, r28 ; 61 ed8a: df 91 pop r29 ed8c: cf 91 pop r28 ed8e: 1f 91 pop r17 ed90: 0f 91 pop r16 ed92: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; ed94: 80 91 63 04 lds r24, 0x0463 ; 0x800463 ed98: 8f 5f subi r24, 0xFF ; 255 ed9a: 80 93 63 04 sts 0x0463, r24 ; 0x800463 ed9e: ef cf rjmp .-34 ; 0xed7e 0000eda0 : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { eda0: cf 93 push r28 eda2: df 93 push r29 eda4: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; eda6: 20 e0 ldi r18, 0x00 ; 0 eda8: 30 e0 ldi r19, 0x00 ; 0 edaa: 4c e8 ldi r20, 0x8C ; 140 edac: 52 e4 ldi r21, 0x42 ; 66 edae: 60 91 6d 12 lds r22, 0x126D ; 0x80126d edb2: 70 91 6e 12 lds r23, 0x126E ; 0x80126e edb6: 80 91 6f 12 lds r24, 0x126F ; 0x80126f edba: 90 91 70 12 lds r25, 0x1270 ; 0x801270 edbe: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> edc2: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d edc6: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e edca: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f edce: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); edd2: 60 e0 ldi r22, 0x00 ; 0 edd4: 70 e0 ldi r23, 0x00 ; 0 edd6: 80 ea ldi r24, 0xA0 ; 160 edd8: 91 e4 ldi r25, 0x41 ; 65 edda: 0f 94 a8 49 call 0x29350 ; 0x29350 load_filament_final_feed(); edde: 0e 94 48 64 call 0xc890 ; 0xc890 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); ede2: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); ede6: 8f ea ldi r24, 0xAF ; 175 ede8: 92 e6 ldi r25, 0x62 ; 98 edea: 0e 94 95 75 call 0xeb2a ; 0xeb2a edee: ac 01 movw r20, r24 edf0: 60 e0 ldi r22, 0x00 ; 0 edf2: 80 e0 ldi r24, 0x00 ; 0 edf4: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 if (filament_name[0]) { edf8: 88 81 ld r24, Y edfa: 88 23 and r24, r24 edfc: 39 f0 breq .+14 ; 0xee0c lcd_set_cursor(0, 1); edfe: 61 e0 ldi r22, 0x01 ; 1 ee00: 80 e0 ldi r24, 0x00 ; 0 ee02: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print(filament_name); ee06: ce 01 movw r24, r28 ee08: 0e 94 ba 73 call 0xe774 ; 0xe774 } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); ee0c: 86 eb ldi r24, 0xB6 ; 182 ee0e: 99 e3 ldi r25, 0x39 ; 57 ee10: 0e 94 95 75 call 0xeb2a ; 0xeb2a ee14: ac 01 movw r20, r24 ee16: 62 e0 ldi r22, 0x02 ; 2 ee18: 80 e0 ldi r24, 0x00 ; 0 ee1a: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 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 ee1e: 83 e4 ldi r24, 0x43 ; 67 ee20: 9b e2 ldi r25, 0x2B ; 43 ee22: 0f 94 e9 08 call 0x211d2 ; 0x211d2 lcd_loading_filament(filament_name); st_synchronize(); } ee26: df 91 pop r29 ee28: 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(); ee2a: 0d 94 5b 18 jmp 0x230b6 ; 0x230b6 0000ee2e : * 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; ee2e: 0f 94 1d 65 call 0x2ca3a ; 0x2ca3a ee32: 8f 3f cpi r24, 0xFF ; 255 ee34: 11 f1 breq .+68 ; 0xee7a lcd_update_enable(false); ee36: 80 e0 ldi r24, 0x00 ; 0 ee38: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_clear(); ee3c: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); ee40: 8b e6 ldi r24, 0x6B ; 107 ee42: 9a e5 ldi r25, 0x5A ; 90 ee44: 0e 94 95 75 call 0xeb2a ; 0xeb2a ee48: ac 01 movw r20, r24 ee4a: 61 e0 ldi r22, 0x01 ; 1 ee4c: 80 e0 ldi r24, 0x00 ; 0 ee4e: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); ee52: 80 e2 ldi r24, 0x20 ; 32 ee54: 0e 94 fd 70 call 0xe1fa ; 0xe1fa lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); ee58: 0f 94 1d 65 call 0x2ca3a ; 0x2ca3a ee5c: 68 2f mov r22, r24 ee5e: 70 e0 ldi r23, 0x00 ; 0 ee60: 6f 5f subi r22, 0xFF ; 255 ee62: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); ee64: 07 2e mov r0, r23 ee66: 00 0c add r0, r0 ee68: 88 0b sbc r24, r24 ee6a: 99 0b sbc r25, r25 ee6c: 0e 94 36 72 call 0xe46c ; 0xe46c // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); ee70: 0f 94 cf 9d call 0x33b9e ; 0x33b9e lcd_update_enable(true); ee74: 81 e0 ldi r24, 0x01 ; 1 ee76: 0c 94 93 70 jmp 0xe126 ; 0xe126 } ee7a: 08 95 ret 0000ee7c <__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 { ee7c: 1f 92 push r1 ee7e: 0f 92 push r0 ee80: 0f b6 in r0, 0x3f ; 63 ee82: 0f 92 push r0 ee84: 11 24 eor r1, r1 ee86: 0b b6 in r0, 0x3b ; 59 ee88: 0f 92 push r0 ee8a: 2f 93 push r18 ee8c: 8f 93 push r24 ee8e: 9f 93 push r25 ee90: ef 93 push r30 ee92: ff 93 push r31 switch(state){ ee94: e0 91 26 03 lds r30, 0x0326 ; 0x800326 ee98: e8 30 cpi r30, 0x08 ; 8 ee9a: e8 f4 brcc .+58 ; 0xeed6 <__vector_23+0x5a> ee9c: f0 e0 ldi r31, 0x00 ; 0 ee9e: 88 27 eor r24, r24 eea0: eb 5a subi r30, 0xAB ; 171 eea2: f8 48 sbci r31, 0x88 ; 136 eea4: 8f 4f sbci r24, 0xFF ; 255 eea6: 0d 94 4e a5 jmp 0x34a9c ; 0x34a9c <__tablejump2__> eeaa: 5d 77 andi r21, 0x7D ; 125 eeac: 77 77 andi r23, 0x77 ; 119 eeae: 82 77 andi r24, 0x72 ; 114 eeb0: 90 77 andi r25, 0x70 ; 112 eeb2: a6 77 andi r26, 0x76 ; 118 eeb4: af 77 andi r26, 0x7F ; 127 eeb6: d2 77 andi r29, 0x72 ; 114 eeb8: e4 77 andi r30, 0x74 ; 116 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin eeba: 80 91 28 06 lds r24, 0x0628 ; 0x800628 eebe: 81 11 cpse r24, r1 eec0: 0a c0 rjmp .+20 ; 0xeed6 <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! eec2: 80 91 ee 05 lds r24, 0x05EE ; 0x8005ee eec6: 88 0f add r24, r24 eec8: 80 93 25 03 sts 0x0325, r24 ; 0x800325 if( pwm != 0 ){ eecc: 88 23 and r24, r24 eece: 19 f0 breq .+6 ; 0xeed6 <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period eed0: 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 eed2: 80 93 26 03 sts 0x0326, r24 ; 0x800326 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } eed6: ff 91 pop r31 eed8: ef 91 pop r30 eeda: 9f 91 pop r25 eedc: 8f 91 pop r24 eede: 2f 91 pop r18 eee0: 0f 90 pop r0 eee2: 0b be out 0x3b, r0 ; 59 eee4: 0f 90 pop r0 eee6: 0f be out 0x3f, r0 ; 63 eee8: 0f 90 pop r0 eeea: 1f 90 pop r1 eeec: 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) eeee: 80 91 24 03 lds r24, 0x0324 ; 0x800324 eef2: 8f 5f subi r24, 0xFF ; 255 eef4: 80 93 24 03 sts 0x0324, r24 ; 0x800324 if( slowCounter > pwm ){ eef8: 90 91 25 03 lds r25, 0x0325 ; 0x800325 eefc: 98 17 cp r25, r24 eefe: 58 f3 brcs .-42 ; 0xeed6 <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 ef00: 82 e0 ldi r24, 0x02 ; 2 ef02: e7 cf rjmp .-50 ; 0xeed2 <__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 ef04: 83 e0 ldi r24, 0x03 ; 3 ef06: 80 93 26 03 sts 0x0326, r24 ; 0x800326 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE ef0a: 8f e0 ldi r24, 0x0F ; 15 ef0c: 80 93 23 03 sts 0x0323, r24 ; 0x800323 TCNT0 = 255; // force overflow on the next clock cycle ef10: 8f ef ldi r24, 0xFF ; 255 ef12: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz ef14: 81 e0 ldi r24, 0x01 ; 1 ef16: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) ef18: 84 b5 in r24, 0x24 ; 36 ef1a: 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 ef1c: 84 bd out 0x24, r24 ; 36 ef1e: db cf rjmp .-74 ; 0xeed6 <__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; ef20: 80 91 23 03 lds r24, 0x0323 ; 0x800323 ef24: 82 95 swap r24 ef26: 80 7f andi r24, 0xF0 ; 240 ef28: 81 95 neg r24 ef2a: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ ef2c: 80 91 23 03 lds r24, 0x0323 ; 0x800323 ef30: 88 23 and r24, r24 ef32: 21 f0 breq .+8 ; 0xef3c <__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; ef34: 81 50 subi r24, 0x01 ; 1 ef36: 80 93 23 03 sts 0x0323, r24 ; 0x800323 ef3a: cd cf rjmp .-102 ; 0xeed6 <__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; ef3c: 84 e0 ldi r24, 0x04 ; 4 ef3e: 80 93 26 03 sts 0x0326, r24 ; 0x800326 OCR0B = 255; // full duty ef42: 8f ef ldi r24, 0xFF ; 255 ef44: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle ef46: 8e ef ldi r24, 0xFE ; 254 ef48: 86 bd out 0x26, r24 ; 38 ef4a: c5 cf rjmp .-118 ; 0xeed6 <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; ef4c: 85 e0 ldi r24, 0x05 ; 5 ef4e: 80 93 26 03 sts 0x0326, r24 ; 0x800326 OCR0B = 255; // full duty ef52: 8f ef ldi r24, 0xFF ; 255 ef54: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle ef56: 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 ef58: 82 e0 ldi r24, 0x02 ; 2 ef5a: 85 bd out 0x25, r24 ; 37 ef5c: bc cf rjmp .-136 ; 0xeed6 <__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; ef5e: 2f ef ldi r18, 0xFF ; 255 ef60: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin ef62: 80 91 28 06 lds r24, 0x0628 ; 0x800628 ef66: 81 11 cpse r24, r1 ef68: b6 cf rjmp .-148 ; 0xeed6 <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less ef6a: 80 91 24 03 lds r24, 0x0324 ; 0x800324 ef6e: 8f 5f subi r24, 0xFF ; 255 ef70: 80 93 24 03 sts 0x0324, r24 ; 0x800324 if( slowCounter < pwm ){ ef74: 90 91 25 03 lds r25, 0x0325 ; 0x800325 ef78: 89 17 cp r24, r25 ef7a: 08 f4 brcc .+2 ; 0xef7e <__vector_23+0x102> ef7c: ac cf rjmp .-168 ; 0xeed6 <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain ef7e: 80 91 ee 05 lds r24, 0x05EE ; 0x8005ee ef82: 90 e0 ldi r25, 0x00 ; 0 ef84: 8f 37 cpi r24, 0x7F ; 127 ef86: 91 05 cpc r25, r1 ef88: 0c f0 brlt .+2 ; 0xef8c <__vector_23+0x110> ef8a: a5 cf rjmp .-182 ; 0xeed6 <__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; ef8c: 86 e0 ldi r24, 0x06 ; 6 ef8e: 80 93 26 03 sts 0x0326, r24 ; 0x800326 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE ef92: 8f e0 ldi r24, 0x0F ; 15 ef94: 80 93 23 03 sts 0x0323, r24 ; 0x800323 TCNT0 = 255; // force overflow on the next clock cycle ef98: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz ef9a: 81 e0 ldi r24, 0x01 ; 1 ef9c: 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 ef9e: 84 b5 in r24, 0x24 ; 36 efa0: 80 61 ori r24, 0x10 ; 16 efa2: bc cf rjmp .-136 ; 0xef1c <__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 efa4: 80 91 23 03 lds r24, 0x0323 ; 0x800323 efa8: 82 95 swap r24 efaa: 80 7f andi r24, 0xF0 ; 240 efac: 81 95 neg r24 efae: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ efb0: 80 91 23 03 lds r24, 0x0323 ; 0x800323 efb4: 81 11 cpse r24, r1 efb6: be cf rjmp .-132 ; 0xef34 <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; efb8: 87 e0 ldi r24, 0x07 ; 7 efba: 80 93 26 03 sts 0x0326, r24 ; 0x800326 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes efbe: 80 e8 ldi r24, 0x80 ; 128 efc0: 86 bd out 0x26, r24 ; 38 OCR0B = 255; efc2: 8f ef ldi r24, 0xFF ; 255 efc4: 88 bd out 0x28, r24 ; 40 efc6: 87 cf rjmp .-242 ; 0xeed6 <__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 efc8: 10 92 26 03 sts 0x0326, r1 ; 0x800326 TCNT0 = 128; efcc: 80 e8 ldi r24, 0x80 ; 128 efce: 86 bd out 0x26, r24 ; 38 OCR0B = 255; efd0: 8f ef ldi r24, 0xFF ; 255 efd2: 88 bd out 0x28, r24 ; 40 efd4: c1 cf rjmp .-126 ; 0xef58 <__vector_23+0xdc> 0000efd6 : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { efd6: cf 93 push r28 efd8: c8 2f mov r28, r24 efda: 68 2f mov r22, r24 efdc: 87 e6 ldi r24, 0x67 ; 103 efde: 9f e0 ldi r25, 0x0F ; 15 efe0: 0f 94 62 a4 call 0x348c4 ; 0x348c4 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { efe4: cc 23 and r28, r28 efe6: 19 f0 breq .+6 ; 0xefee fsensor.init(); } else { fsensor.deinit(); } } efe8: 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(); efea: 0d 94 24 6d jmp 0x2da48 ; 0x2da48 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; efee: 10 92 f1 16 sts 0x16F1, r1 ; 0x8016f1 filter = 0; eff2: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd if (enabled) { fsensor.init(); } else { fsensor.deinit(); } } eff6: cf 91 pop r28 eff8: 08 95 ret 0000effa : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; effa: 10 92 b6 03 sts 0x03B6, r1 ; 0x8003b6 extruder_autofan_last_check = _millis(); effe: 0f 94 01 0b call 0x21602 ; 0x21602 f002: 60 93 07 17 sts 0x1707, r22 ; 0x801707 f006: 70 93 08 17 sts 0x1708, r23 ; 0x801708 f00a: 80 93 09 17 sts 0x1709, r24 ; 0x801709 f00e: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a } f012: 08 95 ret 0000f014 : 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; f014: 80 93 22 03 sts 0x0322, r24 ; 0x800322 newFanSpeed = 0; if (fanState & 0x01) f018: 80 fd sbrc r24, 0 f01a: 1c c0 rjmp .+56 ; 0xf054 { //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; f01c: 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); f020: 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) f024: 8f ef ldi r24, 0xFF ; 255 f026: 82 0f add r24, r18 f028: 8e 3f cpi r24, 0xFE ; 254 f02a: e8 f0 brcs .+58 ; 0xf066 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); f02c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> f030: 87 7f andi r24, 0xF7 ; 247 f032: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; f036: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> f03a: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); f03e: 9f b7 in r25, 0x3f ; 63 f040: 22 23 and r18, r18 f042: 61 f0 breq .+24 ; 0xf05c f044: f8 94 cli f046: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f04a: 80 62 ori r24, 0x20 ; 32 f04c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f050: 9f bf out 0x3f, r25 ; 63 f052: 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; f054: 8f ef ldi r24, 0xFF ; 255 f056: 80 93 3e 03 sts 0x033E, r24 ; 0x80033e f05a: e2 cf rjmp .-60 ; 0xf020 f05c: f8 94 cli f05e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f062: 8f 7d andi r24, 0xDF ; 223 f064: f3 cf rjmp .-26 ; 0xf04c 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; f066: ef b7 in r30, 0x3f ; 63 f068: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); f06a: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> f06e: 88 60 ori r24, 0x08 ; 8 f070: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; f074: 30 e0 ldi r19, 0x00 ; 0 f076: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> f07a: 4f ef ldi r20, 0xFF ; 255 f07c: 50 e0 ldi r21, 0x00 ; 0 f07e: 81 ff sbrs r24, 1 f080: 04 c0 rjmp .+8 ; 0xf08a f082: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> f086: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> f08a: 24 9f mul r18, r20 f08c: c0 01 movw r24, r0 f08e: 25 9f mul r18, r21 f090: 90 0d add r25, r0 f092: 34 9f mul r19, r20 f094: 90 0d add r25, r0 f096: 11 24 eor r1, r1 f098: 6f ef ldi r22, 0xFF ; 255 f09a: 70 e0 ldi r23, 0x00 ; 0 f09c: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__udivmodhi4> f0a0: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> f0a4: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; f0a8: ef bf out 0x3f, r30 ; 63 #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } f0aa: 08 95 ret 0000f0ac : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { f0ac: 1f 93 push r17 f0ae: cf 93 push r28 f0b0: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) f0b2: d0 91 22 03 lds r29, 0x0322 ; 0x800322 f0b6: d1 fd sbrc r29, 1 f0b8: 1d c0 rjmp .+58 ; 0xf0f4 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; f0ba: 10 91 cc 03 lds r17, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; f0be: c1 e0 ldi r28, 0x01 ; 1 f0c0: 20 e0 ldi r18, 0x00 ; 0 f0c2: 30 e0 ldi r19, 0x00 ; 0 f0c4: 48 e4 ldi r20, 0x48 ; 72 f0c6: 52 e4 ldi r21, 0x42 ; 66 f0c8: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a f0cc: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b f0d0: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c f0d4: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d f0d8: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> f0dc: 18 16 cp r1, r24 f0de: 0c f0 brlt .+2 ; 0xf0e2 f0e0: 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; f0e2: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; f0e4: cd 2b or r28, r29 f0e6: 81 e0 ldi r24, 0x01 ; 1 f0e8: 11 11 cpse r17, r1 f0ea: 01 c0 rjmp .+2 ; 0xf0ee f0ec: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); f0ee: c8 2b or r28, r24 f0f0: c0 93 22 03 sts 0x0322, r28 ; 0x800322 } setExtruderAutoFanState(fanState); f0f4: 80 91 22 03 lds r24, 0x0322 ; 0x800322 #endif } f0f8: df 91 pop r29 f0fa: cf 91 pop r28 f0fc: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); f0fe: 0c 94 0a 78 jmp 0xf014 ; 0xf014 0000f102 : 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) { f102: ef 92 push r14 f104: ff 92 push r15 f106: 0f 93 push r16 f108: 1f 93 push r17 f10a: cf 93 push r28 f10c: df 93 push r29 f10e: ec 01 movw r28, r24 f110: 8b 01 movw r16, r22 f112: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) f114: 0e 94 65 56 call 0xacca ; 0xacca f118: 81 11 cpse r24, r1 f11a: 0b c0 rjmp .+22 ; 0xf132 #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); f11c: a8 01 movw r20, r16 f11e: be 01 movw r22, r28 f120: 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); } f122: df 91 pop r29 f124: cf 91 pop r28 f126: 1f 91 pop r17 f128: 0f 91 pop r16 f12a: ff 90 pop r15 f12c: 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); f12e: 0d 94 52 a4 jmp 0x348a4 ; 0x348a4 } 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); } f132: df 91 pop r29 f134: cf 91 pop r28 f136: 1f 91 pop r17 f138: 0f 91 pop r16 f13a: ff 90 pop r15 f13c: ef 90 pop r14 f13e: 08 95 ret 0000f140 : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { f140: 0f 93 push r16 f142: 1f 93 push r17 f144: cf 93 push r28 f146: df 93 push r29 f148: 8c 01 movw r16, r24 f14a: d6 2f mov r29, r22 f14c: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); f14e: 0f 94 4c a4 call 0x34898 ; 0x34898 if (val == EEPROM_EMPTY_VALUE16) { f152: 8f 3f cpi r24, 0xFF ; 255 f154: 98 07 cpc r25, r24 f156: 39 f4 brne .+14 ; 0xf166 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); f158: 6d 2f mov r22, r29 f15a: 7c 2f mov r23, r28 f15c: c8 01 movw r24, r16 f15e: 0f 94 9c a4 call 0x34938 ; 0x34938 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; f162: 8d 2f mov r24, r29 f164: 9c 2f mov r25, r28 } return val; } f166: df 91 pop r29 f168: cf 91 pop r28 f16a: 1f 91 pop r17 f16c: 0f 91 pop r16 f16e: 08 95 ret 0000f170 : 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) { f170: 0f 93 push r16 f172: 1f 93 push r17 f174: cf 93 push r28 f176: 8c 01 movw r16, r24 f178: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); f17a: 0f 94 3e a4 call 0x3487c ; 0x3487c if (val == EEPROM_EMPTY_VALUE) { f17e: 8f 3f cpi r24, 0xFF ; 255 f180: 29 f4 brne .+10 ; 0xf18c 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); f182: 6c 2f mov r22, r28 f184: c8 01 movw r24, r16 f186: 0f 94 86 a4 call 0x3490c ; 0x3490c 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; f18a: 8c 2f mov r24, r28 } return val; } f18c: cf 91 pop r28 f18e: 1f 91 pop r17 f190: 0f 91 pop r16 f192: 08 95 ret 0000f194 : 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) { f194: cf 93 push r28 f196: df 93 push r29 f198: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); f19a: 0f 94 4c a4 call 0x34898 ; 0x34898 f19e: bc 01 movw r22, r24 f1a0: 6f 5f subi r22, 0xFF ; 255 f1a2: 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); f1a4: 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); } f1a6: df 91 pop r29 f1a8: 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); f1aa: 0d 94 9c a4 jmp 0x34938 ; 0x34938 0000f1ae : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { f1ae: cf 93 push r28 f1b0: df 93 push r29 f1b2: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); f1b4: 0f 94 3e a4 call 0x3487c ; 0x3487c f1b8: 61 e0 ldi r22, 0x01 ; 1 f1ba: 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); f1bc: 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); } f1be: df 91 pop r29 f1c0: 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); f1c2: 0d 94 86 a4 jmp 0x3490c ; 0x3490c 0000f1c6 : 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); f1c6: 2b e0 ldi r18, 0x0B ; 11 f1c8: 82 9f mul r24, r18 f1ca: c0 01 movw r24, r0 f1cc: 11 24 eor r1, r1 f1ce: 80 5b subi r24, 0xB0 ; 176 f1d0: 92 4f sbci r25, 0xF2 ; 242 f1d2: 0f 94 4c a4 call 0x34898 ; 0x34898 f1d6: 21 e0 ldi r18, 0x01 ; 1 f1d8: 01 96 adiw r24, 0x01 ; 1 f1da: 09 f4 brne .+2 ; 0xf1de f1dc: 20 e0 ldi r18, 0x00 ; 0 } f1de: 82 2f mov r24, r18 f1e0: 08 95 ret 0000f1e2 : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { f1e2: cf 93 push r28 f1e4: df 93 push r29 f1e6: c8 2f mov r28, r24 f1e8: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; f1ea: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; f1ec: c8 30 cpi r28, 0x08 ; 8 f1ee: 0c f0 brlt .+2 ; 0xf1f2 f1f0: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; f1f2: 8c 2f mov r24, r28 f1f4: 0e 94 e3 78 call 0xf1c6 ; 0xf1c6 f1f8: 81 11 cpse r24, r1 f1fa: 03 c0 rjmp .+6 ; 0xf202 f1fc: 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) f1fe: a9 f7 brne .-22 ; 0xf1ea { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; f200: cf ef ldi r28, 0xFF ; 255 } f202: 8c 2f mov r24, r28 f204: df 91 pop r29 f206: cf 91 pop r28 f208: 08 95 ret 0000f20a : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); f20a: 81 ea ldi r24, 0xA1 ; 161 f20c: 9d e0 ldi r25, 0x0D ; 13 f20e: 0f 94 3e a4 call 0x3487c ; 0x3487c sheet = eeprom_next_initialized_sheet(sheet); f212: 0e 94 f1 78 call 0xf1e2 ; 0xf1e2 if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); f216: 87 fd sbrc r24, 7 f218: 05 c0 rjmp .+10 ; 0xf224 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f21a: 68 2f mov r22, r24 f21c: 81 ea ldi r24, 0xA1 ; 161 f21e: 9d e0 ldi r25, 0x0D ; 13 f220: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 { 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); } f224: 08 95 ret 0000f226 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { f226: 0f 93 push r16 f228: 1f 93 push r17 f22a: cf 93 push r28 f22c: c8 2f mov r28, r24 f22e: 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")); f230: 60 ef ldi r22, 0xF0 ; 240 f232: 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) f234: 82 30 cpi r24, 0x02 ; 2 f236: 70 f0 brcs .+28 ; 0xf254 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); f238: 69 ee ldi r22, 0xE9 ; 233 f23a: 74 e7 ldi r23, 0x74 ; 116 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) f23c: 84 30 cpi r24, 0x04 ; 4 f23e: 50 f0 brcs .+20 ; 0xf254 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); f240: 61 ee ldi r22, 0xE1 ; 225 f242: 74 e7 ldi r23, 0x74 ; 116 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) f244: 84 30 cpi r24, 0x04 ; 4 f246: 31 f0 breq .+12 ; 0xf254 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); f248: 69 ed ldi r22, 0xD9 ; 217 f24a: 74 e7 ldi r23, 0x74 ; 116 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) f24c: 85 30 cpi r24, 0x05 ; 5 f24e: 11 f0 breq .+4 ; 0xf254 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); f250: 62 ed ldi r22, 0xD2 ; 210 f252: 74 e7 ldi r23, 0x74 ; 116 f254: c8 01 movw r24, r16 f256: 0f 94 f5 a1 call 0x343ea ; 0x343ea } if (index <4 || index >5) f25a: 8c ef ldi r24, 0xFC ; 252 f25c: 8c 0f add r24, r28 f25e: 82 30 cpi r24, 0x02 ; 2 f260: 28 f0 brcs .+10 ; 0xf26c { sheetName.c[6] = '0' + ((index % 2)+1); f262: c1 70 andi r28, 0x01 ; 1 f264: cf 5c subi r28, 0xCF ; 207 f266: f8 01 movw r30, r16 f268: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; f26a: 17 82 std Z+7, r1 ; 0x07 } } f26c: cf 91 pop r28 f26e: 1f 91 pop r17 f270: 0f 91 pop r16 f272: 08 95 ret 0000f274 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f274: 61 e0 ldi r22, 0x01 ; 1 f276: 80 ec ldi r24, 0xC0 ; 192 f278: 9f e0 ldi r25, 0x0F ; 15 f27a: 0f 94 62 a4 call 0x348c4 ; 0x348c4 f27e: 60 e0 ldi r22, 0x00 ; 0 f280: 8f eb ldi r24, 0xBF ; 191 f282: 9f e0 ldi r25, 0x0F ; 15 f284: 0f 94 62 a4 call 0x348c4 ; 0x348c4 f288: 60 e0 ldi r22, 0x00 ; 0 f28a: 8e eb ldi r24, 0xBE ; 190 f28c: 9f e0 ldi r25, 0x0F ; 15 f28e: 0f 94 62 a4 call 0x348c4 ; 0x348c4 f292: 60 e0 ldi r22, 0x00 ; 0 f294: 8d eb ldi r24, 0xBD ; 189 f296: 9f e0 ldi r25, 0x0F ; 15 f298: 0f 94 62 a4 call 0x348c4 ; 0x348c4 f29c: 60 e0 ldi r22, 0x00 ; 0 f29e: 8c eb ldi r24, 0xBC ; 188 f2a0: 9f e0 ldi r25, 0x0F ; 15 f2a2: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 0000f2a6 : { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); } void print_hex_byte(uint8_t val) { f2a6: cf 93 push r28 f2a8: c8 2f mov r28, r24 print_hex_nibble(val >> 4); f2aa: 82 95 swap r24 f2ac: 8f 70 andi r24, 0x0F ; 15 f2ae: 0e 94 d3 5d call 0xbba6 ; 0xbba6 print_hex_nibble(val & 15); f2b2: 8c 2f mov r24, r28 f2b4: 8f 70 andi r24, 0x0F ; 15 } f2b6: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); f2b8: 0c 94 d3 5d jmp 0xbba6 ; 0xbba6 0000f2bc : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) f2bc: 40 91 3c 12 lds r20, 0x123C ; 0x80123c f2c0: 50 91 3d 12 lds r21, 0x123D ; 0x80123d return 0; f2c4: 90 e0 ldi r25, 0x00 ; 0 f2c6: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) f2c8: 41 15 cp r20, r1 f2ca: 51 05 cpc r21, r1 f2cc: b1 f1 breq .+108 ; 0xf33a char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { f2ce: 20 91 38 12 lds r18, 0x1238 ; 0x801238 f2d2: 30 91 39 12 lds r19, 0x1239 ; 0x801239 char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; f2d6: 90 e0 ldi r25, 0x00 ; 0 f2d8: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { f2da: f9 01 movw r30, r18 f2dc: e5 5b subi r30, 0xB5 ; 181 f2de: ff 4e sbci r31, 0xEF ; 239 f2e0: a0 81 ld r26, Z f2e2: a2 30 cpi r26, 0x02 ; 2 f2e4: 21 f4 brne .+8 ; 0xf2ee sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; f2e6: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; f2e8: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; f2ea: 86 0f add r24, r22 f2ec: 97 1f adc r25, r23 } if (-- _buflen == 0) f2ee: 41 50 subi r20, 0x01 ; 1 f2f0: 51 09 sbc r21, r1 f2f2: 19 f1 breq .+70 ; 0xf33a f2f4: f9 01 movw r30, r18 f2f6: e2 5b subi r30, 0xB2 ; 178 f2f8: 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) ; f2fa: a1 91 ld r26, Z+ f2fc: 9f 01 movw r18, r30 f2fe: 2b 54 subi r18, 0x4B ; 75 f300: 30 41 sbci r19, 0x10 ; 16 f302: a1 11 cpse r26, r1 f304: fa cf rjmp .-12 ; 0xf2fa f306: f9 01 movw r30, r18 f308: e5 5b subi r30, 0xB5 ; 181 f30a: 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) ; f30c: 2d 3e cpi r18, 0xED ; 237 f30e: a1 e0 ldi r26, 0x01 ; 1 f310: 3a 07 cpc r19, r26 f312: 30 f4 brcc .+12 ; 0xf320 f314: a1 91 ld r26, Z+ f316: a1 11 cpse r26, r1 f318: e0 cf rjmp .-64 ; 0xf2da f31a: 2f 5f subi r18, 0xFF ; 255 f31c: 3f 4f sbci r19, 0xFF ; 255 f31e: f6 cf rjmp .-20 ; 0xf30c // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { f320: 2d 3e cpi r18, 0xED ; 237 f322: e1 e0 ldi r30, 0x01 ; 1 f324: 3e 07 cpc r19, r30 f326: c9 f6 brne .-78 ; 0xf2da f328: eb e4 ldi r30, 0x4B ; 75 f32a: f0 e1 ldi r31, 0x10 ; 16 f32c: 9f 01 movw r18, r30 f32e: 2b 54 subi r18, 0x4B ; 75 f330: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; f332: a1 91 ld r26, Z+ f334: aa 23 and r26, r26 f336: d1 f3 breq .-12 ; 0xf32c f338: d0 cf rjmp .-96 ; 0xf2da } } return sdlen; } f33a: 08 95 ret 0000f33c : // 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) { f33c: 80 91 3c 12 lds r24, 0x123C ; 0x80123c f340: 90 91 3d 12 lds r25, 0x123D ; 0x80123d f344: 18 16 cp r1, r24 f346: 19 06 cpc r1, r25 f348: 0c f0 brlt .+2 ; 0xf34c f34a: 43 c0 rjmp .+134 ; 0xf3d2 SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { f34c: 01 97 sbiw r24, 0x01 ; 1 f34e: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d f352: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c f356: 89 2b or r24, r25 f358: a1 f4 brne .+40 ; 0xf382 // Empty buffer. if (serial_count == 0) f35a: 80 91 47 10 lds r24, 0x1047 ; 0x801047 f35e: 90 91 48 10 lds r25, 0x1048 ; 0x801048 f362: 89 2b or r24, r25 f364: 21 f4 brne .+8 ; 0xf36e // No serial communication is pending. Reset both pointers to zero. bufindw = 0; f366: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> f36a: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.512> bufindr = bufindw; f36e: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> f372: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> f376: 90 93 39 12 sts 0x1239, r25 ; 0x801239 f37a: 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; f37e: 81 e0 ldi r24, 0x01 ; 1 f380: 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) ; f382: 80 91 38 12 lds r24, 0x1238 ; 0x801238 f386: 90 91 39 12 lds r25, 0x1239 ; 0x801239 f38a: 03 96 adiw r24, 0x03 ; 3 f38c: fc 01 movw r30, r24 f38e: e5 5b subi r30, 0xB5 ; 181 f390: ff 4e sbci r31, 0xEF ; 239 f392: 20 81 ld r18, Z f394: 01 96 adiw r24, 0x01 ; 1 f396: 21 11 cpse r18, r1 f398: f9 cf rjmp .-14 ; 0xf38c f39a: fc 01 movw r30, r24 f39c: e5 5b subi r30, 0xB5 ; 181 f39e: 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) ; f3a0: 8d 3e cpi r24, 0xED ; 237 f3a2: 21 e0 ldi r18, 0x01 ; 1 f3a4: 92 07 cpc r25, r18 f3a6: 40 f4 brcc .+16 ; 0xf3b8 f3a8: 41 91 ld r20, Z+ f3aa: 9c 01 movw r18, r24 f3ac: 2f 5f subi r18, 0xFF ; 255 f3ae: 3f 4f sbci r19, 0xFF ; 255 f3b0: 41 11 cpse r20, r1 f3b2: e1 cf rjmp .-62 ; 0xf376 f3b4: c9 01 movw r24, r18 f3b6: f4 cf rjmp .-24 ; 0xf3a0 // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { f3b8: eb e4 ldi r30, 0x4B ; 75 f3ba: f0 e1 ldi r31, 0x10 ; 16 f3bc: 8d 3e cpi r24, 0xED ; 237 f3be: 21 e0 ldi r18, 0x01 ; 1 f3c0: 92 07 cpc r25, r18 f3c2: c9 f6 brne .-78 ; 0xf376 f3c4: cf 01 movw r24, r30 f3c6: 8b 54 subi r24, 0x4B ; 75 f3c8: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; f3ca: 21 91 ld r18, Z+ f3cc: 22 23 and r18, r18 f3ce: d1 f3 breq .-12 ; 0xf3c4 f3d0: d2 cf rjmp .-92 ; 0xf376 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; f3d2: 80 e0 ldi r24, 0x00 ; 0 } f3d4: 08 95 ret 0000f3d6 : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; f3d6: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) f3d8: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; f3da: 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; f3dc: db 01 movw r26, r22 f3de: 4d 91 ld r20, X+ f3e0: bd 01 movw r22, r26 f3e2: 40 32 cpi r20, 0x20 ; 32 f3e4: 49 f0 breq .+18 ; 0xf3f8 if (i == 8) f3e6: 28 30 cpi r18, 0x08 ; 8 f3e8: 11 f4 brne .+4 ; 0xf3ee { *pos++='.'; f3ea: 30 83 st Z, r19 f3ec: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; f3ee: db 01 movw r26, r22 f3f0: 11 97 sbiw r26, 0x01 ; 1 f3f2: 4c 91 ld r20, X f3f4: 40 83 st Z, r20 f3f6: 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++) f3f8: 2f 5f subi r18, 0xFF ; 255 f3fa: 2b 30 cpi r18, 0x0B ; 11 f3fc: 79 f7 brne .-34 ; 0xf3dc { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; f3fe: 10 82 st Z, r1 return buffer; } f400: 08 95 ret 0000f402 : 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);} f402: 40 e0 ldi r20, 0x00 ; 0 f404: 50 e0 ldi r21, 0x00 ; 0 f406: ba 01 movw r22, r20 f408: 0d 94 32 2a jmp 0x25464 ; 0x25464 0000f40c : 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();} f40c: fc 01 movw r30, r24 f40e: 23 81 ldd r18, Z+3 ; 0x03 f410: 21 11 cpse r18, r1 f412: 0d 94 10 2c jmp 0x25820 ; 0x25820 f416: 08 95 ret 0000f418 : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) f418: 90 91 1c 06 lds r25, 0x061C ; 0x80061c f41c: 91 11 cpse r25, r1 f41e: 07 c0 rjmp .+14 ; 0xf42e { while (!((M_UCSRxA) & (1 << M_UDREx))); f420: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> f424: 95 ff sbrs r25, 5 f426: fc cf rjmp .-8 ; 0xf420 M_UDRx = c; f428: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> f42c: 08 95 ret } else if (selectedSerialPort == 1) f42e: 91 30 cpi r25, 0x01 ; 1 f430: 31 f4 brne .+12 ; 0xf43e { while (!((UCSR1A) & (1 << UDRE1))); f432: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> f436: 95 ff sbrs r25, 5 f438: fc cf rjmp .-8 ; 0xf432 UDR1 = c; f43a: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } f43e: 08 95 ret 0000f440 : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { f440: 8f 92 push r8 f442: 9f 92 push r9 f444: af 92 push r10 f446: bf 92 push r11 f448: ef 92 push r14 f44a: ff 92 push r15 f44c: 0f 93 push r16 f44e: 1f 93 push r17 f450: cf 93 push r28 f452: df 93 push r29 f454: cd b7 in r28, 0x3d ; 61 f456: de b7 in r29, 0x3e ; 62 f458: a0 97 sbiw r28, 0x20 ; 32 f45a: 0f b6 in r0, 0x3f ; 63 f45c: f8 94 cli f45e: de bf out 0x3e, r29 ; 62 f460: 0f be out 0x3f, r0 ; 63 f462: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { f464: 61 15 cp r22, r1 f466: 71 05 cpc r23, r1 f468: 81 05 cpc r24, r1 f46a: 91 05 cpc r25, r1 f46c: 99 f4 brne .+38 ; 0xf494 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f46e: 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)); } f470: a0 96 adiw r28, 0x20 ; 32 f472: 0f b6 in r0, 0x3f ; 63 f474: f8 94 cli f476: de bf out 0x3e, r29 ; 62 f478: 0f be out 0x3f, r0 ; 63 f47a: cd bf out 0x3d, r28 ; 61 f47c: df 91 pop r29 f47e: cf 91 pop r28 f480: 1f 91 pop r17 f482: 0f 91 pop r16 f484: ff 90 pop r15 f486: ef 90 pop r14 f488: bf 90 pop r11 f48a: af 90 pop r10 f48c: 9f 90 pop r9 f48e: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f490: 0c 94 0c 7a jmp 0xf418 ; 0xf418 // 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; f494: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; f496: 84 2e mov r8, r20 f498: 91 2c mov r9, r1 f49a: b1 2c mov r11, r1 f49c: a1 2c mov r10, r1 f49e: 9e 01 movw r18, r28 f4a0: 2f 5f subi r18, 0xFF ; 255 f4a2: 3f 4f sbci r19, 0xFF ; 255 f4a4: 79 01 movw r14, r18 f4a6: a5 01 movw r20, r10 f4a8: 94 01 movw r18, r8 f4aa: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> f4ae: f7 01 movw r30, r14 f4b0: e0 0f add r30, r16 f4b2: f1 1d adc r31, r1 f4b4: 60 83 st Z, r22 n /= base; f4b6: b9 01 movw r22, r18 f4b8: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; f4ba: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { f4bc: 61 15 cp r22, r1 f4be: 71 05 cpc r23, r1 f4c0: 81 05 cpc r24, r1 f4c2: 91 05 cpc r25, r1 f4c4: 81 f7 brne .-32 ; 0xf4a6 f4c6: 0e 0d add r16, r14 f4c8: 1f 2d mov r17, r15 f4ca: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) f4cc: e0 16 cp r14, r16 f4ce: f1 06 cpc r15, r17 f4d0: 59 f0 breq .+22 ; 0xf4e8 print((char) (buf[i - 1] < 10 ? f4d2: f8 01 movw r30, r16 f4d4: 82 91 ld r24, -Z f4d6: 8f 01 movw r16, r30 f4d8: 8a 30 cpi r24, 0x0A ; 10 f4da: 20 f4 brcc .+8 ; 0xf4e4 '0' + buf[i - 1] : f4dc: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f4de: 0e 94 0c 7a call 0xf418 ; 0xf418 f4e2: f4 cf rjmp .-24 ; 0xf4cc } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); f4e4: 89 5c subi r24, 0xC9 ; 201 f4e6: fb cf rjmp .-10 ; 0xf4de } f4e8: a0 96 adiw r28, 0x20 ; 32 f4ea: 0f b6 in r0, 0x3f ; 63 f4ec: f8 94 cli f4ee: de bf out 0x3e, r29 ; 62 f4f0: 0f be out 0x3f, r0 ; 63 f4f2: cd bf out 0x3d, r28 ; 61 f4f4: df 91 pop r29 f4f6: cf 91 pop r28 f4f8: 1f 91 pop r17 f4fa: 0f 91 pop r16 f4fc: ff 90 pop r15 f4fe: ef 90 pop r14 f500: bf 90 pop r11 f502: af 90 pop r10 f504: 9f 90 pop r9 f506: 8f 90 pop r8 f508: 08 95 ret 0000f50a : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) f50a: cf 92 push r12 f50c: df 92 push r13 f50e: ef 92 push r14 f510: ff 92 push r15 f512: 6b 01 movw r12, r22 f514: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { f516: f7 fe sbrs r15, 7 f518: 0b c0 rjmp .+22 ; 0xf530 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f51a: 8d e2 ldi r24, 0x2D ; 45 f51c: 0e 94 0c 7a call 0xf418 ; 0xf418 } else if (base == 10) { if (n < 0) { print('-'); n = -n; f520: f0 94 com r15 f522: e0 94 com r14 f524: d0 94 com r13 f526: c0 94 com r12 f528: c1 1c adc r12, r1 f52a: d1 1c adc r13, r1 f52c: e1 1c adc r14, r1 f52e: f1 1c adc r15, r1 } printNumber(n, 10); f530: 4a e0 ldi r20, 0x0A ; 10 f532: c7 01 movw r24, r14 f534: b6 01 movw r22, r12 } else { printNumber(n, base); } } f536: ff 90 pop r15 f538: ef 90 pop r14 f53a: df 90 pop r13 f53c: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); f53e: 0c 94 20 7a jmp 0xf440 ; 0xf440 0000f542 : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { f542: 8f 92 push r8 f544: 9f 92 push r9 f546: af 92 push r10 f548: bf 92 push r11 f54a: cf 92 push r12 f54c: df 92 push r13 f54e: ef 92 push r14 f550: ff 92 push r15 f552: cf 93 push r28 f554: 6b 01 movw r12, r22 f556: 7c 01 movw r14, r24 f558: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) f55a: 20 e0 ldi r18, 0x00 ; 0 f55c: 30 e0 ldi r19, 0x00 ; 0 f55e: a9 01 movw r20, r18 f560: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> f564: 87 ff sbrs r24, 7 f566: 07 c0 rjmp .+14 ; 0xf576 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f568: 8d e2 ldi r24, 0x2D ; 45 f56a: 0e 94 0c 7a call 0xf418 ; 0xf418 { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; f56e: f7 fa bst r15, 7 f570: f0 94 com r15 f572: f7 f8 bld r15, 7 f574: 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; f584: 20 e0 ldi r18, 0x00 ; 0 f586: 30 e0 ldi r19, 0x00 ; 0 f588: 40 e2 ldi r20, 0x20 ; 32 f58a: 51 e4 ldi r21, 0x41 ; 65 f58c: 0f 94 65 a6 call 0x34cca ; 0x34cca <__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; f594: 9b 01 movw r18, r22 f596: ac 01 movw r20, r24 f598: c7 01 movw r24, r14 f59a: b6 01 movw r22, r12 f59c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> f5a0: 6b 01 movw r12, r22 f5a2: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; f5a4: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> f5a8: 4b 01 movw r8, r22 f5aa: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); f5ac: 4a e0 ldi r20, 0x0A ; 10 f5ae: 0e 94 20 7a call 0xf440 ; 0xf440 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) f5b2: cc 23 and r28, r28 f5b4: 91 f1 breq .+100 ; 0xf61a 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; f5b6: c5 01 movw r24, r10 f5b8: b4 01 movw r22, r8 f5ba: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> f5be: 9b 01 movw r18, r22 f5c0: ac 01 movw r20, r24 f5c2: c7 01 movw r24, r14 f5c4: b6 01 movw r22, r12 f5c6: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> f5ca: 6b 01 movw r12, r22 f5cc: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f5ce: 8e e2 ldi r24, 0x2E ; 46 f5d0: 0e 94 0c 7a call 0xf418 ; 0xf418 // 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) f5d4: c1 50 subi r28, 0x01 ; 1 f5d6: 08 f1 brcs .+66 ; 0xf61a { remainder *= 10.0; f5d8: 20 e0 ldi r18, 0x00 ; 0 f5da: 30 e0 ldi r19, 0x00 ; 0 f5dc: 40 e2 ldi r20, 0x20 ; 32 f5de: 51 e4 ldi r21, 0x41 ; 65 f5e0: c7 01 movw r24, r14 f5e2: b6 01 movw r22, r12 f5e4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> f5e8: 4b 01 movw r8, r22 f5ea: 5c 01 movw r10, r24 int toPrint = int(remainder); f5ec: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f5f0: 6b 01 movw r12, r22 f5f2: 77 0f add r23, r23 f5f4: ee 08 sbc r14, r14 f5f6: ff 08 sbc r15, r15 f5f8: c7 01 movw r24, r14 f5fa: b6 01 movw r22, r12 f5fc: 0e 94 85 7a call 0xf50a ; 0xf50a while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; f600: c7 01 movw r24, r14 f602: b6 01 movw r22, r12 f604: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> f608: 9b 01 movw r18, r22 f60a: ac 01 movw r20, r24 f60c: c5 01 movw r24, r10 f60e: b4 01 movw r22, r8 f610: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> f614: 6b 01 movw r12, r22 f616: 7c 01 movw r14, r24 f618: dd cf rjmp .-70 ; 0xf5d4 } } f61a: cf 91 pop r28 f61c: ff 90 pop r15 f61e: ef 90 pop r14 f620: df 90 pop r13 f622: cf 90 pop r12 f624: bf 90 pop r11 f626: af 90 pop r10 f628: 9f 90 pop r9 f62a: 8f 90 pop r8 f62c: 08 95 ret 0000f62e : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f62e: 8a e0 ldi r24, 0x0A ; 10 f630: 0c 94 0c 7a jmp 0xf418 ; 0xf418 0000f634 : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); f634: 0e 94 0c 7a call 0xf418 ; 0xf418 return 0; } f638: 90 e0 ldi r25, 0x00 ; 0 f63a: 80 e0 ldi r24, 0x00 ; 0 f63c: 08 95 ret 0000f63e : 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) { f63e: cf 93 push r28 f640: df 93 push r29 f642: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { f644: fe 01 movw r30, r28 f646: 84 91 lpm r24, Z f648: 88 23 and r24, r24 f64a: 21 f0 breq .+8 ; 0xf654 MYSERIAL.write((char)ch); f64c: 0e 94 0c 7a call 0xf418 ; 0xf418 ++str; f650: 21 96 adiw r28, 0x01 ; 1 f652: f8 cf rjmp .-16 ; 0xf644 } } f654: df 91 pop r29 f656: cf 91 pop r28 f658: 08 95 ret 0000f65a : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { f65a: cf 92 push r12 f65c: df 92 push r13 f65e: ef 92 push r14 f660: 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]; f662: c0 90 5a 0d lds r12, 0x0D5A ; 0x800d5a f666: d0 90 5b 0d lds r13, 0x0D5B ; 0x800d5b f66a: e0 90 5c 0d lds r14, 0x0D5C ; 0x800d5c f66e: f0 90 5d 0d lds r15, 0x0D5D ; 0x800d5d float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); f672: 83 e4 ldi r24, 0x43 ; 67 f674: 99 e7 ldi r25, 0x79 ; 121 f676: 0e 94 1f 7b call 0xf63e ; 0xf63e else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f67a: 42 e0 ldi r20, 0x02 ; 2 f67c: c7 01 movw r24, r14 f67e: b6 01 movw r22, r12 f680: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); f684: 8b e3 ldi r24, 0x3B ; 59 f686: 99 e7 ldi r25, 0x79 ; 121 f688: 0e 94 1f 7b call 0xf63e ; 0xf63e f68c: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc f690: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd f694: 80 91 be 03 lds r24, 0x03BE ; 0x8003be f698: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf f69c: 41 e0 ldi r20, 0x01 ; 1 f69e: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } f6a2: ff 90 pop r15 f6a4: ef 90 pop r14 f6a6: df 90 pop r13 f6a8: 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(); f6aa: 0c 94 17 7b jmp 0xf62e ; 0xf62e 0000f6ae : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { f6ae: 4f 92 push r4 f6b0: 5f 92 push r5 f6b2: 6f 92 push r6 f6b4: 7f 92 push r7 f6b6: 8f 92 push r8 f6b8: 9f 92 push r9 f6ba: af 92 push r10 f6bc: bf 92 push r11 f6be: cf 92 push r12 f6c0: df 92 push r13 f6c2: ef 92 push r14 f6c4: ff 92 push r15 f6c6: 0f 93 push r16 f6c8: 1f 93 push r17 f6ca: cf 93 push r28 f6cc: df 93 push r29 f6ce: cc 24 eor r12, r12 f6d0: ca 94 dec r12 f6d2: dc 2c mov r13, r12 f6d4: 76 01 movw r14, r12 f6d6: 0e ea ldi r16, 0xAE ; 174 f6d8: 1f e0 ldi r17, 0x0F ; 15 f6da: 93 e2 ldi r25, 0x23 ; 35 f6dc: 89 2e mov r8, r25 f6de: 91 2c mov r9, r1 f6e0: a1 2c mov r10, r1 f6e2: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; f6e4: 41 2c mov r4, r1 f6e6: 51 2c mov r5, r1 f6e8: 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; f6ea: d0 e0 ldi r29, 0x00 ; 0 f6ec: 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) { f6ee: 8f ef ldi r24, 0xFF ; 255 f6f0: c8 16 cp r12, r24 f6f2: 09 f4 brne .+2 ; 0xf6f6 f6f4: 5d c0 rjmp .+186 ; 0xf7b0 usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); f6f6: c8 01 movw r24, r16 f6f8: 0f 94 4c a4 call 0x34898 ; 0x34898 f6fc: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; f6fe: bc 01 movw r22, r24 f700: 99 0f add r25, r25 f702: 88 0b sbc r24, r24 f704: 99 0b sbc r25, r25 f706: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> f70a: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 f70e: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 f712: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 f716: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 f71a: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> f71e: 2b 01 movw r4, r22 f720: 3c 01 movw r6, r24 f722: c7 01 movw r24, r14 f724: b6 01 movw r22, r12 f726: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); f72a: 87 e9 ldi r24, 0x97 ; 151 f72c: 98 e7 ldi r25, 0x78 ; 120 f72e: 0e 94 1f 7b call 0xf63e ; 0xf63e f732: c5 01 movw r24, r10 f734: b4 01 movw r22, r8 f736: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); f73a: 87 e9 ldi r24, 0x97 ; 151 f73c: 98 e7 ldi r25, 0x78 ; 120 f73e: 0e 94 1f 7b call 0xf63e ; 0xf63e print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f742: be 01 movw r22, r28 f744: 0d 2e mov r0, r29 f746: 00 0c add r0, r0 f748: 88 0b sbc r24, r24 f74a: 99 0b sbc r25, r25 f74c: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); f750: 87 e9 ldi r24, 0x97 ; 151 f752: 98 e7 ldi r25, 0x78 ; 120 f754: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOLLN(mm * 1000); f758: 20 e0 ldi r18, 0x00 ; 0 f75a: 30 e0 ldi r19, 0x00 ; 0 f75c: 4a e7 ldi r20, 0x7A ; 122 f75e: 54 e4 ldi r21, 0x44 ; 68 f760: c3 01 movw r24, r6 f762: b2 01 movw r22, r4 f764: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> f768: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 f76c: 85 e0 ldi r24, 0x05 ; 5 f76e: 88 0e add r8, r24 f770: 91 1c adc r9, r1 f772: a1 1c adc r10, r1 f774: b1 1c adc r11, r1 f776: 0e 5f subi r16, 0xFE ; 254 f778: 1f 4f sbci r17, 0xFF ; 255 f77a: 8f ef ldi r24, 0xFF ; 255 f77c: c8 1a sub r12, r24 f77e: d8 0a sbc r13, r24 f780: e8 0a sbc r14, r24 f782: 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++) { f784: 0a 3b cpi r16, 0xBA ; 186 f786: 8f e0 ldi r24, 0x0F ; 15 f788: 18 07 cpc r17, r24 f78a: 09 f0 breq .+2 ; 0xf78e f78c: b0 cf rjmp .-160 ; 0xf6ee SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } f78e: df 91 pop r29 f790: cf 91 pop r28 f792: 1f 91 pop r17 f794: 0f 91 pop r16 f796: ff 90 pop r15 f798: ef 90 pop r14 f79a: df 90 pop r13 f79c: cf 90 pop r12 f79e: bf 90 pop r11 f7a0: af 90 pop r10 f7a2: 9f 90 pop r9 f7a4: 8f 90 pop r8 f7a6: 7f 90 pop r7 f7a8: 6f 90 pop r6 f7aa: 5f 90 pop r5 f7ac: 4f 90 pop r4 f7ae: 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); f7b0: 8c e7 ldi r24, 0x7C ; 124 f7b2: 98 e4 ldi r25, 0x48 ; 72 f7b4: 0e 94 1f 7b call 0xf63e ; 0xf63e f7b8: b8 cf rjmp .-144 ; 0xf72a 0000f7ba : /// @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) { f7ba: 88 23 and r24, r24 f7bc: 71 f1 breq .+92 ; 0xf81a currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); f7be: 8b e8 ldi r24, 0x8B ; 139 f7c0: 98 e7 ldi r25, 0x78 ; 120 f7c2: 0e 94 1f 7b call 0xf63e ; 0xf63e f7c6: 60 91 90 12 lds r22, 0x1290 ; 0x801290 f7ca: 70 e0 ldi r23, 0x00 ; 0 f7cc: 90 e0 ldi r25, 0x00 ; 0 f7ce: 80 e0 ldi r24, 0x00 ; 0 f7d0: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; f7d4: 80 91 90 12 lds r24, 0x1290 ; 0x801290 f7d8: 84 30 cpi r24, 0x04 ; 4 f7da: d8 f0 brcs .+54 ; 0xf812 f7dc: 10 92 90 12 sts 0x1290, r1 ; 0x801290 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); f7e0: 86 e8 ldi r24, 0x86 ; 134 f7e2: 98 e7 ldi r25, 0x78 ; 120 f7e4: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN((int)currentMMUSlot); f7e8: 80 91 90 12 lds r24, 0x1290 ; 0x801290 f7ec: 90 e0 ldi r25, 0x00 ; 0 f7ee: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a return currentMMUSlot; f7f2: 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; f7f6: 20 91 5b 12 lds r18, 0x125B ; 0x80125b f7fa: 30 91 5c 12 lds r19, 0x125C ; 0x80125c f7fe: 30 93 5e 12 sts 0x125E, r19 ; 0x80125e f802: 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); f806: 0e 94 96 fb call 0x1f72c ; 0x1f72c load_filament_final_feed(); // @@TODO verify f80a: 0e 94 48 64 call 0xc890 ; 0xc890 st_synchronize(); f80e: 0d 94 5b 18 jmp 0x230b6 ; 0x230b6 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; else currentMMUSlot++; f812: 8f 5f subi r24, 0xFF ; 255 f814: 80 93 90 12 sts 0x1290, r24 ; 0x801290 f818: e3 cf rjmp .-58 ; 0xf7e0 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); f81a: 84 e1 ldi r24, 0x14 ; 20 f81c: 9d e3 ldi r25, 0x3D ; 61 f81e: 0e 94 95 75 call 0xeb2a ; 0xeb2a f822: 70 e0 ldi r23, 0x00 ; 0 f824: 60 e0 ldi r22, 0x00 ; 0 f826: 0e 94 b3 cf call 0x19f66 ; 0x19f66 f82a: e5 cf rjmp .-54 ; 0xf7f6 0000f82c : return final_result; } void gcode_M114() { f82c: cf 93 push r28 f82e: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); f830: 83 e8 ldi r24, 0x83 ; 131 f832: 98 e7 ldi r25, 0x78 ; 120 f834: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOL(current_position[X_AXIS]); f838: c1 e6 ldi r28, 0x61 ; 97 f83a: d2 e1 ldi r29, 0x12 ; 18 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f83c: 68 81 ld r22, Y f83e: 79 81 ldd r23, Y+1 ; 0x01 f840: 8a 81 ldd r24, Y+2 ; 0x02 f842: 9b 81 ldd r25, Y+3 ; 0x03 f844: 42 e0 ldi r20, 0x02 ; 2 f846: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOLPGM(" Y:"); f84a: 8f e7 ldi r24, 0x7F ; 127 f84c: 98 e7 ldi r25, 0x78 ; 120 f84e: 0e 94 1f 7b call 0xf63e ; 0xf63e f852: 6c 81 ldd r22, Y+4 ; 0x04 f854: 7d 81 ldd r23, Y+5 ; 0x05 f856: 8e 81 ldd r24, Y+6 ; 0x06 f858: 9f 81 ldd r25, Y+7 ; 0x07 f85a: 42 e0 ldi r20, 0x02 ; 2 f85c: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); f860: 8b e7 ldi r24, 0x7B ; 123 f862: 98 e7 ldi r25, 0x78 ; 120 f864: 0e 94 1f 7b call 0xf63e ; 0xf63e f868: 68 85 ldd r22, Y+8 ; 0x08 f86a: 79 85 ldd r23, Y+9 ; 0x09 f86c: 8a 85 ldd r24, Y+10 ; 0x0a f86e: 9b 85 ldd r25, Y+11 ; 0x0b f870: 42 e0 ldi r20, 0x02 ; 2 f872: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); f876: 87 e7 ldi r24, 0x77 ; 119 f878: 98 e7 ldi r25, 0x78 ; 120 f87a: 0e 94 1f 7b call 0xf63e ; 0xf63e f87e: 6c 85 ldd r22, Y+12 ; 0x0c f880: 7d 85 ldd r23, Y+13 ; 0x0d f882: 8e 85 ldd r24, Y+14 ; 0x0e f884: 9f 85 ldd r25, Y+15 ; 0x0f f886: 42 e0 ldi r20, 0x02 ; 2 f888: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X f88c: 8b ed ldi r24, 0xDB ; 219 f88e: 94 e6 ldi r25, 0x64 ; 100 f890: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); f894: 80 e0 ldi r24, 0x00 ; 0 f896: 0f 94 39 18 call 0x23072 ; 0x23072 f89a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> f89e: c7 e6 ldi r28, 0x67 ; 103 f8a0: dd e0 ldi r29, 0x0D ; 13 f8a2: 2c 81 ldd r18, Y+4 ; 0x04 f8a4: 3d 81 ldd r19, Y+5 ; 0x05 f8a6: 4e 81 ldd r20, Y+6 ; 0x06 f8a8: 5f 81 ldd r21, Y+7 ; 0x07 f8aa: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> f8ae: 42 e0 ldi r20, 0x02 ; 2 f8b0: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOLPGM(" Y:"); f8b4: 83 e7 ldi r24, 0x73 ; 115 f8b6: 98 e7 ldi r25, 0x78 ; 120 f8b8: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f8bc: 81 e0 ldi r24, 0x01 ; 1 f8be: 0f 94 39 18 call 0x23072 ; 0x23072 f8c2: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> f8c6: 28 85 ldd r18, Y+8 ; 0x08 f8c8: 39 85 ldd r19, Y+9 ; 0x09 f8ca: 4a 85 ldd r20, Y+10 ; 0x0a f8cc: 5b 85 ldd r21, Y+11 ; 0x0b f8ce: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> f8d2: 42 e0 ldi r20, 0x02 ; 2 f8d4: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOLPGM(" Z:"); f8d8: 8f e6 ldi r24, 0x6F ; 111 f8da: 98 e7 ldi r25, 0x78 ; 120 f8dc: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f8e0: 82 e0 ldi r24, 0x02 ; 2 f8e2: 0f 94 39 18 call 0x23072 ; 0x23072 f8e6: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> f8ea: 2c 85 ldd r18, Y+12 ; 0x0c f8ec: 3d 85 ldd r19, Y+13 ; 0x0d f8ee: 4e 85 ldd r20, Y+14 ; 0x0e f8f0: 5f 85 ldd r21, Y+15 ; 0x0f f8f2: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> f8f6: 42 e0 ldi r20, 0x02 ; 2 f8f8: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOLPGM(" E:"); f8fc: 8b e6 ldi r24, 0x6B ; 107 f8fe: 98 e7 ldi r25, 0x78 ; 120 f900: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f904: 83 e0 ldi r24, 0x03 ; 3 f906: 0f 94 39 18 call 0x23072 ; 0x23072 f90a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> f90e: 28 89 ldd r18, Y+16 ; 0x10 f910: 39 89 ldd r19, Y+17 ; 0x11 f912: 4a 89 ldd r20, Y+18 ; 0x12 f914: 5b 89 ldd r21, Y+19 ; 0x13 f916: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> } f91a: df 91 pop r29 f91c: 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]); f91e: 0d 94 18 65 jmp 0x2ca30 ; 0x2ca30 0000f922 : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f922: 8a e7 ldi r24, 0x7A ; 122 f924: 97 e7 ldi r25, 0x77 ; 119 f926: 0e 94 1f 7b call 0xf63e ; 0xf63e f92a: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a f92e: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b f932: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c f936: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d f93a: 41 e0 ldi r20, 0x01 ; 1 f93c: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f940: 87 e7 ldi r24, 0x77 ; 119 f942: 97 e7 ldi r25, 0x77 ; 119 f944: 0e 94 1f 7b call 0xf63e ; 0xf63e return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f948: 60 91 5d 12 lds r22, 0x125D ; 0x80125d f94c: 70 91 5e 12 lds r23, 0x125E ; 0x80125e f950: 07 2e mov r0, r23 f952: 00 0c add r0, r0 f954: 88 0b sbc r24, r24 f956: 99 0b sbc r25, r25 f958: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> f95c: 41 e0 ldi r20, 0x01 ; 1 f95e: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f962: 83 e7 ldi r24, 0x73 ; 115 f964: 97 e7 ldi r25, 0x77 ; 119 f966: 0e 94 1f 7b call 0xf63e ; 0xf63e f96a: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc f96e: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd f972: 80 91 be 03 lds r24, 0x03BE ; 0x8003be f976: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf f97a: 41 e0 ldi r20, 0x01 ; 1 f97c: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f980: 80 e7 ldi r24, 0x70 ; 112 f982: 97 e7 ldi r25, 0x77 ; 119 f984: 0e 94 1f 7b call 0xf63e ; 0xf63e }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f988: 60 91 59 12 lds r22, 0x1259 ; 0x801259 f98c: 70 91 5a 12 lds r23, 0x125A ; 0x80125a f990: 07 2e mov r0, r23 f992: 00 0c add r0, r0 f994: 88 0b sbc r24, r24 f996: 99 0b sbc r25, r25 f998: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> f99c: 41 e0 ldi r20, 0x01 ; 1 f99e: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f9a2: 8b e6 ldi r24, 0x6B ; 107 f9a4: 97 e7 ldi r25, 0x77 ; 119 f9a6: 0e 94 1f 7b call 0xf63e ; 0xf63e f9aa: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a f9ae: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b f9b2: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c f9b6: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d f9ba: 41 e0 ldi r20, 0x01 ; 1 f9bc: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f9c0: 88 e6 ldi r24, 0x68 ; 104 f9c2: 97 e7 ldi r25, 0x77 ; 119 f9c4: 0e 94 1f 7b call 0xf63e ; 0xf63e return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f9c8: 60 91 5d 12 lds r22, 0x125D ; 0x80125d f9cc: 70 91 5e 12 lds r23, 0x125E ; 0x80125e f9d0: 07 2e mov r0, r23 f9d2: 00 0c add r0, r0 f9d4: 88 0b sbc r24, r24 f9d6: 99 0b sbc r25, r25 f9d8: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> f9dc: 41 e0 ldi r20, 0x01 ; 1 f9de: 0e 94 a1 7a call 0xf542 ; 0xf542 #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f9e2: 84 e6 ldi r24, 0x64 ; 100 f9e4: 97 e7 ldi r25, 0x77 ; 119 f9e6: 0e 94 1f 7b call 0xf63e ; 0xf63e print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f9ea: 60 91 f5 05 lds r22, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.502> f9ee: 70 e0 ldi r23, 0x00 ; 0 f9f0: 90 e0 ldi r25, 0x00 ; 0 f9f2: 80 e0 ldi r24, 0x00 ; 0 f9f4: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f9f8: 8f e5 ldi r24, 0x5F ; 95 f9fa: 97 e7 ldi r25, 0x77 ; 119 f9fc: 0e 94 1f 7b call 0xf63e ; 0xf63e fa00: 60 91 ee 05 lds r22, 0x05EE ; 0x8005ee fa04: 70 e0 ldi r23, 0x00 ; 0 fa06: 90 e0 ldi r25, 0x00 ; 0 fa08: 80 e0 ldi r24, 0x00 ; 0 fa0a: 0e 94 85 7a call 0xf50a ; 0xf50a #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); fa0e: 8b e5 ldi r24, 0x5B ; 91 fa10: 97 e7 ldi r25, 0x77 ; 119 fa12: 0e 94 1f 7b call 0xf63e ; 0xf63e else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); fa16: 60 91 85 03 lds r22, 0x0385 ; 0x800385 fa1a: 70 91 86 03 lds r23, 0x0386 ; 0x800386 fa1e: 80 91 87 03 lds r24, 0x0387 ; 0x800387 fa22: 90 91 88 03 lds r25, 0x0388 ; 0x800388 fa26: 41 e0 ldi r20, 0x01 ; 1 fa28: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); fa2c: 0c 94 17 7b jmp 0xf62e ; 0xf62e 0000fa30 : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); fa30: 0e 94 1f 7b call 0xf63e ; 0xf63e MYSERIAL.println(); fa34: 0c 94 17 7b jmp 0xf62e ; 0xf62e 0000fa38 : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { fa38: 8f 92 push r8 fa3a: 9f 92 push r9 fa3c: af 92 push r10 fa3e: bf 92 push r11 fa40: cf 92 push r12 fa42: df 92 push r13 fa44: ef 92 push r14 fa46: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); fa48: 0f 94 01 0b call 0x21602 ; 0x21602 fa4c: 6b 01 movw r12, r22 fa4e: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { fa50: 20 91 32 02 lds r18, 0x0232 ; 0x800232 fa54: 22 23 and r18, r18 fa56: 09 f1 breq .+66 ; 0xfa9a fa58: 40 91 78 02 lds r20, 0x0278 ; 0x800278 fa5c: 41 30 cpi r20, 0x01 ; 1 fa5e: e9 f0 breq .+58 ; 0xfa9a if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; fa60: 80 91 14 02 lds r24, 0x0214 ; 0x800214 fa64: 90 91 15 02 lds r25, 0x0215 ; 0x800215 fa68: a0 91 16 02 lds r26, 0x0216 ; 0x800216 fa6c: b0 91 17 02 lds r27, 0x0217 ; 0x800217 fa70: 46 01 movw r8, r12 fa72: 57 01 movw r10, r14 fa74: 88 1a sub r8, r24 fa76: 99 0a sbc r9, r25 fa78: aa 0a sbc r10, r26 fa7a: bb 0a sbc r11, r27 fa7c: 30 e0 ldi r19, 0x00 ; 0 fa7e: a8 ee ldi r26, 0xE8 ; 232 fa80: b3 e0 ldi r27, 0x03 ; 3 fa82: 0f 94 de a4 call 0x349bc ; 0x349bc <__umulhisi3> fa86: 86 16 cp r8, r22 fa88: 97 06 cpc r9, r23 fa8a: a8 06 cpc r10, r24 fa8c: b9 06 cpc r11, r25 fa8e: 6c f0 brlt .+26 ; 0xfaaa switch (busy_state) { fa90: 44 30 cpi r20, 0x04 ; 4 fa92: 31 f1 breq .+76 ; 0xfae0 fa94: 9c f4 brge .+38 ; 0xfabc fa96: 42 30 cpi r20, 0x02 ; 2 fa98: d4 f4 brge .+52 ; 0xface break; default: break; } } prev_busy_signal_ms = ms; fa9a: c0 92 14 02 sts 0x0214, r12 ; 0x800214 fa9e: d0 92 15 02 sts 0x0215, r13 ; 0x800215 faa2: e0 92 16 02 sts 0x0216, r14 ; 0x800216 faa6: f0 92 17 02 sts 0x0217, r15 ; 0x800217 } faaa: ff 90 pop r15 faac: ef 90 pop r14 faae: df 90 pop r13 fab0: cf 90 pop r12 fab2: bf 90 pop r11 fab4: af 90 pop r10 fab6: 9f 90 pop r9 fab8: 8f 90 pop r8 faba: 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) { fabc: 45 30 cpi r20, 0x05 ; 5 fabe: 69 f7 brne .-38 ; 0xfa9a case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; fac0: 84 ee ldi r24, 0xE4 ; 228 fac2: 92 ea ldi r25, 0xA2 ; 162 fac4: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNPGM("busy: paused for input"); fac8: 86 e4 ldi r24, 0x46 ; 70 faca: 99 e7 ldi r25, 0x79 ; 121 facc: 06 c0 rjmp .+12 ; 0xfada 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; face: 84 ee ldi r24, 0xE4 ; 228 fad0: 92 ea ldi r25, 0xA2 ; 162 fad2: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNPGM("busy: processing"); fad6: 83 e7 ldi r24, 0x73 ; 115 fad8: 99 e7 ldi r25, 0x79 ; 121 SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for input"); fada: 0e 94 18 7d call 0xfa30 ; 0xfa30 fade: dd cf rjmp .-70 ; 0xfa9a case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; fae0: 84 ee ldi r24, 0xE4 ; 228 fae2: 92 ea ldi r25, 0xA2 ; 162 fae4: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNPGM("busy: paused for user"); fae8: 8d e5 ldi r24, 0x5D ; 93 faea: 99 e7 ldi r25, 0x79 ; 121 faec: f6 cf rjmp .-20 ; 0xfada 0000faee : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { faee: 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))); faf0: 81 ea ldi r24, 0xA1 ; 161 faf2: 9d e0 ldi r25, 0x0D ; 13 faf4: 0f 94 3e a4 call 0x3487c ; 0x3487c } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> faf8: cb e0 ldi r28, 0x0B ; 11 fafa: 8c 9f mul r24, r28 fafc: c0 01 movw r24, r0 fafe: 11 24 eor r1, r1 fb00: 80 5b subi r24, 0xB0 ; 176 fb02: 92 4f sbci r25, 0xF2 ; 242 fb04: 0f 94 4c a4 call 0x34898 ; 0x34898 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { fb08: 81 56 subi r24, 0x61 ; 97 fb0a: 90 4f sbci r25, 0xF0 ; 240 fb0c: 80 3a cpi r24, 0xA0 ; 160 fb0e: 9f 40 sbci r25, 0x0F ; 15 fb10: c8 f0 brcs .+50 ; 0xfb44 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"); fb12: 82 e1 ldi r24, 0x12 ; 18 fb14: 99 e7 ldi r25, 0x79 ; 121 fb16: 0e 94 18 7d call 0xfa30 ; 0xfa30 eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), fb1a: 81 ea ldi r24, 0xA1 ; 161 fb1c: 9d e0 ldi r25, 0x0D ; 13 fb1e: 0f 94 3e a4 call 0x3487c ; 0x3487c 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-> fb22: 8c 9f mul r24, r28 fb24: c0 01 movw r24, r0 fb26: 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); fb28: 70 e0 ldi r23, 0x00 ; 0 fb2a: 60 e0 ldi r22, 0x00 ; 0 fb2c: 80 5b subi r24, 0xB0 ; 176 fb2e: 92 4f sbci r25, 0xF2 ; 242 fb30: 0f 94 9c a4 call 0x34938 ; 0x34938 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.")); fb34: 85 ed ldi r24, 0xD5 ; 213 fb36: 98 e7 ldi r25, 0x78 ; 120 fb38: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 lcd_update_enable(true); fb3c: 81 e0 ldi r24, 0x01 ; 1 } } fb3e: 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); fb40: 0c 94 93 70 jmp 0xe126 ; 0xe126 } } fb44: cf 91 pop r28 fb46: 08 95 ret 0000fb48 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { fb48: 2f 92 push r2 fb4a: 3f 92 push r3 fb4c: 4f 92 push r4 fb4e: 5f 92 push r5 fb50: 6f 92 push r6 fb52: 7f 92 push r7 fb54: 8f 92 push r8 fb56: 9f 92 push r9 fb58: af 92 push r10 fb5a: bf 92 push r11 fb5c: cf 92 push r12 fb5e: df 92 push r13 fb60: ef 92 push r14 fb62: ff 92 push r15 fb64: 0f 93 push r16 fb66: 1f 93 push r17 fb68: cf 93 push r28 fb6a: df 93 push r29 fb6c: cd b7 in r28, 0x3d ; 61 fb6e: de b7 in r29, 0x3e ; 62 fb70: a4 97 sbiw r28, 0x24 ; 36 fb72: 0f b6 in r0, 0x3f ; 63 fb74: f8 94 cli fb76: de bf out 0x3e, r29 ; 62 fb78: 0f be out 0x3f, r0 ; 63 fb7a: 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(); fb7c: 0f 94 5b 18 call 0x230b6 ; 0x230b6 if (planner_aborted) fb80: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 fb84: 81 11 cpse r24, r1 fb86: 17 c0 rjmp .+46 ; 0xfbb6 return; mesh_bed_leveling_flag = true; fb88: 81 e0 ldi r24, 0x01 ; 1 fb8a: 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])) { fb8e: 80 91 39 06 lds r24, 0x0639 ; 0x800639 fb92: 88 23 and r24, r24 fb94: 49 f0 breq .+18 ; 0xfba8 fb96: 80 91 3a 06 lds r24, 0x063A ; 0x80063a fb9a: 88 23 and r24, r24 fb9c: 29 f0 breq .+10 ; 0xfba8 fb9e: 20 91 3b 06 lds r18, 0x063B ; 0x80063b fba2: 2f 83 std Y+7, r18 ; 0x07 fba4: 21 11 cpse r18, r1 fba6: 20 c0 rjmp .+64 ; 0xfbe8 // 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; fba8: 81 e0 ldi r24, 0x01 ; 1 fbaa: 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); fbae: 81 e7 ldi r24, 0x71 ; 113 fbb0: 99 e6 ldi r25, 0x69 ; 105 fbb2: 0f 94 e7 66 call 0x2cdce ; 0x2cdce custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } fbb6: a4 96 adiw r28, 0x24 ; 36 fbb8: 0f b6 in r0, 0x3f ; 63 fbba: f8 94 cli fbbc: de bf out 0x3e, r29 ; 62 fbbe: 0f be out 0x3f, r0 ; 63 fbc0: cd bf out 0x3d, r28 ; 61 fbc2: df 91 pop r29 fbc4: cf 91 pop r28 fbc6: 1f 91 pop r17 fbc8: 0f 91 pop r16 fbca: ff 90 pop r15 fbcc: ef 90 pop r14 fbce: df 90 pop r13 fbd0: cf 90 pop r12 fbd2: bf 90 pop r11 fbd4: af 90 pop r10 fbd6: 9f 90 pop r9 fbd8: 8f 90 pop r8 fbda: 7f 90 pop r7 fbdc: 6f 90 pop r6 fbde: 5f 90 pop r5 fbe0: 4f 90 pop r4 fbe2: 3f 90 pop r3 fbe4: 2f 90 pop r2 fbe6: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); fbe8: 8b ea ldi r24, 0xAB ; 171 fbea: 9d e0 ldi r25, 0x0D ; 13 fbec: 0f 94 3e a4 call 0x3487c ; 0x3487c fbf0: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) fbf2: 8e e4 ldi r24, 0x4E ; 78 fbf4: 0e 94 80 56 call 0xad00 ; 0xad00 fbf8: 08 2f mov r16, r24 fbfa: 0e 94 95 56 call 0xad2a ; 0xad2a fbfe: 8e 83 std Y+6, r24 ; 0x06 fc00: 00 23 and r16, r16 fc02: 29 f0 breq .+10 ; 0xfc0e fc04: 87 30 cpi r24, 0x07 ; 7 fc06: 09 f4 brne .+2 ; 0xfc0a fc08: c9 c0 rjmp .+402 ; 0xfd9c fc0a: 83 30 cpi r24, 0x03 ; 3 fc0c: 29 f0 breq .+10 ; 0xfc18 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; fc0e: 13 30 cpi r17, 0x03 ; 3 fc10: 09 f0 breq .+2 ; 0xfc14 fc12: c3 c0 rjmp .+390 ; 0xfd9a fc14: 63 e0 ldi r22, 0x03 ; 3 fc16: 6e 83 std Y+6, r22 ; 0x06 fc18: 80 e0 ldi r24, 0x00 ; 0 fc1a: 90 e0 ldi r25, 0x00 ; 0 fc1c: a0 e8 ldi r26, 0x80 ; 128 fc1e: bf e3 ldi r27, 0x3F ; 63 fc20: 8a 83 std Y+2, r24 ; 0x02 fc22: 9b 83 std Y+3, r25 ; 0x03 fc24: ac 83 std Y+4, r26 ; 0x04 fc26: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); fc28: 8a ea ldi r24, 0xAA ; 170 fc2a: 9d e0 ldi r25, 0x0D ; 13 fc2c: 0f 94 3e a4 call 0x3487c ; 0x3487c fc30: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) fc32: 83 e4 ldi r24, 0x43 ; 67 fc34: 0e 94 80 56 call 0xad00 ; 0xad00 fc38: 18 2f mov r17, r24 fc3a: 0e 94 95 56 call 0xad2a ; 0xad2a fc3e: 11 23 and r17, r17 fc40: 29 f0 breq .+10 ; 0xfc4c fc42: 88 23 and r24, r24 fc44: 19 f0 breq .+6 ; 0xfc4c fc46: 8b 30 cpi r24, 0x0B ; 11 fc48: 08 f4 brcc .+2 ; 0xfc4c fc4a: 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; fc4c: 88 e5 ldi r24, 0x58 ; 88 fc4e: 0e 94 80 56 call 0xad00 ; 0xad00 fc52: 88 23 and r24, r24 fc54: 09 f4 brne .+2 ; 0xfc58 fc56: ab c0 rjmp .+342 ; 0xfdae fc58: 0e 94 10 5b call 0xb620 ; 0xb620 fc5c: 20 e0 ldi r18, 0x00 ; 0 fc5e: 30 e0 ldi r19, 0x00 ; 0 fc60: 48 e0 ldi r20, 0x08 ; 8 fc62: 52 e4 ldi r21, 0x42 ; 66 fc64: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> fc68: 20 e0 ldi r18, 0x00 ; 0 fc6a: 30 e0 ldi r19, 0x00 ; 0 fc6c: 48 eb ldi r20, 0xB8 ; 184 fc6e: 51 e4 ldi r21, 0x41 ; 65 fc70: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> fc74: 6a 87 std Y+10, r22 ; 0x0a fc76: 7b 87 std Y+11, r23 ; 0x0b fc78: 8c 87 std Y+12, r24 ; 0x0c fc7a: 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; fc7c: 89 e5 ldi r24, 0x59 ; 89 fc7e: 0e 94 80 56 call 0xad00 ; 0xad00 fc82: 88 23 and r24, r24 fc84: 09 f4 brne .+2 ; 0xfc88 fc86: 9c c0 rjmp .+312 ; 0xfdc0 fc88: 0e 94 10 5b call 0xb620 ; 0xb620 fc8c: 20 e0 ldi r18, 0x00 ; 0 fc8e: 30 e0 ldi r19, 0x00 ; 0 fc90: 48 e0 ldi r20, 0x08 ; 8 fc92: 52 e4 ldi r21, 0x42 ; 66 fc94: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> fc98: 20 e0 ldi r18, 0x00 ; 0 fc9a: 30 e0 ldi r19, 0x00 ; 0 fc9c: 40 ea ldi r20, 0xA0 ; 160 fc9e: 50 e4 ldi r21, 0x40 ; 64 fca0: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> fca4: 6c 8b std Y+20, r22 ; 0x14 fca6: 7d 8b std Y+21, r23 ; 0x15 fca8: 8e 8b std Y+22, r24 ; 0x16 fcaa: 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; fcac: 87 e5 ldi r24, 0x57 ; 87 fcae: 0e 94 80 56 call 0xad00 ; 0xad00 fcb2: 88 23 and r24, r24 fcb4: 09 f4 brne .+2 ; 0xfcb8 fcb6: 89 c0 rjmp .+274 ; 0xfdca fcb8: 0e 94 10 5b call 0xb620 ; 0xb620 fcbc: 2a 85 ldd r18, Y+10 ; 0x0a fcbe: 3b 85 ldd r19, Y+11 ; 0x0b fcc0: 4c 85 ldd r20, Y+12 ; 0x0c fcc2: 5d 85 ldd r21, Y+13 ; 0x0d fcc4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> fcc8: 20 e0 ldi r18, 0x00 ; 0 fcca: 30 e0 ldi r19, 0x00 ; 0 fccc: 48 e8 ldi r20, 0x88 ; 136 fcce: 52 e4 ldi r21, 0x42 ; 66 fcd0: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> fcd4: 69 8f std Y+25, r22 ; 0x19 fcd6: 7a 8f std Y+26, r23 ; 0x1a fcd8: 8b 8f std Y+27, r24 ; 0x1b fcda: 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; fcdc: 88 e4 ldi r24, 0x48 ; 72 fcde: 0e 94 80 56 call 0xad00 ; 0xad00 fce2: 88 23 and r24, r24 fce4: 09 f4 brne .+2 ; 0xfce8 fce6: 7a c0 rjmp .+244 ; 0xfddc fce8: 0e 94 10 5b call 0xb620 ; 0xb620 fcec: 2c 89 ldd r18, Y+20 ; 0x14 fcee: 3d 89 ldd r19, Y+21 ; 0x15 fcf0: 4e 89 ldd r20, Y+22 ; 0x16 fcf2: 5f 89 ldd r21, Y+23 ; 0x17 fcf4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> fcf8: 20 e0 ldi r18, 0x00 ; 0 fcfa: 30 e0 ldi r19, 0x00 ; 0 fcfc: 48 e8 ldi r20, 0x88 ; 136 fcfe: 52 e4 ldi r21, 0x42 ; 66 fd00: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> fd04: 6d 8f std Y+29, r22 ; 0x1d fd06: 7e 8f std Y+30, r23 ; 0x1e fd08: 8f 8f std Y+31, r24 ; 0x1f fd0a: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling fd0c: 0f 94 41 7c call 0x2f882 ; 0x2f882 mbl.z_values[0][0] = min_pos[Z_AXIS]; fd10: 80 91 2c 02 lds r24, 0x022C ; 0x80022c fd14: 90 91 2d 02 lds r25, 0x022D ; 0x80022d fd18: a0 91 2e 02 lds r26, 0x022E ; 0x80022e fd1c: b0 91 2f 02 lds r27, 0x022F ; 0x80022f fd20: 80 93 0a 13 sts 0x130A, r24 ; 0x80130a fd24: 90 93 0b 13 sts 0x130B, r25 ; 0x80130b fd28: a0 93 0c 13 sts 0x130C, r26 ; 0x80130c fd2c: b0 93 0d 13 sts 0x130D, r27 ; 0x80130d // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); fd30: 0f 94 48 52 call 0x2a490 ; 0x2a490 fd34: 05 ec ldi r16, 0xC5 ; 197 fd36: 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) fd38: c8 01 movw r24, r16 fd3a: 0f 94 4c a4 call 0x34898 ; 0x34898 fd3e: 01 96 adiw r24, 0x01 ; 1 fd40: 09 f0 breq .+2 ; 0xfd44 fd42: 51 c0 rjmp .+162 ; 0xfde6 fd44: 0e 5f subi r16, 0xFE ; 254 fd46: 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) { fd48: 05 3d cpi r16, 0xD5 ; 213 fd4a: 8f e0 ldi r24, 0x0F ; 15 fd4c: 18 07 cpc r17, r24 fd4e: a1 f7 brne .-24 ; 0xfd38 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; fd50: 21 2c mov r2, r1 fd52: a9 e0 ldi r26, 0x09 ; 9 fd54: b3 e1 ldi r27, 0x13 ; 19 fd56: ba a3 std Y+34, r27 ; 0x22 fd58: 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; fd5a: b9 87 std Y+9, r27 ; 0x09 fd5c: a8 87 std Y+8, r26 ; 0x08 fd5e: 51 2c mov r5, r1 fd60: 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; fd62: 31 2c mov r3, r1 fd64: 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)); fd66: 84 2d mov r24, r4 fd68: 63 e0 ldi r22, 0x03 ; 3 fd6a: 0f 94 ed a4 call 0x349da ; 0x349da <__udivmodqi4> fd6e: 98 8b std Y+16, r25 ; 0x10 fd70: 68 84 ldd r6, Y+8 ; 0x08 fd72: 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++) { fd74: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); fd76: f8 89 ldd r31, Y+16 ; 0x10 fd78: f1 11 cpse r31, r1 fd7a: 37 c0 rjmp .+110 ; 0xfdea fd7c: 81 2f mov r24, r17 fd7e: 63 e0 ldi r22, 0x03 ; 3 fd80: 0f 94 ed a4 call 0x349da ; 0x349da <__udivmodqi4> fd84: 91 11 cpse r25, r1 fd86: 31 c0 rjmp .+98 ; 0xfdea if (isOn3x3Mesh) { if (has_z && (row || col)) { fd88: 21 10 cpse r2, r1 fd8a: 3f c1 rjmp .+638 ; 0x1000a } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { fd8c: 7e 81 ldd r23, Y+6 ; 0x06 fd8e: 73 30 cpi r23, 0x03 ; 3 fd90: 09 f4 brne .+2 ; 0xfd94 fd92: 70 c0 rjmp .+224 ; 0xfe74 fd94: 8f 81 ldd r24, Y+7 ; 0x07 fd96: 8e 87 std Y+14, r24 ; 0x0e fd98: 37 c0 rjmp .+110 ; 0xfe08 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; fd9a: 1e 83 std Y+6, r17 ; 0x06 fd9c: 6a e9 ldi r22, 0x9A ; 154 fd9e: 79 e9 ldi r23, 0x99 ; 153 fda0: 89 e1 ldi r24, 0x19 ; 25 fda2: 9f e3 ldi r25, 0x3F ; 63 fda4: 6a 83 std Y+2, r22 ; 0x02 fda6: 7b 83 std Y+3, r23 ; 0x03 fda8: 8c 83 std Y+4, r24 ; 0x04 fdaa: 9d 83 std Y+5, r25 ; 0x05 fdac: 3d cf rjmp .-390 ; 0xfc28 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; fdae: 80 e0 ldi r24, 0x00 ; 0 fdb0: 90 e0 ldi r25, 0x00 ; 0 fdb2: a0 e8 ldi r26, 0x80 ; 128 fdb4: bf ef ldi r27, 0xFF ; 255 fdb6: 8a 87 std Y+10, r24 ; 0x0a fdb8: 9b 87 std Y+11, r25 ; 0x0b fdba: ac 87 std Y+12, r26 ; 0x0c fdbc: bd 87 std Y+13, r27 ; 0x0d fdbe: 5e cf rjmp .-324 ; 0xfc7c const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; fdc0: 60 e0 ldi r22, 0x00 ; 0 fdc2: 70 e0 ldi r23, 0x00 ; 0 fdc4: 80 e8 ldi r24, 0x80 ; 128 fdc6: 9f ef ldi r25, 0xFF ; 255 fdc8: 6d cf rjmp .-294 ; 0xfca4 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; fdca: 80 e0 ldi r24, 0x00 ; 0 fdcc: 90 e0 ldi r25, 0x00 ; 0 fdce: a0 e8 ldi r26, 0x80 ; 128 fdd0: bf e7 ldi r27, 0x7F ; 127 fdd2: 89 8f std Y+25, r24 ; 0x19 fdd4: 9a 8f std Y+26, r25 ; 0x1a fdd6: ab 8f std Y+27, r26 ; 0x1b fdd8: bc 8f std Y+28, r27 ; 0x1c fdda: 80 cf rjmp .-256 ; 0xfcdc const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; fddc: 60 e0 ldi r22, 0x00 ; 0 fdde: 70 e0 ldi r23, 0x00 ; 0 fde0: 80 e8 ldi r24, 0x80 ; 128 fde2: 9f e7 ldi r25, 0x7F ; 127 fde4: 8f cf rjmp .-226 ; 0xfd04 fde6: 2f 80 ldd r2, Y+7 ; 0x07 fde8: b4 cf rjmp .-152 ; 0xfd52 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; } fdea: 60 e0 ldi r22, 0x00 ; 0 fdec: 70 e0 ldi r23, 0x00 ; 0 fdee: 80 ec ldi r24, 0xC0 ; 192 fdf0: 9f e7 ldi r25, 0x7F ; 127 fdf2: d3 01 movw r26, r6 fdf4: 11 96 adiw r26, 0x01 ; 1 fdf6: 6d 93 st X+, r22 fdf8: 7d 93 st X+, r23 fdfa: 8d 93 st X+, r24 fdfc: 9c 93 st X, r25 fdfe: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { fe00: be 81 ldd r27, Y+6 ; 0x06 fe02: b3 30 cpi r27, 0x03 ; 3 fe04: c1 f1 breq .+112 ; 0xfe76 fe06: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); fe08: 81 2f mov r24, r17 fe0a: 0e 94 3b 5f call 0xbe76 ; 0xbe76 fe0e: 4b 01 movw r8, r22 fe10: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); fe12: 80 2f mov r24, r16 fe14: 0e 94 3b 5f call 0xbe76 ; 0xbe76 fe18: 6b 01 movw r12, r22 fe1a: 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)) { fe1c: a5 01 movw r20, r10 fe1e: 94 01 movw r18, r8 fe20: 6a 85 ldd r22, Y+10 ; 0x0a fe22: 7b 85 ldd r23, Y+11 ; 0x0b fe24: 8c 85 ldd r24, Y+12 ; 0x0c fe26: 9d 85 ldd r25, Y+13 ; 0x0d fe28: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> fe2c: 18 16 cp r1, r24 fe2e: 0c f4 brge .+2 ; 0xfe32 fe30: 1c c1 rjmp .+568 ; 0x1006a fe32: 29 8d ldd r18, Y+25 ; 0x19 fe34: 3a 8d ldd r19, Y+26 ; 0x1a fe36: 4b 8d ldd r20, Y+27 ; 0x1b fe38: 5c 8d ldd r21, Y+28 ; 0x1c fe3a: c5 01 movw r24, r10 fe3c: b4 01 movw r22, r8 fe3e: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> fe42: 18 16 cp r1, r24 fe44: 0c f4 brge .+2 ; 0xfe48 fe46: 11 c1 rjmp .+546 ; 0x1006a fe48: a7 01 movw r20, r14 fe4a: 96 01 movw r18, r12 fe4c: 6c 89 ldd r22, Y+20 ; 0x14 fe4e: 7d 89 ldd r23, Y+21 ; 0x15 fe50: 8e 89 ldd r24, Y+22 ; 0x16 fe52: 9f 89 ldd r25, Y+23 ; 0x17 fe54: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> fe58: 18 16 cp r1, r24 fe5a: 0c f4 brge .+2 ; 0xfe5e fe5c: 06 c1 rjmp .+524 ; 0x1006a fe5e: 2d 8d ldd r18, Y+29 ; 0x1d fe60: 3e 8d ldd r19, Y+30 ; 0x1e fe62: 4f 8d ldd r20, Y+31 ; 0x1f fe64: 58 a1 ldd r21, Y+32 ; 0x20 fe66: c7 01 movw r24, r14 fe68: b6 01 movw r22, r12 fe6a: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> fe6e: 18 16 cp r1, r24 fe70: 0c f4 brge .+2 ; 0xfe74 fe72: fb c0 rjmp .+502 ; 0x1006a continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; fe74: 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++) { fe76: 1f 5f subi r17, 0xFF ; 255 fe78: 24 e0 ldi r18, 0x04 ; 4 fe7a: 62 0e add r6, r18 fe7c: 71 1c adc r7, r1 fe7e: 17 30 cpi r17, 0x07 ; 7 fe80: 09 f0 breq .+2 ; 0xfe84 fe82: 79 cf rjmp .-270 ; 0xfd76 fe84: 6f ef ldi r22, 0xFF ; 255 fe86: 46 1a sub r4, r22 fe88: 56 0a sbc r5, r22 fe8a: 88 85 ldd r24, Y+8 ; 0x08 fe8c: 99 85 ldd r25, Y+9 ; 0x09 fe8e: 4c 96 adiw r24, 0x1c ; 28 fe90: 99 87 std Y+9, r25 ; 0x09 fe92: 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++) { fe94: 97 e0 ldi r25, 0x07 ; 7 fe96: 49 16 cp r4, r25 fe98: 51 04 cpc r5, r1 fe9a: 09 f0 breq .+2 ; 0xfe9e fe9c: 63 cf rjmp .-314 ; 0xfd64 // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh fe9e: 0f 94 1b 93 call 0x32636 ; 0x32636 // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; fea2: a0 91 5d 06 lds r26, 0x065D ; 0x80065d fea6: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; fea8: b0 91 de 03 lds r27, 0x03DE ; 0x8003de feac: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; feae: 81 e0 ldi r24, 0x01 ; 1 feb0: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d custom_message_state = meshPointsToProbe + 10; feb4: 8a e0 ldi r24, 0x0A ; 10 feb6: 83 0d add r24, r3 feb8: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_update(1); febc: 81 e0 ldi r24, 0x01 ; 1 febe: 0e 94 54 6f call 0xdea8 ; 0xdea8 // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; fec2: 80 e0 ldi r24, 0x00 ; 0 fec4: 90 e0 ldi r25, 0x00 ; 0 fec6: a0 ea ldi r26, 0xA0 ; 160 fec8: b0 e4 ldi r27, 0x40 ; 64 feca: 80 93 69 12 sts 0x1269, r24 ; 0x801269 fece: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a fed2: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b fed6: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); feda: 65 e5 ldi r22, 0x55 ; 85 fedc: 75 e5 ldi r23, 0x55 ; 85 fede: 85 e5 ldi r24, 0x55 ; 85 fee0: 91 e4 ldi r25, 0x41 ; 65 fee2: 0f 94 a8 49 call 0x29350 ; 0x29350 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 fee6: 80 e0 ldi r24, 0x00 ; 0 fee8: 0e 94 c1 65 call 0xcb82 ; 0xcb82 feec: 9c a3 std Y+36, r25 ; 0x24 feee: 8b a3 std Y+35, r24 ; 0x23 fef0: 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 fef2: 83 2d mov r24, r3 fef4: 67 e0 ldi r22, 0x07 ; 7 fef6: 0f 94 ed a4 call 0x349da ; 0x349da <__udivmodqi4> fefa: f8 2e mov r15, r24 fefc: 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 fefe: 68 2f mov r22, r24 ff00: 70 e0 ldi r23, 0x00 ; 0 ff02: 7f 87 std Y+15, r23 ; 0x0f ff04: 6e 87 std Y+14, r22 ; 0x0e ff06: 80 ff sbrs r24, 0 ff08: 03 c0 rjmp .+6 ; 0xff10 ff0a: 76 e0 ldi r23, 0x06 ; 6 ff0c: 79 1b sub r23, r25 ff0e: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); ff10: 80 2f mov r24, r16 ff12: 63 e0 ldi r22, 0x03 ; 3 ff14: 0f 94 ed a4 call 0x349da ; 0x349da <__udivmodqi4> ff18: 91 11 cpse r25, r1 ff1a: 05 c0 rjmp .+10 ; 0xff26 ff1c: 8f 2d mov r24, r15 ff1e: 0f 94 ed a4 call 0x349da ; 0x349da <__udivmodqi4> ff22: 11 e0 ldi r17, 0x01 ; 1 ff24: 91 11 cpse r25, r1 ff26: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); ff28: 80 2f mov r24, r16 ff2a: 0e 94 3b 5f call 0xbe76 ; 0xbe76 ff2e: 68 8b std Y+16, r22 ; 0x10 ff30: 79 8b std Y+17, r23 ; 0x11 ff32: 8a 8b std Y+18, r24 ; 0x12 ff34: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); ff36: 8f 2d mov r24, r15 ff38: 0e 94 3b 5f call 0xbe76 ; 0xbe76 ff3c: 4b 01 movw r8, r22 ff3e: 5c 01 movw r10, r24 if (nMeasPoints == 3) { ff40: 8e 81 ldd r24, Y+6 ; 0x06 ff42: 83 30 cpi r24, 0x03 ; 3 ff44: 09 f0 breq .+2 ; 0xff48 ff46: 99 c0 rjmp .+306 ; 0x1007a if (!isOn3x3Mesh) { ff48: 11 11 cpse r17, r1 ff4a: c8 c0 rjmp .+400 ; 0x100dc ff4c: 27 e0 ldi r18, 0x07 ; 7 ff4e: ae 85 ldd r26, Y+14 ; 0x0e ff50: bf 85 ldd r27, Y+15 ; 0x0f ff52: 2a 9f mul r18, r26 ff54: f0 01 movw r30, r0 ff56: 2b 9f mul r18, r27 ff58: f0 0d add r31, r0 ff5a: 11 24 eor r1, r1 ff5c: e0 0f add r30, r16 ff5e: f1 1d adc r31, r1 ff60: ee 0f add r30, r30 ff62: ff 1f adc r31, r31 ff64: ee 0f add r30, r30 ff66: ff 1f adc r31, r31 ff68: e7 5f subi r30, 0xF7 ; 247 ff6a: fc 4e sbci r31, 0xEC ; 236 ff6c: 60 e0 ldi r22, 0x00 ; 0 ff6e: 70 e0 ldi r23, 0x00 ; 0 ff70: 80 ec ldi r24, 0xC0 ; 192 ff72: 9f e7 ldi r25, 0x7F ; 127 ff74: 61 83 std Z+1, r22 ; 0x01 ff76: 72 83 std Z+2, r23 ; 0x02 ff78: 83 83 std Z+3, r24 ; 0x03 ff7a: 94 83 std Z+4, r25 ; 0x04 ff7c: 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) { ff7e: e1 e3 ldi r30, 0x31 ; 49 ff80: 3e 12 cpse r3, r30 ff82: b7 cf rjmp .-146 ; 0xfef2 custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; ff84: 80 e0 ldi r24, 0x00 ; 0 ff86: 90 e0 ldi r25, 0x00 ; 0 ff88: a0 ea ldi r26, 0xA0 ; 160 ff8a: b0 e4 ldi r27, 0x40 ; 64 ff8c: 80 93 69 12 sts 0x1269, r24 ; 0x801269 ff90: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a ff94: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b ff98: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); ff9c: 65 e5 ldi r22, 0x55 ; 85 ff9e: 75 e5 ldi r23, 0x55 ; 85 ffa0: 85 e5 ldi r24, 0x55 ; 85 ffa2: 91 e4 ldi r25, 0x41 ; 65 ffa4: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); ffa8: 0f 94 5b 18 call 0x230b6 ; 0x230b6 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { ffac: b1 e3 ldi r27, 0x31 ; 49 ffae: 3b 16 cp r3, r27 ffb0: 09 f4 brne .+2 ; 0xffb4 ffb2: 3c c2 rjmp .+1144 ; 0x1042c if (g80_fail_cnt++ >= 1) { ffb4: 80 91 3d 03 lds r24, 0x033D ; 0x80033d ffb8: 91 e0 ldi r25, 0x01 ; 1 ffba: 98 0f add r25, r24 ffbc: 90 93 3d 03 sts 0x033D, r25 ; 0x80033d ffc0: 88 23 and r24, r24 ffc2: 09 f4 brne .+2 ; 0xffc6 ffc4: d3 c1 rjmp .+934 ; 0x1036c print_stop(); ffc6: 60 e0 ldi r22, 0x00 ; 0 ffc8: 80 e0 ldi r24, 0x00 ; 0 ffca: 0e 94 e4 dc call 0x1b9c8 ; 0x1b9c8 lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); ffce: 84 e3 ldi r24, 0x34 ; 52 ffd0: 96 e3 ldi r25, 0x36 ; 54 ffd2: 0e 94 95 75 call 0xeb2a ; 0xeb2a ffd6: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 lcd_z_calibration_prompt(false); ffda: 80 e0 ldi r24, 0x00 ; 0 ffdc: 0e 94 b6 e7 call 0x1cf6c ; 0x1cf6c current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); ffe0: 81 e0 ldi r24, 0x01 ; 1 ffe2: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); ffe6: 8a e8 ldi r24, 0x8A ; 138 ffe8: 9c e6 ldi r25, 0x6C ; 108 ffea: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe custom_message_type = custom_message_type_old; ffee: 2f 81 ldd r18, Y+7 ; 0x07 fff0: 20 93 5d 06 sts 0x065D, r18 ; 0x80065d custom_message_state = custom_message_state_old; fff4: 68 85 ldd r22, Y+8 ; 0x08 fff6: 60 93 de 03 sts 0x03DE, r22 ; 0x8003de lcd_update(2); fffa: 82 e0 ldi r24, 0x02 ; 2 fffc: 0e 94 54 6f call 0xdea8 ; 0xdea8 st_synchronize(); 10000: 0f 94 5b 18 call 0x230b6 ; 0x230b6 mesh_bed_leveling_flag = false; 10004: 10 92 72 12 sts 0x1272, r1 ; 0x801272 10008: d6 cd rjmp .-1108 ; 0xfbb6 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)) { 1000a: 01 11 cpse r16, r1 1000c: 03 c0 rjmp .+6 ; 0x10014 1000e: 11 23 and r17, r17 10010: 09 f4 brne .+2 ; 0x10014 10012: bc ce rjmp .-648 ; 0xfd8c // 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))); 10014: 81 2f mov r24, r17 10016: 63 e0 ldi r22, 0x03 ; 3 10018: 0f 94 f9 a4 call 0x349f2 ; 0x349f2 <__divmodqi4> 1001c: 84 0d add r24, r4 1001e: 95 2d mov r25, r5 10020: 91 1d adc r25, r1 10022: 88 0f add r24, r24 10024: 99 1f adc r25, r25 10026: 8d 53 subi r24, 0x3D ; 61 10028: 90 4f sbci r25, 0xF0 ; 240 1002a: 0f 94 4c a4 call 0x34898 ; 0x34898 const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 1002e: bc 01 movw r22, r24 10030: 99 0f add r25, r25 10032: 88 0b sbc r24, r24 10034: 99 0b sbc r25, r25 10036: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1003a: 2a e0 ldi r18, 0x0A ; 10 1003c: 37 ed ldi r19, 0xD7 ; 215 1003e: 43 e2 ldi r20, 0x23 ; 35 10040: 5c e3 ldi r21, 0x3C ; 60 10042: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 10046: 9b 01 movw r18, r22 10048: ac 01 movw r20, r24 1004a: 60 91 0a 13 lds r22, 0x130A ; 0x80130a 1004e: 70 91 0b 13 lds r23, 0x130B ; 0x80130b 10052: 80 91 0c 13 lds r24, 0x130C ; 0x80130c 10056: 90 91 0d 13 lds r25, 0x130D ; 0x80130d 1005a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1005e: f3 01 movw r30, r6 10060: 61 83 std Z+1, r22 ; 0x01 10062: 72 83 std Z+2, r23 ; 0x02 10064: 83 83 std Z+3, r24 ; 0x03 10066: 94 83 std Z+4, r25 ; 0x04 10068: 91 ce rjmp .-734 ; 0xfd8c 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)) { 1006a: fe 85 ldd r31, Y+14 ; 0x0e 1006c: ff 23 and r31, r31 1006e: 09 f4 brne .+2 ; 0x10072 10070: 02 cf rjmp .-508 ; 0xfe76 10072: 22 20 and r2, r2 10074: 09 f4 brne .+2 ; 0x10078 10076: fe ce rjmp .-516 ; 0xfe74 10078: fe ce rjmp .-516 ; 0xfe76 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)) { 1007a: 28 89 ldd r18, Y+16 ; 0x10 1007c: 39 89 ldd r19, Y+17 ; 0x11 1007e: 4a 89 ldd r20, Y+18 ; 0x12 10080: 5b 89 ldd r21, Y+19 ; 0x13 10082: 6a 85 ldd r22, Y+10 ; 0x0a 10084: 7b 85 ldd r23, Y+11 ; 0x0b 10086: 8c 85 ldd r24, Y+12 ; 0x0c 10088: 9d 85 ldd r25, Y+13 ; 0x0d 1008a: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1008e: 18 16 cp r1, r24 10090: 04 f1 brlt .+64 ; 0x100d2 10092: 28 89 ldd r18, Y+16 ; 0x10 10094: 39 89 ldd r19, Y+17 ; 0x11 10096: 4a 89 ldd r20, Y+18 ; 0x12 10098: 5b 89 ldd r21, Y+19 ; 0x13 1009a: 69 8d ldd r22, Y+25 ; 0x19 1009c: 7a 8d ldd r23, Y+26 ; 0x1a 1009e: 8b 8d ldd r24, Y+27 ; 0x1b 100a0: 9c 8d ldd r25, Y+28 ; 0x1c 100a2: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 100a6: 87 fd sbrc r24, 7 100a8: 14 c0 rjmp .+40 ; 0x100d2 100aa: a5 01 movw r20, r10 100ac: 94 01 movw r18, r8 100ae: 6c 89 ldd r22, Y+20 ; 0x14 100b0: 7d 89 ldd r23, Y+21 ; 0x15 100b2: 8e 89 ldd r24, Y+22 ; 0x16 100b4: 9f 89 ldd r25, Y+23 ; 0x17 100b6: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 100ba: 18 16 cp r1, r24 100bc: 54 f0 brlt .+20 ; 0x100d2 100be: a5 01 movw r20, r10 100c0: 94 01 movw r18, r8 100c2: 6d 8d ldd r22, Y+29 ; 0x1d 100c4: 7e 8d ldd r23, Y+30 ; 0x1e 100c6: 8f 8d ldd r24, Y+31 ; 0x1f 100c8: 98 a1 ldd r25, Y+32 ; 0x20 100ca: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 100ce: 87 ff sbrs r24, 7 100d0: 05 c0 rjmp .+10 ; 0x100dc 100d2: 11 23 and r17, r17 100d4: 09 f4 brne .+2 ; 0x100d8 100d6: 52 cf rjmp .-348 ; 0xff7c 100d8: 21 10 cpse r2, r1 100da: 50 cf rjmp .-352 ; 0xff7c mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 100dc: 10 e0 ldi r17, 0x00 ; 0 100de: a7 e0 ldi r26, 0x07 ; 7 100e0: 8e 85 ldd r24, Y+14 ; 0x0e 100e2: 9f 85 ldd r25, Y+15 ; 0x0f 100e4: a8 9f mul r26, r24 100e6: f0 01 movw r30, r0 100e8: a9 9f mul r26, r25 100ea: f0 0d add r31, r0 100ec: 11 24 eor r1, r1 100ee: e0 0f add r30, r16 100f0: f1 1f adc r31, r17 100f2: ee 0f add r30, r30 100f4: ff 1f adc r31, r31 100f6: ee 0f add r30, r30 100f8: ff 1f adc r31, r31 100fa: e7 5f subi r30, 0xF7 ; 247 100fc: fc 4e sbci r31, 0xEC ; 236 100fe: 41 80 ldd r4, Z+1 ; 0x01 10100: 52 80 ldd r5, Z+2 ; 0x02 10102: 63 80 ldd r6, Z+3 ; 0x03 10104: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 10106: c1 2c mov r12, r1 10108: d1 2c mov r13, r1 1010a: e0 ea ldi r30, 0xA0 ; 160 1010c: ee 2e mov r14, r30 1010e: e0 e4 ldi r30, 0x40 ; 64 10110: fe 2e mov r15, r30 10112: 22 20 and r2, r2 10114: 51 f0 breq .+20 ; 0x1012a 10116: 23 e3 ldi r18, 0x33 ; 51 10118: 33 e3 ldi r19, 0x33 ; 51 1011a: 43 eb ldi r20, 0xB3 ; 179 1011c: 5e e3 ldi r21, 0x3E ; 62 1011e: c3 01 movw r24, r6 10120: b2 01 movw r22, r4 10122: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 10126: 6b 01 movw r12, r22 10128: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 1012a: a7 01 movw r20, r14 1012c: 96 01 movw r18, r12 1012e: 60 91 69 12 lds r22, 0x1269 ; 0x801269 10132: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 10136: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 1013a: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 1013e: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 10142: 87 ff sbrs r24, 7 10144: 10 c0 rjmp .+32 ; 0x10166 current_position[Z_AXIS] = init_z_bckp; 10146: c0 92 69 12 sts 0x1269, r12 ; 0x801269 1014a: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 1014e: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 10152: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10156: 65 e5 ldi r22, 0x55 ; 85 10158: 75 e5 ldi r23, 0x55 ; 85 1015a: 85 e5 ldi r24, 0x55 ; 85 1015c: 91 e4 ldi r25, 0x41 ; 65 1015e: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 10162: 0f 94 5b 18 call 0x230b6 ; 0x230b6 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 10166: 68 89 ldd r22, Y+16 ; 0x10 10168: 79 89 ldd r23, Y+17 ; 0x11 1016a: 8a 89 ldd r24, Y+18 ; 0x12 1016c: 9b 89 ldd r25, Y+19 ; 0x13 1016e: 60 93 61 12 sts 0x1261, r22 ; 0x801261 10172: 70 93 62 12 sts 0x1262, r23 ; 0x801262 10176: 80 93 63 12 sts 0x1263, r24 ; 0x801263 1017a: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = y_pos; 1017e: 80 92 65 12 sts 0x1265, r8 ; 0x801265 10182: 90 92 66 12 sts 0x1266, r9 ; 0x801266 10186: a0 92 67 12 sts 0x1267, r10 ; 0x801267 1018a: b0 92 68 12 sts 0x1268, r11 ; 0x801268 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 1018e: 65 e6 ldi r22, 0x65 ; 101 10190: 72 e1 ldi r23, 0x12 ; 18 10192: 81 e6 ldi r24, 0x61 ; 97 10194: 92 e1 ldi r25, 0x12 ; 18 10196: 0e 94 79 69 call 0xd2f2 ; 0xd2f2 plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 1019a: 60 e0 ldi r22, 0x00 ; 0 1019c: 70 e0 ldi r23, 0x00 ; 0 1019e: 86 e1 ldi r24, 0x16 ; 22 101a0: 93 e4 ldi r25, 0x43 ; 67 101a2: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 101a6: 0f 94 5b 18 call 0x230b6 ; 0x230b6 if (planner_aborted) 101aa: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 101ae: 88 23 and r24, r24 101b0: 39 f0 breq .+14 ; 0x101c0 { custom_message_type = custom_message_type_old; 101b2: 7f 81 ldd r23, Y+7 ; 0x07 101b4: 70 93 5d 06 sts 0x065D, r23 ; 0x80065d custom_message_state = custom_message_state_old; 101b8: 88 85 ldd r24, Y+8 ; 0x08 101ba: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de 101be: fb cc rjmp .-1546 ; 0xfbb6 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 101c0: 81 2c mov r8, r1 101c2: 91 2c mov r9, r1 101c4: 70 e2 ldi r23, 0x20 ; 32 101c6: a7 2e mov r10, r23 101c8: 71 ec ldi r23, 0xC1 ; 193 101ca: b7 2e mov r11, r23 101cc: 22 20 and r2, r2 101ce: 51 f0 breq .+20 ; 0x101e4 101d0: 2a 81 ldd r18, Y+2 ; 0x02 101d2: 3b 81 ldd r19, Y+3 ; 0x03 101d4: 4c 81 ldd r20, Y+4 ; 0x04 101d6: 5d 81 ldd r21, Y+5 ; 0x05 101d8: c3 01 movw r24, r6 101da: b2 01 movw r22, r4 101dc: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 101e0: 4b 01 movw r8, r22 101e2: 5c 01 movw r10, r24 101e4: 48 8d ldd r20, Y+24 ; 0x18 101e6: c5 01 movw r24, r10 101e8: b4 01 movw r22, r8 101ea: 0f 94 4b 7c call 0x2f896 ; 0x2f896 101ee: 81 11 cpse r24, r1 101f0: 0b c0 rjmp .+22 ; 0x10208 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)); 101f2: 82 e6 ldi r24, 0x62 ; 98 101f4: 96 e5 ldi r25, 0x56 ; 86 101f6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 101fa: 9f 93 push r25 101fc: 8f 93 push r24 101fe: 0f 94 00 a3 call 0x34600 ; 0x34600 10202: 0f 90 pop r0 10204: 0f 90 pop r0 10206: be ce rjmp .-644 ; 0xff84 // 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. 10208: 20 91 69 12 lds r18, 0x1269 ; 0x801269 1020c: 30 91 6a 12 lds r19, 0x126A ; 0x80126a 10210: 40 91 6b 12 lds r20, 0x126B ; 0x80126b 10214: 50 91 6c 12 lds r21, 0x126C ; 0x80126c 10218: c7 01 movw r24, r14 1021a: b6 01 movw r22, r12 1021c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 10220: 20 e0 ldi r18, 0x00 ; 0 10222: 30 e0 ldi r19, 0x00 ; 0 10224: a9 01 movw r20, r18 10226: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1022a: 87 ff sbrs r24, 7 1022c: 36 c0 rjmp .+108 ; 0x1029a current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1022e: 60 e0 ldi r22, 0x00 ; 0 10230: 70 e0 ldi r23, 0x00 ; 0 10232: 80 ea ldi r24, 0xA0 ; 160 10234: 90 e4 ldi r25, 0x40 ; 64 10236: 60 93 69 12 sts 0x1269, r22 ; 0x801269 1023a: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 1023e: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 10242: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10246: 65 e5 ldi r22, 0x55 ; 85 10248: 75 e5 ldi r23, 0x55 ; 85 1024a: 85 e5 ldi r24, 0x55 ; 85 1024c: 91 e4 ldi r25, 0x41 ; 65 1024e: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 10252: 0f 94 5b 18 call 0x230b6 ; 0x230b6 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 10256: 48 8d ldd r20, Y+24 ; 0x18 10258: c5 01 movw r24, r10 1025a: b4 01 movw r22, r8 1025c: 0f 94 4b 7c call 0x2f896 ; 0x2f896 10260: 88 23 and r24, r24 10262: 39 f2 breq .-114 ; 0x101f2 printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 10264: 20 91 69 12 lds r18, 0x1269 ; 0x801269 10268: 30 91 6a 12 lds r19, 0x126A ; 0x80126a 1026c: 40 91 6b 12 lds r20, 0x126B ; 0x80126b 10270: 50 91 6c 12 lds r21, 0x126C ; 0x80126c 10274: 60 e0 ldi r22, 0x00 ; 0 10276: 70 e0 ldi r23, 0x00 ; 0 10278: 80 ea ldi r24, 0xA0 ; 160 1027a: 90 e4 ldi r25, 0x40 ; 64 1027c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 10280: 2d ec ldi r18, 0xCD ; 205 10282: 3c ec ldi r19, 0xCC ; 204 10284: 4c ec ldi r20, 0xCC ; 204 10286: 5d e3 ldi r21, 0x3D ; 61 10288: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1028c: 87 ff sbrs r24, 7 1028e: 05 c0 rjmp .+10 ; 0x1029a puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 10290: 87 ee ldi r24, 0xE7 ; 231 10292: 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")); 10294: 0f 94 27 a3 call 0x3464e ; 0x3464e 10298: 75 ce rjmp .-790 ; 0xff84 1029a: c0 90 69 12 lds r12, 0x1269 ; 0x801269 1029e: d0 90 6a 12 lds r13, 0x126A ; 0x80126a 102a2: e0 90 6b 12 lds r14, 0x126B ; 0x80126b 102a6: 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 102aa: 22 20 and r2, r2 102ac: a1 f0 breq .+40 ; 0x102d6 102ae: a7 01 movw r20, r14 102b0: 96 01 movw r18, r12 102b2: c3 01 movw r24, r6 102b4: b2 01 movw r22, r4 102b6: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 102ba: 9b 01 movw r18, r22 102bc: ac 01 movw r20, r24 102be: 5f 77 andi r21, 0x7F ; 127 102c0: 6a 81 ldd r22, Y+2 ; 0x02 102c2: 7b 81 ldd r23, Y+3 ; 0x03 102c4: 8c 81 ldd r24, Y+4 ; 0x04 102c6: 9d 81 ldd r25, Y+5 ; 0x05 102c8: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 102cc: 87 ff sbrs r24, 7 102ce: 03 c0 rjmp .+6 ; 0x102d6 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 102d0: 8e ea ldi r24, 0xAE ; 174 102d2: 97 e7 ldi r25, 0x77 ; 119 102d4: df cf rjmp .-66 ; 0x10294 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 102d6: 8f ea ldi r24, 0xAF ; 175 102d8: 9f e0 ldi r25, 0x0F ; 15 102da: 0f 94 3e a4 call 0x3487c ; 0x3487c 102de: 88 23 and r24, r24 102e0: 09 f4 brne .+2 ; 0x102e4 102e2: 40 c0 rjmp .+128 ; 0x10364 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); } 102e4: 86 ea ldi r24, 0xA6 ; 166 102e6: 9f e0 ldi r25, 0x0F ; 15 102e8: 0f 94 3e a4 call 0x3487c ; 0x3487c if (!calibration_status_pinda()) return 0; 102ec: 88 23 and r24, r24 102ee: d1 f1 breq .+116 ; 0x10364 return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 102f0: 60 91 85 03 lds r22, 0x0385 ; 0x800385 102f4: 70 91 86 03 lds r23, 0x0386 ; 0x800386 102f8: 80 91 87 03 lds r24, 0x0387 ; 0x800387 102fc: 90 91 88 03 lds r25, 0x0388 ; 0x800388 10300: 0e 94 11 57 call 0xae22 ; 0xae22 10304: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 10308: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1030c: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 10310: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 10314: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 10318: 9b 01 movw r18, r22 1031a: ac 01 movw r20, r24 1031c: e7 e0 ldi r30, 0x07 ; 7 1031e: ae 85 ldd r26, Y+14 ; 0x0e 10320: bf 85 ldd r27, Y+15 ; 0x0f 10322: ea 9f mul r30, r26 10324: c0 01 movw r24, r0 10326: eb 9f mul r30, r27 10328: 90 0d add r25, r0 1032a: 11 24 eor r1, r1 1032c: 08 0f add r16, r24 1032e: 19 1f adc r17, r25 10330: 00 0f add r16, r16 10332: 11 1f adc r17, r17 10334: 00 0f add r16, r16 10336: 11 1f adc r17, r17 10338: 07 5f subi r16, 0xF7 ; 247 1033a: 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; 1033c: c7 01 movw r24, r14 1033e: b6 01 movw r22, r12 10340: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 10344: d8 01 movw r26, r16 10346: 11 96 adiw r26, 0x01 ; 1 10348: 6d 93 st X+, r22 1034a: 7d 93 st X+, r23 1034c: 8d 93 st X+, r24 1034e: 9c 93 st X, r25 10350: 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--; 10352: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 10356: 81 50 subi r24, 0x01 ; 1 10358: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de mesh_point++; lcd_update(1); 1035c: 81 e0 ldi r24, 0x01 ; 1 1035e: 0e 94 54 6f call 0xdea8 ; 0xdea8 10362: 0c ce rjmp .-1000 ; 0xff7c } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 10364: 20 e0 ldi r18, 0x00 ; 0 10366: 30 e0 ldi r19, 0x00 ; 0 10368: a9 01 movw r20, r18 1036a: d8 cf rjmp .-80 ; 0x1031c 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); 1036c: 85 e0 ldi r24, 0x05 ; 5 1036e: 0f 94 06 23 call 0x2460c ; 0x2460c 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; 10372: c1 2c mov r12, r1 10374: d1 2c mov r13, r1 10376: 90 ea ldi r25, 0xA0 ; 160 10378: e9 2e mov r14, r25 1037a: 90 e4 ldi r25, 0x40 ; 64 1037c: 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)); 1037e: 80 e0 ldi r24, 0x00 ; 0 10380: 96 e3 ldi r25, 0x36 ; 54 10382: 0e 94 95 75 call 0xeb2a ; 0xeb2a 10386: 0e 94 94 de call 0x1bd28 ; 0x1bd28 #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 1038a: 90 e0 ldi r25, 0x00 ; 0 1038c: 80 e0 ldi r24, 0x00 ; 0 1038e: 0e 94 ad dd call 0x1bb5a ; 0x1bb5a lcd_calibrate_z_end_stop_manual(true); // Z-leveling (X-assembly stay up!!!) 10392: 81 e0 ldi r24, 0x01 ; 1 10394: 0e 94 70 f9 call 0x1f2e0 ; 0x1f2e0 #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); 10398: 80 e0 ldi r24, 0x00 ; 0 1039a: 0f 94 e1 22 call 0x245c2 ; 0x245c2 1039e: 18 2f mov r17, r24 raise_z(-1); 103a0: 60 e0 ldi r22, 0x00 ; 0 103a2: 70 e0 ldi r23, 0x00 ; 0 103a4: 80 e8 ldi r24, 0x80 ; 128 103a6: 9f eb ldi r25, 0xBF ; 191 103a8: 0e 94 ef 6c call 0xd9de ; 0xd9de enable_z_endstop(true); 103ac: 81 e0 ldi r24, 0x01 ; 1 103ae: 0f 94 e1 22 call 0x245c2 ; 0x245c2 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 103b2: c0 92 69 12 sts 0x1269, r12 ; 0x801269 103b6: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 103ba: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 103be: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 103c2: 65 e5 ldi r22, 0x55 ; 85 103c4: 75 e5 ldi r23, 0x55 ; 85 103c6: 85 e5 ldi r24, 0x55 ; 85 103c8: 91 e4 ldi r25, 0x41 ; 65 103ca: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 103ce: 0f 94 5b 18 call 0x230b6 ; 0x230b6 #ifdef TMC2130 tmc2130_home_exit(); #endif // TMC2130 enable_z_endstop(bState); 103d2: 81 2f mov r24, r17 103d4: 0f 94 e1 22 call 0x245c2 ; 0x245c2 } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 103d8: 82 e0 ldi r24, 0x02 ; 2 103da: 0f 94 47 18 call 0x2308e ; 0x2308e 103de: 20 e0 ldi r18, 0x00 ; 0 103e0: 30 e0 ldi r19, 0x00 ; 0 103e2: 40 ea ldi r20, 0xA0 ; 160 103e4: 50 e4 ldi r21, 0x40 ; 64 103e6: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 103ea: 18 16 cp r1, r24 103ec: 44 f2 brlt .-112 ; 0x1037e custom_message_type = custom_message_type_old; 103ee: ef 81 ldd r30, Y+7 ; 0x07 103f0: e0 93 5d 06 sts 0x065D, r30 ; 0x80065d custom_message_state = custom_message_state_old; 103f4: f8 85 ldd r31, Y+8 ; 0x08 103f6: f0 93 de 03 sts 0x03DE, r31 ; 0x8003de lcd_update_enable(true); // display / status-line recovery 103fa: 81 e0 ldi r24, 0x01 ; 1 103fc: 0e 94 93 70 call 0xe126 ; 0xe126 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); 10400: dd 24 eor r13, r13 10402: d3 94 inc r13 10404: df 92 push r13 10406: 81 2c mov r8, r1 10408: 91 2c mov r9, r1 1040a: 54 01 movw r10, r8 1040c: cc 24 eor r12, r12 1040e: c3 94 inc r12 10410: e1 2c mov r14, r1 10412: f1 2c mov r15, r1 10414: 87 01 movw r16, r14 10416: 21 e0 ldi r18, 0x01 ; 1 10418: 40 e0 ldi r20, 0x00 ; 0 1041a: 50 e0 ldi r21, 0x00 ; 0 1041c: ba 01 movw r22, r20 1041e: 81 e0 ldi r24, 0x01 ; 1 10420: 0e 94 85 6d call 0xdb0a ; 0xdb0a 10424: d0 92 53 12 sts 0x1253, r13 ; 0x801253 10428: 0f 90 pop r0 1042a: c5 cb rjmp .-2166 ; 0xfbb6 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. 1042c: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d clean_up_after_endstop_move(l_feedmultiply); 10430: 8b a1 ldd r24, Y+35 ; 0x23 10432: 9c a1 ldd r25, Y+36 ; 0x24 10434: 0e 94 a7 65 call 0xcb4e ; 0xcb4e // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 10438: 10 92 27 06 sts 0x0627, r1 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.451+0x1> 1043c: 10 92 26 06 sts 0x0626, r1 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.451> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 10440: 80 e1 ldi r24, 0x10 ; 16 10442: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c 10446: 88 23 and r24, r24 10448: 91 f0 breq .+36 ; 0x1046e { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 1044a: 0e 94 77 7d call 0xfaee ; 0xfaee // 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))); 1044e: 81 ea ldi r24, 0xA1 ; 161 10450: 9d e0 ldi r25, 0x0D ; 13 10452: 0f 94 3e a4 call 0x3487c ; 0x3487c 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-> 10456: 2b e0 ldi r18, 0x0B ; 11 10458: 82 9f mul r24, r18 1045a: c0 01 movw r24, r0 1045c: 11 24 eor r1, r1 1045e: 80 5b subi r24, 0xB0 ; 176 10460: 92 4f sbci r25, 0xF2 ; 242 10462: 0f 94 4c a4 call 0x34898 ; 0x34898 10466: 90 93 27 06 sts 0x0627, r25 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.451+0x1> 1046a: 80 93 26 06 sts 0x0626, r24 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.451> } void babystep_apply() { babystep_load(); shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 1046e: 60 91 26 06 lds r22, 0x0626 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.451> 10472: 70 91 27 06 lds r23, 0x0627 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.451+0x1> 10476: 07 2e mov r0, r23 10478: 00 0c add r0, r0 1047a: 88 0b sbc r24, r24 1047c: 99 0b sbc r25, r25 1047e: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 10482: 90 58 subi r25, 0x80 ; 128 10484: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 10488: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1048c: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 10490: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 10494: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 10498: 0f 94 0e 52 call 0x2a41c ; 0x2a41c 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; 1049c: 80 ec ldi r24, 0xC0 ; 192 1049e: 9f e0 ldi r25, 0x0F ; 15 104a0: 0f 94 3e a4 call 0x3487c ; 0x3487c 104a4: 91 e0 ldi r25, 0x01 ; 1 104a6: 81 30 cpi r24, 0x01 ; 1 104a8: 09 f0 breq .+2 ; 0x104ac 104aa: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 104ac: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 104ae: 4f eb ldi r20, 0xBF ; 191 104b0: 5f e0 ldi r21, 0x0F ; 15 104b2: 6c e4 ldi r22, 0x4C ; 76 104b4: ce 01 movw r24, r28 104b6: 01 96 adiw r24, 0x01 ; 1 104b8: 0e 94 af 56 call 0xad5e ; 0xad5e 104bc: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 104be: 4e eb ldi r20, 0xBE ; 190 104c0: 5f e0 ldi r21, 0x0F ; 15 104c2: 62 e5 ldi r22, 0x52 ; 82 104c4: ce 01 movw r24, r28 104c6: 01 96 adiw r24, 0x01 ; 1 104c8: 0e 94 af 56 call 0xad5e ; 0xad5e 104cc: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 104ce: 4d eb ldi r20, 0xBD ; 189 104d0: 5f e0 ldi r21, 0x0F ; 15 104d2: 66 e4 ldi r22, 0x46 ; 70 104d4: ce 01 movw r24, r28 104d6: 01 96 adiw r24, 0x01 ; 1 104d8: 0e 94 af 56 call 0xad5e ; 0xad5e 104dc: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 104de: 4c eb ldi r20, 0xBC ; 188 104e0: 5f e0 ldi r21, 0x0F ; 15 104e2: 62 e4 ldi r22, 0x42 ; 66 104e4: ce 01 movw r24, r28 104e6: 01 96 adiw r24, 0x01 ; 1 104e8: 0e 94 af 56 call 0xad5e ; 0xad5e 104ec: 21 2f mov r18, r17 104ee: 11 0f add r17, r17 104f0: 33 0b sbc r19, r19 104f2: 08 2e mov r0, r24 104f4: 00 0c add r0, r0 104f6: 99 0b sbc r25, r25 104f8: 5c 01 movw r10, r24 104fa: a2 1a sub r10, r18 104fc: b3 0a sbc r11, r19 104fe: 8f 2d mov r24, r15 10500: ff 0c add r15, r15 10502: 99 0b sbc r25, r25 10504: 28 0f add r18, r24 10506: 39 1f adc r19, r25 10508: 46 e0 ldi r20, 0x06 ; 6 1050a: 42 9f mul r20, r18 1050c: 60 01 movw r12, r0 1050e: 43 9f mul r20, r19 10510: d0 0c add r13, r0 10512: 11 24 eor r1, r1 10514: f1 2c mov r15, r1 10516: e1 2c mov r14, r1 10518: 00 2e mov r0, r16 1051a: 00 0c add r0, r0 1051c: 11 0b sbc r17, r17 1051e: 08 1b sub r16, r24 10520: 19 0b sbc r17, r25 10522: b7 01 movw r22, r14 10524: 66 5f subi r22, 0xF6 ; 246 10526: 7c 4e sbci r23, 0xEC ; 236 10528: 3b 01 movw r6, r22 1052a: 46 01 movw r8, r12 1052c: 77 e0 ldi r23, 0x07 ; 7 1052e: 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 * ( 10530: d3 01 movw r26, r6 10532: 2d 90 ld r2, X+ 10534: 3d 90 ld r3, X+ 10536: 4d 90 ld r4, X+ 10538: 5d 90 ld r5, X+ 1053a: 3d 01 movw r6, r26 1053c: fd 01 movw r30, r26 1053e: 34 97 sbiw r30, 0x04 ; 4 10540: fb 87 std Y+11, r31 ; 0x0b 10542: ea 87 std Y+10, r30 ; 0x0a 10544: b4 01 movw r22, r8 10546: 09 2c mov r0, r9 10548: 00 0c add r0, r0 1054a: 88 0b sbc r24, r24 1054c: 99 0b sbc r25, r25 1054e: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 10552: 2f e3 ldi r18, 0x3F ; 63 10554: 33 ec ldi r19, 0xC3 ; 195 10556: 4e e2 ldi r20, 0x2E ; 46 10558: 59 e3 ldi r21, 0x39 ; 57 1055a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1055e: a2 01 movw r20, r4 10560: 91 01 movw r18, r2 10562: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 10566: aa 85 ldd r26, Y+10 ; 0x0a 10568: bb 85 ldd r27, Y+11 ; 0x0b 1056a: 6d 93 st X+, r22 1056c: 7d 93 st X+, r23 1056e: 8d 93 st X+, r24 10570: 9c 93 st X, r25 10572: 13 97 sbiw r26, 0x03 ; 3 10574: ba 81 ldd r27, Y+2 ; 0x02 10576: b1 50 subi r27, 0x01 ; 1 10578: ba 83 std Y+2, r27 ; 0x02 1057a: 80 0e add r8, r16 1057c: 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++) { 1057e: b1 11 cpse r27, r1 10580: d7 cf rjmp .-82 ; 0x10530 10582: ca 0c add r12, r10 10584: db 1c adc r13, r11 10586: ec e1 ldi r30, 0x1C ; 28 10588: ee 0e add r14, r30 1058a: 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++) { 1058c: f4 ec ldi r31, 0xC4 ; 196 1058e: ef 16 cp r14, r31 10590: f1 04 cpc r15, r1 10592: 39 f6 brne .-114 ; 0x10522 + 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) 10594: 0f 94 1b 93 call 0x32636 ; 0x32636 { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 10598: 8d e4 ldi r24, 0x4D ; 77 1059a: 0e 94 80 56 call 0xad00 ; 0xad00 1059e: 88 23 and r24, r24 105a0: 09 f4 brne .+2 ; 0x105a4 105a2: 84 c0 rjmp .+264 ; 0x106ac 105a4: 0e 94 95 56 call 0xad2a ; 0xad2a if (nMeasPoints == 7 && useMagnetCompensation) { 105a8: 2e 81 ldd r18, Y+6 ; 0x06 105aa: 27 30 cpi r18, 0x07 ; 7 105ac: 09 f0 breq .+2 ; 0x105b0 105ae: 94 c0 rjmp .+296 ; 0x106d8 105b0: 88 23 and r24, r24 105b2: 09 f4 brne .+2 ; 0x105b6 105b4: 91 c0 rjmp .+290 ; 0x106d8 105b6: bb 24 eor r11, r11 105b8: b3 94 inc r11 105ba: aa 24 eor r10, r10 105bc: aa 94 dec r10 105be: ab 0c add r10, r11 105c0: 09 a1 ldd r16, Y+33 ; 0x21 105c2: 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++) { 105c4: 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++; } 105c6: 8e ef ldi r24, 0xFE ; 254 105c8: 88 2e mov r8, r24 105ca: 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)) { 105cc: 6a 2d mov r22, r10 105ce: 86 2d mov r24, r6 105d0: 0f 94 d9 51 call 0x2a3b2 ; 0x2a3b2 105d4: 99 24 eor r9, r9 105d6: 93 94 inc r9 105d8: 96 0c add r9, r6 105da: 81 11 cpse r24, r1 105dc: 6e c0 rjmp .+220 ; 0x106ba 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++; } 105de: 6b 2d mov r22, r11 105e0: 86 2d mov r24, r6 105e2: 0f 94 d9 51 call 0x2a3b2 ; 0x2a3b2 } 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; 105e6: c1 2c mov r12, r1 105e8: d1 2c mov r13, r1 105ea: 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; 105ec: 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++; } 105ee: 88 23 and r24, r24 105f0: 81 f0 breq .+32 ; 0x10612 105f2: 20 e0 ldi r18, 0x00 ; 0 105f4: 30 e0 ldi r19, 0x00 ; 0 105f6: a9 01 movw r20, r18 105f8: d8 01 movw r26, r16 105fa: 5d 96 adiw r26, 0x1d ; 29 105fc: 6d 91 ld r22, X+ 105fe: 7d 91 ld r23, X+ 10600: 8d 91 ld r24, X+ 10602: 9c 91 ld r25, X 10604: 90 97 sbiw r26, 0x20 ; 32 10606: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1060a: 6b 01 movw r12, r22 1060c: 7c 01 movw r14, r24 1060e: 77 24 eor r7, r7 10610: 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++; } 10612: 68 2d mov r22, r8 10614: 86 2d mov r24, r6 10616: 0f 94 d9 51 call 0x2a3b2 ; 0x2a3b2 1061a: 88 23 and r24, r24 1061c: 69 f0 breq .+26 ; 0x10638 1061e: f8 01 movw r30, r16 10620: 7b 97 sbiw r30, 0x1b ; 27 10622: 20 81 ld r18, Z 10624: 31 81 ldd r19, Z+1 ; 0x01 10626: 42 81 ldd r20, Z+2 ; 0x02 10628: 53 81 ldd r21, Z+3 ; 0x03 1062a: c7 01 movw r24, r14 1062c: b6 01 movw r22, r12 1062e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 10632: 6b 01 movw r12, r22 10634: 7c 01 movw r14, r24 10636: 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++; } 10638: 6a 2d mov r22, r10 1063a: 89 2d mov r24, r9 1063c: 0f 94 d9 51 call 0x2a3b2 ; 0x2a3b2 10640: 88 23 and r24, r24 10642: 61 f0 breq .+24 ; 0x1065c 10644: f8 01 movw r30, r16 10646: 25 81 ldd r18, Z+5 ; 0x05 10648: 36 81 ldd r19, Z+6 ; 0x06 1064a: 47 81 ldd r20, Z+7 ; 0x07 1064c: 50 85 ldd r21, Z+8 ; 0x08 1064e: c7 01 movw r24, r14 10650: b6 01 movw r22, r12 10652: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 10656: 6b 01 movw r12, r22 10658: 7c 01 movw r14, r24 1065a: 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++; } 1065c: 6a 2d mov r22, r10 1065e: 8f ef ldi r24, 0xFF ; 255 10660: 86 0d add r24, r6 10662: 0f 94 d9 51 call 0x2a3b2 ; 0x2a3b2 10666: 88 23 and r24, r24 10668: 31 f1 breq .+76 ; 0x106b6 1066a: f8 01 movw r30, r16 1066c: 33 97 sbiw r30, 0x03 ; 3 1066e: 20 81 ld r18, Z 10670: 31 81 ldd r19, Z+1 ; 0x01 10672: 42 81 ldd r20, Z+2 ; 0x02 10674: 53 81 ldd r21, Z+3 ; 0x03 10676: c7 01 movw r24, r14 10678: b6 01 movw r22, r12 1067a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1067e: 6b 01 movw r12, r22 10680: 7c 01 movw r14, r24 10682: 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 10684: 67 2d mov r22, r7 10686: 70 e0 ldi r23, 0x00 ; 0 10688: 90 e0 ldi r25, 0x00 ; 0 1068a: 80 e0 ldi r24, 0x00 ; 0 1068c: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 10690: 9b 01 movw r18, r22 10692: ac 01 movw r20, r24 10694: c7 01 movw r24, r14 10696: b6 01 movw r22, r12 10698: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1069c: d8 01 movw r26, r16 1069e: 11 96 adiw r26, 0x01 ; 1 106a0: 6d 93 st X+, r22 106a2: 7d 93 st X+, r23 106a4: 8d 93 st X+, r24 106a6: 9c 93 st X, r25 106a8: 14 97 sbiw r26, 0x04 ; 4 106aa: 07 c0 rjmp .+14 ; 0x106ba } 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); 106ac: 8c ea ldi r24, 0xAC ; 172 106ae: 9d e0 ldi r25, 0x0D ; 13 106b0: 0f 94 3e a4 call 0x3487c ; 0x3487c 106b4: 79 cf rjmp .-270 ; 0x105a8 106b6: 71 10 cpse r7, r1 106b8: e5 cf rjmp .-54 ; 0x10684 //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++) { 106ba: 69 2c mov r6, r9 106bc: 0c 5f subi r16, 0xFC ; 252 106be: 1f 4f sbci r17, 0xFF ; 255 106c0: b7 e0 ldi r27, 0x07 ; 7 106c2: 9b 12 cpse r9, r27 106c4: 83 cf rjmp .-250 ; 0x105cc 106c6: b3 94 inc r11 106c8: e9 a1 ldd r30, Y+33 ; 0x21 106ca: fa a1 ldd r31, Y+34 ; 0x22 106cc: 7c 96 adiw r30, 0x1c ; 28 106ce: fa a3 std Y+34, r31 ; 0x22 106d0: 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++) { 106d2: f8 e0 ldi r31, 0x08 ; 8 106d4: bf 12 cpse r11, r31 106d6: 71 cf rjmp .-286 ; 0x105ba if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 106d8: 81 e0 ldi r24, 0x01 ; 1 106da: 80 93 09 13 sts 0x1309, r24 ; 0x801309 if (code_seen('O') && !code_value_uint8()) { 106de: 8f e4 ldi r24, 0x4F ; 79 106e0: 0e 94 80 56 call 0xad00 ; 0xad00 106e4: 81 11 cpse r24, r1 106e6: 03 c0 rjmp .+6 ; 0x106ee // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 106e8: 0e 94 98 6a call 0xd530 ; 0xd530 106ec: 79 cc rjmp .-1806 ; 0xffe0 } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 106ee: 0e 94 95 56 call 0xad2a ; 0xad2a 106f2: 81 11 cpse r24, r1 106f4: f9 cf rjmp .-14 ; 0x106e8 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 106f6: 0e 94 9c 65 call 0xcb38 ; 0xcb38 106fa: 72 cc rjmp .-1820 ; 0xffe0 000106fc : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { 106fc: ec 01 movw r28, r24 cli(); // Stop interrupts 106fe: f8 94 cli disable_heater(); 10700: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 disable_x(); 10704: 17 9a sbi 0x02, 7 ; 2 10706: 10 92 39 06 sts 0x0639, r1 ; 0x800639 disable_y(); 1070a: 16 9a sbi 0x02, 6 ; 2 1070c: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a poweroff_z(); disable_e0(); 10710: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; 10712: 87 ec ldi r24, 0xC7 ; 199 10714: 92 ea ldi r25, 0xA2 ; 162 10716: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); 1071a: 86 eb ldi r24, 0xB6 ; 182 1071c: 98 e7 ldi r25, 0x78 ; 120 1071e: 0e 94 18 7d call 0xfa30 ; 0xfa30 if (full_screen_message != NULL) { 10722: 20 97 sbiw r28, 0x00 ; 0 10724: 79 f0 breq .+30 ; 0x10744 SERIAL_ERRORLNRPGM(full_screen_message); 10726: ce 01 movw r24, r28 10728: 0e 94 18 7d call 0xfa30 ; 0xfa30 1072c: be 01 movw r22, r28 1072e: 85 e9 ldi r24, 0x95 ; 149 10730: 9c e0 ldi r25, 0x0C ; 12 10732: 0f 94 9c a4 call 0x34938 ; 0x34938 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); 10736: 62 e4 ldi r22, 0x42 ; 66 10738: 84 e9 ldi r24, 0x94 ; 148 1073a: 9c e0 ldi r25, 0x0C ; 12 1073c: 0f 94 86 a4 call 0x3490c ; 0x3490c // 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(); 10740: 0e 94 7a 66 call 0xccf4 ; 0xccf4 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); 10744: ce ea ldi r28, 0xAE ; 174 10746: d8 e7 ldi r29, 0x78 ; 120 10748: f1 cf rjmp .-30 ; 0x1072c 0001074a : // 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(); 1074a: 88 e4 ldi r24, 0x48 ; 72 1074c: 93 e0 ldi r25, 0x03 ; 3 1074e: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) 10752: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 10756: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1075a: 89 2b or r24, r25 1075c: 79 f0 breq .+30 ; 0x1077c 1075e: e0 91 38 12 lds r30, 0x1238 ; 0x801238 10762: f0 91 39 12 lds r31, 0x1239 ; 0x801239 10766: e5 5b subi r30, 0xB5 ; 181 10768: ff 4e sbci r31, 0xEF ; 239 1076a: 80 81 ld r24, Z 1076c: 81 30 cpi r24, 0x01 ; 1 1076e: 11 f0 breq .+4 ; 0x10774 10770: 86 30 cpi r24, 0x06 ; 6 10772: 21 f4 brne .+8 ; 0x1077c SERIAL_PROTOCOLLNRPGM(MSG_OK); 10774: 80 e9 ldi r24, 0x90 ; 144 10776: 9a e6 ldi r25, 0x6A ; 106 10778: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 } 1077c: 08 95 ret 0001077e : return false; } void cmdqueue_reset() { while (buflen) 1077e: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 10782: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 10786: 89 2b or r24, r25 10788: 29 f0 breq .+10 ; 0x10794 { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); 1078a: 0e 94 a5 83 call 0x1074a ; 0x1074a cmdqueue_pop_front(); 1078e: 0e 94 9e 79 call 0xf33c ; 0xf33c 10792: f5 cf rjmp .-22 ; 0x1077e } bufindr = 0; 10794: 10 92 39 12 sts 0x1239, r1 ; 0x801239 10798: 10 92 38 12 sts 0x1238, r1 ; 0x801238 bufindw = 0; 1079c: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 107a0: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.512> //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; 107a4: 81 e0 ldi r24, 0x01 ; 1 107a6: 80 93 53 12 sts 0x1253, r24 ; 0x801253 } 107aa: 08 95 ret 000107ac : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { 107ac: ef 92 push r14 107ae: ff 92 push r15 107b0: 0f 93 push r16 107b2: 1f 93 push r17 107b4: cf 93 push r28 107b6: df 93 push r29 if (mbl.active) { 107b8: 80 91 09 13 lds r24, 0x1309 ; 0x801309 107bc: 88 23 and r24, r24 107be: 89 f1 breq .+98 ; 0x10822 } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); 107c0: 80 e4 ldi r24, 0x40 ; 64 107c2: 98 e7 ldi r25, 0x78 ; 120 107c4: 0e 94 18 7d call 0xfa30 ; 0xfa30 SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); 107c8: 8a e2 ldi r24, 0x2A ; 42 107ca: 98 e7 ldi r25, 0x78 ; 120 107cc: 0e 94 18 7d call 0xfa30 ; 0xfa30 SERIAL_PROTOCOLLNPGM("Measured points:"); 107d0: 89 e1 ldi r24, 0x19 ; 25 107d2: 98 e7 ldi r25, 0x78 ; 120 107d4: 0e 94 18 7d call 0xfa30 ; 0xfa30 for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { 107d8: c7 e0 ldi r28, 0x07 ; 7 107da: dc e1 ldi r29, 0x1C ; 28 107dc: c1 50 subi r28, 0x01 ; 1 107de: 58 f1 brcs .+86 ; 0x10836 107e0: cd 9f mul r28, r29 107e2: 70 01 movw r14, r0 107e4: 11 24 eor r1, r1 107e6: 01 e0 ldi r16, 0x01 ; 1 107e8: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); 107ea: 86 e1 ldi r24, 0x16 ; 22 107ec: 98 e7 ldi r25, 0x78 ; 120 107ee: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOL_F(z_values[y][x], 5); 107f2: f8 01 movw r30, r16 107f4: ee 0f add r30, r30 107f6: ff 1f adc r31, r31 107f8: ee 0f add r30, r30 107fa: ff 1f adc r31, r31 107fc: ee 0d add r30, r14 107fe: ff 1d adc r31, r15 10800: ea 5f subi r30, 0xFA ; 250 10802: fc 4e sbci r31, 0xEC ; 236 10804: 60 81 ld r22, Z 10806: 71 81 ldd r23, Z+1 ; 0x01 10808: 82 81 ldd r24, Z+2 ; 0x02 1080a: 93 81 ldd r25, Z+3 ; 0x03 1080c: 45 e0 ldi r20, 0x05 ; 5 1080e: 0e 94 a1 7a call 0xf542 ; 0xf542 10812: 0f 5f subi r16, 0xFF ; 255 10814: 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++) { 10816: 08 30 cpi r16, 0x08 ; 8 10818: 11 05 cpc r17, r1 1081a: 39 f7 brne .-50 ; 0x107ea SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); 1081c: 0e 94 17 7b call 0xf62e ; 0xf62e 10820: dd cf rjmp .-70 ; 0x107dc mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10822: 8d e4 ldi r24, 0x4D ; 77 10824: 98 e7 ldi r25, 0x78 ; 120 return; } 10826: df 91 pop r29 10828: cf 91 pop r28 1082a: 1f 91 pop r17 1082c: 0f 91 pop r16 1082e: ff 90 pop r15 10830: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10832: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 return; } 10836: df 91 pop r29 10838: cf 91 pop r28 1083a: 1f 91 pop r17 1083c: 0f 91 pop r16 1083e: ff 90 pop r15 10840: ef 90 pop r14 10842: 08 95 ret 00010844 : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 10844: cf 92 push r12 10846: df 92 push r13 10848: ef 92 push r14 1084a: ff 92 push r15 1084c: 6b 01 movw r12, r22 1084e: 7c 01 movw r14, r24 la10c_orig_jerk = j; 10850: c0 92 27 03 sts 0x0327, r12 ; 0x800327 10854: d0 92 28 03 sts 0x0328, r13 ; 0x800328 10858: e0 92 29 03 sts 0x0329, r14 ; 0x800329 1085c: f0 92 2a 03 sts 0x032A, r15 ; 0x80032a if(la10c_mode != LA10C_LA10) 10860: 80 91 43 03 lds r24, 0x0343 ; 0x800343 10864: 82 30 cpi r24, 0x02 ; 2 10866: b1 f4 brne .+44 ; 0x10894 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) 10868: 20 e0 ldi r18, 0x00 ; 0 1086a: 30 e0 ldi r19, 0x00 ; 0 1086c: 40 e9 ldi r20, 0x90 ; 144 1086e: 50 e4 ldi r21, 0x40 ; 64 10870: c7 01 movw r24, r14 10872: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 10876: 87 ff sbrs r24, 7 10878: 14 c0 rjmp .+40 ; 0x108a2 1087a: 80 91 97 0d lds r24, 0x0D97 ; 0x800d97 1087e: 90 91 98 0d lds r25, 0x0D98 ; 0x800d98 10882: a0 91 99 0d lds r26, 0x0D99 ; 0x800d99 10886: b0 91 9a 0d lds r27, 0x0D9A ; 0x800d9a 1088a: 80 3d cpi r24, 0xD0 ; 208 1088c: 97 40 sbci r25, 0x07 ; 7 1088e: a1 05 cpc r26, r1 10890: b1 05 cpc r27, r1 10892: 20 f5 brcc .+72 ; 0x108dc j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 10894: c7 01 movw r24, r14 10896: b6 01 movw r22, r12 10898: ff 90 pop r15 1089a: ef 90 pop r14 1089c: df 90 pop r13 1089e: cf 90 pop r12 108a0: 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: 108a2: 2a e9 ldi r18, 0x9A ; 154 108a4: 39 e9 ldi r19, 0x99 ; 153 108a6: 49 e9 ldi r20, 0x99 ; 153 108a8: 5e e3 ldi r21, 0x3E ; 62 108aa: c7 01 movw r24, r14 108ac: b6 01 movw r22, r12 108ae: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 108b2: 87 ff sbrs r24, 7 108b4: 0a c0 rjmp .+20 ; 0x108ca 108b6: 20 e0 ldi r18, 0x00 ; 0 108b8: 30 e0 ldi r19, 0x00 ; 0 108ba: 48 e3 ldi r20, 0x38 ; 56 108bc: 51 e4 ldi r21, 0x41 ; 65 108be: c7 01 movw r24, r14 108c0: b6 01 movw r22, r12 108c2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 108c6: 6b 01 movw r12, r22 108c8: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 108ca: 84 e2 ldi r24, 0x24 ; 36 108cc: 95 e7 ldi r25, 0x75 ; 117 108ce: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN(j); 108d2: c7 01 movw r24, r14 108d4: b6 01 movw r22, r12 108d6: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 108da: dc cf rjmp .-72 ; 0x10894 // 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: 108dc: 2a e9 ldi r18, 0x9A ; 154 108de: 39 e9 ldi r19, 0x99 ; 153 108e0: 49 e9 ldi r20, 0x99 ; 153 108e2: 5e e3 ldi r21, 0x3E ; 62 108e4: c7 01 movw r24, r14 108e6: b6 01 movw r22, r12 108e8: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 108ec: 87 fd sbrc r24, 7 108ee: e3 cf rjmp .-58 ; 0x108b6 j < 4.5? j * 0.25 + 3.375: 108f0: 20 e0 ldi r18, 0x00 ; 0 108f2: 30 e0 ldi r19, 0x00 ; 0 108f4: 40 e8 ldi r20, 0x80 ; 128 108f6: 5e e3 ldi r21, 0x3E ; 62 108f8: c7 01 movw r24, r14 108fa: b6 01 movw r22, r12 108fc: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__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: 10900: 20 e0 ldi r18, 0x00 ; 0 10902: 30 e0 ldi r19, 0x00 ; 0 10904: 48 e5 ldi r20, 0x58 ; 88 10906: 50 e4 ldi r21, 0x40 ; 64 10908: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1090c: dc cf rjmp .-72 ; 0x108c6 0001090e : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 1090e: cf 92 push r12 10910: df 92 push r13 10912: ef 92 push r14 10914: ff 92 push r15 10916: cf 93 push r28 if(mode == la10c_mode) return; 10918: 90 91 43 03 lds r25, 0x0343 ; 0x800343 1091c: 98 17 cp r25, r24 1091e: b9 f1 breq .+110 ; 0x1098e 10920: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 10922: c0 90 27 03 lds r12, 0x0327 ; 0x800327 10926: d0 90 28 03 lds r13, 0x0328 ; 0x800328 1092a: e0 90 29 03 lds r14, 0x0329 ; 0x800329 1092e: f0 90 2a 03 lds r15, 0x032A ; 0x80032a 10932: 20 e0 ldi r18, 0x00 ; 0 10934: 30 e0 ldi r19, 0x00 ; 0 10936: a9 01 movw r20, r18 10938: c7 01 movw r24, r14 1093a: b6 01 movw r22, r12 1093c: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 10940: 88 23 and r24, r24 10942: 41 f0 breq .+16 ; 0x10954 cs.max_jerk[E_AXIS] = la10c_orig_jerk; 10944: c0 92 bb 0d sts 0x0DBB, r12 ; 0x800dbb 10948: d0 92 bc 0d sts 0x0DBC, r13 ; 0x800dbc 1094c: e0 92 bd 0d sts 0x0DBD, r14 ; 0x800dbd 10950: f0 92 be 0d sts 0x0DBE, r15 ; 0x800dbe SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 10954: 87 e0 ldi r24, 0x07 ; 7 10956: 95 e7 ldi r25, 0x75 ; 117 10958: 0e 94 1f 7b call 0xf63e ; 0xf63e switch(mode) 1095c: c1 30 cpi r28, 0x01 ; 1 1095e: 11 f1 breq .+68 ; 0x109a4 10960: e0 f0 brcs .+56 ; 0x1099a 10962: c2 30 cpi r28, 0x02 ; 2 10964: 11 f1 breq .+68 ; 0x109aa { 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; 10966: 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]); 1096a: 60 91 bb 0d lds r22, 0x0DBB ; 0x800dbb 1096e: 70 91 bc 0d lds r23, 0x0DBC ; 0x800dbc 10972: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 10976: 90 91 be 0d lds r25, 0x0DBE ; 0x800dbe 1097a: 0e 94 22 84 call 0x10844 ; 0x10844 1097e: 60 93 bb 0d sts 0x0DBB, r22 ; 0x800dbb 10982: 70 93 bc 0d sts 0x0DBC, r23 ; 0x800dbc 10986: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd 1098a: 90 93 be 0d sts 0x0DBE, r25 ; 0x800dbe } 1098e: cf 91 pop r28 10990: ff 90 pop r15 10992: ef 90 pop r14 10994: df 90 pop r13 10996: cf 90 pop r12 10998: 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; 1099a: 8f ef ldi r24, 0xFF ; 255 1099c: 94 e7 ldi r25, 0x74 ; 116 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 1099e: 0e 94 18 7d call 0xfa30 ; 0xfa30 109a2: e1 cf rjmp .-62 ; 0x10966 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 109a4: 8b ef ldi r24, 0xFB ; 251 109a6: 94 e7 ldi r25, 0x74 ; 116 109a8: fa cf rjmp .-12 ; 0x1099e case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 109aa: 87 ef ldi r24, 0xF7 ; 247 109ac: 94 e7 ldi r25, 0x74 ; 116 109ae: f7 cf rjmp .-18 ; 0x1099e 000109b0 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 109b0: 0f 94 5b 18 call 0x230b6 ; 0x230b6 disable_x(); 109b4: 17 9a sbi 0x02, 7 ; 2 109b6: e9 e3 ldi r30, 0x39 ; 57 109b8: f6 e0 ldi r31, 0x06 ; 6 109ba: 10 82 st Z, r1 disable_y(); 109bc: 16 9a sbi 0x02, 6 ; 2 109be: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 109c0: 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); } 109c2: 80 e0 ldi r24, 0x00 ; 0 109c4: 0e 94 87 84 call 0x1090e ; 0x1090e return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 109c8: 8f ef ldi r24, 0xFF ; 255 109ca: 9f ef ldi r25, 0xFF ; 255 109cc: 90 93 73 02 sts 0x0273, r25 ; 0x800273 109d0: 80 93 72 02 sts 0x0272, r24 ; 0x800272 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 109d4: 2f ef ldi r18, 0xFF ; 255 109d6: 20 93 6f 02 sts 0x026F, r18 ; 0x80026f print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 109da: 90 93 3e 02 sts 0x023E, r25 ; 0x80023e 109de: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 109e2: 20 93 3f 02 sts 0x023F, r18 ; 0x80023f print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 109e6: 90 93 71 02 sts 0x0271, r25 ; 0x800271 109ea: 80 93 70 02 sts 0x0270, r24 ; 0x800270 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 109ee: 90 93 3c 02 sts 0x023C, r25 ; 0x80023c 109f2: 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(); } 109f6: 08 95 ret 000109f8 : SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); } } void __attribute__((noinline)) serial_dump_and_reset(dump_crash_reason reason) { 109f8: 18 2f mov r17, r24 uint16_t sp; uint32_t pc; // we're being called from a live state, so shut off interrupts ... cli(); 109fa: f8 94 cli // sample SP/PC sp = SP; 109fc: cd b7 in r28, 0x3d ; 61 109fe: de b7 in r29, 0x3e ; 62 "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 10a00: 00 d0 rcall .+0 ; 0x10a02 10a02: cf 90 pop r12 10a04: df 90 pop r13 10a06: ef 90 pop r14 10a08: 88 e1 ldi r24, 0x18 ; 24 10a0a: 99 e2 ldi r25, 0x29 ; 41 10a0c: 0f b6 in r0, 0x3f ; 63 10a0e: f8 94 cli 10a10: a8 95 wdr 10a12: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 10a16: 0f be out 0x3f, r0 ; 63 10a18: 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); 10a1c: 9f b7 in r25, 0x3f ; 63 10a1e: f8 94 cli 10a20: e2 e0 ldi r30, 0x02 ; 2 10a22: f1 e0 ldi r31, 0x01 ; 1 10a24: 80 81 ld r24, Z 10a26: 88 60 ori r24, 0x08 ; 8 10a28: 80 83 st Z, r24 10a2a: 9f bf out 0x3f, r25 ; 63 disable_heater(); 10a2c: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 // 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"); 10a30: 86 eb ldi r24, 0xB6 ; 182 10a32: 94 e7 ldi r25, 0x74 ; 116 10a34: 0e 94 18 7d call 0xfa30 ; 0xfa30 SERIAL_ECHOPGM("error: "); 10a38: 8e ea ldi r24, 0xAE ; 174 10a3a: 94 e7 ldi r25, 0x74 ; 116 10a3c: 0e 94 1f 7b call 0xf63e ; 0xf63e print((long) c, base); } void MarlinSerial::print(unsigned char b, int base) { print((unsigned long) b, base); 10a40: 61 2f mov r22, r17 10a42: 70 e0 ldi r23, 0x00 ; 0 10a44: 90 e0 ldi r25, 0x00 ; 0 10a46: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 10a48: 4a e0 ldi r20, 0x0A ; 10 10a4a: 0e 94 20 7a call 0xf440 ; 0xf440 MYSERIAL.print((uint8_t)reason, DEC); SERIAL_ECHOPGM(" 0x"); 10a4e: 8a ea ldi r24, 0xAA ; 170 10a50: 94 e7 ldi r25, 0x74 ; 116 10a52: 0e 94 1f 7b call 0xf63e ; 0xf63e // we're being called from a live state, so shut off interrupts ... cli(); // sample SP/PC sp = SP; pc = GETPC(); 10a56: 8e 2d mov r24, r14 10a58: b6 01 movw r22, r12 10a5a: 90 e0 ldi r25, 0x00 ; 0 10a5c: 40 e1 ldi r20, 0x10 ; 16 10a5e: 0e 94 20 7a call 0xf440 ; 0xf440 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"); 10a62: 86 ea ldi r24, 0xA6 ; 166 10a64: 94 e7 ldi r25, 0x74 ; 116 10a66: 0e 94 1f 7b call 0xf63e ; 0xf63e print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 10a6a: be 01 movw r22, r28 10a6c: 90 e0 ldi r25, 0x00 ; 0 10a6e: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 10a70: 40 e1 ldi r20, 0x10 ; 16 10a72: 0e 94 20 7a call 0xf440 ; 0xf440 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 10a76: 0e 94 17 7b call 0xf62e ; 0xf62e MYSERIAL.println(sp, HEX); print_mem(0, RAMEND+1, dcode_mem_t::sram); 10a7a: 40 e0 ldi r20, 0x00 ; 0 10a7c: 60 e0 ldi r22, 0x00 ; 0 10a7e: 72 e2 ldi r23, 0x22 ; 34 10a80: 90 e0 ldi r25, 0x00 ; 0 10a82: 80 e0 ldi r24, 0x00 ; 0 10a84: 0f 94 2d 78 call 0x2f05a ; 0x2f05a SERIAL_ECHOLNRPGM(MSG_OK); 10a88: 80 e9 ldi r24, 0x90 ; 144 10a8a: 9a e6 ldi r25, 0x6A ; 106 10a8c: 0e 94 18 7d call 0xfa30 ; 0xfa30 // reset soon softReset(); 10a90: 0e 94 7a 66 call 0xccf4 ; 0xccf4 00010a94 : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { 10a94: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); 10a96: 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); 10a98: 68 2f mov r22, r24 10a9a: 83 e0 ldi r24, 0x03 ; 3 10a9c: 9d e0 ldi r25, 0x0D ; 13 10a9e: 0f 94 62 a4 call 0x348c4 ; 0x348c4 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) 10aa2: 80 91 0f 06 lds r24, 0x060F ; 0x80060f 10aa6: 88 23 and r24, r24 10aa8: 19 f0 breq .+6 ; 0x10ab0 serial_dump_and_reset(reason); 10aaa: 8c 2f mov r24, r28 10aac: 0e 94 fc 84 call 0x109f8 ; 0x109f8 #endif softReset(); 10ab0: 0e 94 7a 66 call 0xccf4 ; 0xccf4 00010ab4 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { 10ab4: 1f 92 push r1 10ab6: 0f 92 push r0 10ab8: 0f b6 in r0, 0x3f ; 63 10aba: 0f 92 push r0 10abc: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); 10abe: 83 e0 ldi r24, 0x03 ; 3 10ac0: 0e 94 4a 85 call 0x10a94 ; 0x10a94 00010ac4 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { 10ac4: 1f 92 push r1 10ac6: 0f 92 push r0 10ac8: 0f b6 in r0, 0x3f ; 63 10aca: 0f 92 push r0 10acc: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); 10ace: 82 e0 ldi r24, 0x02 ; 2 10ad0: 0e 94 4a 85 call 0x10a94 ; 0x10a94 00010ad4 : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 10ad4: 41 ed ldi r20, 0xD1 ; 209 10ad6: 50 e0 ldi r21, 0x00 ; 0 10ad8: 65 ed ldi r22, 0xD5 ; 213 10ada: 73 e7 ldi r23, 0x73 ; 115 10adc: 87 e6 ldi r24, 0x67 ; 103 10ade: 9d e0 ldi r25, 0x0D ; 13 10ae0: 0f 94 d8 a1 call 0x343b0 ; 0x343b0 // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 10ae4: 0f 94 cd 39 call 0x2739a ; 0x2739a #ifdef PIDTEMP updatePID(); 10ae8: 0f 94 1f 14 call 0x2283e ; 0x2283e #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); #endif calculate_extruder_multipliers(); 10aec: 0e 94 a5 64 call 0xc94a ; 0xc94a SERIAL_ECHO_START; 10af0: 84 ee ldi r24, 0xE4 ; 228 10af2: 92 ea ldi r25, 0xA2 ; 162 10af4: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 10af8: 83 eb ldi r24, 0xB3 ; 179 10afa: 93 e7 ldi r25, 0x73 ; 115 10afc: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 00010b00 : //! @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)); 10b00: 44 e0 ldi r20, 0x04 ; 4 10b02: 50 e0 ldi r21, 0x00 ; 0 10b04: 64 e1 ldi r22, 0x14 ; 20 10b06: 70 e0 ldi r23, 0x00 ; 0 10b08: 87 e6 ldi r24, 0x67 ; 103 10b0a: 9d e0 ldi r25, 0x0D ; 13 10b0c: 0f 94 2e a4 call 0x3485c ; 0x3485c // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 10b10: 43 e0 ldi r20, 0x03 ; 3 10b12: 50 e0 ldi r21, 0x00 ; 0 10b14: 65 ed ldi r22, 0xD5 ; 213 10b16: 73 e7 ldi r23, 0x73 ; 115 10b18: 87 e6 ldi r24, 0x67 ; 103 10b1a: 9d e0 ldi r25, 0x0D ; 13 10b1c: 0f 94 1d a2 call 0x3443a ; 0x3443a 10b20: 89 2b or r24, r25 10b22: 09 f0 breq .+2 ; 0x10b26 10b24: 5d c0 rjmp .+186 ; 0x10be0 { // 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)); 10b26: e9 e9 ldi r30, 0x99 ; 153 10b28: f4 e7 ldi r31, 0x74 ; 116 10b2a: 45 91 lpm r20, Z+ 10b2c: 55 91 lpm r21, Z+ 10b2e: 65 91 lpm r22, Z+ 10b30: 74 91 lpm r23, Z 10b32: 88 ed ldi r24, 0xD8 ; 216 10b34: 90 e0 ldi r25, 0x00 ; 0 10b36: 0e 94 2f 5e call 0xbc5e ; 0xbc5e eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 10b3a: ed e9 ldi r30, 0x9D ; 157 10b3c: f4 e7 ldi r31, 0x74 ; 116 10b3e: 45 91 lpm r20, Z+ 10b40: 55 91 lpm r21, Z+ 10b42: 65 91 lpm r22, Z+ 10b44: 74 91 lpm r23, Z 10b46: 8c ed ldi r24, 0xDC ; 220 10b48: 90 e0 ldi r25, 0x00 ; 0 10b4a: 0e 94 2f 5e call 0xbc5e ; 0xbc5e eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 10b4e: e1 ea ldi r30, 0xA1 ; 161 10b50: f4 e7 ldi r31, 0x74 ; 116 10b52: 64 91 lpm r22, Z 10b54: 80 ee ldi r24, 0xE0 ; 224 10b56: 90 e0 ldi r25, 0x00 ; 0 10b58: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 10b5c: e2 ea ldi r30, 0xA2 ; 162 10b5e: f4 e7 ldi r31, 0x74 ; 116 10b60: 65 91 lpm r22, Z+ 10b62: 74 91 lpm r23, Z 10b64: 81 ee ldi r24, 0xE1 ; 225 10b66: 90 e0 ldi r25, 0x00 ; 0 10b68: 0e 94 a0 78 call 0xf140 ; 0xf140 eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 10b6c: e4 ea ldi r30, 0xA4 ; 164 10b6e: f4 e7 ldi r31, 0x74 ; 116 10b70: 65 91 lpm r22, Z+ 10b72: 74 91 lpm r23, Z 10b74: 83 ee ldi r24, 0xE3 ; 227 10b76: 90 e0 ldi r25, 0x00 ; 0 10b78: 0e 94 a0 78 call 0xf140 ; 0xf140 // 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)); 10b7c: e5 e9 ldi r30, 0x95 ; 149 10b7e: f4 e7 ldi r31, 0x74 ; 116 10b80: 45 91 lpm r20, Z+ 10b82: 55 91 lpm r21, Z+ 10b84: 65 91 lpm r22, Z+ 10b86: 74 91 lpm r23, Z 10b88: 84 ed ldi r24, 0xD4 ; 212 10b8a: 90 e0 ldi r25, 0x00 ; 0 10b8c: 0e 94 2f 5e call 0xbc5e ; 0xbc5e // 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); 10b90: 41 e7 ldi r20, 0x71 ; 113 10b92: 54 e7 ldi r21, 0x74 ; 116 10b94: 60 e1 ldi r22, 0x10 ; 16 10b96: 70 e0 ldi r23, 0x00 ; 0 10b98: 80 eb ldi r24, 0xB0 ; 176 10b9a: 90 e0 ldi r25, 0x00 ; 0 10b9c: 0e 94 81 78 call 0xf102 ; 0xf102 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); 10ba0: 41 e8 ldi r20, 0x81 ; 129 10ba2: 54 e7 ldi r21, 0x74 ; 116 10ba4: 60 e1 ldi r22, 0x10 ; 16 10ba6: 70 e0 ldi r23, 0x00 ; 0 10ba8: 80 ec ldi r24, 0xC0 ; 192 10baa: 90 e0 ldi r25, 0x00 ; 0 10bac: 0e 94 81 78 call 0xf102 ; 0xf102 #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)); 10bb0: 41 ed ldi r20, 0xD1 ; 209 10bb2: 50 e0 ldi r21, 0x00 ; 0 10bb4: 64 e1 ldi r22, 0x14 ; 20 10bb6: 70 e0 ldi r23, 0x00 ; 0 10bb8: 87 e6 ldi r24, 0x67 ; 103 10bba: 9d e0 ldi r25, 0x0D ; 13 10bbc: 0f 94 2e a4 call 0x3485c ; 0x3485c calculate_extruder_multipliers(); 10bc0: 0e 94 a5 64 call 0xc94a ; 0xc94a 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(); 10bc4: 0f 94 cd 39 call 0x2739a ; 0x2739a // Call updatePID (similar to when we have processed M301) updatePID(); 10bc8: 0f 94 1f 14 call 0x2283e ; 0x2283e #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 10bcc: 84 ee ldi r24, 0xE4 ; 228 10bce: 92 ea ldi r25, 0xA2 ; 162 10bd0: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNPGM("Stored settings retrieved"); 10bd4: 89 e9 ldi r24, 0x99 ; 153 10bd6: 93 e7 ldi r25, 0x73 ; 115 10bd8: 0e 94 18 7d call 0xfa30 ; 0xfa30 10bdc: 81 e0 ldi r24, 0x01 ; 1 10bde: 08 95 ret } else { Config_ResetDefault(); 10be0: 0e 94 6a 85 call 0x10ad4 ; 0x10ad4 //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))) { 10be4: 64 e0 ldi r22, 0x04 ; 4 10be6: 70 e0 ldi r23, 0x00 ; 0 10be8: 84 e1 ldi r24, 0x14 ; 20 10bea: 90 e0 ldi r25, 0x00 ; 0 10bec: 0e 94 65 56 call 0xacca ; 0xacca 10bf0: 91 e0 ldi r25, 0x01 ; 1 10bf2: 89 27 eor r24, r25 return false; } } return true; } 10bf4: 08 95 ret 00010bf6 : }; void Config_StoreSettings() { strcpy_P(cs.version, default_conf.version); 10bf6: 65 ed ldi r22, 0xD5 ; 213 10bf8: 73 e7 ldi r23, 0x73 ; 115 10bfa: 87 e6 ldi r24, 0x67 ; 103 10bfc: 9d e0 ldi r25, 0x0D ; 13 10bfe: 0f 94 f5 a1 call 0x343ea ; 0x343ea #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); 10c02: 41 ed ldi r20, 0xD1 ; 209 10c04: 50 e0 ldi r21, 0x00 ; 0 10c06: 64 e1 ldi r22, 0x14 ; 20 10c08: 70 e0 ldi r23, 0x00 ; 0 10c0a: 87 e6 ldi r24, 0x67 ; 103 10c0c: 9d e0 ldi r25, 0x0D ; 13 10c0e: 0f 94 52 a4 call 0x348a4 ; 0x348a4 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; 10c12: 84 ee ldi r24, 0xE4 ; 228 10c14: 92 ea ldi r25, 0xA2 ; 162 10c16: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNPGM("Settings Stored"); 10c1a: 89 e8 ldi r24, 0x89 ; 137 10c1c: 93 e7 ldi r25, 0x73 ; 115 10c1e: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 00010c22 : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 10c22: cf 93 push r28 10c24: df 93 push r29 10c26: ec 01 movw r28, r24 { while (*str) 10c28: 89 91 ld r24, Y+ 10c2a: 88 23 and r24, r24 10c2c: 19 f0 breq .+6 ; 0x10c34 write(*str++); 10c2e: 0e 94 0c 7a call 0xf418 ; 0xf418 10c32: fa cf rjmp .-12 ; 0x10c28 } 10c34: df 91 pop r29 10c36: cf 91 pop r28 10c38: 08 95 ret 00010c3a : } }*/ static FORCE_INLINE void print(const char *str) { write(str); 10c3a: 0e 94 11 86 call 0x10c22 ; 0x10c22 }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 10c3e: 0c 94 17 7b jmp 0xf62e ; 0xf62e 00010c42 : { cmdbuffer_front_already_processed = true; } void get_command() { 10c42: 2f 92 push r2 10c44: 3f 92 push r3 10c46: 4f 92 push r4 10c48: 5f 92 push r5 10c4a: 6f 92 push r6 10c4c: 7f 92 push r7 10c4e: 8f 92 push r8 10c50: 9f 92 push r9 10c52: af 92 push r10 10c54: bf 92 push r11 10c56: cf 92 push r12 10c58: df 92 push r13 10c5a: ef 92 push r14 10c5c: ff 92 push r15 10c5e: 0f 93 push r16 10c60: 1f 93 push r17 10c62: cf 93 push r28 10c64: df 93 push r29 10c66: cd b7 in r28, 0x3d ; 61 10c68: de b7 in r29, 0x3e ; 62 10c6a: a0 97 sbiw r28, 0x20 ; 32 10c6c: 0f b6 in r0, 0x3f ; 63 10c6e: f8 94 cli 10c70: de bf out 0x3e, r29 ; 62 10c72: 0f be out 0x3f, r0 ; 63 10c74: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 10c76: 8f e5 ldi r24, 0x5F ; 95 10c78: 90 e0 ldi r25, 0x00 ; 0 10c7a: 0e 94 ef 55 call 0xabde ; 0xabde 10c7e: 88 23 and r24, r24 10c80: 09 f4 brne .+2 ; 0x10c84 10c82: a1 c0 rjmp .+322 ; 0x10dc6 return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 10c84: 0e 94 87 55 call 0xab0e ; 0xab0e 10c88: 8f 37 cpi r24, 0x7F ; 127 10c8a: 91 05 cpc r25, r1 10c8c: 61 f4 brne .+24 ; 0x10ca6 // 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; 10c8e: 80 91 44 05 lds r24, 0x0544 ; 0x800544 10c92: 90 91 45 05 lds r25, 0x0545 ; 0x800545 10c96: 90 93 43 05 sts 0x0543, r25 ; 0x800543 10c9a: 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 10c9e: 8a e7 ldi r24, 0x7A ; 122 10ca0: 93 e7 ldi r25, 0x73 ; 115 10ca2: 0e 94 18 7d call 0xfa30 ; 0xfa30 10ca6: 6e 01 movw r12, r28 10ca8: 4f e1 ldi r20, 0x1F ; 31 10caa: c4 0e add r12, r20 10cac: 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; 10cae: 99 24 eor r9, r9 10cb0: 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 10cb2: 0e 94 87 55 call 0xab0e ; 0xab0e 10cb6: 18 16 cp r1, r24 10cb8: 19 06 cpc r1, r25 10cba: 0c f0 brlt .+2 ; 0x10cbe 10cbc: 78 c0 rjmp .+240 ; 0x10dae 10cbe: 80 91 73 12 lds r24, 0x1273 ; 0x801273 10cc2: 88 23 and r24, r24 10cc4: 29 f0 breq .+10 ; 0x10cd0 10cc6: 0e 94 90 66 call 0xcd20 ; 0xcd20 10cca: 88 23 and r24, r24 10ccc: 09 f4 brne .+2 ; 0x10cd0 10cce: 6f c0 rjmp .+222 ; 0x10dae 10cd0: 80 91 93 03 lds r24, 0x0393 ; 0x800393 10cd4: 81 11 cpse r24, r1 10cd6: 6b c0 rjmp .+214 ; 0x10dae } 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) { 10cd8: 20 91 44 05 lds r18, 0x0544 ; 0x800544 10cdc: 30 91 45 05 lds r19, 0x0545 ; 0x800545 10ce0: 80 91 42 05 lds r24, 0x0542 ; 0x800542 10ce4: 90 91 43 05 lds r25, 0x0543 ; 0x800543 10ce8: 82 17 cp r24, r18 10cea: 93 07 cpc r25, r19 10cec: 11 f3 breq .-60 ; 0x10cb2 return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 10cee: f9 01 movw r30, r18 10cf0: ee 53 subi r30, 0x3E ; 62 10cf2: fb 4f sbci r31, 0xFB ; 251 10cf4: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 10cf6: 2f 5f subi r18, 0xFF ; 255 10cf8: 3f 4f sbci r19, 0xFF ; 255 10cfa: 2f 77 andi r18, 0x7F ; 127 10cfc: 33 27 eor r19, r19 10cfe: 30 93 45 05 sts 0x0545, r19 ; 0x800545 10d02: 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)) { 10d06: 8f 3f cpi r24, 0xFF ; 255 10d08: 09 f0 breq .+2 ; 0x10d0c 10d0a: 79 c0 rjmp .+242 ; 0x10dfe if (mp_cmd_count > 0) { 10d0c: 80 91 19 03 lds r24, 0x0319 ; 0x800319 10d10: 88 23 and r24, r24 10d12: 09 f4 brne .+2 ; 0x10d16 10d14: 71 c0 rjmp .+226 ; 0x10df8 mp_cmd_active = 1; 10d16: 90 92 18 03 sts 0x0318, r9 ; 0x800318 mp_cmd_count = 0; 10d1a: 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}; 10d1e: 1f 8e std Y+31, r1 ; 0x1f 10d20: 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) { 10d22: 80 90 1c 03 lds r8, 0x031C ; 0x80031c 10d26: 88 20 and r8, r8 10d28: 21 f2 breq .-120 ; 0x10cb2 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]; 10d2a: 80 91 1a 03 lds r24, 0x031A ; 0x80031a 10d2e: 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) 10d30: f1 e0 ldi r31, 0x01 ; 1 10d32: f8 15 cp r31, r8 10d34: 18 f4 brcc .+6 ; 0x10d3c out[i] = (char)mp_char_out_buf[i]; 10d36: 80 91 1b 03 lds r24, 0x031B ; 0x80031b 10d3a: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 10d3c: 10 92 1c 03 sts 0x031C, r1 ; 0x80031c 10d40: 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]; 10d42: 82 2d mov r24, r2 10d44: 8c 19 sub r24, r12 10d46: 88 15 cp r24, r8 10d48: 08 f0 brcs .+2 ; 0x10d4c 10d4a: b3 cf rjmp .-154 ; 0x10cb2 10d4c: f1 01 movw r30, r2 10d4e: 11 91 ld r17, Z+ 10d50: 1f 01 movw r2, r30 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 10d52: 8f e1 ldi r24, 0x1F ; 31 10d54: 93 e0 ldi r25, 0x03 ; 3 10d56: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> if (serial_char < 0) 10d5a: 17 fd sbrc r17, 7 10d5c: f2 cf rjmp .-28 ; 0x10d42 10d5e: 80 91 47 10 lds r24, 0x1047 ; 0x801047 10d62: 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' || 10d66: 1a 30 cpi r17, 0x0A ; 10 10d68: 09 f4 brne .+2 ; 0x10d6c 10d6a: 4b c1 rjmp .+662 ; 0x11002 10d6c: 1d 30 cpi r17, 0x0D ; 13 10d6e: 09 f4 brne .+2 ; 0x10d72 10d70: 48 c1 rjmp .+656 ; 0x11002 serial_char == '\r' || 10d72: 8f 35 cpi r24, 0x5F ; 95 10d74: 91 05 cpc r25, r1 10d76: 0c f0 brlt .+2 ; 0x10d7a 10d78: 49 c1 rjmp .+658 ; 0x1100c 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; 10d7a: 1b 33 cpi r17, 0x3B ; 59 10d7c: 11 f4 brne .+4 ; 0x10d82 10d7e: 90 92 1e 03 sts 0x031E, r9 ; 0x80031e if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10d82: 20 91 1e 03 lds r18, 0x031E ; 0x80031e 10d86: 21 11 cpse r18, r1 10d88: dc cf rjmp .-72 ; 0x10d42 10d8a: 9c 01 movw r18, r24 10d8c: 2f 5f subi r18, 0xFF ; 255 10d8e: 3f 4f sbci r19, 0xFF ; 255 10d90: 30 93 48 10 sts 0x1048, r19 ; 0x801048 10d94: 20 93 47 10 sts 0x1047, r18 ; 0x801047 10d98: 20 91 49 10 lds r18, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> 10d9c: 30 91 4a 10 lds r19, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 10da0: 25 5b subi r18, 0xB5 ; 181 10da2: 3f 4e sbci r19, 0xEF ; 239 10da4: 82 0f add r24, r18 10da6: 93 1f adc r25, r19 10da8: fc 01 movw r30, r24 10daa: 13 83 std Z+3, r17 ; 0x03 10dac: ca cf rjmp .-108 ; 0x10d42 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10dae: 80 91 47 10 lds r24, 0x1047 ; 0x801047 10db2: 90 91 48 10 lds r25, 0x1048 ; 0x801048 10db6: 18 16 cp r1, r24 10db8: 19 06 cpc r1, r25 10dba: 0c f4 brge .+2 ; 0x10dbe 10dbc: 51 c2 rjmp .+1186 ; 0x11260 SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10dbe: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 10dc2: 81 11 cpse r24, r1 10dc4: 67 c2 rjmp .+1230 ; 0x11294 prusa_statistics(6); } } #endif //SDSUPPORT } 10dc6: a0 96 adiw r28, 0x20 ; 32 10dc8: 0f b6 in r0, 0x3f ; 63 10dca: f8 94 cli 10dcc: de bf out 0x3e, r29 ; 62 10dce: 0f be out 0x3f, r0 ; 63 10dd0: cd bf out 0x3d, r28 ; 61 10dd2: df 91 pop r29 10dd4: cf 91 pop r28 10dd6: 1f 91 pop r17 10dd8: 0f 91 pop r16 10dda: ff 90 pop r15 10ddc: ef 90 pop r14 10dde: df 90 pop r13 10de0: cf 90 pop r12 10de2: bf 90 pop r11 10de4: af 90 pop r10 10de6: 9f 90 pop r9 10de8: 8f 90 pop r8 10dea: 7f 90 pop r7 10dec: 6f 90 pop r6 10dee: 5f 90 pop r5 10df0: 4f 90 pop r4 10df2: 3f 90 pop r3 10df4: 2f 90 pop r2 10df6: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 10df8: 90 92 19 03 sts 0x0319, r9 ; 0x800319 10dfc: 90 cf rjmp .-224 ; 0x10d1e return; } if (mp_cmd_active > 0) { 10dfe: 90 91 18 03 lds r25, 0x0318 ; 0x800318 10e02: 99 23 and r25, r25 10e04: 09 f4 brne .+2 ; 0x10e08 10e06: 58 c0 rjmp .+176 ; 0x10eb8 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10e08: 89 3f cpi r24, 0xF9 ; 249 10e0a: e9 f1 breq .+122 ; 0x10e86 10e0c: 70 f5 brcc .+92 ; 0x10e6a 10e0e: 86 3f cpi r24, 0xF6 ; 246 10e10: 09 f4 brne .+2 ; 0x10e14 10e12: 4a c0 rjmp .+148 ; 0x10ea8 10e14: 87 3f cpi r24, 0xF7 ; 247 10e16: 09 f4 brne .+2 ; 0x10e1a 10e18: 43 c0 rjmp .+134 ; 0x10ea0 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. 10e1a: 85 e4 ldi r24, 0x45 ; 69 10e1c: 93 e7 ldi r25, 0x73 ; 115 10e1e: 0e 94 1f 7b call 0xf63e ; 0xf63e // 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); 10e22: 80 e4 ldi r24, 0x40 ; 64 10e24: 93 e7 ldi r25, 0x73 ; 115 10e26: 0e 94 1f 7b call 0xf63e ; 0xf63e // Echo current state if (mp_config & MPConfig_Active) 10e2a: 10 91 17 03 lds r17, 0x0317 ; 0x800317 SERIAL_ECHOPGM(" ON"); 10e2e: 8c e3 ldi r24, 0x3C ; 60 10e30: 93 e7 ldi r25, 0x73 ; 115 // 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) 10e32: 10 fd sbrc r17, 0 10e34: 02 c0 rjmp .+4 ; 0x10e3a SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 10e36: 87 e3 ldi r24, 0x37 ; 55 10e38: 93 e7 ldi r25, 0x73 ; 115 10e3a: 0e 94 1f 7b call 0xf63e ; 0xf63e if (mp_config & MPConfig_NoSpaces) 10e3e: 01 2f mov r16, r17 10e40: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10e42: 82 e3 ldi r24, 0x32 ; 50 10e44: 93 e7 ldi r25, 0x73 ; 115 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 10e46: 11 fd sbrc r17, 1 10e48: 02 c0 rjmp .+4 ; 0x10e4e SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 10e4a: 8d e2 ldi r24, 0x2D ; 45 10e4c: 93 e7 ldi r25, 0x73 ; 115 10e4e: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNPGM(""); 10e52: 8c e2 ldi r24, 0x2C ; 44 10e54: 93 e7 ldi r25, 0x73 ; 115 10e56: 0e 94 18 7d call 0xfa30 ; 0xfa30 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 10e5a: 00 23 and r16, r16 10e5c: 49 f1 breq .+82 ; 0x10eb0 MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10e5e: 85 e4 ldi r24, 0x45 ; 69 10e60: 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; 10e64: 10 92 18 03 sts 0x0318, r1 ; 0x800318 10e68: 5a cf rjmp .-332 ; 0x10d1e } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10e6a: 8a 3f cpi r24, 0xFA ; 250 10e6c: 41 f0 breq .+16 ; 0x10e7e 10e6e: 8b 3f cpi r24, 0xFB ; 251 10e70: a1 f6 brne .-88 ; 0x10e1a case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10e72: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10e76: 81 60 ori r24, 0x01 ; 1 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10e78: 80 93 17 03 sts 0x0317, r24 ; 0x800317 10e7c: ce cf rjmp .-100 ; 0x10e1a #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10e7e: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10e82: 8e 7f andi r24, 0xFE ; 254 10e84: f9 cf rjmp .-14 ; 0x10e78 return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 10e86: 10 92 1c 03 sts 0x031C, r1 ; 0x80031c mp_cmd_active = MPCommand_None; 10e8a: 10 92 18 03 sts 0x0318, r1 ; 0x800318 mp_config = MPConfig_None; 10e8e: 10 92 17 03 sts 0x0317, r1 ; 0x800317 mp_char_buf = 0; 10e92: 10 92 16 03 sts 0x0316, r1 ; 0x800316 mp_cmd_count = 0; 10e96: 10 92 19 03 sts 0x0319, r1 ; 0x800319 mp_cmd_active = 0; mp_full_char_queue = 0; 10e9a: 10 92 15 03 sts 0x0315, r1 ; 0x800315 10e9e: bd cf rjmp .-134 ; 0x10e1a #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 10ea0: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10ea4: 82 60 ori r24, 0x02 ; 2 10ea6: e8 cf rjmp .-48 ; 0x10e78 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10ea8: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10eac: 8d 7f andi r24, 0xFD ; 253 10eae: e4 cf rjmp .-56 ; 0x10e78 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 10eb0: 90 e2 ldi r25, 0x20 ; 32 10eb2: 90 93 0b 02 sts 0x020B, r25 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 10eb6: d6 cf rjmp .-84 ; 0x10e64 mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 10eb8: 90 91 19 03 lds r25, 0x0319 ; 0x800319 10ebc: 30 91 17 03 lds r19, 0x0317 ; 0x800317 10ec0: 99 23 and r25, r25 10ec2: 31 f1 breq .+76 ; 0x10f10 10ec4: 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) { 10ec8: 30 ff sbrs r19, 0 10eca: 49 c0 rjmp .+146 ; 0x10f5e if (mp_full_char_queue > 0) { 10ecc: 20 91 15 03 lds r18, 0x0315 ; 0x800315 10ed0: 22 23 and r18, r18 10ed2: 09 f4 brne .+2 ; 0x10ed6 10ed4: 40 c0 rjmp .+128 ; 0x10f56 #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; 10ed6: 91 e0 ldi r25, 0x01 ; 1 10ed8: 9e 0f add r25, r30 10eda: 90 93 1c 03 sts 0x031C, r25 ; 0x80031c 10ede: ae 2f mov r26, r30 10ee0: b0 e0 ldi r27, 0x00 ; 0 10ee2: a6 5e subi r26, 0xE6 ; 230 10ee4: bc 4f sbci r27, 0xFC ; 252 10ee6: ff ef ldi r31, 0xFF ; 255 10ee8: 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) { 10eea: 40 91 16 03 lds r20, 0x0316 ; 0x800316 10eee: 44 23 and r20, r20 10ef0: 51 f0 breq .+20 ; 0x10f06 #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; 10ef2: ee 5f subi r30, 0xFE ; 254 10ef4: e0 93 1c 03 sts 0x031C, r30 ; 0x80031c 10ef8: e9 2f mov r30, r25 10efa: f0 e0 ldi r31, 0x00 ; 0 10efc: e6 5e subi r30, 0xE6 ; 230 10efe: fc 4f sbci r31, 0xFC ; 252 10f00: 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; 10f02: 10 92 16 03 sts 0x0316, r1 ; 0x800316 } --mp_full_char_queue; 10f06: 21 50 subi r18, 0x01 ; 1 10f08: 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; 10f0c: 10 92 19 03 sts 0x0319, r1 ; 0x800319 10f10: 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) { 10f14: 30 ff sbrs r19, 0 10f16: 6c c0 rjmp .+216 ; 0x10ff0 if (mp_full_char_queue > 0) { 10f18: 90 91 15 03 lds r25, 0x0315 ; 0x800315 10f1c: 99 23 and r25, r25 10f1e: 49 f1 breq .+82 ; 0x10f72 #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; 10f20: 21 e0 ldi r18, 0x01 ; 1 10f22: 2e 0f add r18, r30 10f24: 20 93 1c 03 sts 0x031C, r18 ; 0x80031c 10f28: ae 2f mov r26, r30 10f2a: b0 e0 ldi r27, 0x00 ; 0 10f2c: a6 5e subi r26, 0xE6 ; 230 10f2e: bc 4f sbci r27, 0xFC ; 252 10f30: 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) { 10f32: 80 91 16 03 lds r24, 0x0316 ; 0x800316 10f36: 88 23 and r24, r24 10f38: 51 f0 breq .+20 ; 0x10f4e #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; 10f3a: ee 5f subi r30, 0xFE ; 254 10f3c: e0 93 1c 03 sts 0x031C, r30 ; 0x80031c 10f40: e2 2f mov r30, r18 10f42: f0 e0 ldi r31, 0x00 ; 0 10f44: e6 5e subi r30, 0xE6 ; 230 10f46: fc 4f sbci r31, 0xFC ; 252 10f48: 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; 10f4a: 10 92 16 03 sts 0x0316, r1 ; 0x800316 } --mp_full_char_queue; 10f4e: 91 50 subi r25, 0x01 ; 1 10f50: 90 93 15 03 sts 0x0315, r25 ; 0x800315 10f54: e4 ce rjmp .-568 ; 0x10d1e 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; 10f56: 42 e0 ldi r20, 0x02 ; 2 10f58: 40 93 15 03 sts 0x0315, r20 ; 0x800315 10f5c: d7 cf rjmp .-82 ; 0x10f0c #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; 10f5e: 91 e0 ldi r25, 0x01 ; 1 10f60: 9e 0f add r25, r30 10f62: 90 93 1c 03 sts 0x031C, r25 ; 0x80031c 10f66: f0 e0 ldi r31, 0x00 ; 0 10f68: e6 5e subi r30, 0xE6 ; 230 10f6a: fc 4f sbci r31, 0xFC ; 252 10f6c: 9f ef ldi r25, 0xFF ; 255 10f6e: 90 83 st Z, r25 10f70: cd cf rjmp .-102 ; 0x10f0c 10f72: a8 2f mov r26, r24 10f74: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10f76: 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; 10f78: 21 e0 ldi r18, 0x01 ; 1 10f7a: af 30 cpi r26, 0x0F ; 15 10f7c: 29 f0 breq .+10 ; 0x10f88 10f7e: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 10f80: a0 50 subi r26, 0x00 ; 0 10f82: be 4f sbci r27, 0xFE ; 254 10f84: 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; 10f86: 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; 10f88: 48 2f mov r20, r24 10f8a: 40 7f andi r20, 0xF0 ; 240 10f8c: 40 3f cpi r20, 0xF0 ; 240 10f8e: 59 f4 brne .+22 ; 0x10fa6 10f90: 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) { 10f92: 20 ff sbrs r18, 0 10f94: 13 c0 rjmp .+38 ; 0x10fbc ++mp_full_char_queue; 10f96: 90 92 15 03 sts 0x0315, r9 ; 0x800315 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10f9a: 21 ff sbrs r18, 1 10f9c: 0c c0 rjmp .+24 ; 0x10fb6 10f9e: e2 e0 ldi r30, 0x02 ; 2 10fa0: e0 93 15 03 sts 0x0315, r30 ; 0x800315 10fa4: bc ce rjmp .-648 ; 0x10d1e 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 10fa6: 82 95 swap r24 10fa8: 8f 70 andi r24, 0x0F ; 15 10faa: a8 2f mov r26, r24 10fac: b0 e0 ldi r27, 0x00 ; 0 10fae: a0 50 subi r26, 0x00 ; 0 10fb0: be 4f sbci r27, 0xFE ; 254 10fb2: 9c 91 ld r25, X 10fb4: ee cf rjmp .-36 ; 0x10f92 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]; 10fb6: 90 93 16 03 sts 0x0316, r25 ; 0x800316 10fba: b1 ce rjmp .-670 ; 0x10d1e #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; 10fbc: 81 e0 ldi r24, 0x01 ; 1 10fbe: 8e 0f add r24, r30 10fc0: 80 93 1c 03 sts 0x031C, r24 ; 0x80031c 10fc4: ae 2f mov r26, r30 10fc6: b0 e0 ldi r27, 0x00 ; 0 10fc8: a6 5e subi r26, 0xE6 ; 230 10fca: bc 4f sbci r27, 0xFC ; 252 10fcc: 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') { 10fce: 3a 30 cpi r19, 0x0A ; 10 10fd0: 09 f4 brne .+2 ; 0x10fd4 10fd2: a5 ce rjmp .-694 ; 0x10d1e if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10fd4: 21 ff sbrs r18, 1 10fd6: 03 c0 rjmp .+6 ; 0x10fde 10fd8: 90 92 15 03 sts 0x0315, r9 ; 0x800315 10fdc: a0 ce rjmp .-704 ; 0x10d1e #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; 10fde: ee 5f subi r30, 0xFE ; 254 10fe0: e0 93 1c 03 sts 0x031C, r30 ; 0x80031c 10fe4: e8 2f mov r30, r24 10fe6: f0 e0 ldi r31, 0x00 ; 0 10fe8: e6 5e subi r30, 0xE6 ; 230 10fea: fc 4f sbci r31, 0xFC ; 252 10fec: 90 83 st Z, r25 10fee: 97 ce rjmp .-722 ; 0x10d1e 10ff0: 91 e0 ldi r25, 0x01 ; 1 10ff2: 9e 0f add r25, r30 10ff4: 90 93 1c 03 sts 0x031C, r25 ; 0x80031c 10ff8: f0 e0 ldi r31, 0x00 ; 0 10ffa: e6 5e subi r30, 0xE6 ; 230 10ffc: fc 4f sbci r31, 0xFC ; 252 10ffe: 80 83 st Z, r24 11000: 8e ce rjmp .-740 ; 0x10d1e continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 11002: 00 97 sbiw r24, 0x00 ; 0 11004: 19 f4 brne .+6 ; 0x1100c comment_mode = false; //for new command 11006: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e 1100a: dd ce rjmp .-582 ; 0x10dc6 1100c: 00 91 49 10 lds r16, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> 11010: 10 91 4a 10 lds r17, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 11014: 02 5b subi r16, 0xB2 ; 178 11016: 1f 4e sbci r17, 0xEF ; 239 11018: 80 0f add r24, r16 1101a: 91 1f adc r25, r17 1101c: fc 01 movw r30, r24 1101e: 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) 11020: 1a 83 std Y+2, r17 ; 0x02 11022: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 11024: 80 91 1e 03 lds r24, 0x031E ; 0x80031e 11028: 81 11 cpse r24, r1 1102a: fd c0 rjmp .+506 ; 0x11226 long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 1102c: f8 01 movw r30, r16 1102e: 80 81 ld r24, Z 11030: 8e 34 cpi r24, 0x4E ; 78 11032: 09 f0 breq .+2 ; 0x11036 11034: 84 c0 rjmp .+264 ; 0x1113e // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 11036: 4a e0 ldi r20, 0x0A ; 10 11038: 50 e0 ldi r21, 0x00 ; 0 1103a: be 01 movw r22, r28 1103c: 6f 5f subi r22, 0xFF ; 255 1103e: 7f 4f sbci r23, 0xFF ; 255 11040: c8 01 movw r24, r16 11042: 01 96 adiw r24, 0x01 ; 1 11044: 0f 94 c9 9f call 0x33f92 ; 0x33f92 11048: 2b 01 movw r4, r22 1104a: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 1104c: e9 80 ldd r14, Y+1 ; 0x01 1104e: fa 80 ldd r15, Y+2 ; 0x02 11050: f7 01 movw r30, r14 11052: 80 81 ld r24, Z 11054: 80 32 cpi r24, 0x20 ; 32 11056: 31 f4 brne .+12 ; 0x11064 11058: ff ef ldi r31, 0xFF ; 255 1105a: ef 1a sub r14, r31 1105c: ff 0a sbc r15, r31 1105e: fa 82 std Y+2, r15 ; 0x02 11060: e9 82 std Y+1, r14 ; 0x01 11062: f4 cf rjmp .-24 ; 0x1104c // 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)) { 11064: 80 91 3e 12 lds r24, 0x123E ; 0x80123e 11068: 90 91 3f 12 lds r25, 0x123F ; 0x80123f 1106c: a0 91 40 12 lds r26, 0x1240 ; 0x801240 11070: b0 91 41 12 lds r27, 0x1241 ; 0x801241 11074: 01 96 adiw r24, 0x01 ; 1 11076: a1 1d adc r26, r1 11078: b1 1d adc r27, r1 1107a: 84 15 cp r24, r4 1107c: 95 05 cpc r25, r5 1107e: a6 05 cpc r26, r6 11080: b7 05 cpc r27, r7 11082: 49 f0 breq .+18 ; 0x11096 11084: 44 e0 ldi r20, 0x04 ; 4 11086: 50 e0 ldi r21, 0x00 ; 0 11088: 65 e7 ldi r22, 0x75 ; 117 1108a: 73 e7 ldi r23, 0x73 ; 115 1108c: c7 01 movw r24, r14 1108e: 0f 94 1d a2 call 0x3443a ; 0x3443a 11092: 89 2b or r24, r25 11094: a1 f4 brne .+40 ; 0x110be FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 11096: 6a e2 ldi r22, 0x2A ; 42 11098: 70 e0 ldi r23, 0x00 ; 0 1109a: c7 01 movw r24, r14 1109c: 0f 94 95 aa call 0x3552a ; 0x3552a 110a0: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 110a4: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb 110a8: 00 97 sbiw r24, 0x00 ; 0 110aa: 09 f4 brne .+2 ; 0x110ae 110ac: 41 c0 rjmp .+130 ; 0x11130 110ae: f8 01 movw r30, r16 { byte checksum = 0; 110b0: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 110b2: 8e 17 cp r24, r30 110b4: 9f 07 cpc r25, r31 110b6: f1 f0 breq .+60 ; 0x110f4 checksum = checksum^(*p++); 110b8: 21 91 ld r18, Z+ 110ba: f2 26 eor r15, r18 110bc: fa cf rjmp .-12 ; 0x110b2 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; 110be: 87 ec ldi r24, 0xC7 ; 199 110c0: 92 ea ldi r25, 0xA2 ; 162 110c2: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 110c6: 82 ef ldi r24, 0xF2 ; 242 110c8: 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 110ca: 0e 94 1f 7b call 0xf63e ; 0xf63e 110ce: 60 91 3e 12 lds r22, 0x123E ; 0x80123e 110d2: 70 91 3f 12 lds r23, 0x123F ; 0x80123f 110d6: 80 91 40 12 lds r24, 0x1240 ; 0x801240 110da: 90 91 41 12 lds r25, 0x1241 ; 0x801241 110de: 0e 94 85 7a call 0xf50a ; 0xf50a } void MarlinSerial::println(long n, int base) { print(n, base); println(); 110e2: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 110e6: 0e 94 37 56 call 0xac6e ; 0xac6e serial_count = 0; 110ea: 10 92 48 10 sts 0x1048, r1 ; 0x801048 110ee: 10 92 47 10 sts 0x1047, r1 ; 0x801047 110f2: 69 ce rjmp .-814 ; 0x10dc6 { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 110f4: 0e 94 a2 56 call 0xad44 ; 0xad44 110f8: f8 16 cp r15, r24 110fa: 19 06 cpc r1, r25 110fc: 39 f0 breq .+14 ; 0x1110c SERIAL_ERROR_START; 110fe: 87 ec ldi r24, 0xC7 ; 199 11100: 92 ea ldi r25, 0xA2 ; 162 11102: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 11106: 83 ed ldi r24, 0xD3 ; 211 11108: 93 e6 ldi r25, 0x63 ; 99 1110a: df cf rjmp .-66 ; 0x110ca FlushSerialRequestResend(); serial_count = 0; return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 1110c: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 11110: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 11114: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 11116: e9 80 ldd r14, Y+1 ; 0x01 11118: fa 80 ldd r15, Y+2 ; 0x02 1111a: 60 e7 ldi r22, 0x70 ; 112 1111c: 73 e7 ldi r23, 0x73 ; 115 1111e: c7 01 movw r24, r14 11120: 0f 94 ec a1 call 0x343d8 ; 0x343d8 11124: 89 2b or r24, r25 11126: 39 f5 brne .+78 ; 0x11176 kill(MSG_M112_KILL); 11128: 89 e3 ldi r24, 0x39 ; 57 1112a: 96 e6 ldi r25, 0x66 ; 102 1112c: 0e 94 7e 83 call 0x106fc ; 0x106fc // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 11130: 87 ec ldi r24, 0xC7 ; 199 11132: 92 ea ldi r25, 0xA2 ; 162 11134: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 11138: 89 ea ldi r24, 0xA9 ; 169 1113a: 93 e6 ldi r25, 0x63 ; 99 1113c: c6 cf rjmp .-116 ; 0x110ca } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 1113e: 89 81 ldd r24, Y+1 ; 0x01 11140: 9a 81 ldd r25, Y+2 ; 0x02 11142: fc 01 movw r30, r24 11144: 20 81 ld r18, Z 11146: 20 32 cpi r18, 0x20 ; 32 11148: 21 f4 brne .+8 ; 0x11152 1114a: 01 96 adiw r24, 0x01 ; 1 1114c: 9a 83 std Y+2, r25 ; 0x02 1114e: 89 83 std Y+1, r24 ; 0x01 11150: f6 cf rjmp .-20 ; 0x1113e // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 11152: 6a e2 ldi r22, 0x2A ; 42 11154: 70 e0 ldi r23, 0x00 ; 0 11156: 0f 94 95 aa call 0x3552a ; 0x3552a 1115a: 89 2b or r24, r25 1115c: 39 f0 breq .+14 ; 0x1116c { SERIAL_ERROR_START; 1115e: 87 ec ldi r24, 0xC7 ; 199 11160: 92 ea ldi r25, 0xA2 ; 162 11162: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 11166: 8f e7 ldi r24, 0x7F ; 127 11168: 93 e6 ldi r25, 0x63 ; 99 1116a: af cf rjmp .-162 ; 0x110ca 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 1116c: 44 24 eor r4, r4 1116e: 4a 94 dec r4 11170: 54 2c mov r5, r4 11172: 32 01 movw r6, r4 11174: d0 cf rjmp .-96 ; 0x11116 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) 11176: 44 e0 ldi r20, 0x04 ; 4 11178: 50 e0 ldi r21, 0x00 ; 0 1117a: 6b e6 ldi r22, 0x6B ; 107 1117c: 73 e7 ldi r23, 0x73 ; 115 1117e: c7 01 movw r24, r14 11180: 0f 94 1d a2 call 0x3443a ; 0x3443a 11184: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 11186: f7 01 movw r30, r14 11188: 80 81 ld r24, Z 1118a: 87 34 cpi r24, 0x47 ; 71 1118c: 81 f4 brne .+32 ; 0x111ae 1118e: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.385> 11192: 85 30 cpi r24, 0x05 ; 5 11194: 61 f0 breq .+24 ; 0x111ae usb_timer.start(); 11196: 82 e4 ldi r24, 0x42 ; 66 11198: 92 e1 ldi r25, 0x12 ; 18 1119a: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1119e: f6 e0 ldi r31, 0x06 ; 6 111a0: f0 93 61 0d sts 0x0D61, r31 ; 0x800d61 <_ZL13printer_state.lto_priv.385> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 111a4: 60 e0 ldi r22, 0x00 ; 0 111a6: 85 ea ldi r24, 0xA5 ; 165 111a8: 9f e0 ldi r25, 0x0F ; 15 111aa: 0f 94 62 a4 call 0x348c4 ; 0x348c4 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) { 111ae: ab 28 or r10, r11 111b0: 21 f0 breq .+8 ; 0x111ba 111b2: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 111b6: 81 11 cpse r24, r1 111b8: 98 cf rjmp .-208 ; 0x110ea } // 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; 111ba: 26 e0 ldi r18, 0x06 ; 6 111bc: 77 fc sbrc r7, 7 111be: 21 e0 ldi r18, 0x01 ; 1 111c0: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> 111c4: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 111c8: fc 01 movw r30, r24 111ca: e5 5b subi r30, 0xB5 ; 181 111cc: ff 4e sbci r31, 0xEF ; 239 111ce: 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) 111d0: 49 81 ldd r20, Y+1 ; 0x01 111d2: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 111d4: 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) 111d6: da 01 movw r26, r20 111d8: 40 17 cp r20, r16 111da: 51 07 cpc r21, r17 111dc: a1 f5 brne .+104 ; 0x11246 cmd_len = strlen(cmd_start) + 1; 111de: 01 90 ld r0, Z+ 111e0: 00 20 and r0, r0 111e2: e9 f7 brne .-6 ; 0x111de 111e4: 9f 01 movw r18, r30 111e6: 20 1b sub r18, r16 111e8: 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; 111ea: 03 96 adiw r24, 0x03 ; 3 111ec: 28 0f add r18, r24 111ee: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 111f0: 2d 3e cpi r18, 0xED ; 237 111f2: f1 e0 ldi r31, 0x01 ; 1 111f4: 3f 07 cpc r19, r31 111f6: 79 f1 breq .+94 ; 0x11256 // 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; 111f8: 30 93 4a 10 sts 0x104A, r19 ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 111fc: 20 93 49 10 sts 0x1049, r18 ; 0x801049 <_ZL7bufindw.lto_priv.512> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 11200: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 11204: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 11208: 01 96 adiw r24, 0x01 ; 1 1120a: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 1120e: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c // Update the processed gcode line if (gcode_N >= 0) 11212: 77 fc sbrc r7, 7 11214: 08 c0 rjmp .+16 ; 0x11226 gcode_LastN = gcode_N; 11216: 40 92 3e 12 sts 0x123E, r4 ; 0x80123e 1121a: 50 92 3f 12 sts 0x123F, r5 ; 0x80123f 1121e: 60 92 40 12 sts 0x1240, r6 ; 0x801240 11222: 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 11226: 10 92 48 10 sts 0x1048, r1 ; 0x801048 1122a: 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)) 1122e: 0e 94 87 55 call 0xab0e ; 0xab0e 11232: 89 2b or r24, r25 11234: 09 f4 brne .+2 ; 0x11238 11236: c7 cd rjmp .-1138 ; 0x10dc6 11238: 8f e5 ldi r24, 0x5F ; 95 1123a: 90 e0 ldi r25, 0x00 ; 0 1123c: 0e 94 ef 55 call 0xabde ; 0xabde 11240: 81 11 cpse r24, r1 11242: 7f cd rjmp .-1282 ; 0x10d42 11244: c0 cd rjmp .-1152 ; 0x10dc6 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]; } 11246: 6d 91 ld r22, X+ 11248: 61 93 st Z+, r22 1124a: 9d 01 movw r18, r26 1124c: 24 1b sub r18, r20 1124e: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 11250: 61 11 cpse r22, r1 11252: f9 cf rjmp .-14 ; 0x11246 11254: ca cf rjmp .-108 ; 0x111ea } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11256: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 1125a: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.512> 1125e: d0 cf rjmp .-96 ; 0x11200 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 11260: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 11264: 60 e2 ldi r22, 0x20 ; 32 11266: 73 e0 ldi r23, 0x03 ; 3 11268: 81 11 cpse r24, r1 1126a: 02 c0 rjmp .+4 ; 0x11270 1126c: 60 ed ldi r22, 0xD0 ; 208 1126e: 77 e0 ldi r23, 0x07 ; 7 11270: 8f e1 ldi r24, 0x1F ; 31 11272: 93 e0 ldi r25, 0x03 ; 3 11274: 0f 94 30 0b call 0x21660 ; 0x21660 ::expired(unsigned short)> 11278: 88 23 and r24, r24 1127a: 09 f4 brne .+2 ; 0x1127e 1127c: a0 cd rjmp .-1216 ; 0x10dbe comment_mode = false; 1127e: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e serial_count = 0; 11282: 10 92 48 10 sts 0x1048, r1 ; 0x801048 11286: 10 92 47 10 sts 0x1047, r1 ; 0x801047 SERIAL_ECHOLNPGM("RX timeout"); 1128a: 80 e6 ldi r24, 0x60 ; 96 1128c: 93 e7 ldi r25, 0x73 ; 115 1128e: 0e 94 18 7d call 0xfa30 ; 0xfa30 11292: 99 cd rjmp .-1230 ; 0x10dc6 return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 11294: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 11298: 88 23 and r24, r24 1129a: 09 f4 brne .+2 ; 0x1129e 1129c: 94 cd rjmp .-1240 ; 0x10dc6 1129e: 80 91 47 10 lds r24, 0x1047 ; 0x801047 112a2: 90 91 48 10 lds r25, 0x1048 ; 0x801048 112a6: 89 2b or r24, r25 112a8: 09 f0 breq .+2 ; 0x112ac 112aa: 8d cd rjmp .-1254 ; 0x10dc6 //'#' 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; 112ac: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 112b0: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 112b4: 89 2b or r24, r25 112b6: 11 f4 brne .+4 ; 0x112bc 112b8: 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; 112bc: 12 e0 ldi r17, 0x02 ; 2 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 112be: 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) { 112c0: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 112c4: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 112c8: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 112cc: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 112d0: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 112d4: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 112d8: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 112dc: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 112e0: 48 17 cp r20, r24 112e2: 59 07 cpc r21, r25 112e4: 6a 07 cpc r22, r26 112e6: 7b 07 cpc r23, r27 112e8: 08 f0 brcs .+2 ; 0x112ec 112ea: c1 c0 rjmp .+386 ; 0x1146e 112ec: 80 91 1d 03 lds r24, 0x031D ; 0x80031d 112f0: 81 11 cpse r24, r1 112f2: bd c0 rjmp .+378 ; 0x1146e FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); 112f4: 0f 94 5e 6c call 0x2d8bc ; 0x2d8bc 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_;} 112f8: 40 91 6f 16 lds r20, 0x166F ; 0x80166f 112fc: 50 91 70 16 lds r21, 0x1670 ; 0x801670 11300: 60 91 71 16 lds r22, 0x1671 ; 0x801671 11304: 70 91 72 16 lds r23, 0x1672 ; 0x801672 sdpos = file.curPosition(); 11308: 40 93 eb 16 sts 0x16EB, r20 ; 0x8016eb 1130c: 50 93 ec 16 sts 0x16EC, r21 ; 0x8016ec 11310: 60 93 ed 16 sts 0x16ED, r22 ; 0x8016ed 11314: 70 93 ee 16 sts 0x16EE, r23 ; 0x8016ee 11318: 20 91 47 10 lds r18, 0x1047 ; 0x801047 1131c: 30 91 48 10 lds r19, 0x1048 ; 0x801048 int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 11320: 8a 30 cpi r24, 0x0A ; 10 11322: 61 f0 breq .+24 ; 0x1133c || serial_char == '\r' 11324: 8d 30 cpi r24, 0x0D ; 13 11326: 51 f0 breq .+20 ; 0x1133c || serial_char == '#' 11328: 83 32 cpi r24, 0x23 ; 35 1132a: 09 f4 brne .+2 ; 0x1132e 1132c: 87 c0 rjmp .+270 ; 0x1143c || serial_count >= (MAX_CMD_SIZE - 1) 1132e: 2f 35 cpi r18, 0x5F ; 95 11330: 31 05 cpc r19, r1 11332: 24 f4 brge .+8 ; 0x1133c || n==-1 11334: 8f 3f cpi r24, 0xFF ; 255 11336: 98 07 cpc r25, r24 11338: 09 f0 breq .+2 ; 0x1133c 1133a: 87 c0 rjmp .+270 ; 0x1144a ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 1133c: 21 15 cp r18, r1 1133e: 31 05 cpc r19, r1 11340: 09 f4 brne .+2 ; 0x11344 11342: 41 cd rjmp .-1406 ; 0x10dc6 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); }; 11344: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 11348: 81 11 cpse r24, r1 1134a: 03 c0 rjmp .+6 ; 0x11352 1134c: 40 e0 ldi r20, 0x00 ; 0 1134e: 50 e0 ldi r21, 0x00 ; 0 11350: 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; 11352: 80 91 49 12 lds r24, 0x1249 ; 0x801249 11356: 90 91 4a 12 lds r25, 0x124A ; 0x80124a 1135a: 48 1b sub r20, r24 1135c: 59 0b sbc r21, r25 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 1135e: a0 91 49 10 lds r26, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> 11362: b0 91 4a 10 lds r27, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 11366: fd 01 movw r30, r26 11368: e5 5b subi r30, 0xB5 ; 181 1136a: ff 4e sbci r31, 0xEF ; 239 1136c: 10 83 st Z, r17 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 1136e: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 11370: 52 83 std Z+2, r21 ; 0x02 11372: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 11374: 25 5b subi r18, 0xB5 ; 181 11376: 3f 4e sbci r19, 0xEF ; 239 11378: f9 01 movw r30, r18 1137a: ea 0f add r30, r26 1137c: fb 1f adc r31, r27 1137e: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 11380: a5 5b subi r26, 0xB5 ; 181 11382: bf 4e sbci r27, 0xEF ; 239 11384: fd 01 movw r30, r26 11386: 01 90 ld r0, Z+ 11388: 00 20 and r0, r0 1138a: e9 f7 brne .-6 ; 0x11386 1138c: 31 97 sbiw r30, 0x01 ; 1 1138e: ea 1b sub r30, r26 11390: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 11392: 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; 11394: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 11398: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1139c: 01 96 adiw r24, 0x01 ; 1 1139e: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 113a2: 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); 113a6: 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; 113a8: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> 113ac: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 113b0: e8 0f add r30, r24 113b2: f9 2f mov r31, r25 113b4: f1 1d adc r31, r1 113b6: f0 93 4a 10 sts 0x104A, r31 ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 113ba: e0 93 49 10 sts 0x1049, r30 ; 0x801049 <_ZL7bufindw.lto_priv.512> 113be: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 113c2: 88 23 and r24, r24 113c4: 09 f4 brne .+2 ; 0x113c8 113c6: 3d c0 rjmp .+122 ; 0x11442 113c8: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 113cc: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 113d0: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 113d4: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee sdpos_atomic = card.get_sdpos(); 113d8: 80 93 49 12 sts 0x1249, r24 ; 0x801249 113dc: 90 93 4a 12 sts 0x124A, r25 ; 0x80124a 113e0: a0 93 4b 12 sts 0x124B, r26 ; 0x80124b 113e4: b0 93 4c 12 sts 0x124C, r27 ; 0x80124c if (bufindw == sizeof(cmdbuffer)) 113e8: ed 3e cpi r30, 0xED ; 237 113ea: f1 40 sbci r31, 0x01 ; 1 113ec: 21 f4 brne .+8 ; 0x113f6 bufindw = 0; 113ee: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 113f2: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.512> sei(); 113f6: 78 94 sei comment_mode = false; //for new command 113f8: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e serial_count = 0; //clear buffer 113fc: 10 92 48 10 sts 0x1048, r1 ; 0x801048 11400: 10 92 47 10 sts 0x1047, r1 ; 0x801047 if(card.eof()) break; 11404: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 11408: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 1140c: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 11410: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 11414: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 11418: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 1141c: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 11420: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 11424: 48 17 cp r20, r24 11426: 59 07 cpc r21, r25 11428: 6a 07 cpc r22, r26 1142a: 7b 07 cpc r23, r27 1142c: 00 f5 brcc .+64 ; 0x1146e // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 1142e: 8f e5 ldi r24, 0x5F ; 95 11430: 90 e0 ldi r25, 0x00 ; 0 11432: 0e 94 ef 55 call 0xabde ; 0xabde 11436: 81 11 cpse r24, r1 11438: 43 cf rjmp .-378 ; 0x112c0 1143a: c5 cc rjmp .-1654 ; 0x10dc6 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 1143c: 00 93 1d 03 sts 0x031D, r16 ; 0x80031d 11440: 7d cf rjmp .-262 ; 0x1133c 11442: 80 e0 ldi r24, 0x00 ; 0 11444: 90 e0 ldi r25, 0x00 ; 0 11446: dc 01 movw r26, r24 11448: c7 cf rjmp .-114 ; 0x113d8 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 1144a: a9 01 movw r20, r18 1144c: 4f 5f subi r20, 0xFF ; 255 1144e: 5f 4f sbci r21, 0xFF ; 255 11450: 50 93 48 10 sts 0x1048, r21 ; 0x801048 11454: 40 93 47 10 sts 0x1047, r20 ; 0x801047 11458: 40 91 49 10 lds r20, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> 1145c: 50 91 4a 10 lds r21, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 11460: 45 5b subi r20, 0xB5 ; 181 11462: 5f 4e sbci r21, 0xEF ; 239 11464: 24 0f add r18, r20 11466: 35 1f adc r19, r21 11468: f9 01 movw r30, r18 1146a: 83 83 std Z+3, r24 ; 0x03 1146c: 29 cf rjmp .-430 ; 0x112c0 } } if(card.eof()) 1146e: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 11472: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 11476: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 1147a: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 1147e: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 11482: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 11486: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 1148a: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 1148e: 48 17 cp r20, r24 11490: 59 07 cpc r21, r25 11492: 6a 07 cpc r22, r26 11494: 7b 07 cpc r23, r27 11496: 08 f4 brcc .+2 ; 0x1149a 11498: 96 cc rjmp .-1748 ; 0x10dc6 { // 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()) 1149a: 0e 94 5e 79 call 0xf2bc ; 0xf2bc 1149e: 89 2b or r24, r25 114a0: 09 f0 breq .+2 ; 0x114a4 114a2: 91 cc rjmp .-1758 ; 0x10dc6 { // queue is complete, but before we process EOF commands prevent // re-entry by disabling SD processing from any st_synchronize call card.closefile(); 114a4: 0f 94 6f 65 call 0x2cade ; 0x2cade SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED 114a8: 8c e6 ldi r24, 0x6C ; 108 114aa: 93 e6 ldi r25, 0x63 ; 99 114ac: 0e 94 18 7d call 0xfa30 ; 0xfa30 char time[30]; uint32_t t = print_job_timer.duration() / 60; 114b0: 0f 94 cd 14 call 0x2299a ; 0x2299a 114b4: 6b 01 movw r12, r22 114b6: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 114b8: 0e 94 0b 65 call 0xca16 ; 0xca16 // 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; 114bc: 8c e3 ldi r24, 0x3C ; 60 114be: 88 2e mov r8, r24 114c0: 91 2c mov r9, r1 114c2: a1 2c mov r10, r1 114c4: b1 2c mov r11, r1 114c6: c7 01 movw r24, r14 114c8: b6 01 movw r22, r12 114ca: a5 01 movw r20, r10 114cc: 94 01 movw r18, r8 114ce: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> int hours, minutes; minutes = t % 60; 114d2: ca 01 movw r24, r20 114d4: b9 01 movw r22, r18 114d6: a5 01 movw r20, r10 114d8: 94 01 movw r18, r8 114da: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 114de: 7f 93 push r23 114e0: 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; 114e2: c7 01 movw r24, r14 114e4: b6 01 movw r22, r12 114e6: 20 e1 ldi r18, 0x10 ; 16 114e8: 3e e0 ldi r19, 0x0E ; 14 114ea: 40 e0 ldi r20, 0x00 ; 0 114ec: 50 e0 ldi r21, 0x00 ; 0 114ee: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 114f2: 3f 93 push r19 114f4: 2f 93 push r18 114f6: 8c e4 ldi r24, 0x4C ; 76 114f8: 93 e7 ldi r25, 0x73 ; 115 114fa: 9f 93 push r25 114fc: 8f 93 push r24 114fe: 8e 01 movw r16, r28 11500: 0f 5f subi r16, 0xFF ; 255 11502: 1f 4f sbci r17, 0xFF ; 255 11504: 1f 93 push r17 11506: 0f 93 push r16 11508: 0f 94 55 a3 call 0x346aa ; 0x346aa SERIAL_ECHO_START; 1150c: 84 ee ldi r24, 0xE4 ; 228 1150e: 92 ea ldi r25, 0xA2 ; 162 11510: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN(time); 11514: c8 01 movw r24, r16 11516: 0e 94 1d 86 call 0x10c3a ; 0x10c3a lcd_setstatus(time); 1151a: c8 01 movw r24, r16 1151c: 0e 94 d3 dc call 0x1b9a6 ; 0x1b9a6 card.printingHasFinished(); 11520: 0f 94 86 72 call 0x2e50c ; 0x2e50c if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 11524: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.513> if(!mounted) 11528: 0f b6 in r0, 0x3f ; 63 1152a: f8 94 cli 1152c: de bf out 0x3e, r29 ; 62 1152e: 0f be out 0x3f, r0 ; 63 11530: cd bf out 0x3d, r28 ; 61 11532: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 11536: 88 23 and r24, r24 11538: 59 f0 breq .+22 ; 0x11550 1153a: 0f 94 a1 67 call 0x2cf42 ; 0x2cf42 card.checkautostart(true); if (farm_mode) 1153e: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 11542: 88 23 and r24, r24 11544: 09 f4 brne .+2 ; 0x11548 11546: 3f cc rjmp .-1922 ; 0x10dc6 prusa_statistics(6); 11548: 86 e0 ldi r24, 0x06 ; 6 1154a: 0f 94 a0 2f call 0x25f40 ; 0x25f40 1154e: 3b cc rjmp .-1930 ; 0x10dc6 { mount(); 11550: 81 e0 ldi r24, 0x01 ; 1 11552: 0f 94 c5 72 call 0x2e58a ; 0x2e58a if(!mounted) //fail 11556: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1155a: 81 11 cpse r24, r1 1155c: ee cf rjmp .-36 ; 0x1153a 1155e: ef cf rjmp .-34 ; 0x1153e 00011560 : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 11560: 0f 93 push r16 11562: 1f 93 push r17 11564: cf 93 push r28 11566: df 93 push r29 11568: c8 2f mov r28, r24 state = State::disabled; filter = 0; } bool PAT9125_sensor::update() { switch (state) { 1156a: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1156e: 81 30 cpi r24, 0x01 ; 1 11570: 09 f4 brne .+2 ; 0x11574 11572: 49 c0 rjmp .+146 ; 0x11606 11574: 82 30 cpi r24, 0x02 ; 2 11576: 09 f4 brne .+2 ; 0x1157a 11578: 5f c0 rjmp .+190 ; 0x11638 * * 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) 1157a: 0e 94 ec 66 call 0xcdd8 ; 0xcdd8 1157e: 81 11 cpse r24, r1 11580: ff c0 rjmp .+510 ; 0x11780 11582: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 11586: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 1158a: 00 97 sbiw r24, 0x00 ; 0 1158c: 39 f4 brne .+14 ; 0x1159c 1158e: 20 91 59 12 lds r18, 0x1259 ; 0x801259 11592: 30 91 5a 12 lds r19, 0x125A ; 0x80125a 11596: 23 2b or r18, r19 11598: 09 f4 brne .+2 ; 0x1159c 1159a: f2 c0 rjmp .+484 ; 0x11780 1159c: 40 91 33 02 lds r20, 0x0233 ; 0x800233 115a0: 50 91 34 02 lds r21, 0x0234 ; 0x800234 115a4: 60 91 35 02 lds r22, 0x0235 ; 0x800235 115a8: 70 91 36 02 lds r23, 0x0236 ; 0x800236 115ac: 41 15 cp r20, r1 115ae: 51 05 cpc r21, r1 115b0: 61 05 cpc r22, r1 115b2: 71 05 cpc r23, r1 115b4: 09 f4 brne .+2 ; 0x115b8 115b6: e4 c0 rjmp .+456 ; 0x11780 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 115b8: 89 2b or r24, r25 115ba: 31 f4 brne .+12 ; 0x115c8 115bc: 80 91 59 12 lds r24, 0x1259 ; 0x801259 115c0: 90 91 5a 12 lds r25, 0x125A ; 0x80125a 115c4: 89 2b or r24, r25 115c6: 29 f0 breq .+10 ; 0x115d2 115c8: 80 91 ad 05 lds r24, 0x05AD ; 0x8005ad 115cc: 88 23 and r24, r24 115ce: 09 f4 brne .+2 ; 0x115d2 115d0: 3f c1 rjmp .+638 ; 0x11850 { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 115d2: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 115d6: 88 23 and r24, r24 115d8: 21 f0 breq .+8 ; 0x115e2 115da: 40 ee ldi r20, 0xE0 ; 224 115dc: 52 e3 ldi r21, 0x32 ; 50 115de: 69 e2 ldi r22, 0x29 ; 41 115e0: 70 e0 ldi r23, 0x00 ; 0 115e2: 8d ea ldi r24, 0xAD ; 173 115e4: 95 e0 ldi r25, 0x05 ; 5 115e6: 0f 94 6b 0b call 0x216d6 ; 0x216d6 ::expired(unsigned long)> 115ea: 88 23 and r24, r24 115ec: 09 f4 brne .+2 ; 0x115f0 115ee: ca c0 rjmp .+404 ; 0x11784 { disable_heater(); 115f0: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 115f4: 80 e6 ldi r24, 0x60 ; 96 115f6: 96 e3 ldi r25, 0x36 ; 54 115f8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 115fc: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 lcd_return_to_status(); 11600: 0f 94 18 05 call 0x20a30 ; 0x20a30 11604: bf c0 rjmp .+382 ; 0x11784 case State::initializing: if (!updatePAT9125()) { 11606: 0f 94 e5 6d call 0x2dbca ; 0x2dbca 1160a: 88 23 and r24, r24 1160c: 09 f4 brne .+2 ; 0x11610 1160e: b5 cf rjmp .-150 ; 0x1157a class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 11610: 81 e0 ldi r24, 0x01 ; 1 11612: 90 91 fe 16 lds r25, 0x16FE ; 0x8016fe 11616: 91 11 cpse r25, r1 11618: 01 c0 rjmp .+2 ; 0x1161c 1161a: 80 e0 ldi r24, 0x00 ; 0 break; // still not stable. Stay in the initialization state. } oldFilamentPresent = 1161c: 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; 11620: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 11624: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 11628: 90 93 01 17 sts 0x1701, r25 ; 0x801701 1162c: 80 93 00 17 sts 0x1700, r24 ; 0x801700 state = State::ready; 11630: 82 e0 ldi r24, 0x02 ; 2 11632: 80 93 f1 16 sts 0x16F1, r24 ; 0x8016f1 11636: a1 cf rjmp .-190 ; 0x1157a break; case State::ready: { updatePAT9125(); 11638: 0f 94 e5 6d call 0x2dbca ; 0x2dbca postponedLoadEvent = false; 1163c: 10 92 f5 16 sts 0x16F5, r1 ; 0x8016f5 sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 11640: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 11644: 82 30 cpi r24, 0x02 ; 2 11646: 09 f0 breq .+2 ; 0x1164a 11648: 98 cf rjmp .-208 ; 0x1157a return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 1164a: 80 91 f6 16 lds r24, 0x16F6 ; 0x8016f6 1164e: 81 11 cpse r24, r1 11650: 40 c0 rjmp .+128 ; 0x116d2 11652: d0 91 fe 16 lds r29, 0x16FE ; 0x8016fe 11656: 81 e0 ldi r24, 0x01 ; 1 11658: d1 11 cpse r29, r1 1165a: 01 c0 rjmp .+2 ; 0x1165e 1165c: 80 e0 ldi r24, 0x00 ; 0 return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); if (oldFilamentPresent != newFilamentPresent) { 1165e: 90 91 f4 16 lds r25, 0x16F4 ; 0x8016f4 11662: 89 17 cp r24, r25 11664: 09 f4 brne .+2 ; 0x11668 11666: 89 cf rjmp .-238 ; 0x1157a oldFilamentPresent = newFilamentPresent; 11668: 80 93 f4 16 sts 0x16F4, r24 ; 0x8016f4 eventBlankingTimer.start(); 1166c: 86 ef ldi r24, 0xF6 ; 246 1166e: 96 e1 ldi r25, 0x16 ; 22 11670: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> if (newFilamentPresent) { // filament insertion 11674: dd 23 and r29, r29 11676: b1 f1 breq .+108 ; 0x116e4 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11678: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 1167c: 88 23 and r24, r24 1167e: 11 f1 breq .+68 ; 0x116c4 return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 11680: 80 91 94 03 lds r24, 0x0394 ; 0x800394 11684: 81 11 cpse r24, r1 11686: 1e c0 rjmp .+60 ; 0x116c4 && !( 11688: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1168c: 81 30 cpi r24, 0x01 ; 1 1168e: d1 f0 breq .+52 ; 0x116c4 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); 11690: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 11694: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 11698: 89 1b sub r24, r25 1169a: 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 1169c: 99 f4 brne .+38 ; 0x116c4 || printJobOngoing() 1169e: 0e 94 9b 66 call 0xcd36 ; 0xcd36 116a2: 81 11 cpse r24, r1 116a4: 0f c0 rjmp .+30 ; 0x116c4 || (lcd_commands_type == LcdCommands::Layer1Cal) 116a6: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 116aa: 84 30 cpi r24, 0x04 ; 4 116ac: 59 f0 breq .+22 ; 0x116c4 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 116ae: 8f e5 ldi r24, 0x5F ; 95 116b0: 9f e0 ldi r25, 0x0F ; 15 116b2: 0f 94 3e a4 call 0x3487c ; 0x3487c } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 116b6: 81 11 cpse r24, r1 116b8: 05 c0 rjmp .+10 ; 0x116c4 || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 116ba: 61 e0 ldi r22, 0x01 ; 1 116bc: 8e e0 ldi r24, 0x0E ; 14 116be: 98 e3 ldi r25, 0x38 ; 56 116c0: 0e 94 38 63 call 0xc670 ; 0xc670 oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 116c4: 81 e0 ldi r24, 0x01 ; 1 116c6: 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. 116ca: 81 e0 ldi r24, 0x01 ; 1 116cc: 80 93 59 02 sts 0x0259, r24 ; 0x800259 116d0: 54 cf rjmp .-344 ; 0x1157a } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 116d2: 64 e6 ldi r22, 0x64 ; 100 116d4: 70 e0 ldi r23, 0x00 ; 0 116d6: 86 ef ldi r24, 0xF6 ; 246 116d8: 96 e1 ldi r25, 0x16 ; 22 116da: 0f 94 30 0b call 0x21660 ; 0x21660 ::expired(unsigned short)> 116de: 81 11 cpse r24, r1 116e0: b8 cf rjmp .-144 ; 0x11652 116e2: 4b cf rjmp .-362 ; 0x1157a && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 116e4: 80 91 f3 16 lds r24, 0x16F3 ; 0x8016f3 116e8: 88 23 and r24, r24 116ea: 79 f3 breq .-34 ; 0x116ca } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 116ec: 80 91 94 03 lds r24, 0x0394 ; 0x800394 116f0: 81 11 cpse r24, r1 116f2: eb cf rjmp .-42 ; 0x116ca 116f4: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 116f8: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 116fc: 89 1b sub r24, r25 116fe: 8f 70 andi r24, 0x0F ; 15 && ( 11700: 21 f4 brne .+8 ; 0x1170a moves_planned() != 0 || printJobOngoing() 11702: 0e 94 9b 66 call 0xcd36 ; 0xcd36 11706: 88 23 and r24, r24 11708: 01 f3 breq .-64 ; 0x116ca ) && !( 1170a: 80 91 73 12 lds r24, 0x1273 ; 0x801273 1170e: 81 11 cpse r24, r1 11710: dc cf rjmp .-72 ; 0x116ca saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 11712: 80 91 01 13 lds r24, 0x1301 ; 0x801301 11716: 81 30 cpi r24, 0x01 ; 1 11718: c1 f2 breq .-80 ; 0x116ca || (lcd_commands_type == LcdCommands::Layer1Cal) 1171a: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1171e: 84 30 cpi r24, 0x04 ; 4 11720: a1 f2 breq .-88 ; 0x116ca || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 11722: 8f e5 ldi r24, 0x5F ; 95 11724: 9f e0 ldi r25, 0x0F ; 15 11726: 0f 94 3e a4 call 0x3487c ; 0x3487c && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 1172a: 81 11 cpse r24, r1 1172c: ce cf rjmp .-100 ; 0x116ca } //! @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); 1172e: 8a e3 ldi r24, 0x3A ; 58 11730: 95 e6 ldi r25, 0x65 ; 101 11732: 9f 93 push r25 11734: 8f 93 push r24 11736: 80 e2 ldi r24, 0x20 ; 32 11738: 95 e6 ldi r25, 0x65 ; 101 1173a: 9f 93 push r25 1173c: 8f 93 push r24 1173e: 0f 94 00 a3 call 0x34600 ; 0x34600 void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 11742: 10 92 f3 16 sts 0x16F3, r1 ; 0x8016f3 autoLoadEnabled = false; 11746: 10 92 f2 16 sts 0x16F2, r1 ; 0x8016f2 stop_and_save_print_to_ram(0, 0); 1174a: 60 e0 ldi r22, 0x00 ; 0 1174c: 70 e0 ldi r23, 0x00 ; 0 1174e: cb 01 movw r24, r22 11750: 0f 94 7c 65 call 0x2caf8 ; 0x2caf8 restore_print_from_ram_and_continue(0); 11754: 60 e0 ldi r22, 0x00 ; 0 11756: 70 e0 ldi r23, 0x00 ; 0 11758: cb 01 movw r24, r22 1175a: 0e 94 13 67 call 0xce26 ; 0xce26 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 1175e: 85 e6 ldi r24, 0x65 ; 101 11760: 9f e0 ldi r25, 0x0F ; 15 11762: 0e 94 d7 78 call 0xf1ae ; 0xf1ae eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11766: 81 e0 ldi r24, 0x01 ; 1 11768: 9f e0 ldi r25, 0x0F ; 15 1176a: 0e 94 ca 78 call 0xf194 ; 0xf194 enquecommand_front_P(MSG_M600); 1176e: 82 e0 ldi r24, 0x02 ; 2 11770: 9d e6 ldi r25, 0x6D ; 109 11772: 0f 94 e7 66 call 0x2cdce ; 0x2cdce 11776: 0f 90 pop r0 11778: 0f 90 pop r0 1177a: 0f 90 pop r0 1177c: 0f 90 pop r0 1177e: a5 cf rjmp .-182 ; 0x116ca inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 11780: 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)){ 11784: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 11788: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1178c: 03 97 sbiw r24, 0x03 ; 3 1178e: 14 f4 brge .+4 ; 0x11794 get_command(); 11790: 0e 94 21 86 call 0x10c42 ; 0x10c42 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); 11794: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 11798: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 1179c: 98 17 cp r25, r24 1179e: 81 f0 breq .+32 ; 0x117c0 117a0: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.385> 117a4: 86 30 cpi r24, 0x06 ; 6 117a6: 61 f4 brne .+24 ; 0x117c0 117a8: 68 e8 ldi r22, 0x88 ; 136 117aa: 73 e1 ldi r23, 0x13 ; 19 117ac: 82 e4 ldi r24, 0x42 ; 66 117ae: 92 e1 ldi r25, 0x12 ; 18 117b0: 0f 94 30 0b call 0x21660 ; 0x21660 ::expired(unsigned short)> 117b4: 88 23 and r24, r24 117b6: 21 f0 breq .+8 ; 0x117c0 { // 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(); 117b8: 82 e4 ldi r24, 0x42 ; 66 117ba: 92 e1 ldi r25, 0x12 ; 18 117bc: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 117c0: 40 91 44 03 lds r20, 0x0344 ; 0x800344 117c4: 50 91 45 03 lds r21, 0x0345 ; 0x800345 117c8: 60 91 46 03 lds r22, 0x0346 ; 0x800346 117cc: 70 91 47 03 lds r23, 0x0347 ; 0x800347 117d0: 41 15 cp r20, r1 117d2: 51 05 cpc r21, r1 117d4: 61 05 cpc r22, r1 117d6: 71 05 cpc r23, r1 117d8: 09 f0 breq .+2 ; 0x117dc 117da: 3f c0 rjmp .+126 ; 0x1185a kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 117dc: 40 91 37 02 lds r20, 0x0237 ; 0x800237 117e0: 50 91 38 02 lds r21, 0x0238 ; 0x800238 117e4: 60 91 39 02 lds r22, 0x0239 ; 0x800239 117e8: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 117ec: 41 15 cp r20, r1 117ee: 51 05 cpc r21, r1 117f0: 61 05 cpc r22, r1 117f2: 71 05 cpc r23, r1 117f4: a9 f0 breq .+42 ; 0x11820 117f6: 88 e4 ldi r24, 0x48 ; 72 117f8: 93 e0 ldi r25, 0x03 ; 3 117fa: 0f 94 6b 0b call 0x216d6 ; 0x216d6 ::expired(unsigned long)> 117fe: 88 23 and r24, r24 11800: 79 f0 breq .+30 ; 0x11820 11802: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 11806: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f if(blocks_queued() == false && ignore_stepper_queue == false) { 1180a: 98 13 cpse r25, r24 1180c: 09 c0 rjmp .+18 ; 0x11820 1180e: c1 11 cpse r28, r1 11810: 07 c0 rjmp .+14 ; 0x11820 disable_x(); 11812: 17 9a sbi 0x02, 7 ; 2 11814: 10 92 39 06 sts 0x0639, r1 ; 0x800639 disable_y(); 11818: 16 9a sbi 0x02, 6 ; 2 1181a: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a disable_z(); disable_e0(); 1181e: 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; 11820: c0 91 55 12 lds r28, 0x1255 ; 0x801255 block_t *block; if(block_buffer_tail != block_buffer_head) 11824: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 11828: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 1182c: 98 17 cp r25, r24 1182e: 01 f1 breq .+64 ; 0x11870 { uint8_t block_index = block_buffer_tail; 11830: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f tail_fan_speed = block_buffer[block_index].fan_speed; 11834: 9e e6 ldi r25, 0x6E ; 110 11836: 89 9f mul r24, r25 11838: f0 01 movw r30, r0 1183a: 11 24 eor r1, r1 1183c: ec 55 subi r30, 0x5C ; 92 1183e: f9 4f sbci r31, 0xF9 ; 249 11840: c0 81 ld r28, Z while(block_index != block_buffer_head) 11842: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 11846: 98 17 cp r25, r24 11848: 99 f0 breq .+38 ; 0x11870 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); 1184a: 8f 5f subi r24, 0xFF ; 255 1184c: 8f 70 andi r24, 0x0F ; 15 1184e: f9 cf rjmp .-14 ; 0x11842 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 11850: 8d ea ldi r24, 0xAD ; 173 11852: 95 e0 ldi r25, 0x05 ; 5 11854: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> 11858: 95 cf rjmp .-214 ; 0x11784 // 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)) 1185a: 88 e4 ldi r24, 0x48 ; 72 1185c: 93 e0 ldi r25, 0x03 ; 3 1185e: 0f 94 6b 0b call 0x216d6 ; 0x216d6 ::expired(unsigned long)> 11862: 88 23 and r24, r24 11864: 09 f4 brne .+2 ; 0x11868 11866: ba cf rjmp .-140 ; 0x117dc kill(PSTR("Inactivity Shutdown")); 11868: 8a e9 ldi r24, 0x9A ; 154 1186a: 98 e7 ldi r25, 0x78 ; 120 1186c: 0e 94 7e 83 call 0x106fc ; 0x106fc 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) { 11870: cc 23 and r28, r28 11872: 09 f4 brne .+2 ; 0x11876 11874: be c0 rjmp .+380 ; 0x119f2 if (fan_kick_end == 0) { 11876: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 1187a: 90 91 40 03 lds r25, 0x0340 ; 0x800340 1187e: a0 91 41 03 lds r26, 0x0341 ; 0x800341 11882: b0 91 42 03 lds r27, 0x0342 ; 0x800342 11886: 89 2b or r24, r25 11888: 8a 2b or r24, r26 1188a: 8b 2b or r24, r27 1188c: 81 f4 brne .+32 ; 0x118ae // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 1188e: 0f 94 01 0b call 0x21602 ; 0x21602 11892: 60 5e subi r22, 0xE0 ; 224 11894: 7c 4f sbci r23, 0xFC ; 252 11896: 8f 4f sbci r24, 0xFF ; 255 11898: 9f 4f sbci r25, 0xFF ; 255 1189a: 60 93 3f 03 sts 0x033F, r22 ; 0x80033f 1189e: 70 93 40 03 sts 0x0340, r23 ; 0x800340 118a2: 80 93 41 03 sts 0x0341, r24 ; 0x800341 118a6: 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; 118aa: cf ef ldi r28, 0xFF ; 255 118ac: 0f c0 rjmp .+30 ; 0x118cc 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()) 118ae: 0f 94 01 0b call 0x21602 ; 0x21602 118b2: 00 91 3f 03 lds r16, 0x033F ; 0x80033f 118b6: 10 91 40 03 lds r17, 0x0340 ; 0x800340 118ba: 20 91 41 03 lds r18, 0x0341 ; 0x800341 118be: 30 91 42 03 lds r19, 0x0342 ; 0x800342 118c2: 60 17 cp r22, r16 118c4: 71 07 cpc r23, r17 118c6: 82 07 cpc r24, r18 118c8: 93 07 cpc r25, r19 118ca: 78 f3 brcs .-34 ; 0x118aa } 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 118cc: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 118d0: 88 23 and r24, r24 118d2: 09 f4 brne .+2 ; 0x118d6 118d4: 97 c0 rjmp .+302 ; 0x11a04 fanSpeedBckp = tail_fan_speed; 118d6: 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) { 118da: 80 91 5f 04 lds r24, 0x045F ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.501> 118de: 81 11 cpse r24, r1 118e0: 07 c0 rjmp .+14 ; 0x118f0 return; } avoidRecursion = true; 118e2: 81 e0 ldi r24, 0x01 ; 1 118e4: 80 93 5f 04 sts 0x045F, r24 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.501> mmu_loop_inner(true); 118e8: 0f 94 96 97 call 0x32f2c ; 0x32f2c avoidRecursion = false; 118ec: 10 92 5f 04 sts 0x045F, r1 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.501> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { 118f0: 80 91 a6 05 lds r24, 0x05A6 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.499> 118f4: 88 23 and r24, r24 118f6: c9 f1 breq .+114 ; 0x1196a lcd_backlight_wake_trigger = false; 118f8: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.499> backlight_wake(); bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 118fc: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 118fe: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 11900: 80 91 a4 05 lds r24, 0x05A4 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.500> 11904: 28 2f mov r18, r24 11906: 08 2e mov r0, r24 11908: 00 0c add r0, r0 1190a: 33 0b sbc r19, r19 1190c: 37 ff sbrs r19, 7 1190e: 03 c0 rjmp .+6 ; 0x11916 11910: 31 95 neg r19 11912: 21 95 neg r18 11914: 31 09 sbc r19, r1 11916: 24 30 cpi r18, 0x04 ; 4 11918: 31 05 cpc r19, r1 1191a: 0c f4 brge .+2 ; 0x1191e 1191c: 76 c0 rjmp .+236 ; 0x11a0a lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 1191e: 98 2f mov r25, r24 11920: 87 ff sbrs r24, 7 11922: 02 c0 rjmp .+4 ; 0x11928 11924: 93 e0 ldi r25, 0x03 ; 3 11926: 98 0f add r25, r24 11928: 95 95 asr r25 1192a: 95 95 asr r25 1192c: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 11930: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 11934: 29 0f add r18, r25 11936: 31 1d adc r19, r1 11938: 97 fd sbrc r25, 7 1193a: 3a 95 dec r19 1193c: 30 93 1f 06 sts 0x061F, r19 ; 0x80061f 11940: 20 93 1e 06 sts 0x061E, r18 ; 0x80061e lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 11944: 83 78 andi r24, 0x83 ; 131 11946: 87 ff sbrs r24, 7 11948: 03 c0 rjmp .+6 ; 0x11950 1194a: 81 50 subi r24, 0x01 ; 1 1194c: 8c 6f ori r24, 0xFC ; 252 1194e: 8f 5f subi r24, 0xFF ; 255 11950: 80 93 a4 05 sts 0x05A4, r24 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.500> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11954: 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); 11956: 86 e0 ldi r24, 0x06 ; 6 11958: 0f 94 06 23 call 0x2460c ; 0x2460c if (lcd_draw_update == 0) { 1195c: 80 91 59 02 lds r24, 0x0259 ; 0x800259 11960: 81 11 cpse r24, r1 11962: 03 c0 rjmp .+6 ; 0x1196a // Update LCD rendering at minimum lcd_draw_update = 1; 11964: 81 e0 ldi r24, 0x01 ; 1 11966: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_knob_update(); backlight_update(); // handle longpress if(lcd_longpress_trigger) 1196a: 80 91 a7 05 lds r24, 0x05A7 ; 0x8005a7 1196e: 88 23 and r24, r24 11970: 61 f0 breq .+24 ; 0x1198a { lcd_consume_click(); // Reset trigger to prevent recursion 11972: 0e 94 cb 73 call 0xe796 ; 0xe796 // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 11976: e0 91 06 04 lds r30, 0x0406 ; 0x800406 1197a: f0 91 07 04 lds r31, 0x0407 ; 0x800407 1197e: 30 97 sbiw r30, 0x00 ; 0 11980: 21 f0 breq .+8 ; 0x1198a 11982: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 11986: 81 11 cpse r24, r1 { lcd_longpress_func(); 11988: 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); } 1198a: 20 91 cf 13 lds r18, 0x13CF ; 0x8013cf 1198e: 30 e0 ldi r19, 0x00 ; 0 11990: a8 ee ldi r26, 0xE8 ; 232 11992: b3 e0 ldi r27, 0x03 ; 3 11994: 0f 94 de a4 call 0x349bc ; 0x349bc <__umulhisi3> 11998: ab 01 movw r20, r22 1199a: bc 01 movw r22, r24 1199c: 80 ed ldi r24, 0xD0 ; 208 1199e: 93 e1 ldi r25, 0x13 ; 19 119a0: 0f 94 6b 0b call 0x216d6 ; 0x216d6 ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) 119a4: 88 23 and r24, r24 119a6: 99 f0 breq .+38 ; 0x119ce 119a8: 80 91 ce 13 lds r24, 0x13CE ; 0x8013ce { if(autoReportFeatures.Temp()){ 119ac: 80 fd sbrc r24, 0 gcode_M105(); 119ae: 0e 94 91 7c call 0xf922 ; 0xf922 119b2: 80 91 ce 13 lds r24, 0x13CE ; 0x8013ce } if(autoReportFeatures.Pos()){ 119b6: 82 fd sbrc r24, 2 gcode_M114(); 119b8: 0e 94 16 7c call 0xf82c ; 0xf82c 119bc: 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()){ 119c0: 81 fd sbrc r24, 1 gcode_M123(); 119c2: 0e 94 70 65 call 0xcae0 ; 0xcae0 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } 119c6: 80 ed ldi r24, 0xD0 ; 208 119c8: 93 e1 ldi r25, 0x13 ; 19 119ca: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; 119ce: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 119d2: 81 11 cpse r24, r1 119d4: 02 c0 rjmp .+4 ; 0x119da 119d6: 0e 94 1c 7d call 0xfa38 ; 0xfa38 bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 119da: 40 e3 ldi r20, 0x30 ; 48 119dc: 55 e7 ldi r21, 0x75 ; 117 119de: 60 e0 ldi r22, 0x00 ; 0 119e0: 70 e0 ldi r23, 0x00 ; 0 119e2: 8c e8 ldi r24, 0x8C ; 140 119e4: 93 e0 ldi r25, 0x03 ; 3 #if defined(AUTO_REPORT) host_autoreport(); #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } 119e6: df 91 pop r29 119e8: cf 91 pop r28 119ea: 1f 91 pop r17 119ec: 0f 91 pop r16 119ee: 0d 94 6b 0b jmp 0x216d6 ; 0x216d6 ::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; 119f2: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f 119f6: 10 92 40 03 sts 0x0340, r1 ; 0x800340 119fa: 10 92 41 03 sts 0x0341, r1 ; 0x800341 119fe: 10 92 42 03 sts 0x0342, r1 ; 0x800342 11a02: 64 cf rjmp .-312 ; 0x118cc #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; 11a04: c0 93 1d 06 sts 0x061D, r28 ; 0x80061d 11a08: 68 cf rjmp .-304 ; 0x118da 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; 11a0a: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.500> 11a0e: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 11a10: 80 e0 ldi r24, 0x00 ; 0 11a12: a2 cf rjmp .-188 ; 0x11958 00011a14 : #endif #endif } void delay_keep_alive(unsigned int ms) { 11a14: cf 93 push r28 11a16: df 93 push r29 11a18: ec 01 movw r28, r24 for (;;) { manage_heater(); 11a1a: 0f 94 43 37 call 0x26e86 ; 0x26e86 // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 11a1e: 81 e0 ldi r24, 0x01 ; 1 11a20: 0e 94 b0 8a call 0x11560 ; 0x11560 lcd_update(0); 11a24: 80 e0 ldi r24, 0x00 ; 0 11a26: 0e 94 54 6f call 0xdea8 ; 0xdea8 if (ms == 0) 11a2a: 20 97 sbiw r28, 0x00 ; 0 11a2c: 99 f0 breq .+38 ; 0x11a54 break; else if (ms >= 50) { 11a2e: c2 33 cpi r28, 0x32 ; 50 11a30: d1 05 cpc r29, r1 11a32: 40 f0 brcs .+16 ; 0x11a44 _delay(50); 11a34: 62 e3 ldi r22, 0x32 ; 50 11a36: 70 e0 ldi r23, 0x00 ; 0 11a38: 80 e0 ldi r24, 0x00 ; 0 11a3a: 90 e0 ldi r25, 0x00 ; 0 11a3c: 0f 94 ce 0a call 0x2159c ; 0x2159c ms -= 50; 11a40: e2 97 sbiw r28, 0x32 ; 50 11a42: eb cf rjmp .-42 ; 0x11a1a } else { _delay(ms); 11a44: be 01 movw r22, r28 11a46: 90 e0 ldi r25, 0x00 ; 0 11a48: 80 e0 ldi r24, 0x00 ; 0 11a4a: 0f 94 ce 0a call 0x2159c ; 0x2159c ms = 0; 11a4e: d0 e0 ldi r29, 0x00 ; 0 11a50: c0 e0 ldi r28, 0x00 ; 0 11a52: e3 cf rjmp .-58 ; 0x11a1a } } } 11a54: df 91 pop r29 11a56: cf 91 pop r28 11a58: 08 95 ret 00011a5a : /// @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) { 11a5a: cf 93 push r28 11a5c: df 93 push r29 11a5e: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11a60: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 11a62: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 11a66: 81 e0 ldi r24, 0x01 ; 1 11a68: 0e 94 b0 8a call 0x11560 ; 0x11560 11a6c: 80 91 ff 12 lds r24, 0x12FF ; 0x8012ff btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 11a70: 8f 3f cpi r24, 0xFF ; 255 11a72: d9 f4 brne .+54 ; 0x11aaa // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 11a74: 80 91 94 12 lds r24, 0x1294 ; 0x801294 11a78: 84 30 cpi r24, 0x04 ; 4 11a7a: 21 f4 brne .+8 ; 0x11a84 }; 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 11a7c: 80 91 97 12 lds r24, 0x1297 ; 0x801297 11a80: 81 11 cpse r24, r1 11a82: ef cf rjmp .-34 ; 0x11a62 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 11a84: 80 91 d2 12 lds r24, 0x12D2 ; 0x8012d2 11a88: 90 91 d3 12 lds r25, 0x12D3 ; 0x8012d3 11a8c: 01 97 sbiw r24, 0x01 ; 1 11a8e: 49 f7 brne .-46 ; 0x11a62 && lastErrorCode != ec) // The error code is not a duplicate 11a90: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 11a94: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 11a98: 89 32 cpi r24, 0x29 ; 41 11a9a: 90 48 sbci r25, 0x80 ; 128 11a9c: 11 f3 breq .-60 ; 0x11a62 { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11a9e: 60 e0 ldi r22, 0x00 ; 0 11aa0: 89 e2 ldi r24, 0x29 ; 41 11aa2: 90 e8 ldi r25, 0x80 ; 128 11aa4: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 11aa8: dc cf rjmp .-72 ; 0x11a62 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11aaa: d0 93 ff 12 sts 0x12FF, r29 ; 0x8012ff { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11aae: 85 30 cpi r24, 0x05 ; 5 11ab0: 39 f4 brne .+14 ; 0x11ac0 if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 11ab2: cf 3f cpi r28, 0xFF ; 255 11ab4: f9 f2 breq .-66 ; 0x11a74 MMU2::mmu2.eject_filament(eject_slot, true); 11ab6: 61 e0 ldi r22, 0x01 ; 1 11ab8: 8c 2f mov r24, r28 11aba: 0f 94 2a 9e call 0x33c54 ; 0x33c54 11abe: d1 cf rjmp .-94 ; 0x11a62 // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 11ac0: 84 30 cpi r24, 0x04 ; 4 11ac2: c1 f6 brne .-80 ; 0x11a74 } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 11ac4: df 91 pop r29 11ac6: cf 91 pop r28 11ac8: 08 95 ret 00011aca : //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) { 11aca: ff 92 push r15 11acc: 0f 93 push r16 11ace: 1f 93 push r17 11ad0: cf 93 push r28 11ad2: df 93 push r29 11ad4: ec 01 movw r28, r24 11ad6: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 11ad8: 66 23 and r22, r22 11ada: 09 f4 brne .+2 ; 0x11ade 11adc: 4b c0 rjmp .+150 ; 0x11b74 11ade: 0f 94 fc a1 call 0x343f8 ; 0x343f8 <__strlen_P> 11ae2: 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)) { 11ae4: c8 01 movw r24, r16 11ae6: 0e 94 ef 55 call 0xabde ; 0xabde 11aea: 88 23 and r24, r24 11aec: 09 f4 brne .+2 ; 0x11af0 11aee: 53 c0 rjmp .+166 ; 0x11b96 // 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; 11af0: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> 11af4: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 11af8: fc 01 movw r30, r24 11afa: e5 5b subi r30, 0xB5 ; 181 11afc: ff 4e sbci r31, 0xEF ; 239 11afe: 23 e0 ldi r18, 0x03 ; 3 11b00: 20 83 st Z, r18 11b02: 82 5b subi r24, 0xB2 ; 178 11b04: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 11b06: 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) 11b08: ff 20 and r15, r15 11b0a: e9 f1 breq .+122 ; 0x11b86 strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 11b0c: 0f 94 f5 a1 call 0x343ea ; 0x343ea else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 11b10: 84 ee ldi r24, 0xE4 ; 228 11b12: 92 ea ldi r25, 0xA2 ; 162 11b14: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(MSG_Enqueing); 11b18: 81 e6 ldi r24, 0x61 ; 97 11b1a: 93 e6 ldi r25, 0x63 ; 99 11b1c: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 11b20: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> 11b24: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 11b28: 82 5b subi r24, 0xB2 ; 178 11b2a: 9f 4e sbci r25, 0xEF ; 239 11b2c: 0e 94 11 86 call 0x10c22 ; 0x10c22 SERIAL_ECHOLNPGM("\""); 11b30: 8a e2 ldi r24, 0x2A ; 42 11b32: 93 e7 ldi r25, 0x73 ; 115 11b34: 0e 94 18 7d call 0xfa30 ; 0xfa30 bufindw += len + (CMDHDRSIZE + 1); 11b38: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> 11b3c: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 11b40: 04 96 adiw r24, 0x04 ; 4 11b42: 08 0f add r16, r24 11b44: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 11b46: 0d 3e cpi r16, 0xED ; 237 11b48: 81 e0 ldi r24, 0x01 ; 1 11b4a: 18 07 cpc r17, r24 11b4c: f9 f0 breq .+62 ; 0x11b8c strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 11b4e: 10 93 4a 10 sts 0x104A, r17 ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 11b52: 00 93 49 10 sts 0x1049, r16 ; 0x801049 <_ZL7bufindw.lto_priv.512> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 11b56: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 11b5a: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 11b5e: 01 96 adiw r24, 0x01 ; 1 11b60: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 11b64: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11b68: df 91 pop r29 11b6a: cf 91 pop r28 11b6c: 1f 91 pop r17 11b6e: 0f 91 pop r16 11b70: ff 90 pop r15 11b72: 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); 11b74: fc 01 movw r30, r24 11b76: 01 90 ld r0, Z+ 11b78: 00 20 and r0, r0 11b7a: e9 f7 brne .-6 ; 0x11b76 11b7c: 31 97 sbiw r30, 0x01 ; 1 11b7e: 8f 01 movw r16, r30 11b80: 08 1b sub r16, r24 11b82: 19 0b sbc r17, r25 11b84: af cf rjmp .-162 ; 0x11ae4 // 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); 11b86: 0f 94 a9 aa call 0x35552 ; 0x35552 11b8a: c2 cf rjmp .-124 ; 0x11b10 SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11b8c: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 11b90: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.512> 11b94: e0 cf rjmp .-64 ; 0x11b56 ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 11b96: 87 ec ldi r24, 0xC7 ; 199 11b98: 92 ea ldi r25, 0xA2 ; 162 11b9a: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(MSG_Enqueing); 11b9e: 81 e6 ldi r24, 0x61 ; 97 11ba0: 93 e6 ldi r25, 0x63 ; 99 11ba2: 0e 94 1f 7b call 0xf63e ; 0xf63e if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 11ba6: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 11ba8: ff 20 and r15, r15 11baa: 59 f0 breq .+22 ; 0x11bc2 SERIAL_PROTOCOLRPGM(cmd); 11bac: 0e 94 1f 7b call 0xf63e ; 0xf63e else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11bb0: 85 e9 ldi r24, 0x95 ; 149 11bb2: 92 ea ldi r25, 0xA2 ; 162 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11bb4: df 91 pop r29 11bb6: cf 91 pop r28 11bb8: 1f 91 pop r17 11bba: 0f 91 pop r16 11bbc: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11bbe: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 11bc2: 0e 94 11 86 call 0x10c22 ; 0x10c22 11bc6: f4 cf rjmp .-24 ; 0x11bb0 00011bc8 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 11bc8: cf 93 push r28 11bca: df 93 push r29 if (menu_item == menu_line) 11bcc: 30 91 63 04 lds r19, 0x0463 ; 0x800463 11bd0: 20 91 62 04 lds r18, 0x0462 ; 0x800462 11bd4: 32 13 cpse r19, r18 11bd6: 20 c0 rjmp .+64 ; 0x11c18 11bd8: eb 01 movw r28, r22 11bda: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 11bdc: 80 91 59 02 lds r24, 0x0259 ; 0x800259 11be0: 88 23 and r24, r24 11be2: 19 f0 breq .+6 ; 0x11bea 11be4: 80 e2 ldi r24, 0x20 ; 32 11be6: 0e 94 e1 72 call 0xe5c2 ; 0xe5c2 if (menu_clicked && (lcd_encoder == menu_item)) 11bea: 80 91 61 04 lds r24, 0x0461 ; 0x800461 11bee: 88 23 and r24, r24 11bf0: 99 f0 breq .+38 ; 0x11c18 11bf2: 20 91 63 04 lds r18, 0x0463 ; 0x800463 11bf6: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 11bfa: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 11bfe: 28 17 cp r18, r24 11c00: 19 06 cpc r1, r25 11c02: 51 f4 brne .+20 ; 0x11c18 { if (str_gcode) enquecommand_P(str_gcode); 11c04: 20 97 sbiw r28, 0x00 ; 0 11c06: 21 f0 breq .+8 ; 0x11c10 11c08: 61 e0 ldi r22, 0x01 ; 1 11c0a: ce 01 movw r24, r28 11c0c: 0e 94 65 8d call 0x11aca ; 0x11aca menu_item_ret(); return; } } menu_item++; } 11c10: df 91 pop r29 11c12: 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(); 11c14: 0c 94 ce 62 jmp 0xc59c ; 0xc59c return; } } menu_item++; 11c18: 80 91 63 04 lds r24, 0x0463 ; 0x800463 11c1c: 8f 5f subi r24, 0xFF ; 255 11c1e: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } 11c22: df 91 pop r29 11c24: cf 91 pop r28 11c26: 08 95 ret 00011c28 : { 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) { 11c28: 0f 93 push r16 11c2a: 1f 93 push r17 11c2c: cf 93 push r28 11c2e: df 93 push r29 11c30: d6 2f mov r29, r22 11c32: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 11c34: c0 e0 ldi r28, 0x00 ; 0 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); 11c36: f8 01 movw r30, r16 11c38: 85 91 lpm r24, Z+ 11c3a: 94 91 lpm r25, Z 11c3c: 61 e0 ldi r22, 0x01 ; 1 11c3e: 0e 94 65 8d call 0x11aca ; 0x11aca 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) 11c42: cf 5f subi r28, 0xFF ; 255 11c44: 0e 5f subi r16, 0xFE ; 254 11c46: 1f 4f sbci r17, 0xFF ; 255 11c48: dc 13 cpse r29, r28 11c4a: f5 cf rjmp .-22 ; 0x11c36 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); } } 11c4c: df 91 pop r29 11c4e: cf 91 pop r28 11c50: 1f 91 pop r17 11c52: 0f 91 pop r16 11c54: 08 95 ret 00011c56 : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 11c56: cf 93 push r28 11c58: df 93 push r29 11c5a: cd b7 in r28, 0x3d ; 61 11c5c: de b7 in r29, 0x3e ; 62 11c5e: 6e 97 sbiw r28, 0x1e ; 30 11c60: 0f b6 in r0, 0x3f ; 63 11c62: f8 94 cli 11c64: de bf out 0x3e, r29 ; 62 11c66: 0f be out 0x3f, r0 ; 63 11c68: cd bf out 0x3d, r28 ; 61 11c6a: 9e 01 movw r18, r28 11c6c: 2c 5d subi r18, 0xDC ; 220 11c6e: 3f 4f sbci r19, 0xFF ; 255 11c70: f9 01 movw r30, r18 11c72: 41 91 ld r20, Z+ 11c74: 51 91 ld r21, Z+ 11c76: 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); 11c78: 6e e1 ldi r22, 0x1E ; 30 11c7a: 70 e0 ldi r23, 0x00 ; 0 11c7c: ce 01 movw r24, r28 11c7e: 01 96 adiw r24, 0x01 ; 1 11c80: 0f 94 94 a3 call 0x34728 ; 0x34728 va_end(ap); enquecommand(cmd_buffer, false); 11c84: 60 e0 ldi r22, 0x00 ; 0 11c86: ce 01 movw r24, r28 11c88: 01 96 adiw r24, 0x01 ; 1 11c8a: 0e 94 65 8d call 0x11aca ; 0x11aca } 11c8e: 6e 96 adiw r28, 0x1e ; 30 11c90: 0f b6 in r0, 0x3f ; 63 11c92: f8 94 cli 11c94: de bf out 0x3e, r29 ; 62 11c96: 0f be out 0x3f, r0 ; 63 11c98: cd bf out 0x3d, r28 ; 61 11c9a: df 91 pop r29 11c9c: cf 91 pop r28 11c9e: 08 95 ret 00011ca0 : 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() 11ca0: 2f 92 push r2 11ca2: 3f 92 push r3 11ca4: 4f 92 push r4 11ca6: 5f 92 push r5 11ca8: 6f 92 push r6 11caa: 7f 92 push r7 11cac: 8f 92 push r8 11cae: 9f 92 push r9 11cb0: af 92 push r10 11cb2: bf 92 push r11 11cb4: cf 92 push r12 11cb6: df 92 push r13 11cb8: ef 92 push r14 11cba: ff 92 push r15 11cbc: 0f 93 push r16 11cbe: 1f 93 push r17 11cc0: cf 93 push r28 11cc2: df 93 push r29 11cc4: cd b7 in r28, 0x3d ; 61 11cc6: de b7 in r29, 0x3e ; 62 11cc8: c3 56 subi r28, 0x63 ; 99 11cca: d1 09 sbc r29, r1 11ccc: 0f b6 in r0, 0x3f ; 63 11cce: f8 94 cli 11cd0: de bf out 0x3e, r29 ; 62 11cd2: 0f be out 0x3f, r0 ; 63 11cd4: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 11cd6: 82 e0 ldi r24, 0x02 ; 2 11cd8: 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) { 11cdc: 00 91 38 12 lds r16, 0x1238 ; 0x801238 11ce0: 10 91 39 12 lds r17, 0x1239 ; 0x801239 11ce4: 02 5b subi r16, 0xB2 ; 178 11ce6: 1f 4e sbci r17, 0xEF ; 239 11ce8: 45 e0 ldi r20, 0x05 ; 5 11cea: 50 e0 ldi r21, 0x00 ; 0 11cec: 67 ef ldi r22, 0xF7 ; 247 11cee: 71 e8 ldi r23, 0x81 ; 129 11cf0: c8 01 movw r24, r16 11cf2: 0f 94 1d a2 call 0x3443a ; 0x3443a 11cf6: 89 2b or r24, r25 11cf8: 09 f0 breq .+2 ; 0x11cfc 11cfa: 9b c1 rjmp .+822 ; 0x12032 eeprom_update_byte_notify((uint8_t*)EEPROM_FAN_CHECK_ENABLED, true); } } bool farm_prusa_code_seen() { if (!farm_mode) 11cfc: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 11d00: 88 23 and r24, r24 11d02: 09 f4 brne .+2 ; 0x11d06 11d04: 4d c0 rjmp .+154 ; 0x11da0 return false; if (code_seen_P(PSTR("PRN"))) { // PRUSA PRN 11d06: 84 ef ldi r24, 0xF4 ; 244 11d08: 9e e7 ldi r25, 0x7E ; 126 11d0a: 0f 94 89 39 call 0x27312 ; 0x27312 11d0e: 88 23 and r24, r24 11d10: 79 f0 breq .+30 ; 0x11d30 printf_P(_N("%u"), status_number); 11d12: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.490> 11d16: 1f 92 push r1 11d18: 8f 93 push r24 11d1a: 84 ec ldi r24, 0xC4 ; 196 11d1c: 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); 11d1e: 9f 93 push r25 11d20: 8f 93 push r24 11d22: 0f 94 00 a3 call 0x34600 ; 0x34600 11d26: 0f 90 pop r0 11d28: 0f 90 pop r0 11d2a: 0f 90 pop r0 11d2c: 0f 90 pop r0 11d2e: 08 c0 rjmp .+16 ; 0x11d40 } else if (code_seen_P(PSTR("thx"))) { // PRUSA thx 11d30: 80 ef ldi r24, 0xF0 ; 240 11d32: 9e e7 ldi r25, 0x7E ; 126 11d34: 0f 94 89 39 call 0x27312 ; 0x27312 11d38: 88 23 and r24, r24 11d3a: 41 f0 breq .+16 ; 0x11d4c no_response = false; 11d3c: 10 92 08 04 sts 0x0408, r1 ; 0x800408 <_ZL11no_response.lto_priv.491> SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 11d40: 81 e0 ldi r24, 0x01 ; 1 11d42: 80 93 78 02 sts 0x0278, r24 ; 0x800278 ClearToSend(); 11d46: 0e 94 a5 83 call 0x1074a ; 0x1074a 11d4a: 3a c2 rjmp .+1140 ; 0x121c0 trace(); prusa_sd_card_upload = true; card.openFileWrite(strchr_pointer+4); } #endif //PRUSA_M28 else if (code_seen_P(PSTR("fv"))) { // PRUSA fv 11d4c: 8d ee ldi r24, 0xED ; 237 11d4e: 9e e7 ldi r25, 0x7E ; 126 11d50: 0f 94 89 39 call 0x27312 ; 0x27312 11d54: 88 23 and r24, r24 11d56: 21 f1 breq .+72 ; 0x11da0 // get file version #ifdef SDSUPPORT card.openFileReadFilteredGcode(strchr_pointer + 3, true); 11d58: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 11d5c: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 11d60: 61 e0 ldi r22, 0x01 ; 1 11d62: 03 96 adiw r24, 0x03 ; 3 11d64: 0f 94 4e 71 call 0x2e29c ; 0x2e29c FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); 11d68: 0f 94 5e 6c call 0x2d8bc ; 0x2d8bc 11d6c: 8c 01 movw r16, r24 sdpos = file.curPosition(); 11d6e: 80 91 6f 16 lds r24, 0x166F ; 0x80166f 11d72: 90 91 70 16 lds r25, 0x1670 ; 0x801670 11d76: a0 91 71 16 lds r26, 0x1671 ; 0x801671 11d7a: b0 91 72 16 lds r27, 0x1672 ; 0x801672 11d7e: 80 93 eb 16 sts 0x16EB, r24 ; 0x8016eb 11d82: 90 93 ec 16 sts 0x16EC, r25 ; 0x8016ec 11d86: a0 93 ed 16 sts 0x16ED, r26 ; 0x8016ed 11d8a: b0 93 ee 16 sts 0x16EE, r27 ; 0x8016ee while (true) { uint16_t readByte = card.getFilteredGcodeChar(); MYSERIAL.write(readByte); 11d8e: 80 2f mov r24, r16 11d90: 0e 94 0c 7a call 0xf418 ; 0xf418 if (readByte == '\n') { 11d94: 0a 30 cpi r16, 0x0A ; 10 11d96: 11 05 cpc r17, r1 11d98: 39 f7 brne .-50 ; 0x11d68 break; } } card.closefile(); 11d9a: 0f 94 6f 65 call 0x2cade ; 0x2cade 11d9e: d0 cf rjmp .-96 ; 0x11d40 - `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"))) { 11da0: 8d ee ldi r24, 0xED ; 237 11da2: 91 e8 ldi r25, 0x81 ; 129 11da4: 0f 94 89 39 call 0x27312 ; 0x27312 11da8: 81 11 cpse r24, r1 11daa: ca cf rjmp .-108 ; 0x11d40 gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 11dac: 89 ee ldi r24, 0xE9 ; 233 11dae: 91 e8 ldi r25, 0x81 ; 129 11db0: 0f 94 89 39 call 0x27312 ; 0x27312 11db4: 88 23 and r24, r24 11db6: 21 f1 breq .+72 ; 0x11e00 printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 11db8: 40 91 b9 03 lds r20, 0x03B9 ; 0x8003b9 11dbc: 50 91 ba 03 lds r21, 0x03BA ; 0x8003ba 11dc0: 2c e3 ldi r18, 0x3C ; 60 11dc2: 24 9f mul r18, r20 11dc4: c0 01 movw r24, r0 11dc6: 25 9f mul r18, r21 11dc8: 90 0d add r25, r0 11dca: 11 24 eor r1, r1 11dcc: 9f 93 push r25 11dce: 8f 93 push r24 11dd0: 40 91 b7 03 lds r20, 0x03B7 ; 0x8003b7 11dd4: 50 91 b8 03 lds r21, 0x03B8 ; 0x8003b8 11dd8: 24 9f mul r18, r20 11dda: c0 01 movw r24, r0 11ddc: 25 9f mul r18, r21 11dde: 90 0d add r25, r0 11de0: 11 24 eor r1, r1 11de2: 9f 93 push r25 11de4: 8f 93 push r24 11de6: 82 ee ldi r24, 0xE2 ; 226 11de8: 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); 11dea: 9f 93 push r25 11dec: 8f 93 push r24 11dee: 0f 94 00 a3 call 0x34600 ; 0x34600 11df2: 0f 90 pop r0 11df4: 0f 90 pop r0 11df6: 0f 90 pop r0 11df8: 0f 90 pop r0 11dfa: 0f 90 pop r0 11dfc: 0f 90 pop r0 11dfe: a0 cf rjmp .-192 ; 0x11d40 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 11e00: 84 ee ldi r24, 0xE4 ; 228 11e02: 91 e8 ldi r25, 0x81 ; 129 11e04: 0f 94 89 39 call 0x27312 ; 0x27312 11e08: 88 23 and r24, r24 11e0a: 11 f1 breq .+68 ; 0x11e50 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 11e0c: 8c e8 ldi r24, 0x8C ; 140 11e0e: 9f e0 ldi r25, 0x0F ; 15 11e10: 0f 94 3e a4 call 0x3487c ; 0x3487c 11e14: 81 11 cpse r24, r1 11e16: 10 c0 rjmp .+32 ; 0x11e38 // M24 - Start SD print enquecommand_P(MSG_M24); 11e18: 61 e0 ldi r22, 0x01 ; 1 11e1a: 87 e0 ldi r24, 0x07 ; 7 11e1c: 9d e6 ldi r25, 0x6D ; 109 11e1e: 0e 94 65 8d call 0x11aca ; 0x11aca 11e22: 60 e0 ldi r22, 0x00 ; 0 11e24: 85 ea ldi r24, 0xA5 ; 165 11e26: 9f e0 ldi r25, 0x0F ; 15 11e28: 0f 94 62 a4 call 0x348c4 ; 0x348c4 11e2c: 60 e0 ldi r22, 0x00 ; 0 11e2e: 8f e7 ldi r24, 0x7F ; 127 11e30: 9c e0 ldi r25, 0x0C ; 12 11e32: 0f 94 62 a4 call 0x348c4 ; 0x348c4 11e36: 84 cf rjmp .-248 ; 0x11d40 // 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) { 11e38: 81 30 cpi r24, 0x01 ; 1 11e3a: 09 f0 breq .+2 ; 0x11e3e 11e3c: 81 cf rjmp .-254 ; 0x11d40 // 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(); 11e3e: 0f 94 85 16 call 0x22d0a ; 0x22d0a usb_timer.start(); 11e42: 82 e4 ldi r24, 0x42 ; 66 11e44: 92 e1 ldi r25, 0x12 ; 18 11e46: 0f 94 5f 0b call 0x216be ; 0x216be ::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(); 11e4a: 0f 94 0d 0b call 0x2161a ; 0x2161a 11e4e: 78 cf rjmp .-272 ; 0x11d40 } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 11e50: 8d ed ldi r24, 0xDD ; 221 11e52: 91 e8 ldi r25, 0x81 ; 129 11e54: 0f 94 89 39 call 0x27312 ; 0x27312 11e58: 88 23 and r24, r24 11e5a: 21 f0 breq .+8 ; 0x11e64 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 11e5c: 80 e0 ldi r24, 0x00 ; 0 11e5e: 0f 94 a1 95 call 0x32b42 ; 0x32b42 11e62: 6e cf rjmp .-292 ; 0x11d40 MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 11e64: 87 ed ldi r24, 0xD7 ; 215 11e66: 91 e8 ldi r25, 0x81 ; 129 11e68: 0f 94 89 39 call 0x27312 ; 0x27312 11e6c: 81 11 cpse r24, r1 #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 11e6e: 0e 94 7a 66 call 0xccf4 ; 0xccf4 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 11e72: 84 ed ldi r24, 0xD4 ; 212 11e74: 91 e8 ldi r25, 0x81 ; 129 11e76: 0f 94 89 39 call 0x27312 ; 0x27312 11e7a: 88 23 and r24, r24 11e7c: a9 f0 breq .+42 ; 0x11ea8 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 11e7e: 44 e1 ldi r20, 0x14 ; 20 11e80: 50 e0 ldi r21, 0x00 ; 0 11e82: 65 e1 ldi r22, 0x15 ; 21 11e84: 7d e0 ldi r23, 0x0D ; 13 11e86: ce 01 movw r24, r28 11e88: 01 96 adiw r24, 0x01 ; 1 11e8a: 0f 94 2e a4 call 0x3485c ; 0x3485c if (SN[19]) 11e8e: 8c 89 ldd r24, Y+20 ; 0x14 11e90: 88 23 and r24, r24 11e92: 29 f0 breq .+10 ; 0x11e9e puts_P(PSTR("SN invalid")); 11e94: 89 ec ldi r24, 0xC9 ; 201 11e96: 91 e8 ldi r25, 0x81 ; 129 11e98: 0f 94 27 a3 call 0x3464e ; 0x3464e 11e9c: 51 cf rjmp .-350 ; 0x11d40 else puts(SN); 11e9e: ce 01 movw r24, r28 11ea0: 01 96 adiw r24, 0x01 ; 1 11ea2: 0f 94 cd aa call 0x3559a ; 0x3559a 11ea6: 4c cf rjmp .-360 ; 0x11d40 } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 11ea8: 85 ec ldi r24, 0xC5 ; 197 11eaa: 91 e8 ldi r25, 0x81 ; 129 11eac: 0f 94 89 39 call 0x27312 ; 0x27312 11eb0: 88 23 and r24, r24 11eb2: 29 f0 breq .+10 ; 0x11ebe SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 11eb4: 89 eb ldi r24, 0xB9 ; 185 11eb6: 91 e8 ldi r25, 0x81 ; 129 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 11eb8: 0e 94 18 7d call 0xfa30 ; 0xfa30 11ebc: 41 cf rjmp .-382 ; 0x11d40 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 11ebe: 85 eb ldi r24, 0xB5 ; 181 11ec0: 91 e8 ldi r25, 0x81 ; 129 11ec2: 0f 94 89 39 call 0x27312 ; 0x27312 11ec6: 88 23 and r24, r24 11ec8: 19 f0 breq .+6 ; 0x11ed0 SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 11eca: 86 e9 ldi r24, 0x96 ; 150 11ecc: 91 e8 ldi r25, 0x81 ; 129 11ece: f4 cf rjmp .-24 ; 0x11eb8 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 11ed0: 81 e9 ldi r24, 0x91 ; 145 11ed2: 91 e8 ldi r25, 0x81 ; 129 11ed4: 0f 94 89 39 call 0x27312 ; 0x27312 11ed8: 88 23 and r24, r24 11eda: 19 f0 breq .+6 ; 0x11ee2 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 11edc: 0e 94 98 74 call 0xe930 ; 0xe930 11ee0: 2f cf rjmp .-418 ; 0x11d40 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 11ee2: 8e e8 ldi r24, 0x8E ; 142 11ee4: 91 e8 ldi r25, 0x81 ; 129 11ee6: 0f 94 89 39 call 0x27312 ; 0x27312 11eea: 88 23 and r24, r24 11eec: 79 f0 breq .+30 ; 0x11f0c eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 11eee: 81 ea ldi r24, 0xA1 ; 161 11ef0: 9d e0 ldi r25, 0x0D ; 13 11ef2: 0f 94 3e a4 call 0x3487c ; 0x3487c 11ef6: 2b e0 ldi r18, 0x0B ; 11 11ef8: 82 9f mul r24, r18 11efa: c0 01 movw r24, r0 11efc: 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); 11efe: 70 e0 ldi r23, 0x00 ; 0 11f00: 60 e0 ldi r22, 0x00 ; 0 11f02: 80 5b subi r24, 0xB0 ; 176 11f04: 92 4f sbci r25, 0xF2 ; 242 11f06: 0f 94 80 a4 call 0x34900 ; 0x34900 11f0a: 1a cf rjmp .-460 ; 0x11d40 } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 11f0c: 8b e8 ldi r24, 0x8B ; 139 11f0e: 91 e8 ldi r25, 0x81 ; 129 11f10: 0f 94 89 39 call 0x27312 ; 0x27312 11f14: 88 23 and r24, r24 11f16: 51 f0 breq .+20 ; 0x11f2c // 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(); 11f18: 0e 94 81 70 call 0xe102 ; 0xe102 Sound_MakeCustom(100,0,false); 11f1c: 40 e0 ldi r20, 0x00 ; 0 11f1e: 70 e0 ldi r23, 0x00 ; 0 11f20: 60 e0 ldi r22, 0x00 ; 0 11f22: 84 e6 ldi r24, 0x64 ; 100 11f24: 90 e0 ldi r25, 0x00 ; 0 11f26: 0f 94 f3 24 call 0x249e6 ; 0x249e6 11f2a: d8 cf rjmp .-80 ; 0x11edc 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 11f2c: 87 e8 ldi r24, 0x87 ; 135 11f2e: 91 e8 ldi r25, 0x81 ; 129 11f30: 0f 94 89 39 call 0x27312 ; 0x27312 11f34: 88 23 and r24, r24 11f36: e1 f0 breq .+56 ; 0x11f70 // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 11f38: 86 e5 ldi r24, 0x56 ; 86 11f3a: 0e 94 80 56 call 0xad00 ; 0xad00 11f3e: 88 23 and r24, r24 11f40: 09 f4 brne .+2 ; 0x11f44 11f42: fe ce rjmp .-516 ; 0x11d40 bool value = code_value_short(); 11f44: 0e 94 a2 56 call 0xad44 ; 0xad44 11f48: 11 e0 ldi r17, 0x01 ; 1 11f4a: 89 2b or r24, r25 11f4c: 09 f4 brne .+2 ; 0x11f50 11f4e: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 11f50: 0f 94 5b 18 call 0x230b6 ; 0x230b6 if(value != mbl.active) { 11f54: 80 91 09 13 lds r24, 0x1309 ; 0x801309 11f58: 90 e0 ldi r25, 0x00 ; 0 11f5a: 18 17 cp r17, r24 11f5c: 19 06 cpc r1, r25 11f5e: 09 f4 brne .+2 ; 0x11f62 11f60: ef ce rjmp .-546 ; 0x11d40 mbl.active = value; 11f62: 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]); 11f66: 89 e6 ldi r24, 0x69 ; 105 11f68: 92 e1 ldi r25, 0x12 ; 18 11f6a: 0f 94 33 3a call 0x27466 ; 0x27466 11f6e: e8 ce rjmp .-560 ; 0x11d40 } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 11f70: 80 e8 ldi r24, 0x80 ; 128 11f72: 91 e8 ldi r25, 0x81 ; 129 11f74: 0f 94 89 39 call 0x27312 ; 0x27312 11f78: 88 23 and r24, r24 11f7a: 09 f4 brne .+2 ; 0x11f7e 11f7c: e1 ce rjmp .-574 ; 0x11d40 uint16_t nDiameter; if(code_seen('D')) { 11f7e: 84 e4 ldi r24, 0x44 ; 68 11f80: 0e 94 80 56 call 0xad00 ; 0xad00 11f84: 88 23 and r24, r24 11f86: a1 f0 breq .+40 ; 0x11fb0 nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 11f88: 0e 94 10 5b call 0xb620 ; 0xb620 11f8c: 20 e0 ldi r18, 0x00 ; 0 11f8e: 30 e0 ldi r19, 0x00 ; 0 11f90: 4a e7 ldi r20, 0x7A ; 122 11f92: 54 e4 ldi r21, 0x44 ; 68 11f94: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 11f98: 20 e0 ldi r18, 0x00 ; 0 11f9a: 30 e0 ldi r19, 0x00 ; 0 11f9c: 40 e0 ldi r20, 0x00 ; 0 11f9e: 5f e3 ldi r21, 0x3F ; 63 11fa0: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 11fa4: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> nozzle_diameter_check(nDiameter); 11fa8: cb 01 movw r24, r22 11faa: 0e 94 e2 e8 call 0x1d1c4 ; 0x1d1c4 11fae: c8 ce rjmp .-624 ; 0x11d40 } else if(code_seen_P(PSTR("set")) && farm_mode) { 11fb0: 8c e7 ldi r24, 0x7C ; 124 11fb2: 91 e8 ldi r25, 0x81 ; 129 11fb4: 0f 94 89 39 call 0x27312 ; 0x27312 11fb8: 88 23 and r24, r24 11fba: 49 f1 breq .+82 ; 0x1200e 11fbc: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 11fc0: 88 23 and r24, r24 11fc2: 29 f1 breq .+74 ; 0x1200e strchr_pointer++; // skip 1st char (~ 's') strchr_pointer++; // skip 2nd char (~ 'e') 11fc4: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 11fc8: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 11fcc: 02 96 adiw r24, 0x02 ; 2 11fce: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 11fd2: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 11fd6: 0e 94 10 5b call 0xb620 ; 0xb620 11fda: 6b 01 movw r12, r22 11fdc: 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); 11fde: 6f ef ldi r22, 0xFF ; 255 11fe0: 87 ea ldi r24, 0xA7 ; 167 11fe2: 9d e0 ldi r25, 0x0D ; 13 11fe4: 0f 94 62 a4 call 0x348c4 ; 0x348c4 11fe8: 20 e0 ldi r18, 0x00 ; 0 11fea: 30 e0 ldi r19, 0x00 ; 0 11fec: 4a e7 ldi r20, 0x7A ; 122 11fee: 54 e4 ldi r21, 0x44 ; 68 11ff0: c7 01 movw r24, r14 11ff2: b6 01 movw r22, r12 11ff4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 11ff8: 20 e0 ldi r18, 0x00 ; 0 11ffa: 30 e0 ldi r19, 0x00 ; 0 11ffc: 40 e0 ldi r20, 0x00 ; 0 11ffe: 5f e3 ldi r21, 0x3F ; 63 12000: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 12004: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 12008: 85 ea ldi r24, 0xA5 ; 165 1200a: 9d e0 ldi r25, 0x0D ; 13 1200c: 7c cf rjmp .-264 ; 0x11f06 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); 1200e: 85 ea ldi r24, 0xA5 ; 165 12010: 9d e0 ldi r25, 0x0D ; 13 12012: 0f 94 4c a4 call 0x34898 ; 0x34898 12016: bc 01 movw r22, r24 12018: 90 e0 ldi r25, 0x00 ; 0 1201a: 80 e0 ldi r24, 0x00 ; 0 1201c: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 12020: 20 e0 ldi r18, 0x00 ; 0 12022: 30 e0 ldi r19, 0x00 ; 0 12024: 4a e7 ldi r20, 0x7A ; 122 12026: 54 e4 ldi r21, 0x44 ; 68 12028: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1202c: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 12030: 87 ce rjmp .-754 ; 0x11d40 } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 12032: d8 01 movw r26, r16 12034: 8c 91 ld r24, X 12036: 87 34 cpi r24, 0x47 ; 71 12038: 11 f0 breq .+4 ; 0x1203e 1203a: 0c 94 44 9b jmp 0x13688 ; 0x13688 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 1203e: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 12042: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb gcode_in_progress = code_value_short(); 12046: 0e 94 a2 56 call 0xad44 ; 0xad44 1204a: 90 93 56 03 sts 0x0356, r25 ; 0x800356 1204e: 80 93 55 03 sts 0x0355, r24 ; 0x800355 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 12052: 8b 34 cpi r24, 0x4B ; 75 12054: 91 05 cpc r25, r1 12056: 09 f4 brne .+2 ; 0x1205a 12058: 45 c6 rjmp .+3210 ; 0x12ce4 1205a: 0c f0 brlt .+2 ; 0x1205e 1205c: 4b c1 rjmp .+662 ; 0x122f4 1205e: 84 30 cpi r24, 0x04 ; 4 12060: 91 05 cpc r25, r1 12062: 09 f4 brne .+2 ; 0x12066 12064: aa c5 rjmp .+2900 ; 0x12bba 12066: 0c f0 brlt .+2 ; 0x1206a 12068: c5 c0 rjmp .+394 ; 0x121f4 1206a: 97 fd sbrc r25, 7 1206c: cf c0 rjmp .+414 ; 0x1220c 1206e: 02 97 sbiw r24, 0x02 ; 2 12070: 0c f0 brlt .+2 ; 0x12074 12072: a2 c1 rjmp .+836 ; 0x123b8 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 12074: 0e 94 3c 55 call 0xaa78 ; 0xaa78 12078: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 1207a: 0e 94 37 5c call 0xb86e ; 0xb86e if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 1207e: 60 91 17 06 lds r22, 0x0617 ; 0x800617 12082: 70 91 18 06 lds r23, 0x0618 ; 0x800618 12086: 80 91 19 06 lds r24, 0x0619 ; 0x800619 1208a: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 1208e: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 12092: 6b 01 movw r12, r22 12094: 7c 01 movw r14, r24 12096: 40 90 6d 12 lds r4, 0x126D ; 0x80126d 1209a: 50 90 6e 12 lds r5, 0x126E ; 0x80126e 1209e: 60 90 6f 12 lds r6, 0x126F ; 0x80126f 120a2: 70 90 70 12 lds r7, 0x1270 ; 0x801270 120a6: 80 90 35 06 lds r8, 0x0635 ; 0x800635 120aa: 90 90 36 06 lds r9, 0x0636 ; 0x800636 120ae: a0 90 37 06 lds r10, 0x0637 ; 0x800637 120b2: b0 90 38 06 lds r11, 0x0638 ; 0x800638 120b6: a5 01 movw r20, r10 120b8: 94 01 movw r18, r8 120ba: c3 01 movw r24, r6 120bc: b2 01 movw r22, r4 120be: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 120c2: 20 e0 ldi r18, 0x00 ; 0 120c4: 30 e0 ldi r19, 0x00 ; 0 120c6: 48 ec ldi r20, 0xC8 ; 200 120c8: 52 e4 ldi r21, 0x42 ; 66 120ca: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 120ce: 9b 01 movw r18, r22 120d0: ac 01 movw r20, r24 120d2: c7 01 movw r24, r14 120d4: b6 01 movw r22, r12 120d6: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 120da: 18 16 cp r1, r24 120dc: d4 f4 brge .+52 ; 0x12112 total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 120de: a3 01 movw r20, r6 120e0: 92 01 movw r18, r4 120e2: c5 01 movw r24, r10 120e4: b4 01 movw r22, r8 120e6: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 120ea: 20 e0 ldi r18, 0x00 ; 0 120ec: 30 e0 ldi r19, 0x00 ; 0 120ee: 48 ec ldi r20, 0xC8 ; 200 120f0: 52 e4 ldi r21, 0x42 ; 66 120f2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 120f6: a7 01 movw r20, r14 120f8: 96 01 movw r18, r12 120fa: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 120fe: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 12102: 60 93 17 06 sts 0x0617, r22 ; 0x800617 12106: 70 93 18 06 sts 0x0618, r23 ; 0x800618 1210a: 80 93 19 06 sts 0x0619, r24 ; 0x800619 1210e: 90 93 1a 06 sts 0x061A, r25 ; 0x80061a } #ifdef FWRETRACT if(cs.autoretract_enabled) { 12112: 80 91 e9 0d lds r24, 0x0DE9 ; 0x800de9 12116: 88 23 and r24, r24 12118: 09 f4 brne .+2 ; 0x1211c 1211a: 46 c1 rjmp .+652 ; 0x123a8 if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 1211c: 88 e5 ldi r24, 0x58 ; 88 1211e: 0e 94 80 56 call 0xad00 ; 0xad00 12122: 81 11 cpse r24, r1 12124: 41 c1 rjmp .+642 ; 0x123a8 12126: 89 e5 ldi r24, 0x59 ; 89 12128: 0e 94 80 56 call 0xad00 ; 0xad00 1212c: 81 11 cpse r24, r1 1212e: 3c c1 rjmp .+632 ; 0x123a8 12130: 8a e5 ldi r24, 0x5A ; 90 12132: 0e 94 80 56 call 0xad00 ; 0xad00 12136: 81 11 cpse r24, r1 12138: 37 c1 rjmp .+622 ; 0x123a8 1213a: 85 e4 ldi r24, 0x45 ; 69 1213c: 0e 94 80 56 call 0xad00 ; 0xad00 12140: 88 23 and r24, r24 12142: 09 f4 brne .+2 ; 0x12146 12144: 31 c1 rjmp .+610 ; 0x123a8 float echange=destination[E_AXIS]-current_position[E_AXIS]; 12146: 20 91 6d 12 lds r18, 0x126D ; 0x80126d 1214a: 30 91 6e 12 lds r19, 0x126E ; 0x80126e 1214e: 40 91 6f 12 lds r20, 0x126F ; 0x80126f 12152: 50 91 70 12 lds r21, 0x1270 ; 0x801270 12156: 60 91 35 06 lds r22, 0x0635 ; 0x800635 1215a: 70 91 36 06 lds r23, 0x0636 ; 0x800636 1215e: 80 91 37 06 lds r24, 0x0637 ; 0x800637 12162: 90 91 38 06 lds r25, 0x0638 ; 0x800638 12166: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1216a: 6b 01 movw r12, r22 1216c: 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 1216e: 2d ec ldi r18, 0xCD ; 205 12170: 3c ec ldi r19, 0xCC ; 204 12172: 4c ec ldi r20, 0xCC ; 204 12174: 5d eb ldi r21, 0xBD ; 189 12176: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1217a: 87 ff sbrs r24, 7 1217c: 07 c1 rjmp .+526 ; 0x1238c 1217e: 80 91 1b 06 lds r24, 0x061B ; 0x80061b 12182: 81 11 cpse r24, r1 12184: 0c 94 f9 b9 jmp 0x173f2 ; 0x173f2 st_synchronize(); 12188: 0f 94 5b 18 call 0x230b6 ; 0x230b6 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 1218c: 80 91 35 06 lds r24, 0x0635 ; 0x800635 12190: 90 91 36 06 lds r25, 0x0636 ; 0x800636 12194: a0 91 37 06 lds r26, 0x0637 ; 0x800637 12198: b0 91 38 06 lds r27, 0x0638 ; 0x800638 1219c: 80 93 6d 12 sts 0x126D, r24 ; 0x80126d 121a0: 90 93 6e 12 sts 0x126E, r25 ; 0x80126e 121a4: a0 93 6f 12 sts 0x126F, r26 ; 0x80126f 121a8: b0 93 70 12 sts 0x1270, r27 ; 0x801270 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 121ac: 8d e6 ldi r24, 0x6D ; 109 121ae: 92 e1 ldi r25, 0x12 ; 18 121b0: 0f 94 00 3a call 0x27400 ; 0x27400 retract(!retracted[active_extruder]); 121b4: 90 91 1b 06 lds r25, 0x061B ; 0x80061b 121b8: 81 e0 ldi r24, 0x01 ; 1 121ba: 89 27 eor r24, r25 121bc: 0f 94 8a 90 call 0x32114 ; 0x32114 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 121c0: cd 59 subi r28, 0x9D ; 157 121c2: df 4f sbci r29, 0xFF ; 255 121c4: 0f b6 in r0, 0x3f ; 63 121c6: f8 94 cli 121c8: de bf out 0x3e, r29 ; 62 121ca: 0f be out 0x3f, r0 ; 63 121cc: cd bf out 0x3d, r28 ; 61 121ce: df 91 pop r29 121d0: cf 91 pop r28 121d2: 1f 91 pop r17 121d4: 0f 91 pop r16 121d6: ff 90 pop r15 121d8: ef 90 pop r14 121da: df 90 pop r13 121dc: cf 90 pop r12 121de: bf 90 pop r11 121e0: af 90 pop r10 121e2: 9f 90 pop r9 121e4: 8f 90 pop r8 121e6: 7f 90 pop r7 121e8: 6f 90 pop r6 121ea: 5f 90 pop r5 121ec: 4f 90 pop r4 121ee: 3f 90 pop r3 121f0: 2f 90 pop r2 121f2: 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) 121f4: 85 31 cpi r24, 0x15 ; 21 121f6: 91 05 cpc r25, r1 121f8: 09 f4 brne .+2 ; 0x121fc 121fa: d9 c0 rjmp .+434 ; 0x123ae 121fc: fc f4 brge .+62 ; 0x1223c 121fe: 8a 30 cpi r24, 0x0A ; 10 12200: 91 05 cpc r25, r1 12202: 09 f4 brne .+2 ; 0x12206 12204: 23 c5 rjmp .+2630 ; 0x12c4c 12206: 0b 97 sbiw r24, 0x0b ; 11 12208: 09 f4 brne .+2 ; 0x1220c 1220a: 24 c5 rjmp .+2632 ; 0x12c54 case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 1220c: 80 91 38 12 lds r24, 0x1238 ; 0x801238 12210: 90 91 39 12 lds r25, 0x1239 ; 0x801239 12214: 82 5b subi r24, 0xB2 ; 178 12216: 9f 4e sbci r25, 0xEF ; 239 12218: 9f 93 push r25 1221a: 8f 93 push r24 1221c: 1f 92 push r1 1221e: 87 e4 ldi r24, 0x47 ; 71 12220: 8f 93 push r24 12222: 84 e0 ldi r24, 0x04 ; 4 12224: 97 e6 ldi r25, 0x67 ; 103 12226: 9f 93 push r25 12228: 8f 93 push r24 1222a: 0f 94 00 a3 call 0x34600 ; 0x34600 1222e: 0f 90 pop r0 12230: 0f 90 pop r0 12232: 0f 90 pop r0 12234: 0f 90 pop r0 12236: 0f 90 pop r0 12238: 0f 90 pop r0 1223a: b9 c0 rjmp .+370 ; 0x123ae 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) 1223c: 8c 31 cpi r24, 0x1C ; 28 1223e: 91 05 cpc r25, r1 12240: 09 f4 brne .+2 ; 0x12244 12242: 0a c5 rjmp .+2580 ; 0x12c58 12244: 4e 97 sbiw r24, 0x1e ; 30 12246: 11 f7 brne .-60 ; 0x1220c Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 12248: 0f 94 5b 18 call 0x230b6 ; 0x230b6 homing_flag = true; 1224c: 81 e0 ldi r24, 0x01 ; 1 1224e: 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(); 12252: 0e 94 c1 65 call 0xcb82 ; 0xcb82 12256: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 12258: 80 e0 ldi r24, 0x00 ; 0 1225a: 90 e0 ldi r25, 0x00 ; 0 1225c: a8 e4 ldi r26, 0x48 ; 72 1225e: b4 e4 ldi r27, 0x44 ; 68 12260: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 12264: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 12268: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 1226c: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d find_bed_induction_sensor_point_z(-10.f, 3); 12270: 43 e0 ldi r20, 0x03 ; 3 12272: 60 e0 ldi r22, 0x00 ; 0 12274: 70 e0 ldi r23, 0x00 ; 0 12276: 80 e2 ldi r24, 0x20 ; 32 12278: 91 ec ldi r25, 0xC1 ; 193 1227a: 0f 94 4b 7c call 0x2f896 ; 0x2f896 printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 1227e: 70 90 69 12 lds r7, 0x1269 ; 0x801269 12282: 60 90 6a 12 lds r6, 0x126A ; 0x80126a 12286: 50 90 6b 12 lds r5, 0x126B ; 0x80126b 1228a: 40 90 6c 12 lds r4, 0x126C ; 0x80126c 1228e: b0 90 65 12 lds r11, 0x1265 ; 0x801265 12292: a0 90 66 12 lds r10, 0x1266 ; 0x801266 12296: 90 90 67 12 lds r9, 0x1267 ; 0x801267 1229a: 80 90 68 12 lds r8, 0x1268 ; 0x801268 1229e: f0 90 61 12 lds r15, 0x1261 ; 0x801261 122a2: e0 90 62 12 lds r14, 0x1262 ; 0x801262 122a6: d0 90 63 12 lds r13, 0x1263 ; 0x801263 122aa: c0 90 64 12 lds r12, 0x1264 ; 0x801264 122ae: 8a ec ldi r24, 0xCA ; 202 122b0: 94 e4 ldi r25, 0x44 ; 68 122b2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 122b6: 4f 92 push r4 122b8: 5f 92 push r5 122ba: 6f 92 push r6 122bc: 7f 92 push r7 122be: 8f 92 push r8 122c0: 9f 92 push r9 122c2: af 92 push r10 122c4: bf 92 push r11 122c6: cf 92 push r12 122c8: df 92 push r13 122ca: ef 92 push r14 122cc: ff 92 push r15 122ce: 9f 93 push r25 122d0: 8f 93 push r24 122d2: 8d eb ldi r24, 0xBD ; 189 122d4: 97 e6 ldi r25, 0x67 ; 103 122d6: 9f 93 push r25 122d8: 8f 93 push r24 122da: 0f 94 00 a3 call 0x34600 ; 0x34600 clean_up_after_endstop_move(l_feedmultiply); 122de: c8 01 movw r24, r16 122e0: 0e 94 a7 65 call 0xcb4e ; 0xcb4e homing_flag = false; 122e4: 10 92 71 12 sts 0x1271, r1 ; 0x801271 122e8: 0f b6 in r0, 0x3f ; 63 122ea: f8 94 cli 122ec: de bf out 0x3e, r29 ; 62 122ee: 0f be out 0x3f, r0 ; 63 122f0: cd bf out 0x3d, r28 ; 61 122f2: 5d c0 rjmp .+186 ; 0x123ae 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) 122f4: 88 35 cpi r24, 0x58 ; 88 122f6: 91 05 cpc r25, r1 122f8: 09 f4 brne .+2 ; 0x122fc 122fa: 59 c0 rjmp .+178 ; 0x123ae 122fc: f4 f4 brge .+60 ; 0x1233a 122fe: 81 35 cpi r24, 0x51 ; 81 12300: 91 05 cpc r25, r1 12302: 11 f4 brne .+4 ; 0x12308 12304: 0c 94 8a 9a jmp 0x13514 ; 0x13514 12308: 5c f4 brge .+22 ; 0x12320 1230a: 8c 34 cpi r24, 0x4C ; 76 1230c: 91 05 cpc r25, r1 1230e: 09 f4 brne .+2 ; 0x12312 12310: 0c c5 rjmp .+2584 ; 0x12d2a 12312: 80 35 cpi r24, 0x50 ; 80 12314: 91 05 cpc r25, r1 12316: 09 f0 breq .+2 ; 0x1231a 12318: 79 cf rjmp .-270 ; 0x1220c - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 1231a: 0e 94 a4 7d call 0xfb48 ; 0xfb48 1231e: 47 c0 rjmp .+142 ; 0x123ae 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) 12320: 86 35 cpi r24, 0x56 ; 86 12322: 91 05 cpc r25, r1 12324: 11 f4 brne .+4 ; 0x1232a 12326: 0c 94 8e 9a jmp 0x1351c ; 0x1351c 1232a: 87 35 cpi r24, 0x57 ; 87 1232c: 91 05 cpc r25, r1 1232e: 09 f0 breq .+2 ; 0x12332 12330: 6d cf rjmp .-294 ; 0x1220c This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 12332: 80 e1 ldi r24, 0x10 ; 16 12334: 0e 94 39 d5 call 0x1aa72 ; 0x1aa72 12338: 3a c0 rjmp .+116 ; 0x123ae 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) 1233a: 8c 35 cpi r24, 0x5C ; 92 1233c: 91 05 cpc r25, r1 1233e: 11 f4 brne .+4 ; 0x12344 12340: 0c 94 9a 9a jmp 0x13534 ; 0x13534 12344: 74 f4 brge .+28 ; 0x12362 12346: 8a 35 cpi r24, 0x5A ; 90 12348: 91 05 cpc r25, r1 1234a: 11 f4 brne .+4 ; 0x12350 1234c: 0c 94 93 9a jmp 0x13526 ; 0x13526 12350: 8b 35 cpi r24, 0x5B ; 91 12352: 91 05 cpc r25, r1 12354: 09 f0 breq .+2 ; 0x12358 12356: 5a cf rjmp .-332 ; 0x1220c /*! ### 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; 12358: 80 91 57 12 lds r24, 0x1257 ; 0x801257 1235c: 87 60 ori r24, 0x07 ; 7 1235e: 0c 94 96 9a jmp 0x1352c ; 0x1352c 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) 12362: 82 36 cpi r24, 0x62 ; 98 12364: 91 05 cpc r25, r1 12366: 11 f4 brne .+4 ; 0x1236c 12368: 0c 94 31 9b jmp 0x13662 ; 0x13662 1236c: 83 36 cpi r24, 0x63 ; 99 1236e: 91 05 cpc r25, r1 12370: 09 f0 breq .+2 ; 0x12374 12372: 4c cf rjmp .-360 ; 0x1220c lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 12374: 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); 12378: 60 e0 ldi r22, 0x00 ; 0 1237a: 84 ec ldi r24, 0xC4 ; 196 1237c: 9f e0 ldi r25, 0x0F ; 15 1237e: 0f 94 62 a4 call 0x348c4 ; 0x348c4 fCheckModeInit(); // alternatively invoke printer reset } void farm_gcode_g99() { farm_disable(); lcd_update(2); 12382: 82 e0 ldi r24, 0x02 ; 2 12384: 0e 94 54 6f call 0xdea8 ; 0xdea8 12388: 0c 94 40 9b jmp 0x13680 ; 0x13680 #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 1238c: 2d ec ldi r18, 0xCD ; 205 1238e: 3c ec ldi r19, 0xCC ; 204 12390: 4c ec ldi r20, 0xCC ; 204 12392: 5d e3 ldi r21, 0x3D ; 61 12394: c7 01 movw r24, r14 12396: b6 01 movw r22, r12 12398: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1239c: 18 16 cp r1, r24 1239e: 24 f4 brge .+8 ; 0x123a8 123a0: 80 91 1b 06 lds r24, 0x061B ; 0x80061b 123a4: 81 11 cpse r24, r1 123a6: f0 ce rjmp .-544 ; 0x12188 } } } #endif //FWRETRACT prepare_move(start_segment_idx); 123a8: c8 01 movw r24, r16 123aa: 0e 94 16 6b call 0xd62c ; 0xd62c #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; 123ae: 10 92 56 03 sts 0x0356, r1 ; 0x800356 123b2: 10 92 55 03 sts 0x0355, r1 ; 0x800355 123b6: c4 cc rjmp .-1656 ; 0x11d40 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 123b8: 0e 94 3c 55 call 0xaa78 ; 0xaa78 123bc: 2e 96 adiw r28, 0x0e ; 14 123be: 9f af std Y+63, r25 ; 0x3f 123c0: 8e af std Y+62, r24 ; 0x3e 123c2: 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 123c4: 0e 94 37 5c call 0xb86e ; 0xb86e #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 123c8: 89 e4 ldi r24, 0x49 ; 73 123ca: 0e 94 80 56 call 0xad00 ; 0xad00 123ce: 88 23 and r24, r24 123d0: 09 f4 brne .+2 ; 0x123d4 123d2: a0 c3 rjmp .+1856 ; 0x12b14 123d4: 0e 94 10 5b call 0xb620 ; 0xb620 123d8: 60 93 4d 03 sts 0x034D, r22 ; 0x80034d 123dc: 70 93 4e 03 sts 0x034E, r23 ; 0x80034e 123e0: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f 123e4: 90 93 50 03 sts 0x0350, r25 ; 0x800350 offset[1] = code_seen('J') ? code_value() : 0.f; 123e8: 8a e4 ldi r24, 0x4A ; 74 123ea: 0e 94 80 56 call 0xad00 ; 0xad00 123ee: c1 2c mov r12, r1 123f0: d1 2c mov r13, r1 123f2: 76 01 movw r14, r12 123f4: 88 23 and r24, r24 123f6: 21 f0 breq .+8 ; 0x12400 123f8: 0e 94 10 5b call 0xb620 ; 0xb620 123fc: 6b 01 movw r12, r22 123fe: 7c 01 movw r14, r24 12400: c0 92 51 03 sts 0x0351, r12 ; 0x800351 12404: d0 92 52 03 sts 0x0352, r13 ; 0x800352 12408: e0 92 53 03 sts 0x0353, r14 ; 0x800353 1240c: f0 92 54 03 sts 0x0354, r15 ; 0x800354 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 12410: e0 91 55 03 lds r30, 0x0355 ; 0x800355 12414: f0 91 56 03 lds r31, 0x0356 ; 0x800356 12418: a4 96 adiw r28, 0x24 ; 36 1241a: ff af std Y+63, r31 ; 0x3f 1241c: ee af std Y+62, r30 ; 0x3e 1241e: 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 12420: 80 90 4d 03 lds r8, 0x034D ; 0x80034d 12424: 90 90 4e 03 lds r9, 0x034E ; 0x80034e 12428: a0 90 4f 03 lds r10, 0x034F ; 0x80034f 1242c: b0 90 50 03 lds r11, 0x0350 ; 0x800350 12430: a7 01 movw r20, r14 12432: 96 01 movw r18, r12 12434: c5 01 movw r24, r10 12436: b4 01 movw r22, r8 12438: 0f 94 02 a8 call 0x35004 ; 0x35004 1243c: 24 96 adiw r28, 0x04 ; 4 1243e: 6c af std Y+60, r22 ; 0x3c 12440: 7d af std Y+61, r23 ; 0x3d 12442: 8e af std Y+62, r24 ; 0x3e 12444: 9f af std Y+63, r25 ; 0x3f 12446: 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); 12448: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 1244c: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 12450: 07 2e mov r0, r23 12452: 00 0c add r0, r0 12454: 88 0b sbc r24, r24 12456: 99 0b sbc r25, r25 12458: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1245c: 20 91 7a 02 lds r18, 0x027A ; 0x80027a 12460: 30 91 7b 02 lds r19, 0x027B ; 0x80027b 12464: 40 91 7c 02 lds r20, 0x027C ; 0x80027c 12468: 50 91 7d 02 lds r21, 0x027D ; 0x80027d 1246c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12470: 2e e3 ldi r18, 0x3E ; 62 12472: 33 ec ldi r19, 0xC3 ; 195 12474: 4e e2 ldi r20, 0x2E ; 46 12476: 59 e3 ldi r21, 0x39 ; 57 12478: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1247c: 68 af std Y+56, r22 ; 0x38 1247e: 79 af std Y+57, r23 ; 0x39 12480: 8a af std Y+58, r24 ; 0x3a 12482: 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)); 12484: 80 e1 ldi r24, 0x10 ; 16 12486: e1 e6 ldi r30, 0x61 ; 97 12488: f2 e1 ldi r31, 0x12 ; 18 1248a: de 01 movw r26, r28 1248c: 11 96 adiw r26, 0x01 ; 1 1248e: 01 90 ld r0, Z+ 12490: 0d 92 st X+, r0 12492: 8a 95 dec r24 12494: e1 f7 brne .-8 ; 0x1248e float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 12496: a5 01 movw r20, r10 12498: 94 01 movw r18, r8 1249a: 50 58 subi r21, 0x80 ; 128 1249c: 28 a7 std Y+40, r18 ; 0x28 1249e: 39 a7 std Y+41, r19 ; 0x29 124a0: 4a a7 std Y+42, r20 ; 0x2a 124a2: 5b a7 std Y+43, r21 ; 0x2b float r_axis_y = -offset[Y_AXIS]; 124a4: d7 01 movw r26, r14 124a6: c6 01 movw r24, r12 124a8: b0 58 subi r27, 0x80 ; 128 124aa: 8c a7 std Y+44, r24 ; 0x2c 124ac: 9d a7 std Y+45, r25 ; 0x2d 124ae: ae a7 std Y+46, r26 ; 0x2e 124b0: bf a7 std Y+47, r27 ; 0x2f float center_axis_x = start_position[X_AXIS] - r_axis_x; 124b2: 29 81 ldd r18, Y+1 ; 0x01 124b4: 3a 81 ldd r19, Y+2 ; 0x02 124b6: 4b 81 ldd r20, Y+3 ; 0x03 124b8: 5c 81 ldd r21, Y+4 ; 0x04 124ba: 28 96 adiw r28, 0x08 ; 8 124bc: 2c af std Y+60, r18 ; 0x3c 124be: 3d af std Y+61, r19 ; 0x3d 124c0: 4e af std Y+62, r20 ; 0x3e 124c2: 5f af std Y+63, r21 ; 0x3f 124c4: 28 97 sbiw r28, 0x08 ; 8 124c6: c5 01 movw r24, r10 124c8: b4 01 movw r22, r8 124ca: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 124ce: 62 96 adiw r28, 0x12 ; 18 124d0: 6c af std Y+60, r22 ; 0x3c 124d2: 7d af std Y+61, r23 ; 0x3d 124d4: 8e af std Y+62, r24 ; 0x3e 124d6: 9f af std Y+63, r25 ; 0x3f 124d8: 62 97 sbiw r28, 0x12 ; 18 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 124da: 8d 81 ldd r24, Y+5 ; 0x05 124dc: 9e 81 ldd r25, Y+6 ; 0x06 124de: af 81 ldd r26, Y+7 ; 0x07 124e0: b8 85 ldd r27, Y+8 ; 0x08 124e2: 2c 96 adiw r28, 0x0c ; 12 124e4: 8c af std Y+60, r24 ; 0x3c 124e6: 9d af std Y+61, r25 ; 0x3d 124e8: ae af std Y+62, r26 ; 0x3e 124ea: bf af std Y+63, r27 ; 0x3f 124ec: 2c 97 sbiw r28, 0x0c ; 12 124ee: 9c 01 movw r18, r24 124f0: ad 01 movw r20, r26 124f2: c7 01 movw r24, r14 124f4: b6 01 movw r22, r12 124f6: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 124fa: 66 96 adiw r28, 0x16 ; 22 124fc: 6c af std Y+60, r22 ; 0x3c 124fe: 7d af std Y+61, r23 ; 0x3d 12500: 8e af std Y+62, r24 ; 0x3e 12502: 9f af std Y+63, r25 ; 0x3f 12504: 66 97 sbiw r28, 0x16 ; 22 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 12506: 29 85 ldd r18, Y+9 ; 0x09 12508: 3a 85 ldd r19, Y+10 ; 0x0a 1250a: 4b 85 ldd r20, Y+11 ; 0x0b 1250c: 5c 85 ldd r21, Y+12 ; 0x0c 1250e: 60 91 31 06 lds r22, 0x0631 ; 0x800631 12512: 70 91 32 06 lds r23, 0x0632 ; 0x800632 12516: 80 91 33 06 lds r24, 0x0633 ; 0x800633 1251a: 90 91 34 06 lds r25, 0x0634 ; 0x800634 1251e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 12522: 6a 96 adiw r28, 0x1a ; 26 12524: 6c af std Y+60, r22 ; 0x3c 12526: 7d af std Y+61, r23 ; 0x3d 12528: 8e af std Y+62, r24 ; 0x3e 1252a: 9f af std Y+63, r25 ; 0x3f 1252c: 6a 97 sbiw r28, 0x1a ; 26 float rt_x = target[X_AXIS] - center_axis_x; 1252e: 20 91 29 06 lds r18, 0x0629 ; 0x800629 12532: 30 91 2a 06 lds r19, 0x062A ; 0x80062a 12536: 40 91 2b 06 lds r20, 0x062B ; 0x80062b 1253a: 50 91 2c 06 lds r21, 0x062C ; 0x80062c 1253e: 6e 96 adiw r28, 0x1e ; 30 12540: 2c af std Y+60, r18 ; 0x3c 12542: 3d af std Y+61, r19 ; 0x3d 12544: 4e af std Y+62, r20 ; 0x3e 12546: 5f af std Y+63, r21 ; 0x3f 12548: 6e 97 sbiw r28, 0x1e ; 30 1254a: 62 96 adiw r28, 0x12 ; 18 1254c: 2c ad ldd r18, Y+60 ; 0x3c 1254e: 3d ad ldd r19, Y+61 ; 0x3d 12550: 4e ad ldd r20, Y+62 ; 0x3e 12552: 5f ad ldd r21, Y+63 ; 0x3f 12554: 62 97 sbiw r28, 0x12 ; 18 12556: 6e 96 adiw r28, 0x1e ; 30 12558: 6c ad ldd r22, Y+60 ; 0x3c 1255a: 7d ad ldd r23, Y+61 ; 0x3d 1255c: 8e ad ldd r24, Y+62 ; 0x3e 1255e: 9f ad ldd r25, Y+63 ; 0x3f 12560: 6e 97 sbiw r28, 0x1e ; 30 12562: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 12566: 6b 01 movw r12, r22 12568: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 1256a: 80 91 2d 06 lds r24, 0x062D ; 0x80062d 1256e: 90 91 2e 06 lds r25, 0x062E ; 0x80062e 12572: a0 91 2f 06 lds r26, 0x062F ; 0x80062f 12576: b0 91 30 06 lds r27, 0x0630 ; 0x800630 1257a: a2 96 adiw r28, 0x22 ; 34 1257c: 8c af std Y+60, r24 ; 0x3c 1257e: 9d af std Y+61, r25 ; 0x3d 12580: ae af std Y+62, r26 ; 0x3e 12582: bf af std Y+63, r27 ; 0x3f 12584: a2 97 sbiw r28, 0x22 ; 34 12586: 66 96 adiw r28, 0x16 ; 22 12588: 2c ad ldd r18, Y+60 ; 0x3c 1258a: 3d ad ldd r19, Y+61 ; 0x3d 1258c: 4e ad ldd r20, Y+62 ; 0x3e 1258e: 5f ad ldd r21, Y+63 ; 0x3f 12590: 66 97 sbiw r28, 0x16 ; 22 12592: bc 01 movw r22, r24 12594: cd 01 movw r24, r26 12596: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1259a: 4b 01 movw r8, r22 1259c: 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; 1259e: 30 90 2b 0e lds r3, 0x0E2B ; 0x800e2b 125a2: 20 90 2c 0e lds r2, 0x0E2C ; 0x800e2c 125a6: 90 91 2d 0e lds r25, 0x0E2D ; 0x800e2d 125aa: 9c ab std Y+52, r25 ; 0x34 125ac: a0 91 2e 0e lds r26, 0x0E2E ; 0x800e2e 125b0: 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; 125b2: b0 91 33 0e lds r27, 0x0E33 ; 0x800e33 125b6: 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); 125b8: a7 01 movw r20, r14 125ba: 96 01 movw r18, r12 125bc: 68 a5 ldd r22, Y+40 ; 0x28 125be: 79 a5 ldd r23, Y+41 ; 0x29 125c0: 8a a5 ldd r24, Y+42 ; 0x2a 125c2: 9b a5 ldd r25, Y+43 ; 0x2b 125c4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 125c8: 2b 01 movw r4, r22 125ca: 3c 01 movw r6, r24 125cc: a5 01 movw r20, r10 125ce: 94 01 movw r18, r8 125d0: 6c a5 ldd r22, Y+44 ; 0x2c 125d2: 7d a5 ldd r23, Y+45 ; 0x2d 125d4: 8e a5 ldd r24, Y+46 ; 0x2e 125d6: 9f a5 ldd r25, Y+47 ; 0x2f 125d8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 125dc: 9b 01 movw r18, r22 125de: ac 01 movw r20, r24 125e0: c3 01 movw r24, r6 125e2: b2 01 movw r22, r4 125e4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 125e8: 2b 01 movw r4, r22 125ea: 3c 01 movw r6, r24 125ec: a5 01 movw r20, r10 125ee: 94 01 movw r18, r8 125f0: 68 a5 ldd r22, Y+40 ; 0x28 125f2: 79 a5 ldd r23, Y+41 ; 0x29 125f4: 8a a5 ldd r24, Y+42 ; 0x2a 125f6: 9b a5 ldd r25, Y+43 ; 0x2b 125f8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 125fc: 4b 01 movw r8, r22 125fe: 5c 01 movw r10, r24 12600: a7 01 movw r20, r14 12602: 96 01 movw r18, r12 12604: 6c a5 ldd r22, Y+44 ; 0x2c 12606: 7d a5 ldd r23, Y+45 ; 0x2d 12608: 8e a5 ldd r24, Y+46 ; 0x2e 1260a: 9f a5 ldd r25, Y+47 ; 0x2f 1260c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12610: 9b 01 movw r18, r22 12612: ac 01 movw r20, r24 12614: c5 01 movw r24, r10 12616: b4 01 movw r22, r8 12618: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1261c: a3 01 movw r20, r6 1261e: 92 01 movw r18, r4 12620: 0f 94 e5 a5 call 0x34bca ; 0x34bca 12624: 6b 01 movw r12, r22 12626: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 12628: 20 e0 ldi r18, 0x00 ; 0 1262a: 30 e0 ldi r19, 0x00 ; 0 1262c: a9 01 movw r20, r18 1262e: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 12632: 87 ff sbrs r24, 7 12634: 0a c0 rjmp .+20 ; 0x1264a 12636: 2b ed ldi r18, 0xDB ; 219 12638: 3f e0 ldi r19, 0x0F ; 15 1263a: 49 ec ldi r20, 0xC9 ; 201 1263c: 50 e4 ldi r21, 0x40 ; 64 1263e: c7 01 movw r24, r14 12640: b6 01 movw r22, r12 12642: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 12646: 6b 01 movw r12, r22 12648: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 1264a: 60 91 34 0e lds r22, 0x0E34 ; 0x800e34 1264e: 70 91 35 0e lds r23, 0x0E35 ; 0x800e35 12652: 61 15 cp r22, r1 12654: 71 05 cpc r23, r1 12656: 09 f4 brne .+2 ; 0x1265a 12658: 61 c2 rjmp .+1218 ; 0x12b1c { // 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); 1265a: 90 e0 ldi r25, 0x00 ; 0 1265c: 80 e0 ldi r24, 0x00 ; 0 1265e: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 12662: 9b 01 movw r18, r22 12664: ac 01 movw r20, r24 12666: 6b ed ldi r22, 0xDB ; 219 12668: 7f e0 ldi r23, 0x0F ; 15 1266a: 89 ec ldi r24, 0xC9 ; 201 1266c: 90 e4 ldi r25, 0x40 ; 64 1266e: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 12672: 24 96 adiw r28, 0x04 ; 4 12674: 2c ad ldd r18, Y+60 ; 0x3c 12676: 3d ad ldd r19, Y+61 ; 0x3d 12678: 4e ad ldd r20, Y+62 ; 0x3e 1267a: 5f ad ldd r21, Y+63 ; 0x3f 1267c: 24 97 sbiw r28, 0x04 ; 4 1267e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12682: 5b 01 movw r10, r22 12684: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 12686: 60 91 36 0e lds r22, 0x0E36 ; 0x800e36 1268a: 70 91 37 0e lds r23, 0x0E37 ; 0x800e37 1268e: 61 15 cp r22, r1 12690: 71 05 cpc r23, r1 12692: e1 f0 breq .+56 ; 0x126cc { // 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)); 12694: 90 e0 ldi r25, 0x00 ; 0 12696: 80 e0 ldi r24, 0x00 ; 0 12698: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 1269c: 20 e0 ldi r18, 0x00 ; 0 1269e: 30 e0 ldi r19, 0x00 ; 0 126a0: 40 e7 ldi r20, 0x70 ; 112 126a2: 52 e4 ldi r21, 0x42 ; 66 126a4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 126a8: 9b 01 movw r18, r22 126aa: ac 01 movw r20, r24 126ac: 68 ad ldd r22, Y+56 ; 0x38 126ae: 79 ad ldd r23, Y+57 ; 0x39 126b0: 8a ad ldd r24, Y+58 ; 0x3a 126b2: 9b ad ldd r25, Y+59 ; 0x3b 126b4: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 126b8: 3b 01 movw r6, r22 126ba: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 126bc: 95 01 movw r18, r10 126be: a8 01 movw r20, r16 126c0: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 126c4: 87 ff sbrs r24, 7 126c6: 02 c0 rjmp .+4 ; 0x126cc mm_per_arc_segment = mm_per_arc_segment_sec; 126c8: 53 01 movw r10, r6 126ca: 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) 126cc: 40 90 2f 0e lds r4, 0x0E2F ; 0x800e2f 126d0: 50 90 30 0e lds r5, 0x0E30 ; 0x800e30 126d4: 60 90 31 0e lds r6, 0x0E31 ; 0x800e31 126d8: 70 90 32 0e lds r7, 0x0E32 ; 0x800e32 126dc: 95 01 movw r18, r10 126de: a8 01 movw r20, r16 126e0: b2 01 movw r22, r4 126e2: c3 01 movw r24, r6 126e4: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 126e8: 18 16 cp r1, r24 126ea: 84 f0 brlt .+32 ; 0x1270c { // 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) { 126ec: 95 01 movw r18, r10 126ee: a8 01 movw r20, r16 126f0: 63 2d mov r22, r3 126f2: 72 2d mov r23, r2 126f4: 8c a9 ldd r24, Y+52 ; 0x34 126f6: 9c ad ldd r25, Y+60 ; 0x3c 126f8: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 126fc: 25 01 movw r4, r10 126fe: 38 01 movw r6, r16 12700: 87 ff sbrs r24, 7 12702: 04 c0 rjmp .+8 ; 0x1270c // 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; 12704: 43 2c mov r4, r3 12706: 52 2c mov r5, r2 12708: 6c a8 ldd r6, Y+52 ; 0x34 1270a: 7c ac ldd r7, Y+60 ; 0x3c } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 1270c: a4 96 adiw r28, 0x24 ; 36 1270e: ee ad ldd r30, Y+62 ; 0x3e 12710: ff ad ldd r31, Y+63 ; 0x3f 12712: a4 97 sbiw r28, 0x24 ; 36 12714: 32 97 sbiw r30, 0x02 ; 2 12716: 51 f4 brne .+20 ; 0x1272c 12718: 2b ed ldi r18, 0xDB ; 219 1271a: 3f e0 ldi r19, 0x0F ; 15 1271c: 49 ec ldi r20, 0xC9 ; 201 1271e: 50 e4 ldi r21, 0x40 ; 64 12720: c7 01 movw r24, r14 12722: b6 01 movw r22, r12 12724: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 12728: 6b 01 movw r12, r22 1272a: 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) 1272c: 6e 96 adiw r28, 0x1e ; 30 1272e: 2c ad ldd r18, Y+60 ; 0x3c 12730: 3d ad ldd r19, Y+61 ; 0x3d 12732: 4e ad ldd r20, Y+62 ; 0x3e 12734: 5f ad ldd r21, Y+63 ; 0x3f 12736: 6e 97 sbiw r28, 0x1e ; 30 12738: 28 96 adiw r28, 0x08 ; 8 1273a: 6c ad ldd r22, Y+60 ; 0x3c 1273c: 7d ad ldd r23, Y+61 ; 0x3d 1273e: 8e ad ldd r24, Y+62 ; 0x3e 12740: 9f ad ldd r25, Y+63 ; 0x3f 12742: 28 97 sbiw r28, 0x08 ; 8 12744: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 12748: 81 11 cpse r24, r1 1274a: 23 c0 rjmp .+70 ; 0x12792 1274c: a2 96 adiw r28, 0x22 ; 34 1274e: 2c ad ldd r18, Y+60 ; 0x3c 12750: 3d ad ldd r19, Y+61 ; 0x3d 12752: 4e ad ldd r20, Y+62 ; 0x3e 12754: 5f ad ldd r21, Y+63 ; 0x3f 12756: a2 97 sbiw r28, 0x22 ; 34 12758: 2c 96 adiw r28, 0x0c ; 12 1275a: 6c ad ldd r22, Y+60 ; 0x3c 1275c: 7d ad ldd r23, Y+61 ; 0x3d 1275e: 8e ad ldd r24, Y+62 ; 0x3e 12760: 9f ad ldd r25, Y+63 ; 0x3f 12762: 2c 97 sbiw r28, 0x0c ; 12 12764: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 12768: 81 11 cpse r24, r1 1276a: 13 c0 rjmp .+38 ; 0x12792 1276c: 20 e0 ldi r18, 0x00 ; 0 1276e: 30 e0 ldi r19, 0x00 ; 0 12770: a9 01 movw r20, r18 12772: c7 01 movw r24, r14 12774: b6 01 movw r22, r12 12776: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1277a: 81 11 cpse r24, r1 1277c: 0a c0 rjmp .+20 ; 0x12792 { angular_travel_total += 2 * M_PI; 1277e: 2b ed ldi r18, 0xDB ; 219 12780: 3f e0 ldi r19, 0x0F ; 15 12782: 49 ec ldi r20, 0xC9 ; 201 12784: 50 e4 ldi r21, 0x40 ; 64 12786: c7 01 movw r24, r14 12788: b6 01 movw r22, r12 1278a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1278e: 6b 01 movw r12, r22 12790: 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)); 12792: a7 01 movw r20, r14 12794: 96 01 movw r18, r12 12796: 24 96 adiw r28, 0x04 ; 4 12798: 6c ad ldd r22, Y+60 ; 0x3c 1279a: 7d ad ldd r23, Y+61 ; 0x3d 1279c: 8e ad ldd r24, Y+62 ; 0x3e 1279e: 9f ad ldd r25, Y+63 ; 0x3f 127a0: 24 97 sbiw r28, 0x04 ; 4 127a2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 127a6: 6a 96 adiw r28, 0x1a ; 26 127a8: 2c ad ldd r18, Y+60 ; 0x3c 127aa: 3d ad ldd r19, Y+61 ; 0x3d 127ac: 4e ad ldd r20, Y+62 ; 0x3e 127ae: 5f ad ldd r21, Y+63 ; 0x3f 127b0: 6a 97 sbiw r28, 0x1a ; 26 127b2: 0f 94 02 a8 call 0x35004 ; 0x35004 127b6: 4b 01 movw r8, r22 127b8: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 127ba: 2f e6 ldi r18, 0x6F ; 111 127bc: 32 e1 ldi r19, 0x12 ; 18 127be: 43 e8 ldi r20, 0x83 ; 131 127c0: 5a e3 ldi r21, 0x3A ; 58 127c2: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 127c6: 87 fd sbrc r24, 7 127c8: 9e c1 rjmp .+828 ; 0x12b06 // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 127ca: 92 01 movw r18, r4 127cc: a3 01 movw r20, r6 127ce: c5 01 movw r24, r10 127d0: b4 01 movw r22, r8 127d2: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 127d6: 0f 94 44 a6 call 0x34c88 ; 0x34c88 127da: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 127de: 7d ab std Y+53, r23 ; 0x35 127e0: 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) 127e2: 62 30 cpi r22, 0x02 ; 2 127e4: 71 05 cpc r23, r1 127e6: 08 f4 brcc .+2 ; 0x127ea 127e8: 5e c1 rjmp .+700 ; 0x12aa6 127ea: 2e 96 adiw r28, 0x0e ; 14 127ec: 4e ad ldd r20, Y+62 ; 0x3e 127ee: 5f ad ldd r21, Y+63 ; 0x3f 127f0: 2e 97 sbiw r28, 0x0e ; 14 127f2: 45 2b or r20, r21 127f4: 09 f4 brne .+2 ; 0x127f8 127f6: 57 c1 rjmp .+686 ; 0x12aa6 { // 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, 127f8: 90 e0 ldi r25, 0x00 ; 0 127fa: 80 e0 ldi r24, 0x00 ; 0 127fc: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 12800: 4b 01 movw r8, r22 12802: 5c 01 movw r10, r24 12804: ac 01 movw r20, r24 12806: 9b 01 movw r18, r22 12808: c7 01 movw r24, r14 1280a: b6 01 movw r22, r12 1280c: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 12810: 2b 01 movw r4, r22 12812: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 12814: a5 01 movw r20, r10 12816: 94 01 movw r18, r8 12818: 6a 96 adiw r28, 0x1a ; 26 1281a: 6c ad ldd r22, Y+60 ; 0x3c 1281c: 7d ad ldd r23, Y+61 ; 0x3d 1281e: 8e ad ldd r24, Y+62 ; 0x3e 12820: 9f ad ldd r25, Y+63 ; 0x3f 12822: 6a 97 sbiw r28, 0x1a ; 26 12824: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 12828: 28 96 adiw r28, 0x08 ; 8 1282a: 6c af std Y+60, r22 ; 0x3c 1282c: 7d af std Y+61, r23 ; 0x3d 1282e: 8e af std Y+62, r24 ; 0x3e 12830: 9f af std Y+63, r25 ; 0x3f 12832: 28 97 sbiw r28, 0x08 ; 8 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 12834: 2d 85 ldd r18, Y+13 ; 0x0d 12836: 3e 85 ldd r19, Y+14 ; 0x0e 12838: 4f 85 ldd r20, Y+15 ; 0x0f 1283a: 58 89 ldd r21, Y+16 ; 0x10 1283c: 60 91 35 06 lds r22, 0x0635 ; 0x800635 12840: 70 91 36 06 lds r23, 0x0636 ; 0x800636 12844: 80 91 37 06 lds r24, 0x0637 ; 0x800637 12848: 90 91 38 06 lds r25, 0x0638 ; 0x800638 1284c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 12850: a5 01 movw r20, r10 12852: 94 01 movw r18, r8 12854: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 12858: 2c 96 adiw r28, 0x0c ; 12 1285a: 6c af std Y+60, r22 ; 0x3c 1285c: 7d af std Y+61, r23 ; 0x3d 1285e: 8e af std Y+62, r24 ; 0x3e 12860: 9f af std Y+63, r25 ; 0x3f 12862: 2c 97 sbiw r28, 0x0c ; 12 sq_theta_per_segment = theta_per_segment * theta_per_segment, 12864: a3 01 movw r20, r6 12866: 92 01 movw r18, r4 12868: c3 01 movw r24, r6 1286a: b2 01 movw r22, r4 1286c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12870: 6b 01 movw r12, r22 12872: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 12874: ac 01 movw r20, r24 12876: 9b 01 movw r18, r22 12878: c3 01 movw r24, r6 1287a: b2 01 movw r22, r4 1287c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12880: 20 e0 ldi r18, 0x00 ; 0 12882: 30 e0 ldi r19, 0x00 ; 0 12884: 40 ec ldi r20, 0xC0 ; 192 12886: 50 e4 ldi r21, 0x40 ; 64 12888: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1288c: 9b 01 movw r18, r22 1288e: ac 01 movw r20, r24 12890: c3 01 movw r24, r6 12892: b2 01 movw r22, r4 12894: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 12898: 6c af std Y+60, r22 ; 0x3c 1289a: 7d af std Y+61, r23 ; 0x3d 1289c: 8e af std Y+62, r24 ; 0x3e 1289e: 9f af std Y+63, r25 ; 0x3f cos_T = 1 - 0.5f * sq_theta_per_segment; 128a0: 20 e0 ldi r18, 0x00 ; 0 128a2: 30 e0 ldi r19, 0x00 ; 0 128a4: 40 e0 ldi r20, 0x00 ; 0 128a6: 5f e3 ldi r21, 0x3F ; 63 128a8: c7 01 movw r24, r14 128aa: b6 01 movw r22, r12 128ac: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 128b0: 9b 01 movw r18, r22 128b2: ac 01 movw r20, r24 128b4: 60 e0 ldi r22, 0x00 ; 0 128b6: 70 e0 ldi r23, 0x00 ; 0 128b8: 80 e8 ldi r24, 0x80 ; 128 128ba: 9f e3 ldi r25, 0x3F ; 63 128bc: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 128c0: 24 96 adiw r28, 0x04 ; 4 128c2: 6c af std Y+60, r22 ; 0x3c 128c4: 7d af std Y+61, r23 ; 0x3d 128c6: 8e af std Y+62, r24 ; 0x3e 128c8: 9f af std Y+63, r25 ; 0x3f 128ca: 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++) { 128cc: 22 24 eor r2, r2 128ce: 23 94 inc r2 128d0: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 128d2: d8 a8 ldd r13, Y+48 ; 0x30 128d4: da 94 dec r13 128d6: 58 a9 ldd r21, Y+48 ; 0x30 128d8: 51 11 cpse r21, r1 128da: 25 c1 rjmp .+586 ; 0x12b26 // 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); 128dc: b1 01 movw r22, r2 128de: 90 e0 ldi r25, 0x00 ; 0 128e0: 80 e0 ldi r24, 0x00 ; 0 128e2: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 128e6: a3 01 movw r20, r6 128e8: 92 01 movw r18, r4 128ea: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 128ee: 6b 01 movw r12, r22 128f0: 7c 01 movw r14, r24 128f2: 0f 94 60 a6 call 0x34cc0 ; 0x34cc0 128f6: 6c a7 std Y+44, r22 ; 0x2c 128f8: 7d a7 std Y+45, r23 ; 0x2d 128fa: 8e a7 std Y+46, r24 ; 0x2e 128fc: 9f a7 std Y+47, r25 ; 0x2f 128fe: c7 01 movw r24, r14 12900: b6 01 movw r22, r12 12902: 0f 94 26 a9 call 0x3524c ; 0x3524c 12906: 4b 01 movw r8, r22 12908: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 1290a: c0 90 4d 03 lds r12, 0x034D ; 0x80034d 1290e: d0 90 4e 03 lds r13, 0x034E ; 0x80034e 12912: e0 90 4f 03 lds r14, 0x034F ; 0x80034f 12916: f0 90 50 03 lds r15, 0x0350 ; 0x800350 1291a: f7 fa bst r15, 7 1291c: f0 94 com r15 1291e: f7 f8 bld r15, 7 12920: f0 94 com r15 12922: 80 91 51 03 lds r24, 0x0351 ; 0x800351 12926: 90 91 52 03 lds r25, 0x0352 ; 0x800352 1292a: a0 91 53 03 lds r26, 0x0353 ; 0x800353 1292e: b0 91 54 03 lds r27, 0x0354 ; 0x800354 12932: 88 ab std Y+48, r24 ; 0x30 12934: 99 ab std Y+49, r25 ; 0x31 12936: aa ab std Y+50, r26 ; 0x32 12938: bb ab std Y+51, r27 ; 0x33 1293a: a7 01 movw r20, r14 1293c: 96 01 movw r18, r12 1293e: 6c a5 ldd r22, Y+44 ; 0x2c 12940: 7d a5 ldd r23, Y+45 ; 0x2d 12942: 8e a5 ldd r24, Y+46 ; 0x2e 12944: 9f a5 ldd r25, Y+47 ; 0x2f 12946: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1294a: 68 a7 std Y+40, r22 ; 0x28 1294c: 79 a7 std Y+41, r23 ; 0x29 1294e: 8a a7 std Y+42, r24 ; 0x2a 12950: 9b a7 std Y+43, r25 ; 0x2b 12952: 28 a9 ldd r18, Y+48 ; 0x30 12954: 39 a9 ldd r19, Y+49 ; 0x31 12956: 4a a9 ldd r20, Y+50 ; 0x32 12958: 5b a9 ldd r21, Y+51 ; 0x33 1295a: c5 01 movw r24, r10 1295c: b4 01 movw r22, r8 1295e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12962: 9b 01 movw r18, r22 12964: ac 01 movw r20, r24 12966: 68 a5 ldd r22, Y+40 ; 0x28 12968: 79 a5 ldd r23, Y+41 ; 0x29 1296a: 8a a5 ldd r24, Y+42 ; 0x2a 1296c: 9b a5 ldd r25, Y+43 ; 0x2b 1296e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 12972: 68 a7 std Y+40, r22 ; 0x28 12974: 79 a7 std Y+41, r23 ; 0x29 12976: 8a a7 std Y+42, r24 ; 0x2a 12978: 9b a7 std Y+43, r25 ; 0x2b r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 1297a: a7 01 movw r20, r14 1297c: 96 01 movw r18, r12 1297e: c5 01 movw r24, r10 12980: b4 01 movw r22, r8 12982: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12986: 6b 01 movw r12, r22 12988: 7c 01 movw r14, r24 1298a: 28 a9 ldd r18, Y+48 ; 0x30 1298c: 39 a9 ldd r19, Y+49 ; 0x31 1298e: 4a a9 ldd r20, Y+50 ; 0x32 12990: 5b a9 ldd r21, Y+51 ; 0x33 12992: 6c a5 ldd r22, Y+44 ; 0x2c 12994: 7d a5 ldd r23, Y+45 ; 0x2d 12996: 8e a5 ldd r24, Y+46 ; 0x2e 12998: 9f a5 ldd r25, Y+47 ; 0x2f 1299a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1299e: 9b 01 movw r18, r22 129a0: ac 01 movw r20, r24 129a2: c7 01 movw r24, r14 129a4: b6 01 movw r22, r12 129a6: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 129aa: 6c a7 std Y+44, r22 ; 0x2c 129ac: 7d a7 std Y+45, r23 ; 0x2d 129ae: 8e a7 std Y+46, r24 ; 0x2e 129b0: 9f a7 std Y+47, r25 ; 0x2f // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 129b2: 90 91 33 0e lds r25, 0x0E33 ; 0x800e33 129b6: 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; 129b8: 28 a5 ldd r18, Y+40 ; 0x28 129ba: 39 a5 ldd r19, Y+41 ; 0x29 129bc: 4a a5 ldd r20, Y+42 ; 0x2a 129be: 5b a5 ldd r21, Y+43 ; 0x2b 129c0: 62 96 adiw r28, 0x12 ; 18 129c2: 6c ad ldd r22, Y+60 ; 0x3c 129c4: 7d ad ldd r23, Y+61 ; 0x3d 129c6: 8e ad ldd r24, Y+62 ; 0x3e 129c8: 9f ad ldd r25, Y+63 ; 0x3f 129ca: 62 97 sbiw r28, 0x12 ; 18 129cc: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 129d0: 69 83 std Y+1, r22 ; 0x01 129d2: 7a 83 std Y+2, r23 ; 0x02 129d4: 8b 83 std Y+3, r24 ; 0x03 129d6: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 129d8: 2c a5 ldd r18, Y+44 ; 0x2c 129da: 3d a5 ldd r19, Y+45 ; 0x2d 129dc: 4e a5 ldd r20, Y+46 ; 0x2e 129de: 5f a5 ldd r21, Y+47 ; 0x2f 129e0: 66 96 adiw r28, 0x16 ; 22 129e2: 6c ad ldd r22, Y+60 ; 0x3c 129e4: 7d ad ldd r23, Y+61 ; 0x3d 129e6: 8e ad ldd r24, Y+62 ; 0x3e 129e8: 9f ad ldd r25, Y+63 ; 0x3f 129ea: 66 97 sbiw r28, 0x16 ; 22 129ec: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 129f0: 6d 83 std Y+5, r22 ; 0x05 129f2: 7e 83 std Y+6, r23 ; 0x06 129f4: 8f 83 std Y+7, r24 ; 0x07 129f6: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 129f8: 28 96 adiw r28, 0x08 ; 8 129fa: 2c ad ldd r18, Y+60 ; 0x3c 129fc: 3d ad ldd r19, Y+61 ; 0x3d 129fe: 4e ad ldd r20, Y+62 ; 0x3e 12a00: 5f ad ldd r21, Y+63 ; 0x3f 12a02: 28 97 sbiw r28, 0x08 ; 8 12a04: 69 85 ldd r22, Y+9 ; 0x09 12a06: 7a 85 ldd r23, Y+10 ; 0x0a 12a08: 8b 85 ldd r24, Y+11 ; 0x0b 12a0a: 9c 85 ldd r25, Y+12 ; 0x0c 12a0c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 12a10: 69 87 std Y+9, r22 ; 0x09 12a12: 7a 87 std Y+10, r23 ; 0x0a 12a14: 8b 87 std Y+11, r24 ; 0x0b 12a16: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 12a18: 2c 96 adiw r28, 0x0c ; 12 12a1a: 2c ad ldd r18, Y+60 ; 0x3c 12a1c: 3d ad ldd r19, Y+61 ; 0x3d 12a1e: 4e ad ldd r20, Y+62 ; 0x3e 12a20: 5f ad ldd r21, Y+63 ; 0x3f 12a22: 2c 97 sbiw r28, 0x0c ; 12 12a24: 6d 85 ldd r22, Y+13 ; 0x0d 12a26: 7e 85 ldd r23, Y+14 ; 0x0e 12a28: 8f 85 ldd r24, Y+15 ; 0x0f 12a2a: 98 89 ldd r25, Y+16 ; 0x10 12a2c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 12a30: 6d 87 std Y+13, r22 ; 0x0d 12a32: 7e 87 std Y+14, r23 ; 0x0e 12a34: 8f 87 std Y+15, r24 ; 0x0f 12a36: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 12a38: ce 01 movw r24, r28 12a3a: 01 96 adiw r24, 0x01 ; 1 12a3c: 0e 94 d7 6a call 0xd5ae ; 0xd5ae // Insert the segment into the buffer if (i >= start_segment_idx) 12a40: 2e 96 adiw r28, 0x0e ; 14 12a42: ae ad ldd r26, Y+62 ; 0x3e 12a44: bf ad ldd r27, Y+63 ; 0x3f 12a46: 2e 97 sbiw r28, 0x0e ; 14 12a48: 2a 16 cp r2, r26 12a4a: 3b 06 cpc r3, r27 12a4c: f8 f0 brcs .+62 ; 0x12a8c plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 12a4e: e9 84 ldd r14, Y+9 ; 0x09 12a50: fa 84 ldd r15, Y+10 ; 0x0a 12a52: 0b 85 ldd r16, Y+11 ; 0x0b 12a54: 1c 85 ldd r17, Y+12 ; 0x0c 12a56: 2d 81 ldd r18, Y+5 ; 0x05 12a58: 3e 81 ldd r19, Y+6 ; 0x06 12a5a: 4f 81 ldd r20, Y+7 ; 0x07 12a5c: 58 85 ldd r21, Y+8 ; 0x08 12a5e: 69 81 ldd r22, Y+1 ; 0x01 12a60: 7a 81 ldd r23, Y+2 ; 0x02 12a62: 8b 81 ldd r24, Y+3 ; 0x03 12a64: 9c 81 ldd r25, Y+4 ; 0x04 12a66: 3f 92 push r3 12a68: 2f 92 push r2 12a6a: e1 e6 ldi r30, 0x61 ; 97 12a6c: f2 e1 ldi r31, 0x12 ; 18 12a6e: ff 93 push r31 12a70: ef 93 push r30 12a72: 88 ac ldd r8, Y+56 ; 0x38 12a74: 99 ac ldd r9, Y+57 ; 0x39 12a76: aa ac ldd r10, Y+58 ; 0x3a 12a78: bb ac ldd r11, Y+59 ; 0x3b 12a7a: fe 01 movw r30, r28 12a7c: 3d 96 adiw r30, 0x0d ; 13 12a7e: 6f 01 movw r12, r30 12a80: 0f 94 5a 3a call 0x274b4 ; 0x274b4 12a84: 0f 90 pop r0 12a86: 0f 90 pop r0 12a88: 0f 90 pop r0 12a8a: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 12a8c: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 12a90: 81 11 cpse r24, r1 12a92: 39 c0 rjmp .+114 ; 0x12b06 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++) { 12a94: ff ef ldi r31, 0xFF ; 255 12a96: 2f 1a sub r2, r31 12a98: 3f 0a sbc r3, r31 12a9a: 2c a9 ldd r18, Y+52 ; 0x34 12a9c: 3d a9 ldd r19, Y+53 ; 0x35 12a9e: 22 15 cp r18, r2 12aa0: 33 05 cpc r19, r3 12aa2: 09 f0 breq .+2 ; 0x12aa6 12aa4: 16 cf rjmp .-468 ; 0x128d2 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 12aa6: 89 e2 ldi r24, 0x29 ; 41 12aa8: 96 e0 ldi r25, 0x06 ; 6 12aaa: 0e 94 d7 6a call 0xd5ae ; 0xd5ae // 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); 12aae: e0 90 31 06 lds r14, 0x0631 ; 0x800631 12ab2: f0 90 32 06 lds r15, 0x0632 ; 0x800632 12ab6: 00 91 33 06 lds r16, 0x0633 ; 0x800633 12aba: 10 91 34 06 lds r17, 0x0634 ; 0x800634 12abe: 20 91 2d 06 lds r18, 0x062D ; 0x80062d 12ac2: 30 91 2e 06 lds r19, 0x062E ; 0x80062e 12ac6: 40 91 2f 06 lds r20, 0x062F ; 0x80062f 12aca: 50 91 30 06 lds r21, 0x0630 ; 0x800630 12ace: 60 91 29 06 lds r22, 0x0629 ; 0x800629 12ad2: 70 91 2a 06 lds r23, 0x062A ; 0x80062a 12ad6: 80 91 2b 06 lds r24, 0x062B ; 0x80062b 12ada: 90 91 2c 06 lds r25, 0x062C ; 0x80062c 12ade: 1f 92 push r1 12ae0: 1f 92 push r1 12ae2: e1 e6 ldi r30, 0x61 ; 97 12ae4: f2 e1 ldi r31, 0x12 ; 18 12ae6: ff 93 push r31 12ae8: ef 93 push r30 12aea: 88 ac ldd r8, Y+56 ; 0x38 12aec: 99 ac ldd r9, Y+57 ; 0x39 12aee: aa ac ldd r10, Y+58 ; 0x3a 12af0: bb ac ldd r11, Y+59 ; 0x3b 12af2: a5 e3 ldi r26, 0x35 ; 53 12af4: ca 2e mov r12, r26 12af6: a6 e0 ldi r26, 0x06 ; 6 12af8: da 2e mov r13, r26 12afa: 0f 94 5a 3a call 0x274b4 ; 0x274b4 12afe: 0f 90 pop r0 12b00: 0f 90 pop r0 12b02: 0f 90 pop r0 12b04: 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(); 12b06: 0e 94 73 55 call 0xaae6 ; 0xaae6 previous_millis_cmd.start(); 12b0a: 88 e4 ldi r24, 0x48 ; 72 12b0c: 93 e0 ldi r25, 0x03 ; 3 12b0e: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> 12b12: 4d cc rjmp .-1894 ; 0x123ae 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; 12b14: 60 e0 ldi r22, 0x00 ; 0 12b16: 70 e0 ldi r23, 0x00 ; 0 12b18: cb 01 movw r24, r22 12b1a: 5e cc rjmp .-1860 ; 0x123d8 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; 12b1c: a3 2c mov r10, r3 12b1e: b2 2c mov r11, r2 12b20: 0c a9 ldd r16, Y+52 ; 0x34 12b22: 1c ad ldd r17, Y+60 ; 0x3c 12b24: b0 cd rjmp .-1184 ; 0x12686 // 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; 12b26: 28 a5 ldd r18, Y+40 ; 0x28 12b28: 39 a5 ldd r19, Y+41 ; 0x29 12b2a: 4a a5 ldd r20, Y+42 ; 0x2a 12b2c: 5b a5 ldd r21, Y+43 ; 0x2b 12b2e: 6c ad ldd r22, Y+60 ; 0x3c 12b30: 7d ad ldd r23, Y+61 ; 0x3d 12b32: 8e ad ldd r24, Y+62 ; 0x3e 12b34: 9f ad ldd r25, Y+63 ; 0x3f 12b36: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12b3a: 4b 01 movw r8, r22 12b3c: 5c 01 movw r10, r24 12b3e: 2c a5 ldd r18, Y+44 ; 0x2c 12b40: 3d a5 ldd r19, Y+45 ; 0x2d 12b42: 4e a5 ldd r20, Y+46 ; 0x2e 12b44: 5f a5 ldd r21, Y+47 ; 0x2f 12b46: 24 96 adiw r28, 0x04 ; 4 12b48: 6c ad ldd r22, Y+60 ; 0x3c 12b4a: 7d ad ldd r23, Y+61 ; 0x3d 12b4c: 8e ad ldd r24, Y+62 ; 0x3e 12b4e: 9f ad ldd r25, Y+63 ; 0x3f 12b50: 24 97 sbiw r28, 0x04 ; 4 12b52: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12b56: 9b 01 movw r18, r22 12b58: ac 01 movw r20, r24 12b5a: c5 01 movw r24, r10 12b5c: b4 01 movw r22, r8 12b5e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 12b62: 7b 01 movw r14, r22 12b64: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 12b66: 28 a5 ldd r18, Y+40 ; 0x28 12b68: 39 a5 ldd r19, Y+41 ; 0x29 12b6a: 4a a5 ldd r20, Y+42 ; 0x2a 12b6c: 5b a5 ldd r21, Y+43 ; 0x2b 12b6e: 24 96 adiw r28, 0x04 ; 4 12b70: 6c ad ldd r22, Y+60 ; 0x3c 12b72: 7d ad ldd r23, Y+61 ; 0x3d 12b74: 8e ad ldd r24, Y+62 ; 0x3e 12b76: 9f ad ldd r25, Y+63 ; 0x3f 12b78: 24 97 sbiw r28, 0x04 ; 4 12b7a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12b7e: 4b 01 movw r8, r22 12b80: 5c 01 movw r10, r24 12b82: 2c a5 ldd r18, Y+44 ; 0x2c 12b84: 3d a5 ldd r19, Y+45 ; 0x2d 12b86: 4e a5 ldd r20, Y+46 ; 0x2e 12b88: 5f a5 ldd r21, Y+47 ; 0x2f 12b8a: 6c ad ldd r22, Y+60 ; 0x3c 12b8c: 7d ad ldd r23, Y+61 ; 0x3d 12b8e: 8e ad ldd r24, Y+62 ; 0x3e 12b90: 9f ad ldd r25, Y+63 ; 0x3f 12b92: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12b96: 9b 01 movw r18, r22 12b98: ac 01 movw r20, r24 12b9a: c5 01 movw r24, r10 12b9c: b4 01 movw r22, r8 12b9e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 12ba2: 68 a7 std Y+40, r22 ; 0x28 12ba4: 79 a7 std Y+41, r23 ; 0x29 12ba6: 8a a7 std Y+42, r24 ; 0x2a 12ba8: 9b a7 std Y+43, r25 ; 0x2b 12baa: d8 aa std Y+48, r13 ; 0x30 r_axis_y = r_axisi; 12bac: c7 01 movw r24, r14 12bae: d8 01 movw r26, r16 12bb0: 8c a7 std Y+44, r24 ; 0x2c 12bb2: 9d a7 std Y+45, r25 ; 0x2d 12bb4: ae a7 std Y+46, r26 ; 0x2e 12bb6: bf a7 std Y+47, r27 ; 0x2f 12bb8: ff ce rjmp .-514 ; 0x129b8 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 12bba: 80 e5 ldi r24, 0x50 ; 80 12bbc: 0e 94 80 56 call 0xad00 ; 0xad00 - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 12bc0: c1 2c mov r12, r1 12bc2: d1 2c mov r13, r1 12bc4: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 12bc6: 88 23 and r24, r24 12bc8: 31 f0 breq .+12 ; 0x12bd6 12bca: 0e 94 10 5b call 0xb620 ; 0xb620 12bce: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 12bd2: 6b 01 movw r12, r22 12bd4: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 12bd6: 83 e5 ldi r24, 0x53 ; 83 12bd8: 0e 94 80 56 call 0xad00 ; 0xad00 12bdc: 88 23 and r24, r24 12bde: 61 f0 breq .+24 ; 0x12bf8 12be0: 0e 94 10 5b call 0xb620 ; 0xb620 12be4: 20 e0 ldi r18, 0x00 ; 0 12be6: 30 e0 ldi r19, 0x00 ; 0 12be8: 4a e7 ldi r20, 0x7A ; 122 12bea: 54 e4 ldi r21, 0x44 ; 68 12bec: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 12bf0: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 12bf4: 6b 01 movw r12, r22 12bf6: 7c 01 movw r14, r24 if(codenum != 0) 12bf8: c1 14 cp r12, r1 12bfa: d1 04 cpc r13, r1 12bfc: e1 04 cpc r14, r1 12bfe: f1 04 cpc r15, r1 12c00: 41 f0 breq .+16 ; 0x12c12 { if(custom_message_type != CustomMsg::M117) 12c02: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 12c06: 87 30 cpi r24, 0x07 ; 7 12c08: 21 f0 breq .+8 ; 0x12c12 { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 12c0a: 89 ed ldi r24, 0xD9 ; 217 12c0c: 97 e6 ldi r25, 0x67 ; 103 12c0e: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe } } st_synchronize(); 12c12: 0f 94 5b 18 call 0x230b6 ; 0x230b6 codenum += _millis(); // keep track of when we started waiting 12c16: 0f 94 01 0b call 0x21602 ; 0x21602 12c1a: c6 0e add r12, r22 12c1c: d7 1e adc r13, r23 12c1e: e8 1e adc r14, r24 12c20: f9 1e adc r15, r25 previous_millis_cmd.start(); 12c22: 88 e4 ldi r24, 0x48 ; 72 12c24: 93 e0 ldi r25, 0x03 ; 3 12c26: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> while(_millis() < codenum) { 12c2a: 0f 94 01 0b call 0x21602 ; 0x21602 12c2e: 6c 15 cp r22, r12 12c30: 7d 05 cpc r23, r13 12c32: 8e 05 cpc r24, r14 12c34: 9f 05 cpc r25, r15 12c36: 08 f0 brcs .+2 ; 0x12c3a 12c38: ba cb rjmp .-2188 ; 0x123ae manage_heater(); 12c3a: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(); 12c3e: 80 e0 ldi r24, 0x00 ; 0 12c40: 0e 94 b0 8a call 0x11560 ; 0x11560 lcd_update(0); 12c44: 80 e0 ldi r24, 0x00 ; 0 12c46: 0e 94 54 6f call 0xdea8 ; 0xdea8 12c4a: ef cf rjmp .-34 ; 0x12c2a 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); 12c4c: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 12c4e: 0f 94 8a 90 call 0x32114 ; 0x32114 12c52: ad cb rjmp .-2214 ; 0x123ae 12c54: 80 e0 ldi r24, 0x00 ; 0 12c56: fb cf rjmp .-10 ; 0x12c4e { 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]); 12c58: 88 e5 ldi r24, 0x58 ; 88 12c5a: 0e 94 80 56 call 0xad00 ; 0xad00 12c5e: 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; 12c60: 41 2c mov r4, r1 12c62: 51 2c mov r5, r1 12c64: 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(); 12c66: 88 23 and r24, r24 12c68: 21 f0 breq .+8 ; 0x12c72 12c6a: 0e 94 e8 56 call 0xadd0 ; 0xadd0 12c6e: 2b 01 movw r4, r22 12c70: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 12c72: 89 e5 ldi r24, 0x59 ; 89 12c74: 0e 94 80 56 call 0xad00 ; 0xad00 12c78: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 12c7a: 88 23 and r24, r24 12c7c: 71 f1 breq .+92 ; 0x12cda 12c7e: 0e 94 e8 56 call 0xadd0 ; 0xadd0 12c82: 6c a7 std Y+44, r22 ; 0x2c 12c84: 7d a7 std Y+45, r23 ; 0x2d 12c86: 8e a7 std Y+46, r24 ; 0x2e 12c88: 9f a7 std Y+47, r25 ; 0x2f bool home_z = code_seen(axis_codes[Z_AXIS]); 12c8a: 8a e5 ldi r24, 0x5A ; 90 12c8c: 0e 94 80 56 call 0xad00 ; 0xad00 12c90: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 12c92: 81 2c mov r8, r1 12c94: 91 2c mov r9, r1 12c96: 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(); 12c98: 88 23 and r24, r24 12c9a: 21 f0 breq .+8 ; 0x12ca4 12c9c: 0e 94 e8 56 call 0xadd0 ; 0xadd0 12ca0: 4b 01 movw r8, r22 12ca2: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 12ca4: 87 e5 ldi r24, 0x57 ; 87 12ca6: 0e 94 80 56 call 0xad00 ; 0xad00 12caa: 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); 12cac: 8f 93 push r24 12cae: cd 2c mov r12, r13 12cb0: ec a4 ldd r14, Y+44 ; 0x2c 12cb2: fd a4 ldd r15, Y+45 ; 0x2d 12cb4: 0e a5 ldd r16, Y+46 ; 0x2e 12cb6: 1f a5 ldd r17, Y+47 ; 0x2f 12cb8: 22 2d mov r18, r2 12cba: b3 01 movw r22, r6 12cbc: a2 01 movw r20, r4 12cbe: 83 2d mov r24, r3 12cc0: 0e 94 85 6d call 0xdb0a ; 0xdb0a #endif //TMC2130 if ((home_x || home_y || without_mbl || home_z) == false) { 12cc4: 0f 90 pop r0 12cc6: 31 10 cpse r3, r1 12cc8: 72 cb rjmp .-2332 ; 0x123ae 12cca: 21 10 cpse r2, r1 12ccc: 70 cb rjmp .-2336 ; 0x123ae 12cce: 38 a5 ldd r19, Y+40 ; 0x28 12cd0: 31 11 cpse r19, r1 12cd2: 6d cb rjmp .-2342 ; 0x123ae 12cd4: d1 10 cpse r13, r1 12cd6: 6b cb rjmp .-2346 ; 0x123ae 12cd8: 20 cb rjmp .-2496 ; 0x1231a - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 12cda: 1c a6 std Y+44, r1 ; 0x2c 12cdc: 1d a6 std Y+45, r1 ; 0x2d 12cde: 1e a6 std Y+46, r1 ; 0x2e 12ce0: 1f a6 std Y+47, r1 ; 0x2f 12ce2: d3 cf rjmp .-90 ; 0x12c8a 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) 12ce4: 08 e2 ldi r16, 0x28 ; 40 12ce6: 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)); 12ce8: f4 eb ldi r31, 0xB4 ; 180 12cea: ef 2e mov r14, r31 12cec: f7 e6 ldi r31, 0x67 ; 103 12cee: ff 2e mov r15, r31 12cf0: 60 2f mov r22, r16 12cf2: 70 e0 ldi r23, 0x00 ; 0 12cf4: 90 e0 ldi r25, 0x00 ; 0 12cf6: 80 e0 ldi r24, 0x00 ; 0 12cf8: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 12cfc: 0e 94 11 57 call 0xae22 ; 0xae22 12d00: 9f 93 push r25 12d02: 8f 93 push r24 12d04: 7f 93 push r23 12d06: 6f 93 push r22 12d08: 1f 93 push r17 12d0a: 0f 93 push r16 12d0c: ff 92 push r15 12d0e: ef 92 push r14 12d10: 0f 94 00 a3 call 0x34600 ; 0x34600 12d14: 0f 5f subi r16, 0xFF ; 255 12d16: 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++) 12d18: 0f b6 in r0, 0x3f ; 63 12d1a: f8 94 cli 12d1c: de bf out 0x3e, r29 ; 62 12d1e: 0f be out 0x3f, r0 ; 63 12d20: cd bf out 0x3d, r28 ; 61 12d22: 0f 36 cpi r16, 0x6F ; 111 12d24: 11 05 cpc r17, r1 12d26: 21 f7 brne .-56 ; 0x12cf0 12d28: 42 cb rjmp .-2428 ; 0x123ae ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 12d2a: 0f 94 3b 10 call 0x22076 ; 0x22076 12d2e: 81 11 cpse r24, r1 12d30: 05 c0 rjmp .+10 ; 0x12d3c { SERIAL_ECHOLNPGM("No PINDA thermistor"); 12d32: 88 e6 ldi r24, 0x68 ; 104 12d34: 91 e8 ldi r25, 0x81 ; 129 12d36: 0e 94 18 7d call 0xfa30 ; 0xfa30 12d3a: 39 cb rjmp .-2446 ; 0x123ae break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 12d3c: 82 e0 ldi r24, 0x02 ; 2 12d3e: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c 12d42: 81 11 cpse r24, r1 12d44: 07 c0 rjmp .+14 ; 0x12d54 //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)); 12d46: 8b e2 ldi r24, 0x2B ; 43 12d48: 9a e3 ldi r25, 0x3A ; 58 12d4a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 12d4e: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 12d52: 2d cb rjmp .-2470 ; 0x123ae break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 12d54: 80 91 39 06 lds r24, 0x0639 ; 0x800639 12d58: 88 23 and r24, r24 12d5a: 41 f0 breq .+16 ; 0x12d6c 12d5c: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 12d60: 88 23 and r24, r24 12d62: 21 f0 breq .+8 ; 0x12d6c 12d64: d0 90 3b 06 lds r13, 0x063B ; 0x80063b 12d68: d1 10 cpse r13, r1 12d6a: 08 c0 rjmp .+16 ; 0x12d7c // 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; 12d6c: 81 e0 ldi r24, 0x01 ; 1 12d6e: 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); 12d72: 81 e7 ldi r24, 0x71 ; 113 12d74: 99 e6 ldi r25, 0x69 ; 105 12d76: 0f 94 e7 66 call 0x2cdce ; 0x2cdce 12d7a: 19 cb rjmp .-2510 ; 0x123ae break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 12d7c: 82 ee ldi r24, 0xE2 ; 226 12d7e: 99 e3 ldi r25, 0x39 ; 57 12d80: 0e 94 95 75 call 0xeb2a ; 0xeb2a 12d84: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 12d88: 86 e2 ldi r24, 0x26 ; 38 12d8a: 90 e4 ldi r25, 0x40 ; 64 12d8c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 12d90: 41 e0 ldi r20, 0x01 ; 1 12d92: 60 e0 ldi r22, 0x00 ; 0 12d94: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 if (result == LCD_LEFT_BUTTON_CHOICE) 12d98: 81 11 cpse r24, r1 12d9a: 6e c0 rjmp .+220 ; 0x12e78 { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12d9c: 80 e0 ldi r24, 0x00 ; 0 12d9e: 90 e0 ldi r25, 0x00 ; 0 12da0: a0 ea ldi r26, 0xA0 ; 160 12da2: b0 e4 ldi r27, 0x40 ; 64 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 a8 49 call 0x29350 ; 0x29350 current_position[Z_AXIS] = 50; 12dc0: 80 e0 ldi r24, 0x00 ; 0 12dc2: 90 e0 ldi r25, 0x00 ; 0 12dc4: a8 e4 ldi r26, 0x48 ; 72 12dc6: b2 e4 ldi r27, 0x42 ; 66 12dc8: 80 93 69 12 sts 0x1269, r24 ; 0x801269 12dcc: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 12dd0: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 12dd4: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c current_position[Y_AXIS] = 180; 12dd8: 80 e0 ldi r24, 0x00 ; 0 12dda: 90 e0 ldi r25, 0x00 ; 0 12ddc: a4 e3 ldi r26, 0x34 ; 52 12dde: b3 e4 ldi r27, 0x43 ; 67 12de0: 80 93 65 12 sts 0x1265, r24 ; 0x801265 12de4: 90 93 66 12 sts 0x1266, r25 ; 0x801266 12de8: a0 93 67 12 sts 0x1267, r26 ; 0x801267 12dec: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 12df0: 60 e0 ldi r22, 0x00 ; 0 12df2: 70 e0 ldi r23, 0x00 ; 0 12df4: 88 e4 ldi r24, 0x48 ; 72 12df6: 92 e4 ldi r25, 0x42 ; 66 12df8: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 12dfc: 0f 94 5b 18 call 0x230b6 ; 0x230b6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 12e00: 8c ef ldi r24, 0xFC ; 252 12e02: 9f e3 ldi r25, 0x3F ; 63 12e04: 0e 94 95 75 call 0xeb2a ; 0xeb2a 12e08: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 12e0c: e5 e0 ldi r30, 0x05 ; 5 12e0e: fd e9 ldi r31, 0x9D ; 157 12e10: 85 91 lpm r24, Z+ 12e12: 95 91 lpm r25, Z+ 12e14: a5 91 lpm r26, Z+ 12e16: b4 91 lpm r27, Z 12e18: 80 93 65 12 sts 0x1265, r24 ; 0x801265 12e1c: 90 93 66 12 sts 0x1266, r25 ; 0x801266 12e20: a0 93 67 12 sts 0x1267, r26 ; 0x801267 12e24: b0 93 68 12 sts 0x1268, r27 ; 0x801268 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 12e28: e1 e0 ldi r30, 0x01 ; 1 12e2a: fd e9 ldi r31, 0x9D ; 157 12e2c: 85 91 lpm r24, Z+ 12e2e: 95 91 lpm r25, Z+ 12e30: a5 91 lpm r26, Z+ 12e32: b4 91 lpm r27, Z 12e34: 80 93 61 12 sts 0x1261, r24 ; 0x801261 12e38: 90 93 62 12 sts 0x1262, r25 ; 0x801262 12e3c: a0 93 63 12 sts 0x1263, r26 ; 0x801263 12e40: b0 93 64 12 sts 0x1264, r27 ; 0x801264 plan_buffer_line_curposXYZE(3000 / 60); 12e44: 60 e0 ldi r22, 0x00 ; 0 12e46: 70 e0 ldi r23, 0x00 ; 0 12e48: 88 e4 ldi r24, 0x48 ; 72 12e4a: 92 e4 ldi r25, 0x42 ; 66 12e4c: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 12e50: 0f 94 5b 18 call 0x230b6 ; 0x230b6 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); 12e54: 81 e0 ldi r24, 0x01 ; 1 12e56: 8f 93 push r24 12e58: 81 2c mov r8, r1 12e5a: 91 2c mov r9, r1 12e5c: 54 01 movw r10, r8 12e5e: cc 24 eor r12, r12 12e60: c3 94 inc r12 12e62: e1 2c mov r14, r1 12e64: f1 2c mov r15, r1 12e66: 87 01 movw r16, r14 12e68: 20 e0 ldi r18, 0x00 ; 0 12e6a: 40 e0 ldi r20, 0x00 ; 0 12e6c: 50 e0 ldi r21, 0x00 ; 0 12e6e: ba 01 movw r22, r20 12e70: 80 e0 ldi r24, 0x00 ; 0 12e72: 0e 94 85 6d call 0xdb0a ; 0xdb0a 12e76: 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)) { 12e78: 20 e0 ldi r18, 0x00 ; 0 12e7a: 30 e0 ldi r19, 0x00 ; 0 12e7c: 4c e0 ldi r20, 0x0C ; 12 12e7e: 52 e4 ldi r21, 0x42 ; 66 12e80: 60 91 85 03 lds r22, 0x0385 ; 0x800385 12e84: 70 91 86 03 lds r23, 0x0386 ; 0x800386 12e88: 80 91 87 03 lds r24, 0x0387 ; 0x800387 12e8c: 90 91 88 03 lds r25, 0x0388 ; 0x800388 12e90: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 12e94: 18 16 cp r1, r24 12e96: 0c f0 brlt .+2 ; 0x12e9a 12e98: 76 c0 rjmp .+236 ; 0x12f86 12e9a: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 12e9e: 81 11 cpse r24, r1 12ea0: 72 c0 rjmp .+228 ; 0x12f86 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 12ea2: 80 e0 ldi r24, 0x00 ; 0 12ea4: 90 e0 ldi r25, 0x00 ; 0 12ea6: a8 ec ldi r26, 0xC8 ; 200 12ea8: b2 e4 ldi r27, 0x42 ; 66 12eaa: 80 93 69 12 sts 0x1269, r24 ; 0x801269 12eae: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 12eb2: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 12eb6: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 12eba: 60 e0 ldi r22, 0x00 ; 0 12ebc: 70 e0 ldi r23, 0x00 ; 0 12ebe: 88 e4 ldi r24, 0x48 ; 72 12ec0: 92 e4 ldi r25, 0x42 ; 66 12ec2: 0f 94 a8 49 call 0x29350 ; 0x29350 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 12ec6: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 LongTimer pinda_timeout; 12eca: 19 82 std Y+1, r1 ; 0x01 12ecc: 1a 82 std Y+2, r1 ; 0x02 12ece: 1b 82 std Y+3, r1 ; 0x03 12ed0: 1c 82 std Y+4, r1 ; 0x04 12ed2: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 12ed4: ce 01 movw r24, r28 12ed6: 01 96 adiw r24, 0x01 ; 1 12ed8: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::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); 12edc: e3 e2 ldi r30, 0x23 ; 35 12ede: fe 2e mov r15, r30 12ee0: 05 ee ldi r16, 0xE5 ; 229 12ee2: 1e e7 ldi r17, 0x7E ; 126 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 12ee4: 20 e0 ldi r18, 0x00 ; 0 12ee6: 30 e0 ldi r19, 0x00 ; 0 12ee8: 4c e0 ldi r20, 0x0C ; 12 12eea: 52 e4 ldi r21, 0x42 ; 66 12eec: 60 91 85 03 lds r22, 0x0385 ; 0x800385 12ef0: 70 91 86 03 lds r23, 0x0386 ; 0x800386 12ef4: 80 91 87 03 lds r24, 0x0387 ; 0x800387 12ef8: 90 91 88 03 lds r25, 0x0388 ; 0x800388 12efc: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 12f00: 18 16 cp r1, r24 12f02: c4 f5 brge .+112 ; 0x12f74 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 12f04: 84 e9 ldi r24, 0x94 ; 148 12f06: 99 e3 ldi r25, 0x39 ; 57 12f08: 0e 94 95 75 call 0xeb2a ; 0xeb2a 12f0c: 0e 94 94 de call 0x1bd28 ; 0x1bd28 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 12f10: 42 e8 ldi r20, 0x82 ; 130 12f12: 64 e0 ldi r22, 0x04 ; 4 12f14: 80 e0 ldi r24, 0x00 ; 0 12f16: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 12f1a: 1f 92 push r1 12f1c: ff 92 push r15 12f1e: 60 91 85 03 lds r22, 0x0385 ; 0x800385 12f22: 70 91 86 03 lds r23, 0x0386 ; 0x800386 12f26: 80 91 87 03 lds r24, 0x0387 ; 0x800387 12f2a: 90 91 88 03 lds r25, 0x0388 ; 0x800388 12f2e: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 12f32: 7f 93 push r23 12f34: 6f 93 push r22 12f36: 1f 93 push r17 12f38: 0f 93 push r16 12f3a: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_putc(LCD_STR_DEGREE[0]); 12f3e: 81 e8 ldi r24, 0x81 ; 129 12f40: 0e 94 7c 6f call 0xdef8 ; 0xdef8 delay_keep_alive(1000); 12f44: 88 ee ldi r24, 0xE8 ; 232 12f46: 93 e0 ldi r25, 0x03 ; 3 12f48: 0e 94 0a 8d call 0x11a14 ; 0x11a14 serialecho_temperatures(); 12f4c: 0e 94 2d 7b call 0xf65a ; 0xf65a if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 12f50: 40 e0 ldi r20, 0x00 ; 0 12f52: 53 e5 ldi r21, 0x53 ; 83 12f54: 67 e0 ldi r22, 0x07 ; 7 12f56: 70 e0 ldi r23, 0x00 ; 0 12f58: ce 01 movw r24, r28 12f5a: 01 96 adiw r24, 0x01 ; 1 12f5c: 0f 94 6b 0b call 0x216d6 ; 0x216d6 ::expired(unsigned long)> 12f60: 0f 90 pop r0 12f62: 0f 90 pop r0 12f64: 0f 90 pop r0 12f66: 0f 90 pop r0 12f68: 0f 90 pop r0 12f6a: 0f 90 pop r0 12f6c: 88 23 and r24, r24 12f6e: 09 f4 brne .+2 ; 0x12f72 12f70: b9 cf rjmp .-142 ; 0x12ee4 target_temp_reached = false; 12f72: d1 2c mov r13, r1 break; } } lcd_update_enable(true); 12f74: 81 e0 ldi r24, 0x01 ; 1 12f76: 0e 94 93 70 call 0xe126 ; 0xe126 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 12f7a: d1 10 cpse r13, r1 12f7c: 04 c0 rjmp .+8 ; 0x12f86 lcd_temp_cal_show_result(false); 12f7e: 80 e0 ldi r24, 0x00 ; 0 12f80: 0e 94 3d f9 call 0x1f27a ; 0x1f27a 12f84: 14 ca rjmp .-3032 ; 0x123ae break; } } st_synchronize(); 12f86: 0f 94 5b 18 call 0x230b6 ; 0x230b6 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 12f8a: 81 e0 ldi r24, 0x01 ; 1 12f8c: 80 93 71 12 sts 0x1271, r24 ; 0x801271 lcd_update_enable(true); 12f90: 0e 94 93 70 call 0xe126 ; 0xe126 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 12f94: 8a e4 ldi r24, 0x4A ; 74 12f96: 91 e8 ldi r25, 0x81 ; 129 12f98: 0e 94 18 7d call 0xfa30 ; 0xfa30 float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 12f9c: 80 90 85 03 lds r8, 0x0385 ; 0x800385 12fa0: 90 90 86 03 lds r9, 0x0386 ; 0x800386 12fa4: a0 90 87 03 lds r10, 0x0387 ; 0x800387 12fa8: b0 90 88 03 lds r11, 0x0388 ; 0x800388 12fac: 20 e0 ldi r18, 0x00 ; 0 12fae: 30 e0 ldi r19, 0x00 ; 0 12fb0: 40 ea ldi r20, 0xA0 ; 160 12fb2: 50 e4 ldi r21, 0x40 ; 64 12fb4: c5 01 movw r24, r10 12fb6: b4 01 movw r22, r8 12fb8: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 12fbc: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 12fc0: 25 e0 ldi r18, 0x05 ; 5 12fc2: 26 9f mul r18, r22 12fc4: a0 01 movw r20, r0 12fc6: 27 9f mul r18, r23 12fc8: 50 0d add r21, r0 12fca: 11 24 eor r1, r1 12fcc: ba 01 movw r22, r20 12fce: 55 0f add r21, r21 12fd0: 88 0b sbc r24, r24 12fd2: 99 0b sbc r25, r25 12fd4: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 12fd8: 1b 01 movw r2, r22 12fda: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 12fdc: 20 e0 ldi r18, 0x00 ; 0 12fde: 30 e0 ldi r19, 0x00 ; 0 12fe0: 4c e0 ldi r20, 0x0C ; 12 12fe2: 52 e4 ldi r21, 0x42 ; 66 12fe4: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 12fe8: 87 ff sbrs r24, 7 12fea: 06 c0 rjmp .+12 ; 0x12ff8 12fec: 21 2c mov r2, r1 12fee: 31 2c mov r3, r1 12ff0: 6c e0 ldi r22, 0x0C ; 12 12ff2: e6 2e mov r14, r22 12ff4: 72 e4 ldi r23, 0x42 ; 66 12ff6: f7 2e mov r15, r23 if (start_temp < current_temperature_pinda) start_temp += 5; 12ff8: 22 2d mov r18, r2 12ffa: 33 2d mov r19, r3 12ffc: 4e 2d mov r20, r14 12ffe: 5f 2d mov r21, r15 13000: c5 01 movw r24, r10 13002: b4 01 movw r22, r8 13004: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 13008: 18 16 cp r1, r24 1300a: 64 f4 brge .+24 ; 0x13024 1300c: 20 e0 ldi r18, 0x00 ; 0 1300e: 30 e0 ldi r19, 0x00 ; 0 13010: 40 ea ldi r20, 0xA0 ; 160 13012: 50 e4 ldi r21, 0x40 ; 64 13014: 62 2d mov r22, r2 13016: 73 2d mov r23, r3 13018: 8e 2d mov r24, r14 1301a: 9f 2d mov r25, r15 1301c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 13020: 1b 01 movw r2, r22 13022: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 13024: ff 92 push r15 13026: ef 92 push r14 13028: 3f 92 push r3 1302a: 2f 92 push r2 1302c: 8b e9 ldi r24, 0x9B ; 155 1302e: 97 e6 ldi r25, 0x67 ; 103 13030: 9f 93 push r25 13032: 8f 93 push r24 13034: 0f 94 00 a3 call 0x34600 ; 0x34600 setTargetBed(70 + (start_temp - 30)); 13038: 20 e0 ldi r18, 0x00 ; 0 1303a: 30 e0 ldi r19, 0x00 ; 0 1303c: 40 ef ldi r20, 0xF0 ; 240 1303e: 51 e4 ldi r21, 0x41 ; 65 13040: 62 2d mov r22, r2 13042: 73 2d mov r23, r3 13044: 8e 2d mov r24, r14 13046: 9f 2d mov r25, r15 13048: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1304c: 20 e0 ldi r18, 0x00 ; 0 1304e: 30 e0 ldi r19, 0x00 ; 0 13050: 4c e8 ldi r20, 0x8C ; 140 13052: 52 e4 ldi r21, 0x42 ; 66 13054: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 13058: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1305c: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 13060: 60 93 59 12 sts 0x1259, r22 ; 0x801259 custom_message_type = CustomMsg::TempCal; 13064: 84 e0 ldi r24, 0x04 ; 4 13066: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d custom_message_state = 1; 1306a: 81 e0 ldi r24, 0x01 ; 1 1306c: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 13070: 85 ed ldi r24, 0xD5 ; 213 13072: 95 e4 ldi r25, 0x45 ; 69 13074: 0e 94 95 75 call 0xeb2a ; 0xeb2a 13078: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1307c: 80 e0 ldi r24, 0x00 ; 0 1307e: 90 e0 ldi r25, 0x00 ; 0 13080: a0 ea ldi r26, 0xA0 ; 160 13082: b0 e4 ldi r27, 0x40 ; 64 13084: 80 93 69 12 sts 0x1269, r24 ; 0x801269 13088: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 1308c: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 13090: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 13094: 60 e0 ldi r22, 0x00 ; 0 13096: 70 e0 ldi r23, 0x00 ; 0 13098: 88 e4 ldi r24, 0x48 ; 72 1309a: 92 e4 ldi r25, 0x42 ; 66 1309c: 0f 94 a8 49 call 0x29350 ; 0x29350 current_position[X_AXIS] = PINDA_PREHEAT_X; 130a0: 80 e0 ldi r24, 0x00 ; 0 130a2: 90 e0 ldi r25, 0x00 ; 0 130a4: a0 ea ldi r26, 0xA0 ; 160 130a6: b1 e4 ldi r27, 0x41 ; 65 130a8: 80 93 61 12 sts 0x1261, r24 ; 0x801261 130ac: 90 93 62 12 sts 0x1262, r25 ; 0x801262 130b0: a0 93 63 12 sts 0x1263, r26 ; 0x801263 130b4: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 130b8: 80 e0 ldi r24, 0x00 ; 0 130ba: 90 e0 ldi r25, 0x00 ; 0 130bc: a0 e7 ldi r26, 0x70 ; 112 130be: b2 e4 ldi r27, 0x42 ; 66 130c0: 80 93 65 12 sts 0x1265, r24 ; 0x801265 130c4: 90 93 66 12 sts 0x1266, r25 ; 0x801266 130c8: a0 93 67 12 sts 0x1267, r26 ; 0x801267 130cc: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 130d0: 60 e0 ldi r22, 0x00 ; 0 130d2: 70 e0 ldi r23, 0x00 ; 0 130d4: 88 e4 ldi r24, 0x48 ; 72 130d6: 92 e4 ldi r25, 0x42 ; 66 130d8: 0f 94 a8 49 call 0x29350 ; 0x29350 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 130dc: 8a e9 ldi r24, 0x9A ; 154 130de: 99 e9 ldi r25, 0x99 ; 153 130e0: a9 e1 ldi r26, 0x19 ; 25 130e2: be e3 ldi r27, 0x3E ; 62 130e4: 80 93 69 12 sts 0x1269, r24 ; 0x801269 130e8: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 130ec: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 130f0: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 130f4: 60 e0 ldi r22, 0x00 ; 0 130f6: 70 e0 ldi r23, 0x00 ; 0 130f8: 88 e4 ldi r24, 0x48 ; 72 130fa: 92 e4 ldi r25, 0x42 ; 66 130fc: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 13100: 0f 94 5b 18 call 0x230b6 ; 0x230b6 13104: 0f 90 pop r0 13106: 0f 90 pop r0 13108: 0f 90 pop r0 1310a: 0f 90 pop r0 1310c: 0f 90 pop r0 1310e: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 13110: 20 91 85 03 lds r18, 0x0385 ; 0x800385 13114: 30 91 86 03 lds r19, 0x0386 ; 0x800386 13118: 40 91 87 03 lds r20, 0x0387 ; 0x800387 1311c: 50 91 88 03 lds r21, 0x0388 ; 0x800388 13120: 62 2d mov r22, r2 13122: 73 2d mov r23, r3 13124: 8e 2d mov r24, r14 13126: 9f 2d mov r25, r15 13128: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1312c: 18 16 cp r1, r24 1312e: 3c f4 brge .+14 ; 0x1313e { delay_keep_alive(1000); 13130: 88 ee ldi r24, 0xE8 ; 232 13132: 93 e0 ldi r25, 0x03 ; 3 13134: 0e 94 0a 8d call 0x11a14 ; 0x11a14 serialecho_temperatures(); 13138: 0e 94 2d 7b call 0xf65a ; 0xf65a 1313c: e9 cf rjmp .-46 ; 0x13110 1313e: 60 e0 ldi r22, 0x00 ; 0 13140: 86 ea ldi r24, 0xA6 ; 166 13142: 9f e0 ldi r25, 0x0F ; 15 13144: 0f 94 62 a4 call 0x348c4 ; 0x348c4 } 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; 13148: 80 e0 ldi r24, 0x00 ; 0 1314a: 90 e0 ldi r25, 0x00 ; 0 1314c: a0 ea ldi r26, 0xA0 ; 160 1314e: b0 e4 ldi r27, 0x40 ; 64 13150: 80 93 69 12 sts 0x1269, r24 ; 0x801269 13154: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 13158: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 1315c: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 13160: 60 e0 ldi r22, 0x00 ; 0 13162: 70 e0 ldi r23, 0x00 ; 0 13164: 88 e4 ldi r24, 0x48 ; 72 13166: 92 e4 ldi r25, 0x42 ; 66 13168: 0f 94 a8 49 call 0x29350 ; 0x29350 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1316c: e1 e0 ldi r30, 0x01 ; 1 1316e: fd e9 ldi r31, 0x9D ; 157 13170: 85 91 lpm r24, Z+ 13172: 95 91 lpm r25, Z+ 13174: a5 91 lpm r26, Z+ 13176: b4 91 lpm r27, Z 13178: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1317c: 90 93 62 12 sts 0x1262, r25 ; 0x801262 13180: a0 93 63 12 sts 0x1263, r26 ; 0x801263 13184: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 13188: e5 e0 ldi r30, 0x05 ; 5 1318a: fd e9 ldi r31, 0x9D ; 157 1318c: 85 91 lpm r24, Z+ 1318e: 95 91 lpm r25, Z+ 13190: a5 91 lpm r26, Z+ 13192: b4 91 lpm r27, Z 13194: 80 93 65 12 sts 0x1265, r24 ; 0x801265 13198: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1319c: a0 93 67 12 sts 0x1267, r26 ; 0x801267 131a0: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 131a4: 60 e0 ldi r22, 0x00 ; 0 131a6: 70 e0 ldi r23, 0x00 ; 0 131a8: 88 e4 ldi r24, 0x48 ; 72 131aa: 92 e4 ldi r25, 0x42 ; 66 131ac: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 131b0: 0f 94 5b 18 call 0x230b6 ; 0x230b6 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 131b4: 43 e0 ldi r20, 0x03 ; 3 131b6: 60 e0 ldi r22, 0x00 ; 0 131b8: 70 e0 ldi r23, 0x00 ; 0 131ba: 80 e8 ldi r24, 0x80 ; 128 131bc: 9f eb ldi r25, 0xBF ; 191 131be: 0f 94 4b 7c call 0x2f896 ; 0x2f896 if (find_z_result == false) { 131c2: 81 11 cpse r24, r1 131c4: 05 c0 rjmp .+10 ; 0x131d0 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); 131c6: 0e 94 3d f9 call 0x1f27a ; 0x1f27a homing_flag = false; 131ca: 10 92 71 12 sts 0x1271, r1 ; 0x801271 131ce: ef c8 rjmp .-3618 ; 0x123ae if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 131d0: 90 91 69 12 lds r25, 0x1269 ; 0x801269 131d4: 98 a7 std Y+40, r25 ; 0x28 131d6: a0 91 6a 12 lds r26, 0x126A ; 0x80126a 131da: ac a7 std Y+44, r26 ; 0x2c 131dc: b0 91 6b 12 lds r27, 0x126B ; 0x80126b 131e0: b8 ab std Y+48, r27 ; 0x30 131e2: e0 91 6c 12 lds r30, 0x126C ; 0x80126c 131e6: e8 af std Y+56, r30 ; 0x38 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 131e8: ef 93 push r30 131ea: bf 93 push r27 131ec: af 93 push r26 131ee: 9f 93 push r25 131f0: 8e e8 ldi r24, 0x8E ; 142 131f2: 97 e6 ldi r25, 0x67 ; 103 131f4: 9f 93 push r25 131f6: 8f 93 push r24 131f8: 0f 94 00 a3 call 0x34600 ; 0x34600 131fc: 0f 90 pop r0 131fe: 0f 90 pop r0 13200: 0f 90 pop r0 13202: 0f 90 pop r0 13204: 0f 90 pop r0 13206: 0f 90 pop r0 13208: 4e ea ldi r20, 0xAE ; 174 1320a: 84 2e mov r8, r20 1320c: 4f e0 ldi r20, 0x0F ; 15 1320e: 94 2e mov r9, r20 13210: 53 e2 ldi r21, 0x23 ; 35 13212: c5 2e mov r12, r21 13214: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 13216: 0f ef ldi r16, 0xFF ; 255 13218: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 1321a: b6 01 movw r22, r12 1321c: 0d 2c mov r0, r13 1321e: 00 0c add r0, r0 13220: 88 0b sbc r24, r24 13222: 99 0b sbc r25, r25 13224: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 13228: 2b 01 movw r4, r22 1322a: 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)); 1322c: df 92 push r13 1322e: cf 92 push r12 13230: c8 01 movw r24, r16 13232: 02 96 adiw r24, 0x02 ; 2 13234: 9f 93 push r25 13236: 8f 93 push r24 13238: 22 e5 ldi r18, 0x52 ; 82 1323a: 37 e6 ldi r19, 0x67 ; 103 1323c: 3f 93 push r19 1323e: 2f 93 push r18 13240: 0f 94 00 a3 call 0x34600 ; 0x34600 13244: 58 01 movw r10, r16 13246: 5f ef ldi r21, 0xFF ; 255 13248: a5 1a sub r10, r21 1324a: b5 0a sbc r11, r21 if (i >= 0) { 1324c: 0f 90 pop r0 1324e: 0f 90 pop r0 13250: 0f 90 pop r0 13252: 0f 90 pop r0 13254: 0f 90 pop r0 13256: 0f 90 pop r0 13258: 11 f4 brne .+4 ; 0x1325e 1325a: 0c 94 07 ba jmp 0x1740e ; 0x1740e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1325e: 70 e0 ldi r23, 0x00 ; 0 13260: 60 e0 ldi r22, 0x00 ; 0 13262: c4 01 movw r24, r8 13264: 0f 94 80 a4 call 0x34900 ; 0x34900 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 13268: a3 01 movw r20, r6 1326a: 92 01 movw r18, r4 1326c: 62 2d mov r22, r2 1326e: 73 2d mov r23, r3 13270: 8e 2d mov r24, r14 13272: 9f 2d mov r25, r15 13274: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 13278: 18 16 cp r1, r24 1327a: 44 f4 brge .+16 ; 0x1328c } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 1327c: 85 e0 ldi r24, 0x05 ; 5 1327e: a8 16 cp r10, r24 13280: b1 04 cpc r11, r1 13282: 11 f0 breq .+4 ; 0x13288 13284: 0c 94 13 ba jmp 0x17426 ; 0x17426 13288: 05 e0 ldi r16, 0x05 ; 5 1328a: 10 e0 ldi r17, 0x00 ; 0 1328c: 58 01 movw r10, r16 1328e: 97 e2 ldi r25, 0x27 ; 39 13290: a9 1a sub r10, r25 13292: 98 ef ldi r25, 0xF8 ; 248 13294: b9 0a sbc r11, r25 13296: aa 0c add r10, r10 13298: bb 1c adc r11, r11 1329a: 85 e0 ldi r24, 0x05 ; 5 1329c: 80 9f mul r24, r16 1329e: 10 01 movw r2, r0 132a0: 81 9f mul r24, r17 132a2: 30 0c add r3, r0 132a4: 11 24 eor r1, r1 132a6: 0d 5f subi r16, 0xFD ; 253 132a8: 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; 132aa: 2a e9 ldi r18, 0x9A ; 154 132ac: 42 2e mov r4, r18 132ae: 29 e9 ldi r18, 0x99 ; 153 132b0: 52 2e mov r5, r18 132b2: 29 e1 ldi r18, 0x19 ; 25 132b4: 62 2e mov r6, r18 132b6: 2e e3 ldi r18, 0x3E ; 62 132b8: 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); 132ba: 39 e1 ldi r19, 0x19 ; 25 132bc: 83 2e mov r8, r19 132be: 37 e6 ldi r19, 0x67 ; 103 132c0: 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++) 132c2: c8 01 movw r24, r16 132c4: 02 97 sbiw r24, 0x02 ; 2 132c6: 05 97 sbiw r24, 0x05 ; 5 132c8: 0c f0 brlt .+2 ; 0x132cc 132ca: d4 c0 rjmp .+424 ; 0x13474 { float temp = (40 + i * 5); 132cc: b1 01 movw r22, r2 132ce: 63 5d subi r22, 0xD3 ; 211 132d0: 7f 4f sbci r23, 0xFF ; 255 132d2: 07 2e mov r0, r23 132d4: 00 0c add r0, r0 132d6: 88 0b sbc r24, r24 132d8: 99 0b sbc r25, r25 132da: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 132de: 6b 01 movw r12, r22 132e0: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 132e2: 1f 93 push r17 132e4: 0f 93 push r16 132e6: a5 e4 ldi r26, 0x45 ; 69 132e8: b7 e6 ldi r27, 0x67 ; 103 132ea: bf 93 push r27 132ec: af 93 push r26 132ee: 0f 94 00 a3 call 0x34600 ; 0x34600 custom_message_state = i + 2; 132f2: 00 93 de 03 sts 0x03DE, r16 ; 0x8003de setTargetBed(50 + 10 * (temp - 30) / 5); 132f6: 20 e0 ldi r18, 0x00 ; 0 132f8: 30 e0 ldi r19, 0x00 ; 0 132fa: 40 ef ldi r20, 0xF0 ; 240 132fc: 51 e4 ldi r21, 0x41 ; 65 132fe: c7 01 movw r24, r14 13300: b6 01 movw r22, r12 13302: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 13306: 20 e0 ldi r18, 0x00 ; 0 13308: 30 e0 ldi r19, 0x00 ; 0 1330a: 40 e2 ldi r20, 0x20 ; 32 1330c: 51 e4 ldi r21, 0x41 ; 65 1330e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 13312: 20 e0 ldi r18, 0x00 ; 0 13314: 30 e0 ldi r19, 0x00 ; 0 13316: 40 ea ldi r20, 0xA0 ; 160 13318: 50 e4 ldi r21, 0x40 ; 64 1331a: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1331e: 20 e0 ldi r18, 0x00 ; 0 13320: 30 e0 ldi r19, 0x00 ; 0 13322: 48 e4 ldi r20, 0x48 ; 72 13324: 52 e4 ldi r21, 0x42 ; 66 13326: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1332a: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1332e: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 13332: 60 93 59 12 sts 0x1259, r22 ; 0x801259 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 13336: 80 e0 ldi r24, 0x00 ; 0 13338: 90 e0 ldi r25, 0x00 ; 0 1333a: a0 ea ldi r26, 0xA0 ; 160 1333c: b0 e4 ldi r27, 0x40 ; 64 1333e: 80 93 69 12 sts 0x1269, r24 ; 0x801269 13342: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 13346: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 1334a: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 1334e: 60 e0 ldi r22, 0x00 ; 0 13350: 70 e0 ldi r23, 0x00 ; 0 13352: 88 e4 ldi r24, 0x48 ; 72 13354: 92 e4 ldi r25, 0x42 ; 66 13356: 0f 94 a8 49 call 0x29350 ; 0x29350 current_position[X_AXIS] = PINDA_PREHEAT_X; 1335a: 20 e0 ldi r18, 0x00 ; 0 1335c: 30 e0 ldi r19, 0x00 ; 0 1335e: 40 ea ldi r20, 0xA0 ; 160 13360: 51 e4 ldi r21, 0x41 ; 65 13362: 20 93 61 12 sts 0x1261, r18 ; 0x801261 13366: 30 93 62 12 sts 0x1262, r19 ; 0x801262 1336a: 40 93 63 12 sts 0x1263, r20 ; 0x801263 1336e: 50 93 64 12 sts 0x1264, r21 ; 0x801264 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 13372: 80 e0 ldi r24, 0x00 ; 0 13374: 90 e0 ldi r25, 0x00 ; 0 13376: a0 e7 ldi r26, 0x70 ; 112 13378: b2 e4 ldi r27, 0x42 ; 66 1337a: 80 93 65 12 sts 0x1265, r24 ; 0x801265 1337e: 90 93 66 12 sts 0x1266, r25 ; 0x801266 13382: a0 93 67 12 sts 0x1267, r26 ; 0x801267 13386: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 1338a: 60 e0 ldi r22, 0x00 ; 0 1338c: 70 e0 ldi r23, 0x00 ; 0 1338e: 88 e4 ldi r24, 0x48 ; 72 13390: 92 e4 ldi r25, 0x42 ; 66 13392: 0f 94 a8 49 call 0x29350 ; 0x29350 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 13396: 40 92 69 12 sts 0x1269, r4 ; 0x801269 1339a: 50 92 6a 12 sts 0x126A, r5 ; 0x80126a 1339e: 60 92 6b 12 sts 0x126B, r6 ; 0x80126b 133a2: 70 92 6c 12 sts 0x126C, r7 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 133a6: 60 e0 ldi r22, 0x00 ; 0 133a8: 70 e0 ldi r23, 0x00 ; 0 133aa: 88 e4 ldi r24, 0x48 ; 72 133ac: 92 e4 ldi r25, 0x42 ; 66 133ae: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 133b2: 0f 94 5b 18 call 0x230b6 ; 0x230b6 133b6: 0f 90 pop r0 133b8: 0f 90 pop r0 133ba: 0f 90 pop r0 133bc: 0f 90 pop r0 while (current_temperature_pinda < temp) 133be: 20 91 85 03 lds r18, 0x0385 ; 0x800385 133c2: 30 91 86 03 lds r19, 0x0386 ; 0x800386 133c6: 40 91 87 03 lds r20, 0x0387 ; 0x800387 133ca: 50 91 88 03 lds r21, 0x0388 ; 0x800388 133ce: c7 01 movw r24, r14 133d0: b6 01 movw r22, r12 133d2: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 133d6: 18 16 cp r1, r24 133d8: 3c f4 brge .+14 ; 0x133e8 { delay_keep_alive(1000); 133da: 88 ee ldi r24, 0xE8 ; 232 133dc: 93 e0 ldi r25, 0x03 ; 3 133de: 0e 94 0a 8d call 0x11a14 ; 0x11a14 serialecho_temperatures(); 133e2: 0e 94 2d 7b call 0xf65a ; 0xf65a 133e6: eb cf rjmp .-42 ; 0x133be } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 133e8: 80 e0 ldi r24, 0x00 ; 0 133ea: 90 e0 ldi r25, 0x00 ; 0 133ec: a0 ea ldi r26, 0xA0 ; 160 133ee: b0 e4 ldi r27, 0x40 ; 64 133f0: 80 93 69 12 sts 0x1269, r24 ; 0x801269 133f4: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 133f8: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 133fc: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 13400: 60 e0 ldi r22, 0x00 ; 0 13402: 70 e0 ldi r23, 0x00 ; 0 13404: 88 e4 ldi r24, 0x48 ; 72 13406: 92 e4 ldi r25, 0x42 ; 66 13408: 0f 94 a8 49 call 0x29350 ; 0x29350 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1340c: e1 e0 ldi r30, 0x01 ; 1 1340e: fd e9 ldi r31, 0x9D ; 157 13410: 85 91 lpm r24, Z+ 13412: 95 91 lpm r25, Z+ 13414: a5 91 lpm r26, Z+ 13416: b4 91 lpm r27, Z 13418: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1341c: 90 93 62 12 sts 0x1262, r25 ; 0x801262 13420: a0 93 63 12 sts 0x1263, r26 ; 0x801263 13424: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 13428: e5 e0 ldi r30, 0x05 ; 5 1342a: fd e9 ldi r31, 0x9D ; 157 1342c: 85 91 lpm r24, Z+ 1342e: 95 91 lpm r25, Z+ 13430: a5 91 lpm r26, Z+ 13432: b4 91 lpm r27, Z 13434: 80 93 65 12 sts 0x1265, r24 ; 0x801265 13438: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1343c: a0 93 67 12 sts 0x1267, r26 ; 0x801267 13440: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 13444: 60 e0 ldi r22, 0x00 ; 0 13446: 70 e0 ldi r23, 0x00 ; 0 13448: 88 e4 ldi r24, 0x48 ; 72 1344a: 92 e4 ldi r25, 0x42 ; 66 1344c: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 13450: 0f 94 5b 18 call 0x230b6 ; 0x230b6 find_z_result = find_bed_induction_sensor_point_z(-1.f); 13454: 43 e0 ldi r20, 0x03 ; 3 13456: 60 e0 ldi r22, 0x00 ; 0 13458: 70 e0 ldi r23, 0x00 ; 0 1345a: 80 e8 ldi r24, 0x80 ; 128 1345c: 9f eb ldi r25, 0xBF ; 191 1345e: 0f 94 4b 7c call 0x2f896 ; 0x2f896 13462: 95 e0 ldi r25, 0x05 ; 5 13464: 29 0e add r2, r25 13466: 31 1c adc r3, r1 13468: 0f 5f subi r16, 0xFF ; 255 1346a: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 1346c: 81 11 cpse r24, r1 1346e: 04 c0 rjmp .+8 ; 0x13478 lcd_temp_cal_show_result(find_z_result); 13470: 0e 94 3d f9 call 0x1f27a ; 0x1f27a 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); 13474: 81 e0 ldi r24, 0x01 ; 1 13476: a7 ce rjmp .-690 ; 0x131c6 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]); 13478: 78 a5 ldd r23, Y+40 ; 0x28 1347a: 6c a5 ldd r22, Y+44 ; 0x2c 1347c: 98 a9 ldd r25, Y+48 ; 0x30 1347e: 88 ad ldd r24, Y+56 ; 0x38 13480: 27 2f mov r18, r23 13482: 36 2f mov r19, r22 13484: 49 2f mov r20, r25 13486: 58 2f mov r21, r24 13488: 60 91 69 12 lds r22, 0x1269 ; 0x801269 1348c: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 13490: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 13494: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 13498: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1349c: f6 2e mov r15, r22 1349e: e7 2e mov r14, r23 134a0: d8 2e mov r13, r24 134a2: c9 2e mov r12, r25 134a4: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 134a8: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 134ac: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 134b0: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 134b4: d7 01 movw r26, r14 134b6: f6 01 movw r30, r12 134b8: 6b 2f mov r22, r27 134ba: 7a 2f mov r23, r26 134bc: 8f 2f mov r24, r31 134be: 9e 2f mov r25, r30 134c0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 134c4: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 134c8: 6c ab std Y+52, r22 ; 0x34 134ca: 7d ab std Y+53, r23 ; 0x35 134cc: 8e ab std Y+54, r24 ; 0x36 134ce: 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); 134d0: cf 92 push r12 134d2: df 92 push r13 134d4: ef 92 push r14 134d6: ff 92 push r15 134d8: 80 91 88 03 lds r24, 0x0388 ; 0x800388 134dc: 8f 93 push r24 134de: 80 91 87 03 lds r24, 0x0387 ; 0x800387 134e2: 8f 93 push r24 134e4: 80 91 86 03 lds r24, 0x0386 ; 0x800386 134e8: 8f 93 push r24 134ea: 80 91 85 03 lds r24, 0x0385 ; 0x800385 134ee: 8f 93 push r24 134f0: 9f 92 push r9 134f2: 8f 92 push r8 134f4: 0f 94 00 a3 call 0x34600 ; 0x34600 134f8: 6c a9 ldd r22, Y+52 ; 0x34 134fa: 7d a9 ldd r23, Y+53 ; 0x35 134fc: c5 01 movw r24, r10 134fe: 0f 94 80 a4 call 0x34900 ; 0x34900 13502: a2 e0 ldi r26, 0x02 ; 2 13504: aa 0e add r10, r26 13506: b1 1c adc r11, r1 13508: 0f b6 in r0, 0x3f ; 63 1350a: f8 94 cli 1350c: de bf out 0x3e, r29 ; 62 1350e: 0f be out 0x3f, r0 ; 63 13510: cd bf out 0x3d, r28 ; 61 13512: d7 ce rjmp .-594 ; 0x132c2 /*! ### 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(); 13514: 0e 94 d6 83 call 0x107ac ; 0x107ac 13518: 0c 94 d7 91 jmp 0x123ae ; 0x123ae This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1351c: 80 e1 ldi r24, 0x10 ; 16 1351e: 0e 94 e4 d4 call 0x1a9c8 ; 0x1a9c8 13522: 0c 94 d7 91 jmp 0x123ae ; 0x123ae /*! ### 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); 13526: 80 91 57 12 lds r24, 0x1257 ; 0x801257 1352a: 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; 1352c: 80 93 57 12 sts 0x1257, r24 ; 0x801257 13530: 0c 94 d7 91 jmp 0x123ae ; 0x123ae 13534: b4 ec ldi r27, 0xC4 ; 196 13536: cb 2e mov r12, r27 13538: b2 e0 ldi r27, 0x02 ; 2 1353a: db 2e mov r13, r27 1353c: 8e 01 movw r16, r28 1353e: 0c 5d subi r16, 0xDC ; 220 13540: 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) 13542: 58 01 movw r10, r16 13544: ee 24 eor r14, r14 13546: e3 94 inc r14 13548: 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]); 1354a: d6 01 movw r26, r12 1354c: 8d 91 ld r24, X+ 1354e: 6d 01 movw r12, r26 13550: 0e 94 80 56 call 0xad00 ; 0xad00 13554: f5 01 movw r30, r10 13556: 81 93 st Z+, r24 13558: 5f 01 movw r10, r30 if(codes[i]) 1355a: 88 23 and r24, r24 1355c: 91 f0 breq .+36 ; 0x13582 values[i] = code_value(); 1355e: 0e 94 10 5b call 0xb620 ; 0xb620 13562: f7 01 movw r30, r14 13564: ee 0f add r30, r30 13566: ff 1f adc r31, r31 13568: ee 0f add r30, r30 1356a: ff 1f adc r31, r31 1356c: 34 97 sbiw r30, 0x04 ; 4 1356e: 21 e0 ldi r18, 0x01 ; 1 13570: 30 e0 ldi r19, 0x00 ; 0 13572: 2c 0f add r18, r28 13574: 3d 1f adc r19, r29 13576: e2 0f add r30, r18 13578: f3 1f adc r31, r19 1357a: 60 83 st Z, r22 1357c: 71 83 std Z+1, r23 ; 0x01 1357e: 82 83 std Z+2, r24 ; 0x02 13580: 93 83 std Z+3, r25 ; 0x03 13582: 3f ef ldi r19, 0xFF ; 255 13584: e3 1a sub r14, r19 13586: 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) 13588: 45 e0 ldi r20, 0x05 ; 5 1358a: e4 16 cp r14, r20 1358c: f1 04 cpc r15, r1 1358e: e9 f6 brne .-70 ; 0x1354a codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 13590: 9f a0 ldd r9, Y+39 ; 0x27 13592: fc a0 ldd r15, Y+36 ; 0x24 13594: 99 20 and r9, r9 13596: 01 f1 breq .+64 ; 0x135d8 13598: 20 e0 ldi r18, 0x00 ; 0 1359a: 30 e0 ldi r19, 0x00 ; 0 1359c: a9 01 movw r20, r18 1359e: 6d 85 ldd r22, Y+13 ; 0x0d 135a0: 7e 85 ldd r23, Y+14 ; 0x0e 135a2: 8f 85 ldd r24, Y+15 ; 0x0f 135a4: 98 89 ldd r25, Y+16 ; 0x10 135a6: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 135aa: 81 11 cpse r24, r1 135ac: 15 c0 rjmp .+42 ; 0x135d8 135ae: f1 10 cpse r15, r1 135b0: 13 c0 rjmp .+38 ; 0x135d8 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 135b2: 8d a1 ldd r24, Y+37 ; 0x25 135b4: 81 11 cpse r24, r1 135b6: 10 c0 rjmp .+32 ; 0x135d8 135b8: 8e a1 ldd r24, Y+38 ; 0x26 135ba: 81 11 cpse r24, r1 135bc: 0d c0 rjmp .+26 ; 0x135d8 { // 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; 135be: 10 92 6d 12 sts 0x126D, r1 ; 0x80126d 135c2: 10 92 6e 12 sts 0x126E, r1 ; 0x80126e 135c6: 10 92 6f 12 sts 0x126F, r1 ; 0x80126f 135ca: 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; 135ce: 81 e0 ldi r24, 0x01 ; 1 135d0: 80 93 21 04 sts 0x0421, r24 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.442> 135d4: 0c 94 d7 91 jmp 0x123ae ; 0x123ae plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 135d8: 0f 94 5b 18 call 0x230b6 ; 0x230b6 135dc: ce 01 movw r24, r28 135de: 01 96 adiw r24, 0x01 ; 1 135e0: 5c 01 movw r10, r24 135e2: 5f eb ldi r21, 0xBF ; 191 135e4: c5 2e mov r12, r21 135e6: 5d e0 ldi r21, 0x0D ; 13 135e8: d5 2e mov r13, r21 135ea: 61 e6 ldi r22, 0x61 ; 97 135ec: e6 2e mov r14, r22 135ee: 62 e1 ldi r22, 0x12 ; 18 135f0: f6 2e mov r15, r22 135f2: 38 01 movw r6, r16 135f4: 93 e0 ldi r25, 0x03 ; 3 135f6: 69 0e add r6, r25 135f8: 71 1c adc r7, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 135fa: d8 01 movw r26, r16 135fc: 8d 91 ld r24, X+ 135fe: 8d 01 movw r16, r26 13600: 88 23 and r24, r24 13602: 89 f0 breq .+34 ; 0x13626 current_position[i] = values[i] + cs.add_homing[i]; 13604: f6 01 movw r30, r12 13606: 20 81 ld r18, Z 13608: 31 81 ldd r19, Z+1 ; 0x01 1360a: 42 81 ldd r20, Z+2 ; 0x02 1360c: 53 81 ldd r21, Z+3 ; 0x03 1360e: d5 01 movw r26, r10 13610: 6d 91 ld r22, X+ 13612: 7d 91 ld r23, X+ 13614: 8d 91 ld r24, X+ 13616: 9c 91 ld r25, X 13618: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1361c: f7 01 movw r30, r14 1361e: 60 83 st Z, r22 13620: 71 83 std Z+1, r23 ; 0x01 13622: 82 83 std Z+2, r24 ; 0x02 13624: 93 83 std Z+3, r25 ; 0x03 13626: f4 e0 ldi r31, 0x04 ; 4 13628: af 0e add r10, r31 1362a: b1 1c adc r11, r1 1362c: 24 e0 ldi r18, 0x04 ; 4 1362e: c2 0e add r12, r18 13630: d1 1c adc r13, r1 13632: 34 e0 ldi r19, 0x04 ; 4 13634: e3 0e add r14, r19 13636: 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) 13638: 60 16 cp r6, r16 1363a: 71 06 cpc r7, r17 1363c: f1 f6 brne .-68 ; 0x135fa { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 1363e: 99 20 and r9, r9 13640: 61 f0 breq .+24 ; 0x1365a current_position[E_AXIS] = values[E_AXIS]; 13642: 8d 85 ldd r24, Y+13 ; 0x0d 13644: 9e 85 ldd r25, Y+14 ; 0x0e 13646: af 85 ldd r26, Y+15 ; 0x0f 13648: b8 89 ldd r27, Y+16 ; 0x10 1364a: 80 93 6d 12 sts 0x126D, r24 ; 0x80126d 1364e: 90 93 6e 12 sts 0x126E, r25 ; 0x80126e 13652: a0 93 6f 12 sts 0x126F, r26 ; 0x80126f 13656: b0 93 70 12 sts 0x1270, r27 ; 0x801270 // Set all at once plan_set_position_curposXYZE(); 1365a: 0f 94 68 48 call 0x290d0 ; 0x290d0 1365e: 0c 94 d7 91 jmp 0x123ae ; 0x123ae return true; } void farm_gcode_g98() { farm_mode = 1; 13662: 81 e0 ldi r24, 0x01 ; 1 13664: 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); 13668: 61 e0 ldi r22, 0x01 ; 1 1366a: 84 ec ldi r24, 0xC4 ; 196 1366c: 9f e0 ldi r25, 0x0F ; 15 1366e: 0f 94 62 a4 call 0x348c4 ; 0x348c4 eeprom_update_byte_notify((unsigned char *)EEPROM_FARM_MODE, farm_mode); SilentModeMenu = SILENT_MODE_OFF; 13672: 10 92 bb 03 sts 0x03BB, r1 ; 0x8003bb 13676: 60 e0 ldi r22, 0x00 ; 0 13678: 8f ef ldi r24, 0xFF ; 255 1367a: 9f e0 ldi r25, 0x0F ; 15 1367c: 0f 94 62 a4 call 0x348c4 ; 0x348c4 } void farm_gcode_g99() { farm_disable(); lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset 13680: 0e 94 49 d7 call 0x1ae92 ; 0x1ae92 13684: 0c 94 d7 91 jmp 0x123ae ; 0x123ae /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 13688: 8d 34 cpi r24, 0x4D ; 77 1368a: 11 f0 breq .+4 ; 0x13690 1368c: 0c 94 09 b9 jmp 0x17212 ; 0x17212 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 13690: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 13694: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb 13698: f8 01 movw r30, r16 1369a: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 1369c: 81 91 ld r24, Z+ 1369e: 80 32 cpi r24, 0x20 ; 32 136a0: e9 f3 breq .-6 ; 0x1369c 136a2: 89 30 cpi r24, 0x09 ; 9 136a4: d9 f3 breq .-10 ; 0x1369c /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 136a6: 80 53 subi r24, 0x30 ; 48 136a8: 8a 30 cpi r24, 0x0A ; 10 136aa: 30 f0 brcs .+12 ; 0x136b8 printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 136ac: 1f 93 push r17 136ae: 0f 93 push r16 136b0: 86 e3 ldi r24, 0x36 ; 54 136b2: 91 e8 ldi r25, 0x81 ; 129 136b4: 0c 94 8f 8e jmp 0x11d1e ; 0x11d1e } else { mcode_in_progress = code_value_short(); 136b8: 0e 94 a2 56 call 0xad44 ; 0xad44 136bc: 90 93 41 0d sts 0x0D41, r25 ; 0x800d41 <_ZL17mcode_in_progress.lto_priv.487+0x1> 136c0: 80 93 40 0d sts 0x0D40, r24 ; 0x800d40 <_ZL17mcode_in_progress.lto_priv.487> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 136c4: 8e 3b cpi r24, 0xBE ; 190 136c6: 91 05 cpc r25, r1 136c8: 11 f4 brne .+4 ; 0x136ce 136ca: 0c 94 1c a6 jmp 0x14c38 ; 0x14c38 136ce: 0c f0 brlt .+2 ; 0x136d2 136d0: 07 c3 rjmp .+1550 ; 0x13ce0 136d2: 8c 34 cpi r24, 0x4C ; 76 136d4: 91 05 cpc r25, r1 136d6: 11 f4 brne .+4 ; 0x136dc 136d8: 0c 94 35 a5 jmp 0x14a6a ; 0x14a6a 136dc: 0c f0 brlt .+2 ; 0x136e0 136de: de c1 rjmp .+956 ; 0x13a9c 136e0: 8c 31 cpi r24, 0x1C ; 28 136e2: 91 05 cpc r25, r1 136e4: 11 f4 brne .+4 ; 0x136ea 136e6: 0c 94 6c a3 jmp 0x146d8 ; 0x146d8 136ea: 0c f0 brlt .+2 ; 0x136ee 136ec: f4 c0 rjmp .+488 ; 0x138d6 136ee: 85 31 cpi r24, 0x15 ; 21 136f0: 91 05 cpc r25, r1 136f2: 09 f4 brne .+2 ; 0x136f6 136f4: 0a c7 rjmp .+3604 ; 0x1450a 136f6: 0c f0 brlt .+2 ; 0x136fa 136f8: 5a c0 rjmp .+180 ; 0x137ae 136fa: 81 31 cpi r24, 0x11 ; 17 136fc: 91 05 cpc r25, r1 136fe: 09 f4 brne .+2 ; 0x13702 13700: f9 c6 rjmp .+3570 ; 0x144f4 13702: dc f4 brge .+54 ; 0x1373a 13704: 02 97 sbiw r24, 0x02 ; 2 13706: 08 f4 brcc .+2 ; 0x1370a 13708: 5d c6 rjmp .+3258 ; 0x143c4 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 1370a: 80 91 38 12 lds r24, 0x1238 ; 0x801238 1370e: 90 91 39 12 lds r25, 0x1239 ; 0x801239 13712: 82 5b subi r24, 0xB2 ; 178 13714: 9f 4e sbci r25, 0xEF ; 239 13716: 9f 93 push r25 13718: 8f 93 push r24 1371a: 1f 92 push r1 1371c: 8d e4 ldi r24, 0x4D ; 77 1371e: 8f 93 push r24 13720: 84 e0 ldi r24, 0x04 ; 4 13722: 97 e6 ldi r25, 0x67 ; 103 13724: 9f 93 push r25 13726: 8f 93 push r24 13728: 0f 94 00 a3 call 0x34600 ; 0x34600 1372c: 0f 90 pop r0 1372e: 0f 90 pop r0 13730: 0f 90 pop r0 13732: 0f 90 pop r0 13734: 0f 90 pop r0 13736: 0f 90 pop r0 13738: a8 c6 rjmp .+3408 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1373a: 82 31 cpi r24, 0x12 ; 18 1373c: 91 05 cpc r25, r1 1373e: 11 f4 brne .+4 ; 0x13744 13740: 0c 94 c7 a6 jmp 0x14d8e ; 0x14d8e 13744: 44 97 sbiw r24, 0x14 ; 20 13746: 09 f7 brne .-62 ; 0x1370a #### 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() 13748: 81 e0 ldi r24, 0x01 ; 1 1374a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 1374e: 84 ef ldi r24, 0xF4 ; 244 13750: 96 e6 ldi r25, 0x66 ; 102 13752: 0e 94 18 7d call 0xfa30 ; 0xfa30 card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 13756: 84 e5 ldi r24, 0x54 ; 84 13758: 0e 94 80 56 call 0xad00 ; 0xad00 1375c: 18 2f mov r17, r24 1375e: 8c e4 ldi r24, 0x4C ; 76 13760: 0e 94 80 56 call 0xad00 ; 0xad00 13764: 00 e0 ldi r16, 0x00 ; 0 13766: 80 fb bst r24, 0 13768: 00 f9 bld r16, 0 1376a: 10 fb bst r17, 0 1376c: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 1376e: 8d e5 ldi r24, 0x5D ; 93 13770: 94 e1 ldi r25, 0x14 ; 20 13772: 0e 94 01 7a call 0xf402 ; 0xf402 lsDive("",root, NULL, LS_SerialPrint, params); 13776: 83 e2 ldi r24, 0x23 ; 35 13778: ed e5 ldi r30, 0x5D ; 93 1377a: f4 e1 ldi r31, 0x14 ; 20 1377c: de 01 movw r26, r28 1377e: 11 96 adiw r26, 0x01 ; 1 13780: 01 90 ld r0, Z+ 13782: 0d 92 st X+, r0 13784: 8a 95 dec r24 13786: e1 f7 brne .-8 ; 0x13780 13788: 20 e0 ldi r18, 0x00 ; 0 1378a: 50 e0 ldi r21, 0x00 ; 0 1378c: 40 e0 ldi r20, 0x00 ; 0 1378e: be 01 movw r22, r28 13790: 6f 5f subi r22, 0xFF ; 255 13792: 7f 4f sbci r23, 0xFF ; 255 13794: 8f ed ldi r24, 0xDF ; 223 13796: 92 e0 ldi r25, 0x02 ; 2 13798: 0f 94 f9 68 call 0x2d1f2 ; 0x2d1f2 1379c: ce 01 movw r24, r28 1379e: 01 96 adiw r24, 0x01 ; 1 137a0: 0e 94 06 7a call 0xf40c ; 0xf40c SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 137a4: 86 ee ldi r24, 0xE6 ; 230 137a6: 96 e6 ldi r25, 0x66 ; 102 137a8: 0e 94 18 7d call 0xfa30 ; 0xfa30 137ac: 6e c6 rjmp .+3292 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 137ae: 88 31 cpi r24, 0x18 ; 24 137b0: 91 05 cpc r25, r1 137b2: 09 f4 brne .+2 ; 0x137b6 137b4: bb c6 rjmp .+3446 ; 0x1452c 137b6: 84 f4 brge .+32 ; 0x137d8 137b8: 86 31 cpi r24, 0x16 ; 22 137ba: 91 05 cpc r25, r1 137bc: 09 f4 brne .+2 ; 0x137c0 137be: a9 c6 rjmp .+3410 ; 0x14512 137c0: 47 97 sbiw r24, 0x17 ; 23 137c2: 09 f0 breq .+2 ; 0x137c6 137c4: a2 cf rjmp .-188 ; 0x1370a M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 137c6: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 137ca: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 137ce: 61 e0 ldi r22, 0x01 ; 1 137d0: 04 96 adiw r24, 0x04 ; 4 137d2: 0f 94 4e 71 call 0x2e29c ; 0x2e29c 137d6: 59 c6 rjmp .+3250 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 137d8: 8a 31 cpi r24, 0x1A ; 26 137da: 91 05 cpc r25, r1 137dc: 09 f4 brne .+2 ; 0x137e0 137de: ec c6 rjmp .+3544 ; 0x145b8 137e0: 0c f0 brlt .+2 ; 0x137e4 137e2: 0c c7 rjmp .+3608 ; 0x145fc 137e4: 04 ec ldi r16, 0xC4 ; 196 137e6: 12 e0 ldi r17, 0x02 ; 2 137e8: f2 e4 ldi r31, 0x42 ; 66 137ea: af 2e mov r10, r31 137ec: f2 e0 ldi r31, 0x02 ; 2 137ee: bf 2e mov r11, r31 137f0: a4 e2 ldi r26, 0x24 ; 36 137f2: ca 2e mov r12, r26 137f4: a2 e0 ldi r26, 0x02 ; 2 137f6: da 2e mov r13, r26 137f8: b8 e1 ldi r27, 0x18 ; 24 137fa: eb 2e mov r14, r27 137fc: b2 e0 ldi r27, 0x02 ; 2 137fe: fb 2e mov r15, r27 13800: 87 ec ldi r24, 0xC7 ; 199 13802: 88 2e mov r8, r24 13804: 82 e0 ldi r24, 0x02 ; 2 13806: 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])) { 13808: f8 01 movw r30, r16 1380a: 81 91 ld r24, Z+ 1380c: 8f 01 movw r16, r30 1380e: 0e 94 80 56 call 0xad00 ; 0xad00 13812: 88 23 and r24, r24 13814: 21 f1 breq .+72 ; 0x1385e //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 13816: 0e 94 10 5b call 0xb620 ; 0xb620 1381a: d6 01 movw r26, r12 1381c: 4d 90 ld r4, X+ 1381e: 5d 90 ld r5, X+ 13820: 6d 90 ld r6, X+ 13822: 7c 90 ld r7, X 13824: a3 01 movw r20, r6 13826: 92 01 movw r18, r4 13828: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1382c: 87 fd sbrc r24, 7 1382e: 11 c0 rjmp .+34 ; 0x13852 13830: 0e 94 10 5b call 0xb620 ; 0xb620 13834: f7 01 movw r30, r14 13836: 40 80 ld r4, Z 13838: 51 80 ldd r5, Z+1 ; 0x01 1383a: 62 80 ldd r6, Z+2 ; 0x02 1383c: 73 80 ldd r7, Z+3 ; 0x03 1383e: a3 01 movw r20, r6 13840: 92 01 movw r18, r4 13842: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 13846: 18 16 cp r1, r24 13848: 24 f0 brlt .+8 ; 0x13852 1384a: 0e 94 10 5b call 0xb620 ; 0xb620 1384e: 2b 01 movw r4, r22 13850: 3c 01 movw r6, r24 13852: d5 01 movw r26, r10 13854: 4d 92 st X+, r4 13856: 5d 92 st X+, r5 13858: 6d 92 st X+, r6 1385a: 7c 92 st X, r7 1385c: 13 97 sbiw r26, 0x03 ; 3 1385e: b4 e0 ldi r27, 0x04 ; 4 13860: ab 0e add r10, r27 13862: b1 1c adc r11, r1 13864: e4 e0 ldi r30, 0x04 ; 4 13866: ce 0e add r12, r30 13868: d1 1c adc r13, r1 1386a: f4 e0 ldi r31, 0x04 ; 4 1386c: ef 0e add r14, r31 1386e: 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++) { 13870: 80 16 cp r8, r16 13872: 91 06 cpc r9, r17 13874: 49 f6 brne .-110 ; 0x13808 //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')) { 13876: 83 e5 ldi r24, 0x53 ; 83 13878: 0e 94 80 56 call 0xad00 ; 0xad00 1387c: 88 23 and r24, r24 1387e: 11 f4 brne .+4 ; 0x13884 13880: 0c 94 e4 b2 jmp 0x165c8 ; 0x165c8 if ( code_value_uint8() == 0 ) { 13884: 0e 94 95 56 call 0xad2a ; 0xad2a 13888: 81 11 cpse r24, r1 1388a: ff c5 rjmp .+3070 ; 0x1448a pause_position[X_AXIS] = X_PAUSE_POS; 1388c: 80 e0 ldi r24, 0x00 ; 0 1388e: 90 e0 ldi r25, 0x00 ; 0 13890: a8 e4 ldi r26, 0x48 ; 72 13892: b2 e4 ldi r27, 0x42 ; 66 13894: 80 93 42 02 sts 0x0242, r24 ; 0x800242 <_ZL14pause_position.lto_priv.489> 13898: 90 93 43 02 sts 0x0243, r25 ; 0x800243 <_ZL14pause_position.lto_priv.489+0x1> 1389c: a0 93 44 02 sts 0x0244, r26 ; 0x800244 <_ZL14pause_position.lto_priv.489+0x2> 138a0: b0 93 45 02 sts 0x0245, r27 ; 0x800245 <_ZL14pause_position.lto_priv.489+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 138a4: 80 e0 ldi r24, 0x00 ; 0 138a6: 90 e0 ldi r25, 0x00 ; 0 138a8: ae e3 ldi r26, 0x3E ; 62 138aa: b3 e4 ldi r27, 0x43 ; 67 138ac: 80 93 46 02 sts 0x0246, r24 ; 0x800246 <_ZL14pause_position.lto_priv.489+0x4> 138b0: 90 93 47 02 sts 0x0247, r25 ; 0x800247 <_ZL14pause_position.lto_priv.489+0x5> 138b4: a0 93 48 02 sts 0x0248, r26 ; 0x800248 <_ZL14pause_position.lto_priv.489+0x6> 138b8: b0 93 49 02 sts 0x0249, r27 ; 0x800249 <_ZL14pause_position.lto_priv.489+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 138bc: 80 e0 ldi r24, 0x00 ; 0 138be: 90 e0 ldi r25, 0x00 ; 0 138c0: a0 ea ldi r26, 0xA0 ; 160 138c2: b1 e4 ldi r27, 0x41 ; 65 138c4: 80 93 4a 02 sts 0x024A, r24 ; 0x80024a <_ZL14pause_position.lto_priv.489+0x8> 138c8: 90 93 4b 02 sts 0x024B, r25 ; 0x80024b <_ZL14pause_position.lto_priv.489+0x9> 138cc: a0 93 4c 02 sts 0x024C, r26 ; 0x80024c <_ZL14pause_position.lto_priv.489+0xa> 138d0: b0 93 4d 02 sts 0x024D, r27 ; 0x80024d <_ZL14pause_position.lto_priv.489+0xb> 138d4: da c5 rjmp .+2996 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 138d6: 8c 32 cpi r24, 0x2C ; 44 138d8: 91 05 cpc r25, r1 138da: 09 f4 brne .+2 ; 0x138de 138dc: ce c7 rjmp .+3996 ; 0x1487a 138de: 0c f0 brlt .+2 ; 0x138e2 138e0: 8f c0 rjmp .+286 ; 0x13a00 138e2: 8f 31 cpi r24, 0x1F ; 31 138e4: 91 05 cpc r25, r1 138e6: 09 f4 brne .+2 ; 0x138ea 138e8: 9e c7 rjmp .+3900 ; 0x14826 138ea: 0c f0 brlt .+2 ; 0x138ee 138ec: 52 c0 rjmp .+164 ; 0x13992 138ee: 8d 31 cpi r24, 0x1D ; 29 138f0: 91 05 cpc r25, r1 138f2: 09 f4 brne .+2 ; 0x138f6 138f4: ca c5 rjmp .+2964 ; 0x1448a 138f6: 4e 97 sbiw r24, 0x1e ; 30 138f8: 09 f0 breq .+2 ; 0x138fc 138fa: 07 cf rjmp .-498 ; 0x1370a M30 [filename] */ case 30: if (card.mounted){ 138fc: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 13900: 88 23 and r24, r24 13902: 09 f4 brne .+2 ; 0x13906 13904: c2 c5 rjmp .+2948 ; 0x1448a card.closefile(); 13906: 0f 94 6f 65 call 0x2cade ; 0x2cade card.removeFile(strchr_pointer + 4); 1390a: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 1390e: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 13912: 0c 5f subi r16, 0xFC ; 252 13914: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 13916: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1391a: 88 23 and r24, r24 1391c: 09 f4 brne .+2 ; 0x13920 1391e: b5 c5 rjmp .+2922 ; 0x1448a file.close(); 13920: 87 e6 ldi r24, 0x67 ; 103 13922: 96 e1 ldi r25, 0x16 ; 22 13924: 0f 94 10 2c call 0x25820 ; 0x25820 sdprinting = false; 13928: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 const char *fname=name; 1392c: 1d a3 std Y+37, r17 ; 0x25 1392e: 0c a3 std Y+36, r16 ; 0x24 if (!diveSubfolder(fname)) 13930: ce 01 movw r24, r28 13932: 84 96 adiw r24, 0x24 ; 36 13934: 0f 94 c9 70 call 0x2e192 ; 0x2e192 13938: 88 23 and r24, r24 1393a: 09 f4 brne .+2 ; 0x1393e 1393c: a6 c5 rjmp .+2892 ; 0x1448a return; if (file.remove(curDir, fname)) 1393e: 4c a1 ldd r20, Y+36 ; 0x24 13940: 5d a1 ldd r21, Y+37 ; 0x25 13942: 60 91 80 14 lds r22, 0x1480 ; 0x801480 13946: 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) {} 1394a: 19 82 std Y+1, r1 ; 0x01 1394c: 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; 1394e: 22 e0 ldi r18, 0x02 ; 2 13950: ce 01 movw r24, r28 13952: 01 96 adiw r24, 0x01 ; 1 13954: 0f 94 3b 54 call 0x2a876 ; 0x2a876 13958: 81 11 cpse r24, r1 1395a: c6 c6 rjmp .+3468 ; 0x146e8 return file.remove(); fail: // can't set iostate - static function return false; 1395c: 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; 1395e: ce 01 movw r24, r28 13960: 01 96 adiw r24, 0x01 ; 1 13962: 0e 94 06 7a call 0xf40c ; 0xf40c 13966: 11 23 and r17, r17 13968: 09 f4 brne .+2 ; 0x1396c 1396a: d5 c6 rjmp .+3498 ; 0x14716 { SERIAL_PROTOCOLPGM("File deleted:"); 1396c: 8b ea ldi r24, 0xAB ; 171 1396e: 9e e7 ldi r25, 0x7E ; 126 13970: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOLLN(fname); 13974: 8c a1 ldd r24, Y+36 ; 0x24 13976: 9d a1 ldd r25, Y+37 ; 0x25 13978: 0e 94 1d 86 call 0x10c3a ; 0x10c3a sdpos = 0; 1397c: 10 92 eb 16 sts 0x16EB, r1 ; 0x8016eb 13980: 10 92 ec 16 sts 0x16EC, r1 ; 0x8016ec 13984: 10 92 ed 16 sts 0x16ED, r1 ; 0x8016ed 13988: 10 92 ee 16 sts 0x16EE, r1 ; 0x8016ee #ifdef SDCARD_SORT_ALPHA presort(); 1398c: 0f 94 8d 6e call 0x2dd1a ; 0x2dd1a 13990: 7c c5 rjmp .+2808 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13992: 80 32 cpi r24, 0x20 ; 32 13994: 91 05 cpc r25, r1 13996: 09 f4 brne .+2 ; 0x1399a 13998: cc c6 rjmp .+3480 ; 0x14732 1399a: 8a 97 sbiw r24, 0x2a ; 42 1399c: 09 f0 breq .+2 ; 0x139a0 1399e: b5 ce rjmp .-662 ; 0x1370a #### 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')) 139a0: 83 e5 ldi r24, 0x53 ; 83 139a2: 0e 94 80 56 call 0xad00 ; 0xad00 139a6: 88 23 and r24, r24 139a8: 09 f4 brne .+2 ; 0x139ac 139aa: 6f c5 rjmp .+2782 ; 0x1448a { uint8_t pin_status = code_value_uint8(); 139ac: 0e 94 95 56 call 0xad2a ; 0xad2a 139b0: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 139b2: 80 e5 ldi r24, 0x50 ; 80 139b4: 0e 94 80 56 call 0xad00 ; 0xad00 */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 139b8: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 139ba: 88 23 and r24, r24 139bc: 19 f0 breq .+6 ; 0x139c4 pin_number = code_value_uint8(); 139be: 0e 94 95 56 call 0xad2a ; 0xad2a 139c2: 18 2f mov r17, r24 139c4: eb e0 ldi r30, 0x0B ; 11 139c6: f1 e8 ldi r31, 0x81 ; 129 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) 139c8: 84 91 lpm r24, Z 139ca: 81 17 cp r24, r17 139cc: 09 f4 brne .+2 ; 0x139d0 139ce: 5d c5 rjmp .+2746 ; 0x1448a 139d0: 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++) 139d2: 31 e8 ldi r19, 0x81 ; 129 139d4: e7 32 cpi r30, 0x27 ; 39 139d6: f3 07 cpc r31, r19 139d8: b9 f7 brne .-18 ; 0x139c8 pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 139da: 16 30 cpi r17, 0x06 ; 6 139dc: 09 f0 breq .+2 ; 0x139e0 139de: 4a c7 rjmp .+3732 ; 0x14874 fanSpeed = pin_status; 139e0: 00 93 55 12 sts 0x1255, r16 ; 0x801255 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 139e4: 61 e0 ldi r22, 0x01 ; 1 139e6: 81 2f mov r24, r17 139e8: 0e 94 28 d1 call 0x1a250 ; 0x1a250 digitalWrite(pin_number, pin_status); 139ec: 60 2f mov r22, r16 139ee: 81 2f mov r24, r17 139f0: 0e 94 fa d0 call 0x1a1f4 ; 0x1a1f4 analogWrite(pin_number, pin_status); 139f4: 60 2f mov r22, r16 139f6: 70 e0 ldi r23, 0x00 ; 0 139f8: 81 2f mov r24, r17 139fa: 0e 94 59 d1 call 0x1a2b2 ; 0x1a2b2 139fe: 45 c5 rjmp .+2698 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13a00: 8f 32 cpi r24, 0x2F ; 47 13a02: 91 05 cpc r25, r1 13a04: 09 f4 brne .+2 ; 0x13a08 13a06: 62 c7 rjmp .+3780 ; 0x148cc 13a08: 5c f5 brge .+86 ; 0x13a60 13a0a: 8d 32 cpi r24, 0x2D ; 45 13a0c: 91 05 cpc r25, r1 13a0e: 09 f4 brne .+2 ; 0x13a12 13a10: 4d c7 rjmp .+3738 ; 0x148ac 13a12: 8e 97 sbiw r24, 0x2e ; 46 13a14: 09 f0 breq .+2 ; 0x13a18 13a16: 79 ce rjmp .-782 ; 0x1370a ### 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()) { 13a18: 80 91 48 16 lds r24, 0x1648 ; 0x801648 13a1c: 88 23 and r24, r24 13a1e: 09 f4 brne .+2 ; 0x13a22 13a20: 50 c7 rjmp .+3744 ; 0x148c2 uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 13a22: ce 01 movw r24, r28 13a24: 01 96 adiw r24, 0x01 ; 1 13a26: 0f 94 d2 77 call 0x2efa4 ; 0x2efa4 13a2a: 88 23 and r24, r24 13a2c: 09 f4 brne .+2 ; 0x13a30 13a2e: 44 c7 rjmp .+3720 ; 0x148b8 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 13a30: 89 81 ldd r24, Y+1 ; 0x01 13a32: 0e 94 0c 7a call 0xf418 ; 0xf418 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 13a36: 8e e2 ldi r24, 0x2E ; 46 13a38: 0e 94 0c 7a call 0xf418 ; 0xf418 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 13a3c: 8a 81 ldd r24, Y+2 ; 0x02 13a3e: 0e 94 0c 7a call 0xf418 ; 0xf418 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 13a42: 8e e2 ldi r24, 0x2E ; 46 13a44: 0e 94 0c 7a call 0xf418 ; 0xf418 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 13a48: 8b 81 ldd r24, Y+3 ; 0x03 13a4a: 0e 94 0c 7a call 0xf418 ; 0xf418 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 13a4e: 8e e2 ldi r24, 0x2E ; 46 13a50: 0e 94 0c 7a call 0xf418 ; 0xf418 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 13a54: 8c 81 ldd r24, Y+4 ; 0x04 13a56: 0e 94 0c 7a call 0xf418 ; 0xf418 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 13a5a: 0e 94 17 7b call 0xf62e ; 0xf62e 13a5e: 15 c5 rjmp .+2602 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13a60: 89 34 cpi r24, 0x49 ; 73 13a62: 91 05 cpc r25, r1 13a64: 09 f4 brne .+2 ; 0x13a68 13a66: 5b c7 rjmp .+3766 ; 0x1491e 13a68: 8b 34 cpi r24, 0x4B ; 75 13a6a: 91 05 cpc r25, r1 13a6c: 11 f4 brne .+4 ; 0x13a72 13a6e: 0c 94 2f a5 jmp 0x14a5e ; 0x14a5e 13a72: 88 34 cpi r24, 0x48 ; 72 13a74: 91 05 cpc r25, r1 13a76: 09 f0 breq .+2 ; 0x13a7a 13a78: 48 ce rjmp .-880 ; 0x1370a #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 13a7a: 83 e5 ldi r24, 0x53 ; 83 13a7c: 0e 94 80 56 call 0xad00 ; 0xad00 13a80: 88 23 and r24, r24 13a82: 09 f4 brne .+2 ; 0x13a86 13a84: 3d c7 rjmp .+3706 ; 0x14900 switch (code_value_uint8()){ 13a86: 0e 94 95 56 call 0xad2a ; 0xad2a 13a8a: 88 23 and r24, r24 13a8c: 09 f4 brne .+2 ; 0x13a90 13a8e: 35 c7 rjmp .+3690 ; 0x148fa 13a90: 81 30 cpi r24, 0x01 ; 1 13a92: 09 f0 breq .+2 ; 0x13a96 13a94: fa c4 rjmp .+2548 ; 0x1448a 13a96: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.385> 13a9a: f7 c4 rjmp .+2542 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13a9c: 8b 36 cpi r24, 0x6B ; 107 13a9e: 91 05 cpc r25, r1 13aa0: 11 f4 brne .+4 ; 0x13aa6 13aa2: 0c 94 be a6 jmp 0x14d7c ; 0x14d7c 13aa6: 0c f0 brlt .+2 ; 0x13aaa 13aa8: 83 c0 rjmp .+262 ; 0x13bb0 13aaa: 84 35 cpi r24, 0x54 ; 84 13aac: 91 05 cpc r25, r1 13aae: 11 f4 brne .+4 ; 0x13ab4 13ab0: 0c 94 c7 a6 jmp 0x14d8e ; 0x14d8e 13ab4: bc f5 brge .+110 ; 0x13b24 13ab6: 8f 34 cpi r24, 0x4F ; 79 13ab8: 91 05 cpc r25, r1 13aba: 09 f4 brne .+2 ; 0x13abe 13abc: ee c7 rjmp .+4060 ; 0x14a9a 13abe: 1c f5 brge .+70 ; 0x13b06 13ac0: 8d 34 cpi r24, 0x4D ; 77 13ac2: 91 05 cpc r25, r1 13ac4: 09 f4 brne .+2 ; 0x13ac8 13ac6: e4 c7 rjmp .+4040 ; 0x14a90 13ac8: 8e 34 cpi r24, 0x4E ; 78 13aca: 91 05 cpc r25, r1 13acc: 09 f0 breq .+2 ; 0x13ad0 13ace: 1d ce rjmp .-966 ; 0x1370a ### M78 - Show statistical information about the print jobs M78: Show statistical information about the print jobs */ case 78: { // @todo useful for maintenance notifications SERIAL_ECHOPGM("STATS "); 13ad0: 80 ee ldi r24, 0xE0 ; 224 13ad2: 90 e8 ldi r25, 0x80 ; 128 13ad4: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME)); 13ad8: 8d ee ldi r24, 0xED ; 237 13ada: 9f e0 ldi r25, 0x0F ; 15 13adc: 0f 94 46 a4 call 0x3488c ; 0x3488c } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 13ae0: 4a e0 ldi r20, 0x0A ; 10 13ae2: 0e 94 20 7a call 0xf440 ; 0xf440 SERIAL_ECHOPGM(" min "); 13ae6: 8a ed ldi r24, 0xDA ; 218 13ae8: 90 e8 ldi r25, 0x80 ; 128 13aea: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED)); 13aee: 81 ef ldi r24, 0xF1 ; 241 13af0: 9f e0 ldi r25, 0x0F ; 15 13af2: 0f 94 46 a4 call 0x3488c ; 0x3488c 13af6: 4a e0 ldi r20, 0x0A ; 10 13af8: 0e 94 20 7a call 0xf440 ; 0xf440 SERIAL_ECHOLNPGM(" cm."); 13afc: 85 ed ldi r24, 0xD5 ; 213 13afe: 90 e8 ldi r25, 0x80 ; 128 13b00: 0e 94 18 7d call 0xfa30 ; 0xfa30 13b04: c2 c4 rjmp .+2436 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13b06: 82 35 cpi r24, 0x52 ; 82 13b08: 91 05 cpc r25, r1 13b0a: 11 f4 brne .+4 ; 0x13b10 13b0c: 0c 94 c1 a6 jmp 0x14d82 ; 0x14d82 13b10: 83 35 cpi r24, 0x53 ; 83 13b12: 91 05 cpc r25, r1 13b14: 09 f0 breq .+2 ; 0x13b18 13b16: f9 cd rjmp .-1038 ; 0x1370a /*! ### 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; 13b18: 80 91 57 12 lds r24, 0x1257 ; 0x801257 13b1c: 88 60 ori r24, 0x08 ; 8 13b1e: 80 93 57 12 sts 0x1257, r24 ; 0x801257 13b22: b3 c4 rjmp .+2406 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13b24: 8c 35 cpi r24, 0x5C ; 92 13b26: 91 05 cpc r25, r1 13b28: 11 f4 brne .+4 ; 0x13b2e 13b2a: 0c 94 30 a7 jmp 0x14e60 ; 0x14e60 13b2e: 34 f5 brge .+76 ; 0x13b7c 13b30: 85 35 cpi r24, 0x55 ; 85 13b32: 91 05 cpc r25, r1 13b34: 11 f4 brne .+4 ; 0x13b3a 13b36: 0c 94 17 a7 jmp 0x14e2e ; 0x14e2e 13b3a: 86 35 cpi r24, 0x56 ; 86 13b3c: 91 05 cpc r25, r1 13b3e: 09 f0 breq .+2 ; 0x13b42 13b40: e4 cd rjmp .-1080 ; 0x1370a #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 13b42: 83 e5 ldi r24, 0x53 ; 83 13b44: 0e 94 80 56 call 0xad00 ; 0xad00 13b48: 88 23 and r24, r24 13b4a: 09 f4 brne .+2 ; 0x13b4e 13b4c: 9e c4 rjmp .+2364 ; 0x1448a safetytimer_inactive_time = code_value() * 1000; 13b4e: 0e 94 10 5b call 0xb620 ; 0xb620 13b52: 20 e0 ldi r18, 0x00 ; 0 13b54: 30 e0 ldi r19, 0x00 ; 0 13b56: 4a e7 ldi r20, 0x7A ; 122 13b58: 54 e4 ldi r21, 0x44 ; 68 13b5a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 13b5e: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 13b62: 60 93 33 02 sts 0x0233, r22 ; 0x800233 13b66: 70 93 34 02 sts 0x0234, r23 ; 0x800234 13b6a: 80 93 35 02 sts 0x0235, r24 ; 0x800235 13b6e: 90 93 36 02 sts 0x0236, r25 ; 0x800236 safetyTimer.start(); 13b72: 8d ea ldi r24, 0xAD ; 173 13b74: 95 e0 ldi r25, 0x05 ; 5 13b76: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> 13b7a: 87 c4 rjmp .+2318 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13b7c: 89 36 cpi r24, 0x69 ; 105 13b7e: 91 05 cpc r25, r1 13b80: 09 f4 brne .+2 ; 0x13b84 13b82: de c7 rjmp .+4028 ; 0x14b40 13b84: 14 f0 brlt .+4 ; 0x13b8a 13b86: 0c 94 b0 a6 jmp 0x14d60 ; 0x14d60 13b8a: 88 36 cpi r24, 0x68 ; 104 13b8c: 91 05 cpc r25, r1 13b8e: 09 f0 breq .+2 ; 0x13b92 13b90: bc cd rjmp .-1160 ; 0x1370a #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 13b92: 83 e5 ldi r24, 0x53 ; 83 13b94: 0e 94 80 56 call 0xad00 ; 0xad00 13b98: 88 23 and r24, r24 13b9a: 09 f4 brne .+2 ; 0x13b9e 13b9c: 76 c4 rjmp .+2284 ; 0x1448a { setTargetHotend(code_value()); 13b9e: 0e 94 10 5b call 0xb620 ; 0xb620 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 13ba2: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 13ba6: 70 93 5e 12 sts 0x125E, r23 ; 0x80125e 13baa: 60 93 5d 12 sts 0x125D, r22 ; 0x80125d 13bae: 6d c4 rjmp .+2266 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13bb0: 85 37 cpi r24, 0x75 ; 117 13bb2: 91 05 cpc r25, r1 13bb4: 11 f4 brne .+4 ; 0x13bba 13bb6: 0c 94 b0 a8 jmp 0x15160 ; 0x15160 13bba: b4 f5 brge .+108 ; 0x13c28 13bbc: 80 37 cpi r24, 0x70 ; 112 13bbe: 91 05 cpc r25, r1 13bc0: 09 f4 brne .+2 ; 0x13bc4 13bc2: ab c7 rjmp .+3926 ; 0x14b1a 13bc4: cc f4 brge .+50 ; 0x13bf8 13bc6: 8d 36 cpi r24, 0x6D ; 109 13bc8: 91 05 cpc r25, r1 13bca: 09 f4 brne .+2 ; 0x13bce 13bcc: e5 c7 rjmp .+4042 ; 0x14b98 13bce: 8e 36 cpi r24, 0x6E ; 110 13bd0: 91 05 cpc r25, r1 13bd2: 09 f0 breq .+2 ; 0x13bd6 13bd4: 9a cd rjmp .-1228 ; 0x1370a #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 13bd6: 8e e4 ldi r24, 0x4E ; 78 13bd8: 0e 94 80 56 call 0xad00 ; 0xad00 13bdc: 88 23 and r24, r24 13bde: 09 f4 brne .+2 ; 0x13be2 13be0: 54 c4 rjmp .+2216 ; 0x1448a gcode_LastN = code_value_long(); 13be2: 0e 94 e8 56 call 0xadd0 ; 0xadd0 13be6: 60 93 3e 12 sts 0x123E, r22 ; 0x80123e 13bea: 70 93 3f 12 sts 0x123F, r23 ; 0x80123f 13bee: 80 93 40 12 sts 0x1240, r24 ; 0x801240 13bf2: 90 93 41 12 sts 0x1241, r25 ; 0x801241 13bf6: 49 c4 rjmp .+2194 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13bf8: 82 37 cpi r24, 0x72 ; 114 13bfa: 91 05 cpc r25, r1 13bfc: 11 f4 brne .+4 ; 0x13c02 13bfe: 0c 94 ad a8 jmp 0x1515a ; 0x1515a 13c02: 14 f4 brge .+4 ; 0x13c08 13c04: 0c 94 ba a7 jmp 0x14f74 ; 0x14f74 13c08: 83 37 cpi r24, 0x73 ; 115 13c0a: 91 05 cpc r25, r1 13c0c: 09 f0 breq .+2 ; 0x13c10 13c0e: 7d cd rjmp .-1286 ; 0x1370a #### 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')) { 13c10: 86 e5 ldi r24, 0x56 ; 86 13c12: 0e 94 80 56 call 0xad00 ; 0xad00 13c16: 88 23 and r24, r24 13c18: 11 f4 brne .+4 ; 0x13c1e 13c1a: 0c 94 d9 a7 jmp 0x14fb2 ; 0x14fb2 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 13c1e: 8f ee ldi r24, 0xEF ; 239 13c20: 99 e8 ldi r25, 0x89 ; 137 13c22: 0e 94 18 7d call 0xfa30 ; 0xfa30 13c26: 31 c4 rjmp .+2146 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13c28: 8b 37 cpi r24, 0x7B ; 123 13c2a: 91 05 cpc r25, r1 13c2c: 11 f4 brne .+4 ; 0x13c32 13c2e: 0c 94 08 a9 jmp 0x15210 ; 0x15210 13c32: 0c f0 brlt .+2 ; 0x13c36 13c34: 48 c0 rjmp .+144 ; 0x13cc6 13c36: 86 37 cpi r24, 0x76 ; 118 13c38: 91 05 cpc r25, r1 13c3a: 11 f4 brne .+4 ; 0x13c40 13c3c: 0c 94 c0 a8 jmp 0x15180 ; 0x15180 13c40: 87 37 cpi r24, 0x77 ; 119 13c42: 91 05 cpc r25, r1 13c44: 09 f0 breq .+2 ; 0x13c48 13c46: 61 cd rjmp .-1342 ; 0x1370a /*! ### 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 13c48: 80 e2 ldi r24, 0x20 ; 32 13c4a: 96 e6 ldi r25, 0x66 ; 102 13c4c: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOLLN(); 13c50: 0e 94 17 7b call 0xf62e ; 0xf62e #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 13c54: 88 e1 ldi r24, 0x18 ; 24 13c56: 96 e6 ldi r25, 0x66 ; 102 13c58: 0e 94 1f 7b call 0xf63e ; 0xf63e if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 13c5c: 1e 9b sbis 0x03, 6 ; 3 13c5e: 02 c0 rjmp .+4 ; 0x13c64 13c60: 0c 94 f8 a8 jmp 0x151f0 ; 0x151f0 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13c64: 83 e1 ldi r24, 0x13 ; 19 13c66: 96 e6 ldi r25, 0x66 ; 102 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); 13c68: 0e 94 1f 7b call 0xf63e ; 0xf63e }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13c6c: 0e 94 17 7b call 0xf62e ; 0xf62e 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 13c70: 81 e0 ldi r24, 0x01 ; 1 13c72: 96 e6 ldi r25, 0x66 ; 102 13c74: 0e 94 1f 7b call 0xf63e ; 0xf63e if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 13c78: 1d 9b sbis 0x03, 5 ; 3 13c7a: 02 c0 rjmp .+4 ; 0x13c80 13c7c: 0c 94 fc a8 jmp 0x151f8 ; 0x151f8 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13c80: 83 e1 ldi r24, 0x13 ; 19 13c82: 96 e6 ldi r25, 0x66 ; 102 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); 13c84: 0e 94 1f 7b call 0xf63e ; 0xf63e }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13c88: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 13c8c: 89 ef ldi r24, 0xF9 ; 249 13c8e: 95 e6 ldi r25, 0x65 ; 101 13c90: 0e 94 1f 7b call 0xf63e ; 0xf63e if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 13c94: 1c 9b sbis 0x03, 4 ; 3 13c96: 02 c0 rjmp .+4 ; 0x13c9c 13c98: 0c 94 00 a9 jmp 0x15200 ; 0x15200 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13c9c: 83 e1 ldi r24, 0x13 ; 19 13c9e: 96 e6 ldi r25, 0x66 ; 102 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); 13ca0: 0e 94 1f 7b call 0xf63e ; 0xf63e }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13ca4: 0e 94 17 7b call 0xf62e ; 0xf62e #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 13ca8: 81 ef ldi r24, 0xF1 ; 241 13caa: 95 e6 ldi r25, 0x65 ; 101 13cac: 0e 94 1f 7b call 0xf63e ; 0xf63e if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 13cb0: 01 99 sbic 0x00, 1 ; 0 13cb2: 02 c0 rjmp .+4 ; 0x13cb8 13cb4: 0c 94 04 a9 jmp 0x15208 ; 0x15208 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13cb8: 83 e1 ldi r24, 0x13 ; 19 13cba: 96 e6 ldi r25, 0x66 ; 102 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); 13cbc: 0e 94 1f 7b call 0xf63e ; 0xf63e }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13cc0: 0e 94 17 7b call 0xf62e ; 0xf62e 13cc4: e2 c3 rjmp .+1988 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13cc6: 8c 38 cpi r24, 0x8C ; 140 13cc8: 91 05 cpc r25, r1 13cca: 09 f4 brne .+2 ; 0x13cce 13ccc: 2a c7 rjmp .+3668 ; 0x14b22 13cce: 8b 39 cpi r24, 0x9B ; 155 13cd0: 91 05 cpc r25, r1 13cd2: 09 f4 brne .+2 ; 0x13cd6 13cd4: 41 c7 rjmp .+3714 ; 0x14b58 13cd6: 8d 37 cpi r24, 0x7D ; 125 13cd8: 91 05 cpc r25, r1 13cda: 09 f0 breq .+2 ; 0x13cde 13cdc: 16 cd rjmp .-1492 ; 0x1370a 13cde: 82 cd rjmp .-1276 ; 0x137e4 13ce0: 84 3a cpi r24, 0xA4 ; 164 13ce2: 41 e0 ldi r20, 0x01 ; 1 13ce4: 94 07 cpc r25, r20 13ce6: 11 f4 brne .+4 ; 0x13cec 13ce8: 0c 94 27 ac jmp 0x1584e ; 0x1584e 13cec: 0c f0 brlt .+2 ; 0x13cf0 13cee: 38 c2 rjmp .+1136 ; 0x14160 13cf0: 82 3e cpi r24, 0xE2 ; 226 13cf2: 91 05 cpc r25, r1 13cf4: 11 f4 brne .+4 ; 0x13cfa 13cf6: 0c 94 b1 aa jmp 0x15562 ; 0x15562 13cfa: 0c f0 brlt .+2 ; 0x13cfe 13cfc: 6b c1 rjmp .+726 ; 0x13fd4 13cfe: 8e 3c cpi r24, 0xCE ; 206 13d00: 91 05 cpc r25, r1 13d02: 11 f4 brne .+4 ; 0x13d08 13d04: 0c 94 c4 a9 jmp 0x15388 ; 0x15388 13d08: 0c f0 brlt .+2 ; 0x13d0c 13d0a: b1 c0 rjmp .+354 ; 0x13e6e 13d0c: 8b 3c cpi r24, 0xCB ; 203 13d0e: 91 05 cpc r25, r1 13d10: 11 f4 brne .+4 ; 0x13d16 13d12: 0c 94 4e a9 jmp 0x1529c ; 0x1529c 13d16: 5c f5 brge .+86 ; 0x13d6e 13d18: 88 3c cpi r24, 0xC8 ; 200 13d1a: 91 05 cpc r25, r1 13d1c: 11 f4 brne .+4 ; 0x13d22 13d1e: 0c 94 0b a9 jmp 0x15216 ; 0x15216 13d22: 89 3c cpi r24, 0xC9 ; 201 13d24: 91 05 cpc r25, r1 13d26: 09 f0 breq .+2 ; 0x13d2a 13d28: f0 cc rjmp .-1568 ; 0x1370a 13d2a: 04 ec ldi r16, 0xC4 ; 196 13d2c: 12 e0 ldi r17, 0x02 ; 2 13d2e: b7 e6 ldi r27, 0x67 ; 103 13d30: eb 2e mov r14, r27 13d32: bd e0 ldi r27, 0x0D ; 13 13d34: fb 2e mov r15, r27 13d36: 88 ec ldi r24, 0xC8 ; 200 13d38: c8 2e mov r12, r24 13d3a: 82 e0 ldi r24, 0x02 ; 2 13d3c: 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])) 13d3e: d8 01 movw r26, r16 13d40: 8d 91 ld r24, X+ 13d42: 8d 01 movw r16, r26 13d44: 0e 94 80 56 call 0xad00 ; 0xad00 13d48: 88 23 and r24, r24 13d4a: 49 f0 breq .+18 ; 0x13d5e { unsigned long val = code_value(); 13d4c: 0e 94 10 5b call 0xb620 ; 0xb620 13d50: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 13d54: f7 01 movw r30, r14 13d56: 64 a3 std Z+36, r22 ; 0x24 13d58: 75 a3 std Z+37, r23 ; 0x25 13d5a: 86 a3 std Z+38, r24 ; 0x26 13d5c: 97 a3 std Z+39, r25 ; 0x27 13d5e: f4 e0 ldi r31, 0x04 ; 4 13d60: ef 0e add r14, r31 13d62: 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++) 13d64: c0 16 cp r12, r16 13d66: d1 06 cpc r13, r17 13d68: 51 f7 brne .-44 ; 0x13d3e 13d6a: 0c 94 af a7 jmp 0x14f5e ; 0x14f5e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13d6e: 8c 3c cpi r24, 0xCC ; 204 13d70: 91 05 cpc r25, r1 13d72: 11 f4 brne .+4 ; 0x13d78 13d74: 0c 94 6d a9 jmp 0x152da ; 0x152da 13d78: 8d 3c cpi r24, 0xCD ; 205 13d7a: 91 05 cpc r25, r1 13d7c: 09 f0 breq .+2 ; 0x13d80 13d7e: c5 cc rjmp .-1654 ; 0x1370a - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 13d80: 83 e5 ldi r24, 0x53 ; 83 13d82: 0e 94 80 56 call 0xad00 ; 0xad00 13d86: 88 23 and r24, r24 13d88: 51 f0 breq .+20 ; 0x13d9e 13d8a: 0e 94 10 5b call 0xb620 ; 0xb620 13d8e: 60 93 a3 0d sts 0x0DA3, r22 ; 0x800da3 13d92: 70 93 a4 0d sts 0x0DA4, r23 ; 0x800da4 13d96: 80 93 a5 0d sts 0x0DA5, r24 ; 0x800da5 13d9a: 90 93 a6 0d sts 0x0DA6, r25 ; 0x800da6 if(code_seen('T')) cs.mintravelfeedrate = code_value(); 13d9e: 84 e5 ldi r24, 0x54 ; 84 13da0: 0e 94 80 56 call 0xad00 ; 0xad00 13da4: 88 23 and r24, r24 13da6: 51 f0 breq .+20 ; 0x13dbc 13da8: 0e 94 10 5b call 0xb620 ; 0xb620 13dac: 60 93 a7 0d sts 0x0DA7, r22 ; 0x800da7 13db0: 70 93 a8 0d sts 0x0DA8, r23 ; 0x800da8 13db4: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 13db8: 90 93 aa 0d sts 0x0DAA, r25 ; 0x800daa if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 13dbc: 82 e4 ldi r24, 0x42 ; 66 13dbe: 0e 94 80 56 call 0xad00 ; 0xad00 13dc2: 88 23 and r24, r24 13dc4: 61 f0 breq .+24 ; 0x13dde 13dc6: 0e 94 10 5b call 0xb620 ; 0xb620 13dca: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 13dce: 60 93 ab 0d sts 0x0DAB, r22 ; 0x800dab 13dd2: 70 93 ac 0d sts 0x0DAC, r23 ; 0x800dac 13dd6: 80 93 ad 0d sts 0x0DAD, r24 ; 0x800dad 13dda: 90 93 ae 0d sts 0x0DAE, r25 ; 0x800dae if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 13dde: 88 e5 ldi r24, 0x58 ; 88 13de0: 0e 94 80 56 call 0xad00 ; 0xad00 13de4: 88 23 and r24, r24 13de6: 91 f0 breq .+36 ; 0x13e0c 13de8: 0e 94 10 5b call 0xb620 ; 0xb620 13dec: 60 93 b3 0d sts 0x0DB3, r22 ; 0x800db3 13df0: 70 93 b4 0d sts 0x0DB4, r23 ; 0x800db4 13df4: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 13df8: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 13dfc: 60 93 af 0d sts 0x0DAF, r22 ; 0x800daf 13e00: 70 93 b0 0d sts 0x0DB0, r23 ; 0x800db0 13e04: 80 93 b1 0d sts 0x0DB1, r24 ; 0x800db1 13e08: 90 93 b2 0d sts 0x0DB2, r25 ; 0x800db2 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 13e0c: 89 e5 ldi r24, 0x59 ; 89 13e0e: 0e 94 80 56 call 0xad00 ; 0xad00 13e12: 88 23 and r24, r24 13e14: 51 f0 breq .+20 ; 0x13e2a 13e16: 0e 94 10 5b call 0xb620 ; 0xb620 13e1a: 60 93 b3 0d sts 0x0DB3, r22 ; 0x800db3 13e1e: 70 93 b4 0d sts 0x0DB4, r23 ; 0x800db4 13e22: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 13e26: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 13e2a: 8a e5 ldi r24, 0x5A ; 90 13e2c: 0e 94 80 56 call 0xad00 ; 0xad00 13e30: 88 23 and r24, r24 13e32: 51 f0 breq .+20 ; 0x13e48 13e34: 0e 94 10 5b call 0xb620 ; 0xb620 13e38: 60 93 b7 0d sts 0x0DB7, r22 ; 0x800db7 13e3c: 70 93 b8 0d sts 0x0DB8, r23 ; 0x800db8 13e40: 80 93 b9 0d sts 0x0DB9, r24 ; 0x800db9 13e44: 90 93 ba 0d sts 0x0DBA, r25 ; 0x800dba if(code_seen('E')) 13e48: 85 e4 ldi r24, 0x45 ; 69 13e4a: 0e 94 80 56 call 0xad00 ; 0xad00 13e4e: 88 23 and r24, r24 13e50: 09 f4 brne .+2 ; 0x13e54 13e52: 1b c3 rjmp .+1590 ; 0x1448a { float e = code_value(); 13e54: 0e 94 10 5b call 0xb620 ; 0xb620 #ifndef LA_NOCOMPAT e = la10c_jerk(e); 13e58: 0e 94 22 84 call 0x10844 ; 0x10844 #endif cs.max_jerk[E_AXIS] = e; 13e5c: 60 93 bb 0d sts 0x0DBB, r22 ; 0x800dbb 13e60: 70 93 bc 0d sts 0x0DBC, r23 ; 0x800dbc 13e64: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd 13e68: 90 93 be 0d sts 0x0DBE, r25 ; 0x800dbe 13e6c: 0e c3 rjmp .+1564 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13e6e: 81 3d cpi r24, 0xD1 ; 209 13e70: 91 05 cpc r25, r1 13e72: 11 f4 brne .+4 ; 0x13e78 13e74: 0c 94 11 aa jmp 0x15422 ; 0x15422 13e78: 5c f5 brge .+86 ; 0x13ed0 13e7a: 8f 3c cpi r24, 0xCF ; 207 13e7c: 91 05 cpc r25, r1 13e7e: 11 f4 brne .+4 ; 0x13e84 13e80: 0c 94 e0 a9 jmp 0x153c0 ; 0x153c0 13e84: 80 3d cpi r24, 0xD0 ; 208 13e86: 91 05 cpc r25, r1 13e88: 09 f0 breq .+2 ; 0x13e8c 13e8a: 3f cc rjmp .-1922 ; 0x1370a - `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')) 13e8c: 83 e5 ldi r24, 0x53 ; 83 13e8e: 0e 94 80 56 call 0xad00 ; 0xad00 13e92: 88 23 and r24, r24 13e94: 51 f0 breq .+20 ; 0x13eaa { cs.retract_recover_length = code_value() ; 13e96: 0e 94 10 5b call 0xb620 ; 0xb620 13e9a: 60 93 f6 0d sts 0x0DF6, r22 ; 0x800df6 13e9e: 70 93 f7 0d sts 0x0DF7, r23 ; 0x800df7 13ea2: 80 93 f8 0d sts 0x0DF8, r24 ; 0x800df8 13ea6: 90 93 f9 0d sts 0x0DF9, r25 ; 0x800df9 } if(code_seen('F')) 13eaa: 86 e4 ldi r24, 0x46 ; 70 13eac: 0e 94 80 56 call 0xad00 ; 0xad00 13eb0: 88 23 and r24, r24 13eb2: 09 f4 brne .+2 ; 0x13eb6 13eb4: ea c2 rjmp .+1492 ; 0x1448a { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 13eb6: 0e 94 10 5b call 0xb620 ; 0xb620 13eba: 0e 94 a0 65 call 0xcb40 ; 0xcb40 13ebe: 60 93 fa 0d sts 0x0DFA, r22 ; 0x800dfa 13ec2: 70 93 fb 0d sts 0x0DFB, r23 ; 0x800dfb 13ec6: 80 93 fc 0d sts 0x0DFC, r24 ; 0x800dfc 13eca: 90 93 fd 0d sts 0x0DFD, r25 ; 0x800dfd 13ece: dd c2 rjmp .+1466 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13ed0: 8c 3d cpi r24, 0xDC ; 220 13ed2: 91 05 cpc r25, r1 13ed4: 11 f4 brne .+4 ; 0x13eda 13ed6: 0c 94 51 aa jmp 0x154a2 ; 0x154a2 13eda: 8d 3d cpi r24, 0xDD ; 221 13edc: 91 05 cpc r25, r1 13ede: 11 f4 brne .+4 ; 0x13ee4 13ee0: 0c 94 90 aa jmp 0x15520 ; 0x15520 13ee4: 86 3d cpi r24, 0xD6 ; 214 13ee6: 91 05 cpc r25, r1 13ee8: 09 f0 breq .+2 ; 0x13eec 13eea: 0f cc rjmp .-2018 ; 0x1370a 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; 13eec: 80 e5 ldi r24, 0x50 ; 80 13eee: 0e 94 80 56 call 0xad00 ; 0xad00 13ef2: 88 23 and r24, r24 13ef4: 11 f4 brne .+4 ; 0x13efa 13ef6: 0c 94 3d aa jmp 0x1547a ; 0x1547a 13efa: 0e 94 10 5b call 0xb620 ; 0xb620 13efe: 2b 01 movw r4, r22 13f00: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 13f02: 83 e5 ldi r24, 0x53 ; 83 13f04: 0e 94 80 56 call 0xad00 ; 0xad00 13f08: 88 23 and r24, r24 13f0a: 11 f4 brne .+4 ; 0x13f10 13f0c: 0c 94 47 aa jmp 0x1548e ; 0x1548e 13f10: 0e 94 10 5b call 0xb620 ; 0xb620 13f14: 4b 01 movw r8, r22 13f16: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 13f18: 8e e4 ldi r24, 0x4E ; 78 13f1a: 0e 94 80 56 call 0xad00 ; 0xad00 13f1e: d0 90 33 0e lds r13, 0x0E33 ; 0x800e33 13f22: 88 23 and r24, r24 13f24: 29 f0 breq .+10 ; 0x13f30 13f26: 0e 94 10 5b call 0xb620 ; 0xb620 13f2a: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 13f2e: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 13f30: 82 e5 ldi r24, 0x52 ; 82 13f32: 0e 94 80 56 call 0xad00 ; 0xad00 13f36: e0 90 34 0e lds r14, 0x0E34 ; 0x800e34 13f3a: f0 90 35 0e lds r15, 0x0E35 ; 0x800e35 13f3e: 88 23 and r24, r24 13f40: 29 f0 breq .+10 ; 0x13f4c 13f42: 0e 94 10 5b call 0xb620 ; 0xb620 13f46: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 13f4a: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 13f4c: 86 e4 ldi r24, 0x46 ; 70 13f4e: 0e 94 80 56 call 0xad00 ; 0xad00 13f52: 00 91 36 0e lds r16, 0x0E36 ; 0x800e36 13f56: 10 91 37 0e lds r17, 0x0E37 ; 0x800e37 13f5a: 88 23 and r24, r24 13f5c: 29 f0 breq .+10 ; 0x13f68 13f5e: 0e 94 10 5b call 0xb620 ; 0xb620 13f62: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 13f66: 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) 13f68: 20 e0 ldi r18, 0x00 ; 0 13f6a: 30 e0 ldi r19, 0x00 ; 0 13f6c: a9 01 movw r20, r18 13f6e: c3 01 movw r24, r6 13f70: b2 01 movw r22, r4 13f72: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 13f76: 18 16 cp r1, r24 13f78: 0c f0 brlt .+2 ; 0x13f7c 13f7a: 87 c2 rjmp .+1294 ; 0x1448a 13f7c: 20 e0 ldi r18, 0x00 ; 0 13f7e: 30 e0 ldi r19, 0x00 ; 0 13f80: a9 01 movw r20, r18 13f82: c5 01 movw r24, r10 13f84: b4 01 movw r22, r8 13f86: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 13f8a: 87 fd sbrc r24, 7 13f8c: 7e c2 rjmp .+1276 ; 0x1448a 13f8e: a5 01 movw r20, r10 13f90: 94 01 movw r18, r8 13f92: c3 01 movw r24, r6 13f94: b2 01 movw r22, r4 13f96: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 13f9a: 87 fd sbrc r24, 7 13f9c: 76 c2 rjmp .+1260 ; 0x1448a { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 13f9e: 40 92 2b 0e sts 0x0E2B, r4 ; 0x800e2b 13fa2: 50 92 2c 0e sts 0x0E2C, r5 ; 0x800e2c 13fa6: 60 92 2d 0e sts 0x0E2D, r6 ; 0x800e2d 13faa: 70 92 2e 0e sts 0x0E2E, r7 ; 0x800e2e cs.min_mm_per_arc_segment = s; 13fae: 80 92 2f 0e sts 0x0E2F, r8 ; 0x800e2f 13fb2: 90 92 30 0e sts 0x0E30, r9 ; 0x800e30 13fb6: a0 92 31 0e sts 0x0E31, r10 ; 0x800e31 13fba: b0 92 32 0e sts 0x0E32, r11 ; 0x800e32 cs.n_arc_correction = n; 13fbe: d0 92 33 0e sts 0x0E33, r13 ; 0x800e33 cs.min_arc_segments = r; 13fc2: f0 92 35 0e sts 0x0E35, r15 ; 0x800e35 13fc6: e0 92 34 0e sts 0x0E34, r14 ; 0x800e34 cs.arc_segments_per_sec = f; 13fca: 10 93 37 0e sts 0x0E37, r17 ; 0x800e37 13fce: 00 93 36 0e sts 0x0E36, r16 ; 0x800e36 13fd2: 5b c2 rjmp .+1206 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13fd4: 80 33 cpi r24, 0x30 ; 48 13fd6: a1 e0 ldi r26, 0x01 ; 1 13fd8: 9a 07 cpc r25, r26 13fda: 11 f4 brne .+4 ; 0x13fe0 13fdc: 0c 94 8c ab jmp 0x15718 ; 0x15718 13fe0: 0c f0 brlt .+2 ; 0x13fe4 13fe2: 6c c0 rjmp .+216 ; 0x140bc 13fe4: 8d 32 cpi r24, 0x2D ; 45 13fe6: e1 e0 ldi r30, 0x01 ; 1 13fe8: 9e 07 cpc r25, r30 13fea: 11 f4 brne .+4 ; 0x13ff0 13fec: 0c 94 13 ab jmp 0x15626 ; 0x15626 13ff0: 54 f5 brge .+84 ; 0x14046 13ff2: 80 3f cpi r24, 0xF0 ; 240 13ff4: 91 05 cpc r25, r1 13ff6: 09 f4 brne .+2 ; 0x13ffa 13ff8: 48 c2 rjmp .+1168 ; 0x1448a 13ffa: 8c 32 cpi r24, 0x2C ; 44 13ffc: 91 40 sbci r25, 0x01 ; 1 13ffe: 09 f0 breq .+2 ; 0x14002 14000: 84 cb rjmp .-2296 ; 0x1370a - `S` - frequency in Hz. Not all firmware versions support this parameter - `P` - duration in milliseconds */ case 300: // M300 { uint16_t beepP = code_seen('P') ? code_value() : 1000; 14002: 80 e5 ldi r24, 0x50 ; 80 14004: 0e 94 80 56 call 0xad00 ; 0xad00 14008: 08 ee ldi r16, 0xE8 ; 232 1400a: 13 e0 ldi r17, 0x03 ; 3 1400c: 88 23 and r24, r24 1400e: 29 f0 breq .+10 ; 0x1401a 14010: 0e 94 10 5b call 0xb620 ; 0xb620 14014: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 14018: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 1401a: 83 e5 ldi r24, 0x53 ; 83 1401c: 0e 94 80 56 call 0xad00 ; 0xad00 14020: 88 23 and r24, r24 14022: 11 f4 brne .+4 ; 0x14028 14024: 0c 94 0b ab jmp 0x15616 ; 0x15616 beepS = 0; else { beepS = code_value(); 14028: 0e 94 10 5b call 0xb620 ; 0xb620 1402c: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> if (!beepS) { 14030: 61 15 cp r22, r1 14032: 71 05 cpc r23, r1 14034: 11 f0 breq .+4 ; 0x1403a 14036: 0c 94 0d ab jmp 0x1561a ; 0x1561a // handle S0 as a pause _delay(beepP); 1403a: b8 01 movw r22, r16 1403c: 90 e0 ldi r25, 0x00 ; 0 1403e: 80 e0 ldi r24, 0x00 ; 0 14040: 0f 94 ce 0a call 0x2159c ; 0x2159c 14044: 22 c2 rjmp .+1092 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14046: 8e 32 cpi r24, 0x2E ; 46 14048: 31 e0 ldi r19, 0x01 ; 1 1404a: 93 07 cpc r25, r19 1404c: 11 f4 brne .+4 ; 0x14052 1404e: 0c 94 05 ac jmp 0x1580a ; 0x1580a 14052: 8f 32 cpi r24, 0x2F ; 47 14054: 91 40 sbci r25, 0x01 ; 1 14056: 09 f0 breq .+2 ; 0x1405a 14058: 58 cb rjmp .-2384 ; 0x1370a case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 1405a: 85 e4 ldi r24, 0x45 ; 69 1405c: 0e 94 80 56 call 0xad00 ; 0xad00 - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 14060: 10 e0 ldi r17, 0x00 ; 0 14062: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 14064: 88 23 and r24, r24 14066: 59 f0 breq .+22 ; 0x1407e 14068: 0e 94 a2 56 call 0xad44 ; 0xad44 1406c: 8c 01 movw r16, r24 if (e < 0) temp = 70; 1406e: c1 2c mov r12, r1 14070: d1 2c mov r13, r1 14072: 6c e8 ldi r22, 0x8C ; 140 14074: e6 2e mov r14, r22 14076: 62 e4 ldi r22, 0x42 ; 66 14078: 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) 1407a: 97 fd sbrc r25, 7 1407c: 06 c0 rjmp .+12 ; 0x1408a - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 1407e: c1 2c mov r12, r1 14080: d1 2c mov r13, r1 14082: 76 e1 ldi r23, 0x16 ; 22 14084: e7 2e mov r14, r23 14086: 73 e4 ldi r23, 0x43 ; 67 14088: 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(); 1408a: 83 e5 ldi r24, 0x53 ; 83 1408c: 0e 94 80 56 call 0xad00 ; 0xad00 14090: 88 23 and r24, r24 14092: 21 f0 breq .+8 ; 0x1409c 14094: 0e 94 10 5b call 0xb620 ; 0xb620 14098: 6b 01 movw r12, r22 1409a: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 1409c: 83 e4 ldi r24, 0x43 ; 67 1409e: 0e 94 80 56 call 0xad00 ; 0xad00 140a2: 88 23 and r24, r24 140a4: 11 f4 brne .+4 ; 0x140aa 140a6: 0c 94 15 ac jmp 0x1582a ; 0x1582a 140aa: 0e 94 a2 56 call 0xad44 ; 0xad44 PID_autotune(temp, e, c); 140ae: 9c 01 movw r18, r24 140b0: a8 01 movw r20, r16 140b2: c7 01 movw r24, r14 140b4: b6 01 movw r22, r12 140b6: 0f 94 a0 33 call 0x26740 ; 0x26740 140ba: e7 c1 rjmp .+974 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 140bc: 80 39 cpi r24, 0x90 ; 144 140be: 51 e0 ldi r21, 0x01 ; 1 140c0: 95 07 cpc r25, r21 140c2: 11 f4 brne .+4 ; 0x140c8 140c4: 0c 94 19 ac jmp 0x15832 ; 0x15832 140c8: 04 f5 brge .+64 ; 0x1410a 140ca: 8e 35 cpi r24, 0x5E ; 94 140cc: b1 e0 ldi r27, 0x01 ; 1 140ce: 9b 07 cpc r25, r27 140d0: 11 f4 brne .+4 ; 0x140d6 140d2: 0c 94 3a b7 jmp 0x16e74 ; 0x16e74 140d6: 8f 35 cpi r24, 0x5F ; 95 140d8: 91 40 sbci r25, 0x01 ; 1 140da: 09 f0 breq .+2 ; 0x140de 140dc: 16 cb rjmp .-2516 ; 0x1370a - `B` - new pin value */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) 140de: 83 e5 ldi r24, 0x53 ; 83 140e0: 0e 94 80 56 call 0xad00 ; 0xad00 140e4: 88 23 and r24, r24 140e6: 71 f0 breq .+28 ; 0x14104 140e8: 0e 94 10 5b call 0xb620 ; 0xb620 140ec: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 140f0: 61 30 cpi r22, 0x01 ; 1 140f2: 71 05 cpc r23, r1 140f4: 11 f4 brne .+4 ; 0x140fa 140f6: 0c 94 70 b7 jmp 0x16ee0 ; 0x16ee0 140fa: 62 30 cpi r22, 0x02 ; 2 140fc: 71 05 cpc r23, r1 140fe: 11 f4 brne .+4 ; 0x14104 14100: 0c 94 92 b7 jmp 0x16f24 ; 0x16f24 case 2: for(int i=0;i 14108: c0 c1 rjmp .+896 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1410a: 85 39 cpi r24, 0x95 ; 149 1410c: f1 e0 ldi r31, 0x01 ; 1 1410e: 9f 07 cpc r25, r31 14110: 11 f4 brne .+4 ; 0x14116 14112: 0c 94 1d ac jmp 0x1583a ; 0x1583a 14116: 86 39 cpi r24, 0x96 ; 150 14118: 21 e0 ldi r18, 0x01 ; 1 1411a: 92 07 cpc r25, r18 1411c: 11 f4 brne .+4 ; 0x14122 1411e: 0c 94 22 ac jmp 0x15844 ; 0x15844 14122: 83 39 cpi r24, 0x93 ; 147 14124: 91 40 sbci r25, 0x01 ; 1 14126: 09 f0 breq .+2 ; 0x1412a 14128: f0 ca rjmp .-2592 ; 0x1370a */ 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()) 1412a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1412e: 81 30 cpi r24, 0x01 ; 1 14130: 09 f0 breq .+2 ; 0x14134 14132: ab c1 rjmp .+854 ; 0x1448a { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 14134: 85 e4 ldi r24, 0x45 ; 69 14136: 0e 94 80 56 call 0xad00 ; 0xad00 1413a: 81 11 cpse r24, r1 1413c: 0e 94 95 56 call 0xad2a ; 0xad2a if(code_seen('F')) filament = code_value_uint8(); 14140: 86 e4 ldi r24, 0x46 ; 70 14142: 0e 94 80 56 call 0xad00 ; 0xad00 14146: 81 11 cpse r24, r1 14148: 0e 94 95 56 call 0xad2a ; 0xad2a MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 1414c: 0f 94 04 7a call 0x2f408 ; 0x2f408 14150: 88 23 and r24, r24 14152: 09 f4 brne .+2 ; 0x14156 14154: 9a c1 rjmp .+820 ; 0x1448a // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 14156: 60 e0 ldi r22, 0x00 ; 0 14158: 80 e0 ldi r24, 0x00 ; 0 1415a: 0f 94 08 9d call 0x33a10 ; 0x33a10 1415e: 95 c1 rjmp .+810 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14160: 80 3c cpi r24, 0xC0 ; 192 14162: 42 e0 ldi r20, 0x02 ; 2 14164: 94 07 cpc r25, r20 14166: 11 f4 brne .+4 ; 0x1416c 14168: 0c 94 7c b8 jmp 0x170f8 ; 0x170f8 1416c: 0c f0 brlt .+2 ; 0x14170 1416e: 57 c0 rjmp .+174 ; 0x1421e 14170: 88 32 cpi r24, 0x28 ; 40 14172: a2 e0 ldi r26, 0x02 ; 2 14174: 9a 07 cpc r25, r26 14176: 11 f4 brne .+4 ; 0x1417c 14178: 0c 94 c8 ae jmp 0x15d90 ; 0x15d90 1417c: 4c f5 brge .+82 ; 0x141d0 1417e: 86 3f cpi r24, 0xF6 ; 246 14180: e1 e0 ldi r30, 0x01 ; 1 14182: 9e 07 cpc r25, r30 14184: 11 f4 brne .+4 ; 0x1418a 14186: 0c 94 2f ac jmp 0x1585e ; 0x1585e 1418a: 6c f4 brge .+26 ; 0x141a6 1418c: 84 3f cpi r24, 0xF4 ; 244 1418e: 21 e0 ldi r18, 0x01 ; 1 14190: 92 07 cpc r25, r18 14192: 11 f4 brne .+4 ; 0x14198 14194: 0c 94 2b ac jmp 0x15856 ; 0x15856 14198: 85 3f cpi r24, 0xF5 ; 245 1419a: 91 40 sbci r25, 0x01 ; 1 1419c: 09 f0 breq .+2 ; 0x141a0 1419e: b5 ca rjmp .-2710 ; 0x1370a M501 */ case 501: { Config_RetrieveSettings(); 141a0: 0e 94 80 85 call 0x10b00 ; 0x10b00 141a4: 72 c1 rjmp .+740 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 141a6: 87 3f cpi r24, 0xF7 ; 247 141a8: 41 e0 ldi r20, 0x01 ; 1 141aa: 94 07 cpc r25, r20 141ac: 11 f4 brne .+4 ; 0x141b2 141ae: 0c 94 33 ac jmp 0x15866 ; 0x15866 141b2: 8d 3f cpi r24, 0xFD ; 253 141b4: 91 40 sbci r25, 0x01 ; 1 141b6: 09 f0 breq .+2 ; 0x141ba 141b8: a8 ca rjmp .-2736 ; 0x1370a M509 */ case 509: { lang_reset(); 141ba: 0e 94 98 74 call 0xe930 ; 0xe930 SERIAL_ECHO_START; 141be: 84 ee ldi r24, 0xE4 ; 228 141c0: 92 ea ldi r25, 0xA2 ; 162 141c2: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 141c6: 8d ed ldi r24, 0xDD ; 221 141c8: 9f e7 ldi r25, 0x7F ; 127 141ca: 0e 94 1f 7b call 0xf63e ; 0xf63e 141ce: 5d c1 rjmp .+698 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 141d0: 8a 35 cpi r24, 0x5A ; 90 141d2: a2 e0 ldi r26, 0x02 ; 2 141d4: 9a 07 cpc r25, r26 141d6: 11 f4 brne .+4 ; 0x141dc 141d8: 0c 94 f3 b2 jmp 0x165e6 ; 0x165e6 141dc: 5c f4 brge .+22 ; 0x141f4 141de: 88 35 cpi r24, 0x58 ; 88 141e0: e2 e0 ldi r30, 0x02 ; 2 141e2: 9e 07 cpc r25, r30 141e4: 11 f4 brne .+4 ; 0x141ea 141e6: 0c 94 fd ae jmp 0x15dfa ; 0x15dfa 141ea: 89 35 cpi r24, 0x59 ; 89 141ec: 92 40 sbci r25, 0x02 ; 2 141ee: 09 f4 brne .+2 ; 0x141f2 141f0: f9 ca rjmp .-2574 ; 0x137e4 141f2: 8b ca rjmp .-2794 ; 0x1370a 141f4: 8d 3b cpi r24, 0xBD ; 189 141f6: 22 e0 ldi r18, 0x02 ; 2 141f8: 92 07 cpc r25, r18 141fa: 11 f4 brne .+4 ; 0x14200 141fc: 0c 94 ab b7 jmp 0x16f56 ; 0x16f56 14200: 8e 3b cpi r24, 0xBE ; 190 14202: 32 e0 ldi r19, 0x02 ; 2 14204: 93 07 cpc r25, r19 14206: 11 f4 brne .+4 ; 0x1420c 14208: 0c 94 48 b8 jmp 0x17090 ; 0x17090 1420c: 8b 35 cpi r24, 0x5B ; 91 1420e: 92 40 sbci r25, 0x02 ; 2 14210: 09 f0 breq .+2 ; 0x14214 14212: 7b ca rjmp .-2826 ; 0x1370a /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 14214: 60 e0 ldi r22, 0x00 ; 0 14216: 80 e0 ldi r24, 0x00 ; 0 14218: 0e 94 e4 dc call 0x1b9c8 ; 0x1b9c8 1421c: 36 c1 rjmp .+620 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1421e: 8c 35 cpi r24, 0x5C ; 92 14220: 53 e0 ldi r21, 0x03 ; 3 14222: 95 07 cpc r25, r21 14224: 11 f4 brne .+4 ; 0x1422a 14226: 0c 94 15 b4 jmp 0x1682a ; 0x1682a 1422a: 0c f0 brlt .+2 ; 0x1422e 1422c: 42 c0 rjmp .+132 ; 0x142b2 1422e: 83 3c cpi r24, 0xC3 ; 195 14230: b2 e0 ldi r27, 0x02 ; 2 14232: 9b 07 cpc r25, r27 14234: 11 f4 brne .+4 ; 0x1423a 14236: 0c 94 88 b8 jmp 0x17110 ; 0x17110 1423a: 7c f4 brge .+30 ; 0x1425a 1423c: 81 3c cpi r24, 0xC1 ; 193 1423e: f2 e0 ldi r31, 0x02 ; 2 14240: 9f 07 cpc r25, r31 14242: 11 f4 brne .+4 ; 0x14248 14244: 0c 94 82 b8 jmp 0x17104 ; 0x17104 14248: 82 3c cpi r24, 0xC2 ; 194 1424a: 92 40 sbci r25, 0x02 ; 2 1424c: 09 f0 breq .+2 ; 0x14250 1424e: 5d ca rjmp .-2886 ; 0x1370a #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 14250: 82 ec ldi r24, 0xC2 ; 194 14252: 92 e0 ldi r25, 0x02 ; 2 14254: 0e 94 d6 5a call 0xb5ac ; 0xb5ac 14258: 18 c1 rjmp .+560 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1425a: 85 3c cpi r24, 0xC5 ; 197 1425c: 32 e0 ldi r19, 0x02 ; 2 1425e: 93 07 cpc r25, r19 14260: 11 f4 brne .+4 ; 0x14266 14262: 0c 94 d1 b8 jmp 0x171a2 ; 0x171a2 14266: 14 f4 brge .+4 ; 0x1426c 14268: 0c 94 a5 b8 jmp 0x1714a ; 0x1714a 1426c: 82 35 cpi r24, 0x52 ; 82 1426e: 93 40 sbci r25, 0x03 ; 3 14270: 09 f0 breq .+2 ; 0x14274 14272: 4b ca rjmp .-2922 ; 0x1370a float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 14274: 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')) { 14276: 83 e5 ldi r24, 0x53 ; 83 14278: 0e 94 80 56 call 0xad00 ; 0xad00 1427c: 88 23 and r24, r24 1427e: 11 f4 brne .+4 ; 0x14284 14280: 0c 94 fb b2 jmp 0x165f6 ; 0x165f6 iSel = code_value_uint8(); 14284: 0e 94 95 56 call 0xad2a ; 0xad2a 14288: 18 2f mov r17, r24 if (iSel>=max_sheets) 1428a: 88 30 cpi r24, 0x08 ; 8 1428c: 10 f4 brcc .+4 ; 0x14292 1428e: 0c 94 00 b3 jmp 0x16600 ; 0x16600 { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 14292: 89 eb ldi r24, 0xB9 ; 185 14294: 9f e7 ldi r25, 0x7F ; 127 14296: 0e 94 1f 7b call 0xf63e ; 0xf63e 1429a: 4a e0 ldi r20, 0x0A ; 10 1429c: 67 e0 ldi r22, 0x07 ; 7 1429e: 70 e0 ldi r23, 0x00 ; 0 142a0: 80 e0 ldi r24, 0x00 ; 0 142a2: 90 e0 ldi r25, 0x00 ; 0 142a4: 0e 94 20 7a call 0xf440 ; 0xf440 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 142a8: 8f ed ldi r24, 0xDF ; 223 142aa: 92 e0 ldi r25, 0x02 ; 2 142ac: 0e 94 1d 86 call 0x10c3a ; 0x10c3a 142b0: ec c0 rjmp .+472 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 142b2: 84 38 cpi r24, 0x84 ; 132 142b4: a3 e0 ldi r26, 0x03 ; 3 142b6: 9a 07 cpc r25, r26 142b8: 11 f4 brne .+4 ; 0x142be 142ba: 0c 94 8b b6 jmp 0x16d16 ; 0x16d16 142be: 0c f0 brlt .+2 ; 0x142c2 142c0: 4d c0 rjmp .+154 ; 0x1435c 142c2: 8d 35 cpi r24, 0x5D ; 93 142c4: e3 e0 ldi r30, 0x03 ; 3 142c6: 9e 07 cpc r25, r30 142c8: 11 f4 brne .+4 ; 0x142ce 142ca: 0c 94 9f b4 jmp 0x1693e ; 0x1693e 142ce: 8e 35 cpi r24, 0x5E ; 94 142d0: 93 40 sbci r25, 0x03 ; 3 142d2: 09 f0 breq .+2 ; 0x142d6 142d4: 1a ca rjmp .-3020 ; 0x1370a */ 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); 142d6: 0e 94 10 5b call 0xb620 ; 0xb620 142da: 20 e0 ldi r18, 0x00 ; 0 142dc: 30 e0 ldi r19, 0x00 ; 0 142de: 40 e2 ldi r20, 0x20 ; 32 142e0: 51 e4 ldi r21, 0x41 ; 65 142e2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 142e6: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 142ea: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 142ec: 63 30 cpi r22, 0x03 ; 3 142ee: 11 f4 brne .+4 ; 0x142f4 142f0: 0c 94 a5 b5 jmp 0x16b4a ; 0x16b4a 142f4: 10 f0 brcs .+4 ; 0x142fa 142f6: 0c 94 37 b5 jmp 0x16a6e ; 0x16a6e 142fa: 61 30 cpi r22, 0x01 ; 1 142fc: 11 f4 brne .+4 ; 0x14302 142fe: 0c 94 60 b5 jmp 0x16ac0 ; 0x16ac0 14302: 62 30 cpi r22, 0x02 ; 2 14304: 09 f0 breq .+2 ; 0x14308 14306: c1 c0 rjmp .+386 ; 0x1448a ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 14308: 80 91 01 13 lds r24, 0x1301 ; 0x801301 return pgm_read_word(&_nPrinterMmuType); 1430c: ee ee ldi r30, 0xEE ; 238 1430e: f9 e7 ldi r31, 0x79 ; 121 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 14310: 81 30 cpi r24, 0x01 ; 1 14312: 11 f0 breq .+4 ; 0x14318 return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 14314: e0 ef ldi r30, 0xF0 ; 240 14316: f9 e7 ldi r31, 0x79 ; 121 14318: 05 91 lpm r16, Z+ 1431a: 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')) 1431c: 80 e5 ldi r24, 0x50 ; 80 1431e: 0e 94 80 56 call 0xad00 ; 0xad00 14322: 88 23 and r24, r24 14324: 11 f4 brne .+4 ; 0x1432a 14326: 0c 94 94 b5 jmp 0x16b28 ; 0x16b28 { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 1432a: 0e 94 e8 56 call 0xadd0 ; 0xadd0 menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 1432e: f0 90 ea 03 lds r15, 0x03EA ; 0x8003ea 14332: ff 20 and r15, r15 14334: 09 f4 brne .+2 ; 0x14338 14336: a9 c0 rjmp .+338 ; 0x1448a return; if (nPrinterModel == actualPrinterModel) 14338: 60 17 cp r22, r16 1433a: 71 07 cpc r23, r17 1433c: 09 f4 brne .+2 ; 0x14340 1433e: a5 c0 rjmp .+330 ; 0x1448a // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 14340: 89 ec ldi r24, 0xC9 ; 201 14342: 97 e3 ldi r25, 0x37 ; 55 14344: 0e 94 95 75 call 0xeb2a ; 0xeb2a 14348: 8c 01 movw r16, r24 1434a: 81 e9 ldi r24, 0x91 ; 145 1434c: 97 e3 ldi r25, 0x37 ; 55 1434e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 14352: 4f 2d mov r20, r15 14354: b8 01 movw r22, r16 14356: 0e 94 a3 e8 call 0x1d146 ; 0x1d146 1435a: 97 c0 rjmp .+302 ; 0x1448a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1435c: 8c 38 cpi r24, 0x8C ; 140 1435e: 23 e0 ldi r18, 0x03 ; 3 14360: 92 07 cpc r25, r18 14362: 09 f4 brne .+2 ; 0x14366 14364: 92 c0 rjmp .+292 ; 0x1448a 14366: 80 3a cpi r24, 0xA0 ; 160 14368: 33 e0 ldi r19, 0x03 ; 3 1436a: 93 07 cpc r25, r19 1436c: 09 f4 brne .+2 ; 0x14370 1436e: 50 c2 rjmp .+1184 ; 0x14810 14370: 8b 38 cpi r24, 0x8B ; 139 14372: 93 40 sbci r25, 0x03 ; 3 14374: 09 f0 breq .+2 ; 0x14378 14376: c9 c9 rjmp .-3182 ; 0x1370a for(int i=0;i 1437e: 88 23 and r24, r24 14380: 39 f0 breq .+14 ; 0x14390 14382: 0e 94 10 5b call 0xb620 ; 0xb620 14386: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1438a: 80 e0 ldi r24, 0x00 ; 0 1438c: 0f 94 be 17 call 0x22f7c ; 0x22f7c #endif #ifdef MOTOR_CURRENT_PWM_Z_PIN if(code_seen('Z')) st_current_set(1, code_value()); 14390: 8a e5 ldi r24, 0x5A ; 90 14392: 0e 94 80 56 call 0xad00 ; 0xad00 14396: 88 23 and r24, r24 14398: 39 f0 breq .+14 ; 0x143a8 1439a: 0e 94 10 5b call 0xb620 ; 0xb620 1439e: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 143a2: 81 e0 ldi r24, 0x01 ; 1 143a4: 0f 94 be 17 call 0x22f7c ; 0x22f7c #endif #ifdef MOTOR_CURRENT_PWM_E_PIN if(code_seen('E')) st_current_set(2, code_value()); 143a8: 85 e4 ldi r24, 0x45 ; 69 143aa: 0e 94 80 56 call 0xad00 ; 0xad00 143ae: 88 23 and r24, r24 143b0: 09 f4 brne .+2 ; 0x143b4 143b2: 6b c0 rjmp .+214 ; 0x1448a 143b4: 0e 94 10 5b call 0xb620 ; 0xb620 143b8: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 143bc: cb 01 movw r24, r22 143be: 0f 94 be 16 call 0x22d7c ; 0x22d7c 143c2: 63 c0 rjmp .+198 ; 0x1448a - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 143c4: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 143c8: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 143cc: 0e 5f subi r16, 0xFE ; 254 143ce: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 143d0: 80 e5 ldi r24, 0x50 ; 80 143d2: 0e 94 80 56 call 0xad00 ; 0xad00 */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 143d6: c1 2c mov r12, r1 143d8: d1 2c mov r13, r1 143da: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 143dc: 88 23 and r24, r24 143de: 21 f0 breq .+8 ; 0x143e8 143e0: 0e 94 e8 56 call 0xadd0 ; 0xadd0 143e4: 6b 01 movw r12, r22 143e6: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 143e8: 83 e5 ldi r24, 0x53 ; 83 143ea: 0e 94 80 56 call 0xad00 ; 0xad00 143ee: 88 23 and r24, r24 143f0: 51 f0 breq .+20 ; 0x14406 143f2: 0e 94 e8 56 call 0xadd0 ; 0xadd0 143f6: 9b 01 movw r18, r22 143f8: ac 01 movw r20, r24 143fa: a8 ee ldi r26, 0xE8 ; 232 143fc: b3 e0 ldi r27, 0x03 ; 3 143fe: 0f 94 d3 a4 call 0x349a6 ; 0x349a6 <__muluhisi3> 14402: 6b 01 movw r12, r22 14404: 7c 01 movw r14, r24 14406: c8 01 movw r24, r16 14408: 0f 5f subi r16, 0xFF ; 255 1440a: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 1440c: dc 01 movw r26, r24 1440e: 4c 91 ld r20, X 14410: 40 32 cpi r20, 0x20 ; 32 14412: c9 f3 breq .-14 ; 0x14406 custom_message_type = CustomMsg::M0Wait; 14414: 26 e0 ldi r18, 0x06 ; 6 14416: 20 93 5d 06 sts 0x065D, r18 ; 0x80065d if (!expiration_time_set && *src != '\0') { 1441a: c1 14 cp r12, r1 1441c: d1 04 cpc r13, r1 1441e: e1 04 cpc r14, r1 14420: f1 04 cpc r15, r1 14422: c9 f5 brne .+114 ; 0x14496 14424: 2c 91 ld r18, X 14426: 22 23 and r18, r18 14428: b1 f1 breq .+108 ; 0x14496 lcd_setstatus(src); 1442a: 0e 94 d3 dc call 0x1b9a6 ; 0x1b9a6 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(); 1442e: 0f 94 5b 18 call 0x230b6 ; 0x230b6 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 14432: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 14436: 84 60 ori r24, 0x04 ; 4 14438: 80 93 3a 12 sts 0x123A, r24 ; 0x80123a previous_millis_cmd.start(); 1443c: 88 e4 ldi r24, 0x48 ; 72 1443e: 93 e0 ldi r25, 0x03 ; 3 14440: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> if (expiration_time_set) { 14444: c1 14 cp r12, r1 14446: d1 04 cpc r13, r1 14448: e1 04 cpc r14, r1 1444a: f1 04 cpc r15, r1 1444c: d9 f1 breq .+118 ; 0x144c4 codenum += _millis(); // keep track of when we started waiting 1444e: 0f 94 01 0b call 0x21602 ; 0x21602 14452: c6 0e add r12, r22 14454: d7 1e adc r13, r23 14456: e8 1e adc r14, r24 14458: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 1445a: 84 e0 ldi r24, 0x04 ; 4 1445c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(_millis() < codenum && !lcd_clicked()) { 14460: 0f 94 01 0b call 0x21602 ; 0x21602 14464: 6c 15 cp r22, r12 14466: 7d 05 cpc r23, r13 14468: 8e 05 cpc r24, r14 1446a: 9f 05 cpc r25, r15 1446c: 10 f1 brcs .+68 ; 0x144b2 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 1446e: 82 e0 ldi r24, 0x02 ; 2 14470: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 14474: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 14478: 8b 7f andi r24, 0xFB ; 251 1447a: 80 93 3a 12 sts 0x123A, r24 ; 0x80123a if (IS_SD_PRINTING) 1447e: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 14482: 88 23 and r24, r24 14484: 91 f1 breq .+100 ; 0x144ea custom_message_type = CustomMsg::Status; 14486: 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; 1448a: 10 92 41 0d sts 0x0D41, r1 ; 0x800d41 <_ZL17mcode_in_progress.lto_priv.487+0x1> 1448e: 10 92 40 0d sts 0x0D40, r1 ; 0x800d40 <_ZL17mcode_in_progress.lto_priv.487> 14492: 0c 94 a0 8e jmp 0x11d40 ; 0x11d40 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){ 14496: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1449a: 81 11 cpse r24, r1 1449c: 07 c0 rjmp .+14 ; 0x144ac LCD_MESSAGERPGM(_T(MSG_USERWAIT)); 1449e: 8f ec ldi r24, 0xCF ; 207 144a0: 99 e3 ldi r25, 0x39 ; 57 144a2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 144a6: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe 144aa: c1 cf rjmp .-126 ; 0x1442e } else { custom_message_type = CustomMsg::Status; // let the lcd display the name of the printed G-code file in farm mode 144ac: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 144b0: be cf rjmp .-132 ; 0x1442e 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()) { 144b2: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 144b6: 81 11 cpse r24, r1 144b8: da cf rjmp .-76 ; 0x1446e delay_keep_alive(0); 144ba: 90 e0 ldi r25, 0x00 ; 0 144bc: 80 e0 ldi r24, 0x00 ; 0 144be: 0e 94 0a 8d call 0x11a14 ; 0x11a14 144c2: ce cf rjmp .-100 ; 0x14460 //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 144c4: 10 91 78 02 lds r17, 0x0278 ; 0x800278 KEEPALIVE_STATE(PAUSED_FOR_USER); 144c8: 84 e0 ldi r24, 0x04 ; 4 144ca: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 144ce: 0e 94 cb 73 call 0xe796 ; 0xe796 while(!lcd_clicked()) 144d2: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 144d6: 81 11 cpse r24, r1 144d8: 05 c0 rjmp .+10 ; 0x144e4 { delay_keep_alive(0); 144da: 90 e0 ldi r25, 0x00 ; 0 144dc: 80 e0 ldi r24, 0x00 ; 0 144de: 0e 94 0a 8d call 0x11a14 ; 0x11a14 144e2: f7 cf rjmp .-18 ; 0x144d2 } KEEPALIVE_STATE(busy_state_backup); 144e4: 10 93 78 02 sts 0x0278, r17 ; 0x800278 144e8: c5 cf rjmp .-118 ; 0x14474 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 144ea: 8a e8 ldi r24, 0x8A ; 138 144ec: 9c e6 ldi r25, 0x6C ; 108 144ee: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe 144f2: cb cf rjmp .-106 ; 0x1448a /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 144f4: 84 ec ldi r24, 0xC4 ; 196 144f6: 99 e3 ldi r25, 0x39 ; 57 144f8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 144fc: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe enable_x(); 14500: 17 98 cbi 0x02, 7 ; 2 enable_y(); 14502: 16 98 cbi 0x02, 6 ; 2 enable_z(); 14504: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 14506: 14 98 cbi 0x02, 4 ; 2 14508: c0 cf rjmp .-128 ; 0x1448a /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 1450a: 81 e0 ldi r24, 0x01 ; 1 1450c: 0f 94 c5 72 call 0x2e58a ; 0x2e58a 14510: bc cf rjmp .-136 ; 0x1448a presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 14512: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 mounted = false; 14516: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 SERIAL_ECHO_START; 1451a: 84 ee ldi r24, 0xE4 ; 228 1451c: 92 ea ldi r25, 0xA2 ; 162 1451e: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 14522: 88 e4 ldi r24, 0x48 ; 72 14524: 99 e6 ldi r25, 0x69 ; 105 14526: 0e 94 18 7d call 0xfa30 ; 0xfa30 1452a: af cf rjmp .-162 ; 0x1448a /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 1452c: 0e 94 90 66 call 0xcd20 ; 0xcd20 14530: 88 23 and r24, r24 14532: 19 f0 breq .+6 ; 0x1453a lcd_resume_print(); 14534: 0e 94 a4 dc call 0x1b948 ; 0x1b948 14538: a8 cf rjmp .-176 ; 0x1448a else { if (!filament_presence_check()) { 1453a: 0e 94 b4 e8 call 0x1d168 ; 0x1d168 1453e: 88 23 and r24, r24 14540: 09 f4 brne .+2 ; 0x14544 14542: a3 cf rjmp .-186 ; 0x1448a 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); }; 14544: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 14548: 88 23 and r24, r24 1454a: 61 f0 breq .+24 ; 0x14564 // Print was aborted break; } if (!card.get_sdpos()) 1454c: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 14550: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 14554: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 14558: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee 1455c: 89 2b or r24, r25 1455e: 8a 2b or r24, r26 14560: 8b 2b or r24, r27 14562: 69 f4 brne .+26 ; 0x1457e { // A new print has started from scratch, reset stats failstats_reset_print(); 14564: 0e 94 f3 56 call 0xade6 ; 0xade6 sdpos_atomic = 0; 14568: 10 92 49 12 sts 0x1249, r1 ; 0x801249 1456c: 10 92 4a 12 sts 0x124A, r1 ; 0x80124a 14570: 10 92 4b 12 sts 0x124B, r1 ; 0x80124b 14574: 10 92 4c 12 sts 0x124C, r1 ; 0x80124c 14578: 80 e0 ldi r24, 0x00 ; 0 1457a: 0e 94 87 84 call 0x1090e ; 0x1090e } void CardReader::startFileprint() { if(mounted) 1457e: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 14582: 88 23 and r24, r24 14584: 31 f0 breq .+12 ; 0x14592 { sdprinting = true; 14586: 81 e0 ldi r24, 0x01 ; 1 14588: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 1458c: 85 e0 ldi r24, 0x05 ; 5 1458e: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.385> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 14592: 0f 94 85 16 call 0x22d0a ; 0x22d0a if (MMU2::mmu2.Enabled()) 14596: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1459a: 81 30 cpi r24, 0x01 ; 1 1459c: 09 f0 breq .+2 ; 0x145a0 1459e: 75 cf rjmp .-278 ; 0x1448a { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 145a0: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 145a4: 88 23 and r24, r24 145a6: 09 f4 brne .+2 ; 0x145aa 145a8: 70 cf rjmp .-288 ; 0x1448a 145aa: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 145ae: 81 11 cpse r24, r1 145b0: 6c cf rjmp .-296 ; 0x1448a { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 145b2: 0f 94 cf 9d call 0x33b9e ; 0x33b9e 145b6: 69 cf rjmp .-302 ; 0x1448a #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 145b8: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 145bc: 88 23 and r24, r24 145be: 09 f4 brne .+2 ; 0x145c2 145c0: 64 cf rjmp .-312 ; 0x1448a 145c2: 83 e5 ldi r24, 0x53 ; 83 145c4: 0e 94 80 56 call 0xad00 ; 0xad00 145c8: 88 23 and r24, r24 145ca: 09 f4 brne .+2 ; 0x145ce 145cc: 5e cf rjmp .-324 ; 0x1448a long index = code_value_long(); 145ce: 0e 94 e8 56 call 0xadd0 ; 0xadd0 145d2: 6b 01 movw r12, r22 145d4: 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);}; 145d6: c0 92 eb 16 sts 0x16EB, r12 ; 0x8016eb 145da: d0 92 ec 16 sts 0x16EC, r13 ; 0x8016ec 145de: e0 92 ed 16 sts 0x16ED, r14 ; 0x8016ed 145e2: f0 92 ee 16 sts 0x16EE, r15 ; 0x8016ee 145e6: 0f 94 86 67 call 0x2cf0c ; 0x2cf0c 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; 145ea: c0 92 49 12 sts 0x1249, r12 ; 0x801249 145ee: d0 92 4a 12 sts 0x124A, r13 ; 0x80124a 145f2: e0 92 4b 12 sts 0x124B, r14 ; 0x80124b 145f6: f0 92 4c 12 sts 0x124C, r15 ; 0x80124c 145fa: 47 cf rjmp .-370 ; 0x1448a #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 145fc: 80 e5 ldi r24, 0x50 ; 80 145fe: 0e 94 80 56 call 0xad00 ; 0xad00 14602: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 14604: 0e 94 90 66 call 0xcd20 ; 0xcd20 14608: 88 23 and r24, r24 1460a: 91 f0 breq .+36 ; 0x14630 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 1460c: 80 91 73 12 lds r24, 0x1273 ; 0x801273 14610: 88 23 and r24, r24 14612: 49 f0 breq .+18 ; 0x14626 14614: 80 91 79 02 lds r24, 0x0279 ; 0x800279 14618: 81 11 cpse r24, r1 1461a: 05 c0 rjmp .+10 ; 0x14626 SERIAL_PROTOCOLLNPGM("SD print paused"); 1461c: 85 ed ldi r24, 0xD5 ; 213 1461e: 9e e7 ldi r25, 0x7E ; 126 14620: 0e 94 18 7d call 0xfa30 ; 0xfa30 14624: 32 cf rjmp .-412 ; 0x1448a else SERIAL_PROTOCOLLNPGM("Print saved"); 14626: 89 ec ldi r24, 0xC9 ; 201 14628: 9e e7 ldi r25, 0x7E ; 126 1462a: 0e 94 18 7d call 0xfa30 ; 0xfa30 1462e: 2d cf rjmp .-422 ; 0x1448a } else if (sdprinting) 14630: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 14634: 88 23 and r24, r24 14636: 09 f4 brne .+2 ; 0x1463a 14638: 4a c0 rjmp .+148 ; 0x146ce { if (arg_P) 1463a: 11 23 and r17, r17 1463c: e1 f1 breq .+120 ; 0x146b6 { printAbsFilenameFast(); 1463e: 0f 94 0b 6c call 0x2d816 ; 0x2d816 SERIAL_PROTOCOLLN(); 14642: 0e 94 17 7b call 0xf62e ; 0xf62e } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 14646: 82 eb ldi r24, 0xB2 ; 178 14648: 95 e6 ldi r25, 0x65 ; 101 1464a: 0e 94 1f 7b call 0xf63e ; 0xf63e 1464e: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 14652: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 14656: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 1465a: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 1465e: 4a e0 ldi r20, 0x0A ; 10 14660: 0e 94 20 7a call 0xf440 ; 0xf440 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 14664: 8f e2 ldi r24, 0x2F ; 47 14666: 0e 94 0c 7a call 0xf418 ; 0xf418 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 1466a: 60 91 e4 16 lds r22, 0x16E4 ; 0x8016e4 1466e: 70 91 e5 16 lds r23, 0x16E5 ; 0x8016e5 14672: 80 91 e6 16 lds r24, 0x16E6 ; 0x8016e6 14676: 90 91 e7 16 lds r25, 0x16E7 ; 0x8016e7 1467a: 4a e0 ldi r20, 0x0A ; 10 1467c: 0e 94 20 7a call 0xf440 ; 0xf440 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 14680: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 14684: 0f 94 cd 14 call 0x2299a ; 0x2299a 14688: 2c e3 ldi r18, 0x3C ; 60 1468a: 30 e0 ldi r19, 0x00 ; 0 1468c: 40 e0 ldi r20, 0x00 ; 0 1468e: 50 e0 ldi r21, 0x00 ; 0 14690: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 14694: c9 01 movw r24, r18 14696: 6c e3 ldi r22, 0x3C ; 60 14698: 70 e0 ldi r23, 0x00 ; 0 1469a: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__udivmodhi4> 1469e: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 146a0: 90 e0 ldi r25, 0x00 ; 0 146a2: 80 e0 ldi r24, 0x00 ; 0 146a4: 0e 94 85 7a call 0xf50a ; 0xf50a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 146a8: 8a e3 ldi r24, 0x3A ; 58 146aa: 0e 94 0c 7a call 0xf418 ; 0xf418 SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 146ae: c8 01 movw r24, r16 146b0: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a 146b4: ea ce rjmp .-556 ; 0x1448a { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 146b6: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 146ba: 88 23 and r24, r24 146bc: 29 f0 breq .+10 ; 0x146c8 146be: 8e ee ldi r24, 0xEE ; 238 146c0: 93 e1 ldi r25, 0x13 ; 19 146c2: 0e 94 1d 86 call 0x10c3a ; 0x10c3a 146c6: bf cf rjmp .-130 ; 0x14646 146c8: 89 ed ldi r24, 0xD9 ; 217 146ca: 93 e1 ldi r25, 0x13 ; 19 146cc: fa cf rjmp .-12 ; 0x146c2 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 146ce: 89 eb ldi r24, 0xB9 ; 185 146d0: 9e e7 ldi r25, 0x7E ; 126 146d2: 0e 94 18 7d call 0xfa30 ; 0xfa30 146d6: d9 ce rjmp .-590 ; 0x1448a /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 146d8: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 146dc: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 146e0: 04 96 adiw r24, 0x04 ; 4 146e2: 0f 94 6a 77 call 0x2eed4 ; 0x2eed4 146e6: d1 ce rjmp .-606 ; 0x1448a * 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; 146e8: ce 01 movw r24, r28 146ea: 01 96 adiw r24, 0x01 ; 1 146ec: 0f 94 67 68 call 0x2d0ce ; 0x2d0ce 146f0: 88 23 and r24, r24 146f2: 09 f4 brne .+2 ; 0x146f6 146f4: 33 c9 rjmp .-3482 ; 0x1395c // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 146f6: 61 e0 ldi r22, 0x01 ; 1 146f8: ce 01 movw r24, r28 146fa: 01 96 adiw r24, 0x01 ; 1 146fc: 0f 94 c1 2b call 0x25782 ; 0x25782 if (!d) goto fail; 14700: 00 97 sbiw r24, 0x00 ; 0 14702: 09 f4 brne .+2 ; 0x14706 14704: 2b c9 rjmp .-3498 ; 0x1395c // mark entry deleted d->name[0] = DIR_NAME_DELETED; 14706: 25 ee ldi r18, 0xE5 ; 229 14708: fc 01 movw r30, r24 1470a: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 1470c: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 1470e: 0f 94 b5 26 call 0x24d6a ; 0x24d6a 14712: 18 2f mov r17, r24 14714: 24 c9 rjmp .-3512 ; 0x1395e presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 14716: 83 e9 ldi r24, 0x93 ; 147 14718: 9e e7 ldi r25, 0x7E ; 126 1471a: 0e 94 1f 7b call 0xf63e ; 0xf63e 1471e: 8c a1 ldd r24, Y+36 ; 0x24 14720: 9d a1 ldd r25, Y+37 ; 0x25 14722: 0e 94 11 86 call 0x10c22 ; 0x10c22 14726: 8e e2 ldi r24, 0x2E ; 46 14728: 0e 94 0c 7a call 0xf418 ; 0xf418 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 1472c: 0e 94 17 7b call 0xf62e ; 0xf62e 14730: ac ce rjmp .-680 ; 0x1448a - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 14732: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 14736: 81 11 cpse r24, r1 st_synchronize(); 14738: 0f 94 5b 18 call 0x230b6 ; 0x230b6 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 1473c: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 14740: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 14744: 0c 5f subi r16, 0xFC ; 252 14746: 1f 4f sbci r17, 0xFF ; 255 14748: 61 e2 ldi r22, 0x21 ; 33 1474a: 70 e0 ldi r23, 0x00 ; 0 1474c: c8 01 movw r24, r16 1474e: 0f 94 95 aa call 0x3552a ; 0x3552a if(namestartpos==NULL) 14752: 00 97 sbiw r24, 0x00 ; 0 14754: 19 f0 breq .+6 ; 0x1475c { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 14756: 8c 01 movw r16, r24 14758: 0f 5f subi r16, 0xFF ; 255 1475a: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 1475c: 80 e5 ldi r24, 0x50 ; 80 1475e: 0e 94 80 56 call 0xad00 ; 0xad00 14762: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 14764: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 14768: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 1476c: 08 17 cp r16, r24 1476e: 19 07 cpc r17, r25 14770: 08 f4 brcc .+2 ; 0x14774 call_procedure=false; //false alert, 'P' found within filename 14772: f1 2c mov r15, r1 if( card.mounted ) 14774: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 14778: 88 23 and r24, r24 1477a: 09 f4 brne .+2 ; 0x1477e 1477c: 86 ce rjmp .-756 ; 0x1448a { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 1477e: 61 e0 ldi r22, 0x01 ; 1 14780: 6f 25 eor r22, r15 14782: c8 01 movw r24, r16 14784: 0f 94 4e 71 call 0x2e29c ; 0x2e29c if(code_seen('S')) 14788: 83 e5 ldi r24, 0x53 ; 83 1478a: 0e 94 80 56 call 0xad00 ; 0xad00 1478e: 88 23 and r24, r24 14790: 99 f0 breq .+38 ; 0x147b8 if(strchr_pointer 14796: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 1479a: 80 17 cp r24, r16 1479c: 91 07 cpc r25, r17 1479e: 60 f4 brcc .+24 ; 0x147b8 card.setIndex(code_value_long()); 147a0: 0e 94 e8 56 call 0xadd0 ; 0xadd0 147a4: 60 93 eb 16 sts 0x16EB, r22 ; 0x8016eb 147a8: 70 93 ec 16 sts 0x16EC, r23 ; 0x8016ec 147ac: 80 93 ed 16 sts 0x16ED, r24 ; 0x8016ed 147b0: 90 93 ee 16 sts 0x16EE, r25 ; 0x8016ee 147b4: 0f 94 86 67 call 0x2cf0c ; 0x2cf0c SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 147b8: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 147bc: 88 23 and r24, r24 147be: 31 f0 breq .+12 ; 0x147cc { sdprinting = true; 147c0: 81 e0 ldi r24, 0x01 ; 1 147c2: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 147c6: 85 e0 ldi r24, 0x05 ; 5 147c8: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.385> card.startFileprint(); if(!call_procedure) 147cc: f1 10 cpse r15, r1 147ce: 5d ce rjmp .-838 ; 0x1448a 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); }; 147d0: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 147d4: 88 23 and r24, r24 147d6: 61 f0 breq .+24 ; 0x147f0 { if(!card.get_sdpos()) 147d8: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 147dc: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 147e0: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 147e4: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee 147e8: 89 2b or r24, r25 147ea: 8a 2b or r24, r26 147ec: 8b 2b or r24, r27 147ee: 69 f4 brne .+26 ; 0x1480a { // A new print has started from scratch, reset stats failstats_reset_print(); 147f0: 0e 94 f3 56 call 0xade6 ; 0xade6 sdpos_atomic = 0; 147f4: 10 92 49 12 sts 0x1249, r1 ; 0x801249 147f8: 10 92 4a 12 sts 0x124A, r1 ; 0x80124a 147fc: 10 92 4b 12 sts 0x124B, r1 ; 0x80124b 14800: 10 92 4c 12 sts 0x124C, r1 ; 0x80124c 14804: 80 e0 ldi r24, 0x00 ; 0 14806: 0e 94 87 84 call 0x1090e ; 0x1090e #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 1480a: 0f 94 85 16 call 0x22d0a ; 0x22d0a 1480e: 3d ce rjmp .-902 ; 0x1448a M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 14810: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 14814: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc } } void CardReader::openLogFile(const char* name) { logging = true; 14818: 21 e0 ldi r18, 0x01 ; 1 1481a: 20 93 d6 13 sts 0x13D6, r18 ; 0x8013d6 openFileWrite(name); 1481e: 05 96 adiw r24, 0x05 ; 5 14820: 0f 94 6a 77 call 0x2eed4 ; 0x2eed4 14824: 32 ce rjmp .-924 ; 0x1448a ### 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(); 14826: 0f 94 cd 14 call 0x2299a ; 0x2299a int16_t sec, min; min = t / 60; sec = t % 60; 1482a: 2c e3 ldi r18, 0x3C ; 60 1482c: 30 e0 ldi r19, 0x00 ; 0 1482e: 40 e0 ldi r20, 0x00 ; 0 14830: 50 e0 ldi r21, 0x00 ; 0 14832: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 14836: 7f 93 push r23 14838: 6f 93 push r22 1483a: 3f 93 push r19 1483c: 2f 93 push r18 1483e: 87 e2 ldi r24, 0x27 ; 39 14840: 91 e8 ldi r25, 0x81 ; 129 14842: 9f 93 push r25 14844: 8f 93 push r24 14846: 8e 01 movw r16, r28 14848: 0f 5f subi r16, 0xFF ; 255 1484a: 1f 4f sbci r17, 0xFF ; 255 1484c: 1f 93 push r17 1484e: 0f 93 push r16 14850: 0f 94 55 a3 call 0x346aa ; 0x346aa SERIAL_ECHO_START; 14854: 84 ee ldi r24, 0xE4 ; 228 14856: 92 ea ldi r25, 0xA2 ; 162 14858: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN(time); 1485c: c8 01 movw r24, r16 1485e: 0e 94 1d 86 call 0x10c3a ; 0x10c3a lcd_setstatus(time); 14862: c8 01 movw r24, r16 14864: 0e 94 d3 dc call 0x1b9a6 ; 0x1b9a6 autotempShutdown(); 14868: 0f b6 in r0, 0x3f ; 63 1486a: f8 94 cli 1486c: de bf out 0x3e, r29 ; 62 1486e: 0f be out 0x3f, r0 ; 63 14870: cd bf out 0x3d, r28 ; 61 14872: 0b ce rjmp .-1002 ; 0x1448a } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 14874: 17 fd sbrc r17, 7 14876: 09 ce rjmp .-1006 ; 0x1448a 14878: b5 c8 rjmp .-3734 ; 0x139e4 ### 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); 1487a: 80 e1 ldi r24, 0x10 ; 16 1487c: 0e 94 e4 d4 call 0x1a9c8 ; 0x1a9c8 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 14880: 81 ea ldi r24, 0xA1 ; 161 14882: 9d e0 ldi r25, 0x0D ; 13 14884: 0f 94 3e a4 call 0x3487c ; 0x3487c 14888: 4b e0 ldi r20, 0x0B ; 11 1488a: 84 9f mul r24, r20 1488c: c0 01 movw r24, r0 1488e: 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); 14890: 70 e0 ldi r23, 0x00 ; 0 14892: 60 e0 ldi r22, 0x00 ; 0 14894: 80 5b subi r24, 0xB0 ; 176 14896: 92 4f sbci r25, 0xF2 ; 242 14898: 0f 94 80 a4 call 0x34900 ; 0x34900 // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 1489c: 82 e0 ldi r24, 0x02 ; 2 1489e: 0e 94 e4 d4 call 0x1a9c8 ; 0x1a9c8 reset_bed_offset_and_skew(); 148a2: 0e 94 a9 55 call 0xab52 ; 0xab52 // 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(); 148a6: 0e 94 88 62 call 0xc510 ; 0xc510 148aa: ef cd rjmp .-1058 ; 0x1448a */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 148ac: 8a e5 ldi r24, 0x5A ; 90 148ae: 0e 94 80 56 call 0xad00 ; 0xad00 // 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); 148b2: 0f 94 7c 7d call 0x2faf8 ; 0x2faf8 148b6: e9 cd rjmp .-1070 ; 0x1448a SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 148b8: 8b ee ldi r24, 0xEB ; 235 148ba: 90 e8 ldi r25, 0x80 ; 128 148bc: 0e 94 1f 7b call 0xf63e ; 0xf63e 148c0: e4 cd rjmp .-1080 ; 0x1448a } } else { SERIAL_PROTOCOLLNPGM("n/a"); 148c2: 87 ee ldi r24, 0xE7 ; 231 148c4: 90 e8 ldi r25, 0x80 ; 128 148c6: 0e 94 18 7d call 0xfa30 ; 0xfa30 148ca: df cd rjmp .-1090 ; 0x1448a /*! ### 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); 148cc: 84 e0 ldi r24, 0x04 ; 4 148ce: 80 93 78 02 sts 0x0278, r24 ; 0x800278 menu_back_if_clicked(); } void lcd_diag_show_end_stops() { lcd_clear(); 148d2: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_consume_click(); 148d6: 0e 94 cb 73 call 0xe796 ; 0xe796 for (;;) { manage_heater(); 148da: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 148de: 81 e0 ldi r24, 0x01 ; 1 148e0: 0e 94 b0 8a call 0x11560 ; 0x11560 lcd_show_end_stops(); 148e4: 0e 94 31 dd call 0x1ba62 ; 0x1ba62 if (lcd_clicked()) { 148e8: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 148ec: 88 23 and r24, r24 148ee: a9 f3 breq .-22 ; 0x148da break; } } lcd_clear(); 148f0: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_return_to_status(); 148f4: 0f 94 18 05 call 0x20a30 ; 0x20a30 148f8: c8 cd rjmp .-1136 ; 0x1448a 148fa: 10 92 61 0d sts 0x0D61, r1 ; 0x800d61 <_ZL13printer_state.lto_priv.385> 148fe: c5 cd rjmp .-1142 ; 0x1448a break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 14900: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.385> 14904: 1f 92 push r1 14906: 8f 93 push r24 14908: 84 ed ldi r24, 0xD4 ; 212 1490a: 96 e6 ldi r25, 0x66 ; 102 1490c: 9f 93 push r25 1490e: 8f 93 push r24 14910: 0f 94 00 a3 call 0x34600 ; 0x34600 14914: 0f 90 pop r0 14916: 0f 90 pop r0 14918: 0f 90 pop r0 1491a: 0f 90 pop r0 1491c: b6 cd rjmp .-1172 ; 0x1448a - `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(); 1491e: 80 e5 ldi r24, 0x50 ; 80 14920: 0e 94 80 56 call 0xad00 ; 0xad00 14924: 88 23 and r24, r24 14926: 21 f0 breq .+8 ; 0x14930 14928: 0e 94 95 56 call 0xad2a ; 0xad2a 1492c: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f if(code_seen('R')) print_time_remaining_normal = code_value(); 14930: 82 e5 ldi r24, 0x52 ; 82 14932: 0e 94 80 56 call 0xad00 ; 0xad00 14936: 88 23 and r24, r24 14938: 41 f0 breq .+16 ; 0x1494a 1493a: 0e 94 10 5b call 0xb620 ; 0xb620 1493e: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 14942: 70 93 73 02 sts 0x0273, r23 ; 0x800273 14946: 60 93 72 02 sts 0x0272, r22 ; 0x800272 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 1494a: 81 e5 ldi r24, 0x51 ; 81 1494c: 0e 94 80 56 call 0xad00 ; 0xad00 14950: 88 23 and r24, r24 14952: 21 f0 breq .+8 ; 0x1495c 14954: 0e 94 95 56 call 0xad2a ; 0xad2a 14958: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f if(code_seen('S')) print_time_remaining_silent = code_value(); 1495c: 83 e5 ldi r24, 0x53 ; 83 1495e: 0e 94 80 56 call 0xad00 ; 0xad00 14962: 88 23 and r24, r24 14964: 41 f0 breq .+16 ; 0x14976 14966: 0e 94 10 5b call 0xb620 ; 0xb620 1496a: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 1496e: 70 93 3e 02 sts 0x023E, r23 ; 0x80023e 14972: 60 93 3d 02 sts 0x023D, r22 ; 0x80023d if(code_seen('C')){ 14976: 83 e4 ldi r24, 0x43 ; 67 14978: 0e 94 80 56 call 0xad00 ; 0xad00 1497c: 88 23 and r24, r24 1497e: a9 f0 breq .+42 ; 0x149aa float print_time_to_change_normal_f = code_value(); 14980: 0e 94 10 5b call 0xb620 ; 0xb620 14984: 6b 01 movw r12, r22 14986: 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; 14988: 20 e0 ldi r18, 0x00 ; 0 1498a: 30 e0 ldi r19, 0x00 ; 0 1498c: a9 01 movw r20, r18 1498e: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 14992: 6f ef ldi r22, 0xFF ; 255 14994: 7f ef ldi r23, 0xFF ; 255 14996: 18 16 cp r1, r24 14998: 24 f4 brge .+8 ; 0x149a2 1499a: c7 01 movw r24, r14 1499c: b6 01 movw r22, r12 1499e: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 149a2: 70 93 71 02 sts 0x0271, r23 ; 0x800271 149a6: 60 93 70 02 sts 0x0270, r22 ; 0x800270 } if(code_seen('D')){ 149aa: 84 e4 ldi r24, 0x44 ; 68 149ac: 0e 94 80 56 call 0xad00 ; 0xad00 149b0: 88 23 and r24, r24 149b2: a9 f0 breq .+42 ; 0x149de float print_time_to_change_silent_f = code_value(); 149b4: 0e 94 10 5b call 0xb620 ; 0xb620 149b8: 6b 01 movw r12, r22 149ba: 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; 149bc: 20 e0 ldi r18, 0x00 ; 0 149be: 30 e0 ldi r19, 0x00 ; 0 149c0: a9 01 movw r20, r18 149c2: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 149c6: 6f ef ldi r22, 0xFF ; 255 149c8: 7f ef ldi r23, 0xFF ; 255 149ca: 18 16 cp r1, r24 149cc: 24 f4 brge .+8 ; 0x149d6 149ce: c7 01 movw r24, r14 149d0: b6 01 movw r22, r12 149d2: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 149d6: 70 93 3c 02 sts 0x023C, r23 ; 0x80023c 149da: 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); 149de: 80 91 71 02 lds r24, 0x0271 ; 0x800271 149e2: 8f 93 push r24 149e4: 80 91 70 02 lds r24, 0x0270 ; 0x800270 149e8: 8f 93 push r24 149ea: 80 91 73 02 lds r24, 0x0273 ; 0x800273 149ee: 8f 93 push r24 149f0: 80 91 72 02 lds r24, 0x0272 ; 0x800272 149f4: 8f 93 push r24 149f6: 80 91 6f 02 lds r24, 0x026F ; 0x80026f 149fa: 28 2f mov r18, r24 149fc: 08 2e mov r0, r24 149fe: 00 0c add r0, r0 14a00: 33 0b sbc r19, r19 14a02: 3f 93 push r19 14a04: 8f 93 push r24 14a06: 8a e7 ldi r24, 0x7A ; 122 14a08: 96 e6 ldi r25, 0x66 ; 102 14a0a: 9f 93 push r25 14a0c: 8f 93 push r24 14a0e: 01 e8 ldi r16, 0x81 ; 129 14a10: 16 e6 ldi r17, 0x66 ; 102 14a12: 1f 93 push r17 14a14: 0f 93 push r16 14a16: 0f 94 00 a3 call 0x34600 ; 0x34600 printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 14a1a: 80 91 3c 02 lds r24, 0x023C ; 0x80023c 14a1e: 8f 93 push r24 14a20: 80 91 3b 02 lds r24, 0x023B ; 0x80023b 14a24: 8f 93 push r24 14a26: 80 91 3e 02 lds r24, 0x023E ; 0x80023e 14a2a: 8f 93 push r24 14a2c: 80 91 3d 02 lds r24, 0x023D ; 0x80023d 14a30: 8f 93 push r24 14a32: 80 91 3f 02 lds r24, 0x023F ; 0x80023f 14a36: 28 2f mov r18, r24 14a38: 08 2e mov r0, r24 14a3a: 00 0c add r0, r0 14a3c: 33 0b sbc r19, r19 14a3e: 3f 93 push r19 14a40: 8f 93 push r24 14a42: 83 e7 ldi r24, 0x73 ; 115 14a44: 96 e6 ldi r25, 0x66 ; 102 14a46: 9f 93 push r25 14a48: 8f 93 push r24 14a4a: 1f 93 push r17 14a4c: 0f 93 push r16 14a4e: 0f 94 00 a3 call 0x34600 ; 0x34600 14a52: 0f b6 in r0, 0x3f ; 63 14a54: f8 94 cli 14a56: de bf out 0x3e, r29 ; 62 14a58: 0f be out 0x3f, r0 ; 63 14a5a: cd bf out 0x3d, r28 ; 61 14a5c: 16 cd rjmp .-1492 ; 0x1448a /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 14a5e: 0e 94 b4 e8 call 0x1d168 ; 0x1d168 14a62: 88 23 and r24, r24 14a64: 09 f4 brne .+2 ; 0x14a68 14a66: 11 cd rjmp .-1502 ; 0x1448a 14a68: d0 ce rjmp .-608 ; 0x1480a } else return false; } bool Stopwatch::pause() { if (isRunning()) { 14a6a: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 14a6e: 81 30 cpi r24, 0x01 ; 1 14a70: 09 f0 breq .+2 ; 0x14a74 14a72: 0b cd rjmp .-1514 ; 0x1448a state = PAUSED; 14a74: 82 e0 ldi r24, 0x02 ; 2 14a76: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b stopTimestamp = _millis(); 14a7a: 0f 94 01 0b call 0x21602 ; 0x21602 14a7e: 60 93 0b 06 sts 0x060B, r22 ; 0x80060b 14a82: 70 93 0c 06 sts 0x060C, r23 ; 0x80060c 14a86: 80 93 0d 06 sts 0x060D, r24 ; 0x80060d 14a8a: 90 93 0e 06 sts 0x060E, r25 ; 0x80060e 14a8e: fd cc rjmp .-1542 ; 0x1448a /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 14a90: 0f 94 a9 16 call 0x22d52 ; 0x22d52 save_statistics(); 14a94: 0e 94 0b 65 call 0xca16 ; 0xca16 14a98: f8 cc rjmp .-1552 ; 0x1448a void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 14a9a: 8c e8 ldi r24, 0x8C ; 140 14a9c: 93 e0 ldi r25, 0x03 ; 3 14a9e: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 14aa2: 83 e5 ldi r24, 0x53 ; 83 14aa4: 0e 94 80 56 call 0xad00 ; 0xad00 14aa8: 88 23 and r24, r24 14aaa: 09 f1 breq .+66 ; 0x14aee , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 14aac: 62 e2 ldi r22, 0x22 ; 34 14aae: 70 e0 ldi r23, 0x00 ; 0 14ab0: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 14ab4: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 14ab8: 0f 94 95 aa call 0x3552a ; 0x3552a 14abc: 8c 01 movw r16, r24 if (!this->ptr) { 14abe: 89 2b or r24, r25 14ac0: b1 f0 breq .+44 ; 0x14aee // First quote not found return; } // Skip the leading quote this->ptr++; 14ac2: 0f 5f subi r16, 0xFF ; 255 14ac4: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 14ac6: 62 e2 ldi r22, 0x22 ; 34 14ac8: 70 e0 ldi r23, 0x00 ; 0 14aca: c8 01 movw r24, r16 14acc: 0f 94 95 aa call 0x3552a ; 0x3552a if(!pStrEnd) { 14ad0: 89 2b or r24, r25 14ad2: 69 f0 breq .+26 ; 0x14aee char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 14ad4: e5 e0 ldi r30, 0x05 ; 5 14ad6: f6 e0 ldi r31, 0x06 ; 6 14ad8: 83 e0 ldi r24, 0x03 ; 3 14ada: df 01 movw r26, r30 14adc: 1d 92 st X+, r1 14ade: 8a 95 dec r24 14ae0: e9 f7 brne .-6 ; 0x14adc static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 14ae2: 42 e0 ldi r20, 0x02 ; 2 14ae4: 50 e0 ldi r21, 0x00 ; 0 14ae6: b8 01 movw r22, r16 14ae8: cf 01 movw r24, r30 14aea: 0f 94 be aa call 0x3557c ; 0x3557c } #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 14aee: 8c e8 ldi r24, 0x8C ; 140 14af0: 9f e0 ldi r25, 0x0F ; 15 14af2: 0f 94 3e a4 call 0x3487c ; 0x3487c && printer_recovering() && printingIsPaused()) { 14af6: 81 30 cpi r24, 0x01 ; 1 14af8: 09 f0 breq .+2 ; 0x14afc 14afa: c7 cc rjmp .-1650 ; 0x1448a #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() 14afc: 0e 94 86 66 call 0xcd0c ; 0xcd0c 14b00: 88 23 and r24, r24 14b02: 09 f4 brne .+2 ; 0x14b06 14b04: c2 cc rjmp .-1660 ; 0x1448a && printingIsPaused()) { 14b06: 0e 94 90 66 call 0xcd20 ; 0xcd20 14b0a: 88 23 and r24, r24 14b0c: 09 f4 brne .+2 ; 0x14b10 14b0e: bd cc rjmp .-1670 ; 0x1448a // 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); 14b10: 86 e5 ldi r24, 0x56 ; 86 14b12: 96 e6 ldi r25, 0x66 ; 102 14b14: 0e 94 18 7d call 0xfa30 ; 0xfa30 14b18: b8 cc rjmp .-1680 ; 0x1448a /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 14b1a: 89 e3 ldi r24, 0x39 ; 57 14b1c: 96 e6 ldi r25, 0x66 ; 102 14b1e: 0e 94 7e 83 call 0x106fc ; 0x106fc #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 14b22: 83 e5 ldi r24, 0x53 ; 83 14b24: 0e 94 80 56 call 0xad00 ; 0xad00 14b28: 88 23 and r24, r24 14b2a: 09 f4 brne .+2 ; 0x14b2e 14b2c: ae cc rjmp .-1700 ; 0x1448a 14b2e: 0e 94 10 5b call 0xb620 ; 0xb620 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 14b32: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 14b36: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 14b3a: 60 93 59 12 sts 0x1259, r22 ; 0x801259 14b3e: a5 cc rjmp .-1718 ; 0x1448a 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 "); 14b40: 81 ed ldi r24, 0xD1 ; 209 14b42: 90 e8 ldi r25, 0x80 ; 128 14b44: 0e 94 1f 7b call 0xf63e ; 0xf63e gcode_M105(); 14b48: 0e 94 91 7c call 0xf922 ; 0xf922 cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 14b4c: 0e 94 9e 79 call 0xf33c ; 0xf33c cmdbuffer_front_already_processed = true; 14b50: 81 e0 ldi r24, 0x01 ; 1 14b52: 80 93 53 12 sts 0x1253, r24 ; 0x801253 14b56: 99 cc rjmp .-1742 ; 0x1448a bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 14b58: 83 e5 ldi r24, 0x53 ; 83 14b5a: 0e 94 80 56 call 0xad00 ; 0xad00 14b5e: 88 23 and r24, r24 14b60: 51 f0 breq .+20 ; 0x14b76 autoReportFeatures.SetPeriod( code_value_uint8() ); 14b62: 0e 94 95 56 call 0xad2a ; 0xad2a 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; 14b66: 80 93 cf 13 sts 0x13CF, r24 ; 0x8013cf if (auto_report_period != 0){ 14b6a: 88 23 and r24, r24 14b6c: 71 f0 breq .+28 ; 0x14b8a auto_report_timer.start(); 14b6e: 80 ed ldi r24, 0xD0 ; 208 14b70: 93 e1 ldi r25, 0x13 ; 19 14b72: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 14b76: 83 e4 ldi r24, 0x43 ; 67 14b78: 0e 94 80 56 call 0xad00 ; 0xad00 14b7c: 88 23 and r24, r24 14b7e: 41 f0 breq .+16 ; 0x14b90 autoReportFeatures.SetMask(code_value_uint8()); 14b80: 0e 94 95 56 call 0xad2a ; 0xad2a 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; } 14b84: 80 93 ce 13 sts 0x13CE, r24 ; 0x8013ce 14b88: 80 cc rjmp .-1792 ; 0x1448a 14b8a: 10 92 d0 13 sts 0x13D0, r1 ; 0x8013d0 14b8e: f3 cf rjmp .-26 ; 0x14b76 14b90: 81 e0 ldi r24, 0x01 ; 1 14b92: 80 93 ce 13 sts 0x13CE, r24 ; 0x8013ce 14b96: 79 cc rjmp .-1806 ; 0x1448a 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)); 14b98: 87 e3 ldi r24, 0x37 ; 55 14b9a: 97 e5 ldi r25, 0x57 ; 87 14b9c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 14ba0: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe heating_status = HeatingStatus::EXTRUDER_HEATING; 14ba4: 81 e0 ldi r24, 0x01 ; 1 14ba6: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb prusa_statistics(1); 14baa: 0f 94 a0 2f call 0x25f40 ; 0x25f40 #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 14bae: 83 e5 ldi r24, 0x53 ; 83 14bb0: 0e 94 80 56 call 0xad00 ; 0xad00 14bb4: 88 23 and r24, r24 14bb6: 49 f0 breq .+18 ; 0x14bca setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 14bb8: 0e 94 10 5b call 0xb620 ; 0xb620 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 14bbc: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 14bc0: 70 93 5e 12 sts 0x125E, r23 ; 0x80125e 14bc4: 60 93 5d 12 sts 0x125D, r22 ; 0x80125d 14bc8: 05 c0 rjmp .+10 ; 0x14bd4 #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 14bca: 82 e5 ldi r24, 0x52 ; 82 14bcc: 0e 94 80 56 call 0xad00 ; 0xad00 14bd0: 81 11 cpse r24, r1 14bd2: f2 cf rjmp .-28 ; 0x14bb8 autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 14bd4: 0f 94 01 0b call 0x21602 ; 0x21602 14bd8: 6b 01 movw r12, r22 14bda: 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]; 14bdc: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 14be0: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 14be4: 07 2e mov r0, r23 14be6: 00 0c add r0, r0 14be8: 88 0b sbc r24, r24 14bea: 99 0b sbc r25, r25 14bec: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 14bf0: 11 e0 ldi r17, 0x01 ; 1 14bf2: 20 91 5a 0d lds r18, 0x0D5A ; 0x800d5a 14bf6: 30 91 5b 0d lds r19, 0x0D5B ; 0x800d5b 14bfa: 40 91 5c 0d lds r20, 0x0D5C ; 0x800d5c 14bfe: 50 91 5d 0d lds r21, 0x0D5D ; 0x800d5d 14c02: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 14c06: 18 16 cp r1, r24 14c08: 0c f0 brlt .+2 ; 0x14c0c 14c0a: 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 14c0c: 10 93 59 0d sts 0x0D59, r17 ; 0x800d59 <_ZL16target_direction.lto_priv.488> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 14c10: c7 01 movw r24, r14 14c12: b6 01 movw r22, r12 14c14: 0f 94 e0 73 call 0x2e7c0 ; 0x2e7c0 LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 14c18: 87 e2 ldi r24, 0x27 ; 39 14c1a: 97 e5 ldi r25, 0x57 ; 87 14c1c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 14c20: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 14c24: 82 e0 ldi r24, 0x02 ; 2 14c26: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb prusa_statistics(2); 14c2a: 0f 94 a0 2f call 0x25f40 ; 0x25f40 previous_millis_cmd.start(); 14c2e: 88 e4 ldi r24, 0x48 ; 72 14c30: 93 e0 ldi r25, 0x03 ; 3 14c32: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> 14c36: 29 cc rjmp .-1966 ; 0x1448a */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 14c38: 89 e1 ldi r24, 0x19 ; 25 14c3a: 97 e5 ldi r25, 0x57 ; 87 14c3c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 14c40: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe heating_status = HeatingStatus::BED_HEATING; 14c44: 83 e0 ldi r24, 0x03 ; 3 14c46: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb prusa_statistics(1); 14c4a: 81 e0 ldi r24, 0x01 ; 1 14c4c: 0f 94 a0 2f call 0x25f40 ; 0x25f40 if (code_seen('S')) 14c50: 83 e5 ldi r24, 0x53 ; 83 14c52: 0e 94 80 56 call 0xad00 ; 0xad00 14c56: 18 2f mov r17, r24 14c58: 88 23 and r24, r24 14c5a: 49 f0 breq .+18 ; 0x14c6e setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 14c5c: 0e 94 10 5b call 0xb620 ; 0xb620 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 14c60: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 14c64: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 14c68: 60 93 59 12 sts 0x1259, r22 ; 0x801259 14c6c: 05 c0 rjmp .+10 ; 0x14c78 if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 14c6e: 82 e5 ldi r24, 0x52 ; 82 14c70: 0e 94 80 56 call 0xad00 ; 0xad00 14c74: 81 11 cpse r24, r1 14c76: f2 cf rjmp .-28 ; 0x14c5c { setTargetBed(code_value()); } codenum = _millis(); 14c78: 0f 94 01 0b call 0x21602 ; 0x21602 14c7c: 6b 01 movw r12, r22 14c7e: 7c 01 movw r14, r24 cancel_heatup = false; 14c80: 10 92 5f 0d sts 0x0D5F, r1 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.390> 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; 14c84: 60 91 59 12 lds r22, 0x1259 ; 0x801259 14c88: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 14c8c: 07 2e mov r0, r23 14c8e: 00 0c add r0, r0 14c90: 88 0b sbc r24, r24 14c92: 99 0b sbc r25, r25 14c94: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 14c98: 01 e0 ldi r16, 0x01 ; 1 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: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 14cae: 18 16 cp r1, r24 14cb0: 0c f0 brlt .+2 ; 0x14cb4 14cb2: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 14cb4: 00 93 59 0d sts 0x0D59, r16 ; 0x800d59 <_ZL16target_direction.lto_priv.488> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 14cb8: 80 91 5f 0d lds r24, 0x0D5F ; 0x800d5f <_ZL13cancel_heatup.lto_priv.390> 14cbc: 81 11 cpse r24, r1 14cbe: 1a c0 rjmp .+52 ; 0x14cf4 14cc0: 60 91 59 12 lds r22, 0x1259 ; 0x801259 14cc4: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 14cc8: 07 2e mov r0, r23 14cca: 00 0c add r0, r0 14ccc: 88 0b sbc r24, r24 14cce: 99 0b sbc r25, r25 14cd0: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 14cd4: 20 91 bc 03 lds r18, 0x03BC ; 0x8003bc 14cd8: 30 91 bd 03 lds r19, 0x03BD ; 0x8003bd 14cdc: 40 91 be 03 lds r20, 0x03BE ; 0x8003be 14ce0: 50 91 bf 03 lds r21, 0x03BF ; 0x8003bf 14ce4: e0 91 59 0d lds r30, 0x0D59 ; 0x800d59 <_ZL16target_direction.lto_priv.488> 14ce8: ee 23 and r30, r30 14cea: 91 f0 breq .+36 ; 0x14d10 14cec: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 14cf0: 18 16 cp r1, r24 14cf2: a4 f0 brlt .+40 ; 0x14d1c } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 14cf4: 8e e0 ldi r24, 0x0E ; 14 14cf6: 97 e5 ldi r25, 0x57 ; 87 14cf8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 14cfc: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe heating_status = HeatingStatus::BED_HEATING_COMPLETE; 14d00: 84 e0 ldi r24, 0x04 ; 4 14d02: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb previous_millis_cmd.start(); 14d06: 88 e4 ldi r24, 0x48 ; 72 14d08: 93 e0 ldi r25, 0x03 ; 3 14d0a: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> 14d0e: bd cb rjmp .-2182 ; 0x1448a codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 14d10: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 14d14: 87 ff sbrs r24, 7 14d16: ee cf rjmp .-36 ; 0x14cf4 14d18: 11 11 cpse r17, r1 14d1a: ec cf rjmp .-40 ; 0x14cf4 { if (lcd_commands_type == LcdCommands::LongPause) { 14d1c: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 14d20: 82 30 cpi r24, 0x02 ; 2 14d22: 41 f3 breq .-48 ; 0x14cf4 // 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. 14d24: 0f 94 01 0b call 0x21602 ; 0x21602 14d28: 6c 19 sub r22, r12 14d2a: 7d 09 sbc r23, r13 14d2c: 8e 09 sbc r24, r14 14d2e: 9f 09 sbc r25, r15 14d30: 69 3e cpi r22, 0xE9 ; 233 14d32: 73 40 sbci r23, 0x03 ; 3 14d34: 81 05 cpc r24, r1 14d36: 91 05 cpc r25, r1 14d38: 50 f0 brcs .+20 ; 0x14d4e { if (!farm_mode) { 14d3a: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 14d3e: 81 11 cpse r24, r1 14d40: 02 c0 rjmp .+4 ; 0x14d46 serialecho_temperatures(); 14d42: 0e 94 2d 7b call 0xf65a ; 0xf65a } codenum = _millis(); 14d46: 0f 94 01 0b call 0x21602 ; 0x21602 14d4a: 6b 01 movw r12, r22 14d4c: 7c 01 movw r14, r24 } manage_heater(); 14d4e: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(); 14d52: 80 e0 ldi r24, 0x00 ; 0 14d54: 0e 94 b0 8a call 0x11560 ; 0x11560 lcd_update(0); 14d58: 80 e0 ldi r24, 0x00 ; 0 14d5a: 0e 94 54 6f call 0xdea8 ; 0xdea8 14d5e: ac cf rjmp .-168 ; 0x14cb8 #### 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')){ 14d60: 83 e5 ldi r24, 0x53 ; 83 14d62: 0e 94 80 56 call 0xad00 ; 0xad00 14d66: 88 23 and r24, r24 14d68: 29 f0 breq .+10 ; 0x14d74 fanSpeed = code_value_uint8(); 14d6a: 0e 94 95 56 call 0xad2a ; 0xad2a 14d6e: 80 93 55 12 sts 0x1255, r24 ; 0x801255 14d72: 8b cb rjmp .-2282 ; 0x1448a } else { fanSpeed = 255; 14d74: 8f ef ldi r24, 0xFF ; 255 14d76: 80 93 55 12 sts 0x1255, r24 ; 0x801255 14d7a: 87 cb rjmp .-2290 ; 0x1448a /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 14d7c: 10 92 55 12 sts 0x1255, r1 ; 0x801255 14d80: 84 cb rjmp .-2296 ; 0x1448a /*! ### 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; 14d82: 80 91 57 12 lds r24, 0x1257 ; 0x801257 14d86: 87 7f andi r24, 0xF7 ; 247 14d88: 80 93 57 12 sts 0x1257, r24 ; 0x801257 14d8c: 7e cb rjmp .-2308 ; 0x1448a ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 14d8e: 83 e5 ldi r24, 0x53 ; 83 14d90: 0e 94 80 56 call 0xad00 ; 0xad00 14d94: 88 23 and r24, r24 14d96: 99 f0 breq .+38 ; 0x14dbe stepper_inactive_time = code_value() * 1000; 14d98: 0e 94 10 5b call 0xb620 ; 0xb620 14d9c: 20 e0 ldi r18, 0x00 ; 0 14d9e: 30 e0 ldi r19, 0x00 ; 0 14da0: 4a e7 ldi r20, 0x7A ; 122 14da2: 54 e4 ldi r21, 0x44 ; 68 14da4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 14da8: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 14dac: 60 93 37 02 sts 0x0237, r22 ; 0x800237 14db0: 70 93 38 02 sts 0x0238, r23 ; 0x800238 14db4: 80 93 39 02 sts 0x0239, r24 ; 0x800239 14db8: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 14dbc: 66 cb rjmp .-2356 ; 0x1448a } 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]))); 14dbe: 88 e5 ldi r24, 0x58 ; 88 14dc0: 0e 94 80 56 call 0xad00 ; 0xad00 14dc4: 88 23 and r24, r24 14dc6: d1 f0 breq .+52 ; 0x14dfc disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 14dc8: 0f 94 5b 18 call 0x230b6 ; 0x230b6 if (code_seen('X')) disable_x(); 14dcc: 88 e5 ldi r24, 0x58 ; 88 14dce: 0e 94 80 56 call 0xad00 ; 0xad00 14dd2: 81 11 cpse r24, r1 14dd4: 28 c0 rjmp .+80 ; 0x14e26 if (code_seen('Y')) disable_y(); 14dd6: 89 e5 ldi r24, 0x59 ; 89 14dd8: 0e 94 80 56 call 0xad00 ; 0xad00 14ddc: 88 23 and r24, r24 14dde: 19 f0 breq .+6 ; 0x14de6 14de0: 16 9a sbi 0x02, 6 ; 2 14de2: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a if (code_seen('Z')) disable_z(); 14de6: 8a e5 ldi r24, 0x5A ; 90 14de8: 0e 94 80 56 call 0xad00 ; 0xad00 #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 14dec: 85 e4 ldi r24, 0x45 ; 69 14dee: 0e 94 80 56 call 0xad00 ; 0xad00 14df2: 88 23 and r24, r24 14df4: 09 f4 brne .+2 ; 0x14df8 14df6: 49 cb rjmp .-2414 ; 0x1448a 14df8: 14 9a sbi 0x02, 4 ; 2 14dfa: 47 cb rjmp .-2418 ; 0x1448a 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]))); 14dfc: 89 e5 ldi r24, 0x59 ; 89 14dfe: 0e 94 80 56 call 0xad00 ; 0xad00 14e02: 81 11 cpse r24, r1 14e04: e1 cf rjmp .-62 ; 0x14dc8 14e06: 8a e5 ldi r24, 0x5A ; 90 14e08: 0e 94 80 56 call 0xad00 ; 0xad00 14e0c: 81 11 cpse r24, r1 14e0e: dc cf rjmp .-72 ; 0x14dc8 14e10: 85 e4 ldi r24, 0x45 ; 69 14e12: 0e 94 80 56 call 0xad00 ; 0xad00 14e16: 81 11 cpse r24, r1 14e18: d7 cf rjmp .-82 ; 0x14dc8 if(all_axis) { st_synchronize(); 14e1a: 0f 94 5b 18 call 0x230b6 ; 0x230b6 disable_e0(); 14e1e: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 14e20: 0e 94 d8 84 call 0x109b0 ; 0x109b0 14e24: 32 cb rjmp .-2460 ; 0x1448a } else { st_synchronize(); if (code_seen('X')) disable_x(); 14e26: 17 9a sbi 0x02, 7 ; 2 14e28: 10 92 39 06 sts 0x0639, r1 ; 0x800639 14e2c: d4 cf rjmp .-88 ; 0x14dd6 #### 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')) { 14e2e: 83 e5 ldi r24, 0x53 ; 83 14e30: 0e 94 80 56 call 0xad00 ; 0xad00 14e34: 88 23 and r24, r24 14e36: 09 f4 brne .+2 ; 0x14e3a 14e38: 28 cb rjmp .-2480 ; 0x1448a max_inactive_time = code_value() * 1000; 14e3a: 0e 94 10 5b call 0xb620 ; 0xb620 14e3e: 20 e0 ldi r18, 0x00 ; 0 14e40: 30 e0 ldi r19, 0x00 ; 0 14e42: 4a e7 ldi r20, 0x7A ; 122 14e44: 54 e4 ldi r21, 0x44 ; 68 14e46: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 14e4a: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 14e4e: 60 93 44 03 sts 0x0344, r22 ; 0x800344 14e52: 70 93 45 03 sts 0x0345, r23 ; 0x800345 14e56: 80 93 46 03 sts 0x0346, r24 ; 0x800346 14e5a: 90 93 47 03 sts 0x0347, r25 ; 0x800347 14e5e: 15 cb rjmp .-2518 ; 0x1448a 14e60: 34 ec ldi r19, 0xC4 ; 196 14e62: 83 2e mov r8, r19 14e64: 32 e0 ldi r19, 0x02 ; 2 14e66: 93 2e mov r9, r19 14e68: 47 e6 ldi r20, 0x67 ; 103 14e6a: a4 2e mov r10, r20 14e6c: 4d e0 ldi r20, 0x0D ; 13 14e6e: 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++) 14e70: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 14e72: f4 01 movw r30, r8 14e74: 81 91 ld r24, Z+ 14e76: 4f 01 movw r8, r30 14e78: 0e 94 80 56 call 0xad00 ; 0xad00 14e7c: 88 23 and r24, r24 14e7e: 09 f4 brne .+2 ; 0x14e82 14e80: 67 c0 rjmp .+206 ; 0x14f50 { float value = code_value(); 14e82: 0e 94 10 5b call 0xb620 ; 0xb620 14e86: 6b 01 movw r12, r22 14e88: 7c 01 movw r14, r24 if(i == E_AXIS) { // E 14e8a: 13 30 cpi r17, 0x03 ; 3 14e8c: 09 f0 breq .+2 ; 0x14e90 14e8e: 6a c0 rjmp .+212 ; 0x14f64 if(value < 20.0) { 14e90: 20 e0 ldi r18, 0x00 ; 0 14e92: 30 e0 ldi r19, 0x00 ; 0 14e94: 40 ea ldi r20, 0xA0 ; 160 14e96: 51 e4 ldi r21, 0x41 ; 65 14e98: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 14e9c: 87 ff sbrs r24, 7 14e9e: 4e c0 rjmp .+156 ; 0x14f3c const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 14ea0: a7 01 movw r20, r14 14ea2: 96 01 movw r18, r12 14ea4: 60 91 77 0d lds r22, 0x0D77 ; 0x800d77 14ea8: 70 91 78 0d lds r23, 0x0D78 ; 0x800d78 14eac: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 14eb0: 90 91 7a 0d lds r25, 0x0D7A ; 0x800d7a 14eb4: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 14eb8: 2b 01 movw r4, r22 14eba: 3c 01 movw r6, r24 cs.max_jerk[E_AXIS] *= factor; 14ebc: ac 01 movw r20, r24 14ebe: 9b 01 movw r18, r22 14ec0: 60 91 bb 0d lds r22, 0x0DBB ; 0x800dbb 14ec4: 70 91 bc 0d lds r23, 0x0DBC ; 0x800dbc 14ec8: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 14ecc: 90 91 be 0d lds r25, 0x0DBE ; 0x800dbe 14ed0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 14ed4: 60 93 bb 0d sts 0x0DBB, r22 ; 0x800dbb 14ed8: 70 93 bc 0d sts 0x0DBC, r23 ; 0x800dbc 14edc: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd 14ee0: 90 93 be 0d sts 0x0DBE, r25 ; 0x800dbe max_feedrate[E_AXIS] *= factor; 14ee4: a3 01 movw r20, r6 14ee6: 92 01 movw r18, r4 14ee8: 60 91 87 0d lds r22, 0x0D87 ; 0x800d87 14eec: 70 91 88 0d lds r23, 0x0D88 ; 0x800d88 14ef0: 80 91 89 0d lds r24, 0x0D89 ; 0x800d89 14ef4: 90 91 8a 0d lds r25, 0x0D8A ; 0x800d8a 14ef8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 14efc: 60 93 87 0d sts 0x0D87, r22 ; 0x800d87 14f00: 70 93 88 0d sts 0x0D88, r23 ; 0x800d88 14f04: 80 93 89 0d sts 0x0D89, r24 ; 0x800d89 14f08: 90 93 8a 0d sts 0x0D8A, r25 ; 0x800d8a max_acceleration_steps_per_s2[E_AXIS] *= factor; 14f0c: 60 91 b7 04 lds r22, 0x04B7 ; 0x8004b7 14f10: 70 91 b8 04 lds r23, 0x04B8 ; 0x8004b8 14f14: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 14f18: 90 91 ba 04 lds r25, 0x04BA ; 0x8004ba 14f1c: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 14f20: a3 01 movw r20, r6 14f22: 92 01 movw r18, r4 14f24: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 14f28: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 14f2c: 60 93 b7 04 sts 0x04B7, r22 ; 0x8004b7 14f30: 70 93 b8 04 sts 0x04B8, r23 ; 0x8004b8 14f34: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 14f38: 90 93 ba 04 sts 0x04BA, r25 ; 0x8004ba } cs.axis_steps_per_mm[E_AXIS] = value; 14f3c: c0 92 77 0d sts 0x0D77, r12 ; 0x800d77 14f40: d0 92 78 0d sts 0x0D78, r13 ; 0x800d78 14f44: e0 92 79 0d sts 0x0D79, r14 ; 0x800d79 14f48: f0 92 7a 0d sts 0x0D7A, r15 ; 0x800d7a #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.init(); 14f4c: 0f 94 24 6d call 0x2da48 ; 0x2da48 14f50: b4 e0 ldi r27, 0x04 ; 4 14f52: ab 0e add r10, r27 14f54: b1 1c adc r11, r1 14f56: 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++) 14f58: 14 30 cpi r17, 0x04 ; 4 14f5a: 09 f0 breq .+2 ; 0x14f5e 14f5c: 8a cf rjmp .-236 ; 0x14e72 } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 14f5e: 0f 94 cd 39 call 0x2739a ; 0x2739a 14f62: 93 ca rjmp .-2778 ; 0x1448a 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; 14f64: d5 01 movw r26, r10 14f66: 14 96 adiw r26, 0x04 ; 4 14f68: cd 92 st X+, r12 14f6a: dd 92 st X+, r13 14f6c: ed 92 st X+, r14 14f6e: fc 92 st X, r15 14f70: 17 97 sbiw r26, 0x07 ; 7 14f72: ee cf rjmp .-36 ; 0x14f50 #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 14f74: 83 e5 ldi r24, 0x53 ; 83 14f76: 0e 94 80 56 call 0xad00 ; 0xad00 14f7a: 88 23 and r24, r24 14f7c: 29 f0 breq .+10 ; 0x14f88 host_keepalive_interval = code_value_uint8(); 14f7e: 0e 94 95 56 call 0xad2a ; 0xad2a 14f82: 80 93 32 02 sts 0x0232, r24 ; 0x800232 14f86: 81 ca rjmp .-2814 ; 0x1448a } else { SERIAL_ECHO_START; 14f88: 84 ee ldi r24, 0xE4 ; 228 14f8a: 92 ea ldi r25, 0xA2 ; 162 14f8c: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 14f90: c0 90 32 02 lds r12, 0x0232 ; 0x800232 14f94: d1 2c mov r13, r1 14f96: f1 2c mov r15, r1 14f98: 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); } 14f9a: 8a ec ldi r24, 0xCA ; 202 14f9c: 90 e8 ldi r25, 0x80 ; 128 14f9e: 0e 94 1f 7b call 0xf63e ; 0xf63e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 14fa2: 4a e0 ldi r20, 0x0A ; 10 14fa4: c7 01 movw r24, r14 14fa6: b6 01 movw r22, r12 14fa8: 0e 94 20 7a call 0xf440 ; 0xf440 host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 14fac: 0e 94 17 7b call 0xf62e ; 0xf62e 14fb0: 6c ca rjmp .-2856 ; 0x1448a */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 14fb2: 85 e5 ldi r24, 0x55 ; 85 14fb4: 0e 94 80 56 call 0xad00 ; 0xad00 14fb8: 88 23 and r24, r24 14fba: 09 f4 brne .+2 ; 0x14fbe 14fbc: 5a c0 rjmp .+180 ; 0x15072 // 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); 14fbe: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 14fc2: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 14fc6: 0f 5f subi r16, 0xFF ; 255 14fc8: 1f 4f sbci r17, 0xFF ; 255 14fca: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 14fce: 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) 14fd2: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 14fd6: 88 23 and r24, r24 14fd8: 09 f4 brne .+2 ; 0x14fdc 14fda: 57 ca rjmp .-2898 ; 0x1448a // 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)) 14fdc: be 01 movw r22, r28 14fde: 6f 5f subi r22, 0xFF ; 255 14fe0: 7f 4f sbci r23, 0xFF ; 255 14fe2: c8 01 movw r24, r16 14fe4: 0e 94 86 d7 call 0x1af0c ; 0x1af0c 14fe8: 88 23 and r24, r24 14fea: 09 f4 brne .+2 ; 0x14fee 14fec: 4e ca rjmp .-2916 ; 0x1448a 14fee: 86 e1 ldi r24, 0x16 ; 22 14ff0: 98 e8 ldi r25, 0x88 ; 136 14ff2: de 01 movw r26, r28 14ff4: 11 96 adiw r26, 0x01 ; 1 14ff6: be 01 movw r22, r28 14ff8: 67 5f subi r22, 0xF7 ; 247 14ffa: 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]); 14ffc: fc 01 movw r30, r24 14ffe: 45 91 lpm r20, Z+ 15000: 54 91 lpm r21, Z if (ver_gcode[i] > v) 15002: 2d 91 ld r18, X+ 15004: 3d 91 ld r19, X+ 15006: 42 17 cp r20, r18 15008: 53 07 cpc r21, r19 1500a: 10 f4 brcc .+4 ; 0x15010 1500c: 0c 94 1c ba jmp 0x17438 ; 0x17438 return 1; else if (ver_gcode[i] < v) 15010: 24 17 cp r18, r20 15012: 35 07 cpc r19, r21 15014: 08 f4 brcc .+2 ; 0x15018 15016: 39 ca rjmp .-2958 ; 0x1448a 15018: 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) 1501a: a6 17 cp r26, r22 1501c: b7 07 cpc r27, r23 1501e: 71 f7 brne .-36 ; 0x14ffc 15020: 34 ca rjmp .-2968 ; 0x1448a 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)); 15022: 80 e6 ldi r24, 0x60 ; 96 15024: 99 e3 ldi r25, 0x39 ; 57 15026: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1502a: ac 01 movw r20, r24 1502c: 63 e0 ldi r22, 0x03 ; 3 1502e: 80 e0 ldi r24, 0x00 ; 0 15030: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 Sound_MakeCustom(50,1000,false); 15034: 40 e0 ldi r20, 0x00 ; 0 15036: 68 ee ldi r22, 0xE8 ; 232 15038: 73 e0 ldi r23, 0x03 ; 3 1503a: 82 e3 ldi r24, 0x32 ; 50 1503c: 90 e0 ldi r25, 0x00 ; 0 1503e: 0f 94 f3 24 call 0x249e6 ; 0x249e6 delay_keep_alive(500); 15042: 84 ef ldi r24, 0xF4 ; 244 15044: 91 e0 ldi r25, 0x01 ; 1 15046: 0e 94 0a 8d call 0x11a14 ; 0x11a14 Sound_MakeCustom(50,1000,false); 1504a: 40 e0 ldi r20, 0x00 ; 0 1504c: 68 ee ldi r22, 0xE8 ; 232 1504e: 73 e0 ldi r23, 0x03 ; 3 15050: 82 e3 ldi r24, 0x32 ; 50 15052: 90 e0 ldi r25, 0x00 ; 0 15054: 0f 94 f3 24 call 0x249e6 ; 0x249e6 lcd_wait_for_click_delay(30); 15058: 8e e1 ldi r24, 0x1E ; 30 1505a: 90 e0 ldi r25, 0x00 ; 0 1505c: 0e 94 ad dd call 0x1bb5a ; 0x1bb5a lcd_update_enable(true); 15060: 81 e0 ldi r24, 0x01 ; 1 15062: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_clear(); 15066: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_update(0); 1506a: 80 e0 ldi r24, 0x00 ; 0 1506c: 0e 94 54 6f call 0xdea8 ; 0xdea8 15070: 0c ca rjmp .-3048 ; 0x1448a } 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); 15072: 41 e1 ldi r20, 0x11 ; 17 15074: 50 e0 ldi r21, 0x00 ; 0 15076: 60 e8 ldi r22, 0x80 ; 128 15078: 7c e0 ldi r23, 0x0C ; 12 1507a: ce 01 movw r24, r28 1507c: 01 96 adiw r24, 0x01 ; 1 1507e: 0f 94 2e a4 call 0x3485c ; 0x3485c SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 15082: 8c ea ldi r24, 0xAC ; 172 15084: 90 e8 ldi r25, 0x80 ; 128 15086: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(FW_VERSION_STR_P()); 1508a: 8f ee ldi r24, 0xEF ; 239 1508c: 99 e8 ldi r25, 0x89 ; 137 1508e: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOPGM("+"); 15092: 8a ea ldi r24, 0xAA ; 170 15094: 90 e8 ldi r25, 0x80 ; 128 15096: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOPGM(STR(FW_COMMITNR)); 1509a: 85 ea ldi r24, 0xA5 ; 165 1509c: 90 e8 ldi r25, 0x80 ; 128 1509e: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOPGM("_"); 150a2: 83 ea ldi r24, 0xA3 ; 163 150a4: 90 e8 ldi r25, 0x80 ; 128 150a6: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOPGM(FW_COMMIT_HASH); 150aa: 89 e9 ldi r24, 0x99 ; 153 150ac: 90 e8 ldi r25, 0x80 ; 128 150ae: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 150b2: 8f e3 ldi r24, 0x3F ; 63 150b4: 90 e8 ldi r25, 0x80 ; 128 150b6: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOPGM(PROTOCOL_VERSION); 150ba: 8b e3 ldi r24, 0x3B ; 59 150bc: 90 e8 ldi r25, 0x80 ; 128 150be: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOPGM(" MACHINE_TYPE:"); 150c2: 8c e2 ldi r24, 0x2C ; 44 150c4: 90 e8 ldi r25, 0x80 ; 128 150c6: 0e 94 1f 7b call 0xf63e ; 0xf63e 150ca: ce 01 movw r24, r28 150cc: 01 96 adiw r24, 0x01 ; 1 150ce: 0e 94 11 86 call 0x10c22 ; 0x10c22 SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 150d2: 8a e1 ldi r24, 0x1A ; 26 150d4: 90 e8 ldi r25, 0x80 ; 128 150d6: 0e 94 1f 7b call 0xf63e ; 0xf63e #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 150da: 89 e1 ldi r24, 0x19 ; 25 150dc: 90 e8 ldi r25, 0x80 ; 128 150de: 0e 94 18 7d call 0xfa30 ; 0xfa30 } #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'); 150e2: 1f 92 push r1 150e4: 21 e3 ldi r18, 0x31 ; 49 150e6: f2 2e mov r15, r18 150e8: ff 92 push r15 150ea: 82 e8 ldi r24, 0x82 ; 130 150ec: 9e e7 ldi r25, 0x7E ; 126 150ee: 9f 93 push r25 150f0: 8f 93 push r24 150f2: 0b e3 ldi r16, 0x3B ; 59 150f4: 1e e7 ldi r17, 0x7E ; 126 150f6: 1f 93 push r17 150f8: 0f 93 push r16 150fa: 0f 94 00 a3 call 0x34600 ; 0x34600 150fe: 1f 92 push r1 15100: ff 92 push r15 15102: 82 e7 ldi r24, 0x72 ; 114 15104: 9e e7 ldi r25, 0x7E ; 126 15106: 9f 93 push r25 15108: 8f 93 push r24 1510a: 1f 93 push r17 1510c: 0f 93 push r16 1510e: 0f 94 00 a3 call 0x34600 ; 0x34600 15112: 1f 92 push r1 15114: ff 92 push r15 15116: 8e e5 ldi r24, 0x5E ; 94 15118: 9e e7 ldi r25, 0x7E ; 126 1511a: 9f 93 push r25 1511c: 8f 93 push r24 1511e: 1f 93 push r17 15120: 0f 93 push r16 15122: 0f 94 00 a3 call 0x34600 ; 0x34600 15126: 1f 92 push r1 15128: ff 92 push r15 1512a: 81 e5 ldi r24, 0x51 ; 81 1512c: 9e e7 ldi r25, 0x7E ; 126 1512e: 9f 93 push r25 15130: 8f 93 push r24 15132: 1f 93 push r17 15134: 0f 93 push r16 15136: 0f 94 00 a3 call 0x34600 ; 0x34600 1513a: 1f 92 push r1 1513c: ff 92 push r15 1513e: 86 e4 ldi r24, 0x46 ; 70 15140: 9e e7 ldi r25, 0x7E ; 126 15142: 9f 93 push r25 15144: 8f 93 push r24 15146: 1f 93 push r17 15148: 0f 93 push r16 1514a: 0f 94 00 a3 call 0x34600 ; 0x34600 1514e: 0f b6 in r0, 0x3f ; 63 15150: f8 94 cli 15152: de bf out 0x3e, r29 ; 62 15154: 0f be out 0x3f, r0 ; 63 15156: cd bf out 0x3d, r28 ; 61 15158: 98 c9 rjmp .-3280 ; 0x1448a /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 1515a: 0e 94 16 7c call 0xf82c ; 0xf82c 1515e: 95 c9 rjmp .-3286 ; 0x1448a /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 15160: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 15164: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 15168: cf 01 movw r24, r30 1516a: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 1516c: 24 81 ldd r18, Z+4 ; 0x04 1516e: 20 32 cpi r18, 0x20 ; 32 15170: 09 f4 brne .+2 ; 0x15174 15172: 01 96 adiw r24, 0x01 ; 1 15174: 0e 94 d3 dc call 0x1b9a6 ; 0x1b9a6 custom_message_type = CustomMsg::M117; 15178: 87 e0 ldi r24, 0x07 ; 7 1517a: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d 1517e: 85 c9 rjmp .-3318 ; 0x1448a - `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; 15180: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 15184: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 15188: 0b 5f subi r16, 0xFB ; 251 1518a: 1f 4f sbci r17, 0xFF ; 255 1518c: 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; 1518e: f1 2c mov r15, r1 15190: 40 e0 ldi r20, 0x00 ; 0 15192: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 15194: e9 f0 breq .+58 ; 0x151d0 // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 15196: d8 01 movw r26, r16 15198: 9c 91 ld r25, X 1519a: 29 2f mov r18, r25 1519c: 2b 7f andi r18, 0xFB ; 251 1519e: 21 34 cpi r18, 0x41 ; 65 151a0: b9 f4 brne .+46 ; 0x151d0 151a2: 11 96 adiw r26, 0x01 ; 1 151a4: 2c 91 ld r18, X 151a6: 21 33 cpi r18, 0x31 ; 49 151a8: 99 f4 brne .+38 ; 0x151d0 switch (p[0]) { 151aa: 91 34 cpi r25, 0x41 ; 65 151ac: 71 f0 breq .+28 ; 0x151ca 151ae: 95 34 cpi r25, 0x45 ; 69 151b0: 09 f4 brne .+2 ; 0x151b4 case 'A': hasA = true; break; case 'E': hasE = true; break; 151b2: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 151b4: 98 01 movw r18, r16 151b6: 2e 5f subi r18, 0xFE ; 254 151b8: 3f 4f sbci r19, 0xFF ; 255 151ba: 89 01 movw r16, r18 151bc: 2f 5f subi r18, 0xFF ; 255 151be: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 151c0: f8 01 movw r30, r16 151c2: 90 81 ld r25, Z 151c4: 90 32 cpi r25, 0x20 ; 32 151c6: c9 f3 breq .-14 ; 0x151ba 151c8: e4 cf rjmp .-56 ; 0x15192 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; 151ca: ff 24 eor r15, r15 151cc: f3 94 inc r15 151ce: f2 cf rjmp .-28 ; 0x151b4 } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 151d0: 44 23 and r20, r20 151d2: 21 f0 breq .+8 ; 0x151dc 151d4: 84 ee ldi r24, 0xE4 ; 228 151d6: 92 ea ldi r25, 0xA2 ; 162 151d8: 0e 94 1f 7b call 0xf63e ; 0xf63e if (hasA) SERIAL_ECHOPGM("//"); 151dc: ff 20 and r15, r15 151de: 21 f0 breq .+8 ; 0x151e8 151e0: 86 e1 ldi r24, 0x16 ; 22 151e2: 90 e8 ldi r25, 0x80 ; 128 151e4: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN(p); 151e8: c8 01 movw r24, r16 151ea: 0e 94 1d 86 call 0x10c3a ; 0x10c3a 151ee: 4d c9 rjmp .-3430 ; 0x1448a 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); 151f0: 89 e0 ldi r24, 0x09 ; 9 151f2: 96 e6 ldi r25, 0x66 ; 102 151f4: 0c 94 34 9e jmp 0x13c68 ; 0x13c68 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); 151f8: 89 e0 ldi r24, 0x09 ; 9 151fa: 96 e6 ldi r25, 0x66 ; 102 151fc: 0c 94 42 9e jmp 0x13c84 ; 0x13c84 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); 15200: 89 e0 ldi r24, 0x09 ; 9 15202: 96 e6 ldi r25, 0x66 ; 102 15204: 0c 94 50 9e jmp 0x13ca0 ; 0x13ca0 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); 15208: 89 e0 ldi r24, 0x09 ; 9 1520a: 96 e6 ldi r25, 0x66 ; 102 1520c: 0c 94 5e 9e jmp 0x13cbc ; 0x13cbc E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 15210: 0e 94 70 65 call 0xcae0 ; 0xcae0 15214: 3a c9 rjmp .-3468 ; 0x1448a */ 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')) { 15216: 84 e5 ldi r24, 0x54 ; 84 15218: 0e 94 80 56 call 0xad00 ; 0xad00 1521c: 88 23 and r24, r24 1521e: 69 f0 breq .+26 ; 0x1523a extruder = code_value_uint8(); 15220: 0e 94 95 56 call 0xad2a ; 0xad2a if(extruder >= EXTRUDERS) { 15224: 88 23 and r24, r24 15226: 49 f0 breq .+18 ; 0x1523a SERIAL_ECHO_START; 15228: 84 ee ldi r24, 0xE4 ; 228 1522a: 92 ea ldi r25, 0xA2 ; 162 1522c: 0e 94 1f 7b call 0xf63e ; 0xf63e 15230: 8a ed ldi r24, 0xDA ; 218 15232: 95 e6 ldi r25, 0x65 ; 101 15234: 0e 94 11 86 call 0x10c22 ; 0x10c22 15238: 28 c9 rjmp .-3504 ; 0x1448a SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 1523a: 84 e4 ldi r24, 0x44 ; 68 1523c: 0e 94 80 56 call 0xad00 ; 0xad00 15240: 88 23 and r24, r24 15242: 09 f4 brne .+2 ; 0x15246 15244: 22 c9 rjmp .-3516 ; 0x1448a float diameter = code_value(); 15246: 0e 94 10 5b call 0xb620 ; 0xb620 if (diameter == 0.0) { 1524a: 20 e0 ldi r18, 0x00 ; 0 1524c: 30 e0 ldi r19, 0x00 ; 0 1524e: a9 01 movw r20, r18 15250: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 15254: 81 11 cpse r24, r1 15256: 05 c0 rjmp .+10 ; 0x15262 // 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; 15258: 10 92 fe 0d sts 0x0DFE, r1 ; 0x800dfe } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 1525c: 0e 94 a5 64 call 0xc94a ; 0xc94a 15260: 14 c9 rjmp .-3544 ; 0x1448a // 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(); 15262: 0e 94 10 5b call 0xb620 ; 0xb620 15266: 6b 01 movw r12, r22 15268: 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]); 1526a: 20 e0 ldi r18, 0x00 ; 0 1526c: 30 e0 ldi r19, 0x00 ; 0 1526e: a9 01 movw r20, r18 15270: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 15274: 81 11 cpse r24, r1 15276: 06 c0 rjmp .+12 ; 0x15284 15278: c1 2c mov r12, r1 1527a: d1 2c mov r13, r1 1527c: 90 ee ldi r25, 0xE0 ; 224 1527e: e9 2e mov r14, r25 15280: 9f e3 ldi r25, 0x3F ; 63 15282: f9 2e mov r15, r25 15284: c0 92 ff 0d sts 0x0DFF, r12 ; 0x800dff 15288: d0 92 00 0e sts 0x0E00, r13 ; 0x800e00 1528c: e0 92 01 0e sts 0x0E01, r14 ; 0x800e01 15290: 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; 15294: 81 e0 ldi r24, 0x01 ; 1 15296: 80 93 fe 0d sts 0x0DFE, r24 ; 0x800dfe 1529a: e0 cf rjmp .-64 ; 0x1525c 1529c: 04 ec ldi r16, 0xC4 ; 196 1529e: 12 e0 ldi r17, 0x02 ; 2 152a0: f7 e6 ldi r31, 0x67 ; 103 152a2: ef 2e mov r14, r31 152a4: fd e0 ldi r31, 0x0D ; 13 152a6: ff 2e mov r15, r31 152a8: a8 ec ldi r26, 0xC8 ; 200 152aa: ca 2e mov r12, r26 152ac: a2 e0 ldi r26, 0x02 ; 2 152ae: 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])) 152b0: d8 01 movw r26, r16 152b2: 8d 91 ld r24, X+ 152b4: 8d 01 movw r16, r26 152b6: 0e 94 80 56 call 0xad00 ; 0xad00 152ba: 88 23 and r24, r24 152bc: 39 f0 breq .+14 ; 0x152cc { float val = code_value(); 152be: 0e 94 10 5b call 0xb620 ; 0xb620 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; 152c2: f7 01 movw r30, r14 152c4: 64 8b std Z+20, r22 ; 0x14 152c6: 75 8b std Z+21, r23 ; 0x15 152c8: 86 8b std Z+22, r24 ; 0x16 152ca: 97 8b std Z+23, r25 ; 0x17 152cc: f4 e0 ldi r31, 0x04 ; 4 152ce: ef 0e add r14, r31 152d0: 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++) 152d2: c0 16 cp r12, r16 152d4: d1 06 cpc r13, r17 152d6: 61 f7 brne .-40 ; 0x152b0 152d8: d8 c8 rjmp .-3664 ; 0x1448a - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 152da: 83 e5 ldi r24, 0x53 ; 83 152dc: 0e 94 80 56 call 0xad00 ; 0xad00 152e0: 88 23 and r24, r24 152e2: 19 f1 breq .+70 ; 0x1532a // 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(); 152e4: 0e 94 10 5b call 0xb620 ; 0xb620 152e8: 60 93 27 0e sts 0x0E27, r22 ; 0x800e27 152ec: 70 93 28 0e sts 0x0E28, r23 ; 0x800e28 152f0: 80 93 29 0e sts 0x0E29, r24 ; 0x800e29 152f4: 90 93 2a 0e sts 0x0E2A, r25 ; 0x800e2a 152f8: 60 93 9b 0d sts 0x0D9B, r22 ; 0x800d9b 152fc: 70 93 9c 0d sts 0x0D9C, r23 ; 0x800d9c 15300: 80 93 9d 0d sts 0x0D9D, r24 ; 0x800d9d 15304: 90 93 9e 0d sts 0x0D9E, r25 ; 0x800d9e // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 15308: 84 e5 ldi r24, 0x54 ; 84 1530a: 0e 94 80 56 call 0xad00 ; 0xad00 1530e: 88 23 and r24, r24 15310: 09 f4 brne .+2 ; 0x15314 15312: bb c8 rjmp .-3722 ; 0x1448a cs.retract_acceleration = code_value(); 15314: 0e 94 10 5b call 0xb620 ; 0xb620 15318: 60 93 9f 0d sts 0x0D9F, r22 ; 0x800d9f 1531c: 70 93 a0 0d sts 0x0DA0, r23 ; 0x800da0 15320: 80 93 a1 0d sts 0x0DA1, r24 ; 0x800da1 15324: 90 93 a2 0d sts 0x0DA2, r25 ; 0x800da2 15328: b0 c8 rjmp .-3744 ; 0x1448a } else { // New acceleration format, compatible with the upstream Marlin. if(code_seen('P')) 1532a: 80 e5 ldi r24, 0x50 ; 80 1532c: 0e 94 80 56 call 0xad00 ; 0xad00 15330: 88 23 and r24, r24 15332: 51 f0 breq .+20 ; 0x15348 cs.acceleration = code_value(); 15334: 0e 94 10 5b call 0xb620 ; 0xb620 15338: 60 93 9b 0d sts 0x0D9B, r22 ; 0x800d9b 1533c: 70 93 9c 0d sts 0x0D9C, r23 ; 0x800d9c 15340: 80 93 9d 0d sts 0x0D9D, r24 ; 0x800d9d 15344: 90 93 9e 0d sts 0x0D9E, r25 ; 0x800d9e if(code_seen('R')) 15348: 82 e5 ldi r24, 0x52 ; 82 1534a: 0e 94 80 56 call 0xad00 ; 0xad00 1534e: 88 23 and r24, r24 15350: 51 f0 breq .+20 ; 0x15366 cs.retract_acceleration = code_value(); 15352: 0e 94 10 5b call 0xb620 ; 0xb620 15356: 60 93 9f 0d sts 0x0D9F, r22 ; 0x800d9f 1535a: 70 93 a0 0d sts 0x0DA0, r23 ; 0x800da0 1535e: 80 93 a1 0d sts 0x0DA1, r24 ; 0x800da1 15362: 90 93 a2 0d sts 0x0DA2, r25 ; 0x800da2 if(code_seen('T')) 15366: 84 e5 ldi r24, 0x54 ; 84 15368: 0e 94 80 56 call 0xad00 ; 0xad00 1536c: 88 23 and r24, r24 1536e: 09 f4 brne .+2 ; 0x15372 15370: 8c c8 rjmp .-3816 ; 0x1448a cs.travel_acceleration = code_value(); 15372: 0e 94 10 5b call 0xb620 ; 0xb620 15376: 60 93 27 0e sts 0x0E27, r22 ; 0x800e27 1537a: 70 93 28 0e sts 0x0E28, r23 ; 0x800e28 1537e: 80 93 29 0e sts 0x0E29, r24 ; 0x800e29 15382: 90 93 2a 0e sts 0x0E2A, r25 ; 0x800e2a 15386: 81 c8 rjmp .-3838 ; 0x1448a 15388: 04 ec ldi r16, 0xC4 ; 196 1538a: 12 e0 ldi r17, 0x02 ; 2 1538c: ef eb ldi r30, 0xBF ; 191 1538e: ee 2e mov r14, r30 15390: ed e0 ldi r30, 0x0D ; 13 15392: 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(); 15394: d8 01 movw r26, r16 15396: 8d 91 ld r24, X+ 15398: 8d 01 movw r16, r26 1539a: 0e 94 80 56 call 0xad00 ; 0xad00 1539e: 88 23 and r24, r24 153a0: 39 f0 breq .+14 ; 0x153b0 153a2: 0e 94 10 5b call 0xb620 ; 0xb620 153a6: f7 01 movw r30, r14 153a8: 60 83 st Z, r22 153aa: 71 83 std Z+1, r23 ; 0x01 153ac: 82 83 std Z+2, r24 ; 0x02 153ae: 93 83 std Z+3, r25 ; 0x03 153b0: f4 e0 ldi r31, 0x04 ; 4 153b2: ef 0e add r14, r31 153b4: 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++) 153b6: 22 e0 ldi r18, 0x02 ; 2 153b8: 07 3c cpi r16, 0xC7 ; 199 153ba: 12 07 cpc r17, r18 153bc: 59 f7 brne .-42 ; 0x15394 153be: 65 c8 rjmp .-3894 ; 0x1448a - `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')) 153c0: 83 e5 ldi r24, 0x53 ; 83 153c2: 0e 94 80 56 call 0xad00 ; 0xad00 153c6: 88 23 and r24, r24 153c8: 51 f0 breq .+20 ; 0x153de { cs.retract_length = code_value() ; 153ca: 0e 94 10 5b call 0xb620 ; 0xb620 153ce: 60 93 ea 0d sts 0x0DEA, r22 ; 0x800dea 153d2: 70 93 eb 0d sts 0x0DEB, r23 ; 0x800deb 153d6: 80 93 ec 0d sts 0x0DEC, r24 ; 0x800dec 153da: 90 93 ed 0d sts 0x0DED, r25 ; 0x800ded } if(code_seen('F')) 153de: 86 e4 ldi r24, 0x46 ; 70 153e0: 0e 94 80 56 call 0xad00 ; 0xad00 153e4: 88 23 and r24, r24 153e6: 61 f0 breq .+24 ; 0x15400 { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 153e8: 0e 94 10 5b call 0xb620 ; 0xb620 153ec: 0e 94 a0 65 call 0xcb40 ; 0xcb40 153f0: 60 93 ee 0d sts 0x0DEE, r22 ; 0x800dee 153f4: 70 93 ef 0d sts 0x0DEF, r23 ; 0x800def 153f8: 80 93 f0 0d sts 0x0DF0, r24 ; 0x800df0 153fc: 90 93 f1 0d sts 0x0DF1, r25 ; 0x800df1 } if(code_seen('Z')) 15400: 8a e5 ldi r24, 0x5A ; 90 15402: 0e 94 80 56 call 0xad00 ; 0xad00 15406: 88 23 and r24, r24 15408: 09 f4 brne .+2 ; 0x1540c 1540a: 3f c8 rjmp .-3970 ; 0x1448a { cs.retract_zlift = code_value() ; 1540c: 0e 94 10 5b call 0xb620 ; 0xb620 15410: 60 93 f2 0d sts 0x0DF2, r22 ; 0x800df2 15414: 70 93 f3 0d sts 0x0DF3, r23 ; 0x800df3 15418: 80 93 f4 0d sts 0x0DF4, r24 ; 0x800df4 1541c: 90 93 f5 0d sts 0x0DF5, r25 ; 0x800df5 15420: 34 c8 rjmp .-3992 ; 0x1448a #### 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')) 15422: 83 e5 ldi r24, 0x53 ; 83 15424: 0e 94 80 56 call 0xad00 ; 0xad00 15428: 88 23 and r24, r24 1542a: 09 f4 brne .+2 ; 0x1542e 1542c: 2e c8 rjmp .-4004 ; 0x1448a { switch(code_value_uint8()) 1542e: 0e 94 95 56 call 0xad2a ; 0xad2a 15432: 88 23 and r24, r24 15434: b9 f0 breq .+46 ; 0x15464 15436: 81 30 cpi r24, 0x01 ; 1 15438: d1 f0 breq .+52 ; 0x1546e #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 1543a: 84 ee ldi r24, 0xE4 ; 228 1543c: 92 ea ldi r25, 0xA2 ; 162 1543e: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 15442: 87 ec ldi r24, 0xC7 ; 199 15444: 95 e6 ldi r25, 0x65 ; 101 15446: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 1544a: 80 91 38 12 lds r24, 0x1238 ; 0x801238 1544e: 90 91 39 12 lds r25, 0x1239 ; 0x801239 15452: 82 5b subi r24, 0xB2 ; 178 15454: 9f 4e sbci r25, 0xEF ; 239 15456: 0e 94 11 86 call 0x10c22 ; 0x10c22 SERIAL_ECHOLNPGM("\"(1)"); 1545a: 81 e1 ldi r24, 0x11 ; 17 1545c: 90 e8 ldi r25, 0x80 ; 128 1545e: 0e 94 18 7d call 0xfa30 ; 0xfa30 15462: 13 c8 rjmp .-4058 ; 0x1448a { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 15464: 10 92 e9 0d sts 0x0DE9, r1 ; 0x800de9 retracted[0]=false; 15468: 10 92 1b 06 sts 0x061B, r1 ; 0x80061b 1546c: 0e c8 rjmp .-4068 ; 0x1448a retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 1546e: 80 93 e9 0d sts 0x0DE9, r24 ; 0x800de9 retracted[0]=false; 15472: 10 92 1b 06 sts 0x061B, r1 ; 0x80061b 15476: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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; 1547a: 40 90 2b 0e lds r4, 0x0E2B ; 0x800e2b 1547e: 50 90 2c 0e lds r5, 0x0E2C ; 0x800e2c 15482: 60 90 2d 0e lds r6, 0x0E2D ; 0x800e2d 15486: 70 90 2e 0e lds r7, 0x0E2E ; 0x800e2e 1548a: 0c 94 81 9f jmp 0x13f02 ; 0x13f02 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 1548e: 80 90 2f 0e lds r8, 0x0E2F ; 0x800e2f 15492: 90 90 30 0e lds r9, 0x0E30 ; 0x800e30 15496: a0 90 31 0e lds r10, 0x0E31 ; 0x800e31 1549a: b0 90 32 0e lds r11, 0x0E32 ; 0x800e32 1549e: 0c 94 8c 9f jmp 0x13f18 ; 0x13f18 - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 154a2: 82 e4 ldi r24, 0x42 ; 66 154a4: 0e 94 80 56 call 0xad00 ; 0xad00 154a8: 18 2f mov r17, r24 154aa: 88 23 and r24, r24 154ac: 41 f0 breq .+16 ; 0x154be { saved_feedmultiply_mm = feedmultiply; 154ae: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 154b2: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 154b6: 90 93 31 02 sts 0x0231, r25 ; 0x800231 154ba: 80 93 30 02 sts 0x0230, r24 ; 0x800230 codesWereSeen = true; } if (code_seen('S')) 154be: 83 e5 ldi r24, 0x53 ; 83 154c0: 0e 94 80 56 call 0xad00 ; 0xad00 154c4: 08 2f mov r16, r24 154c6: 88 23 and r24, r24 154c8: 39 f0 breq .+14 ; 0x154d8 { feedmultiply = code_value_short(); 154ca: 0e 94 a2 56 call 0xad44 ; 0xad44 154ce: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 154d2: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e codesWereSeen = true; 154d6: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 154d8: 82 e5 ldi r24, 0x52 ; 82 154da: 0e 94 80 56 call 0xad00 ; 0xad00 154de: 88 23 and r24, r24 154e0: 51 f0 breq .+20 ; 0x154f6 { feedmultiply = saved_feedmultiply_mm; 154e2: 80 91 30 02 lds r24, 0x0230 ; 0x800230 154e6: 90 91 31 02 lds r25, 0x0231 ; 0x800231 154ea: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 154ee: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 154f2: 0c 94 45 a2 jmp 0x1448a ; 0x1448a codesWereSeen = true; } if (!codesWereSeen) 154f6: 11 11 cpse r17, r1 154f8: 0c 94 45 a2 jmp 0x1448a ; 0x1448a { printf_P(PSTR("%i%%\n"), feedmultiply); 154fc: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 15500: 8f 93 push r24 15502: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 15506: 8f 93 push r24 15508: 8b e0 ldi r24, 0x0B ; 11 1550a: 90 e8 ldi r25, 0x80 ; 128 1550c: 9f 93 push r25 1550e: 8f 93 push r24 15510: 0f 94 00 a3 call 0x34600 ; 0x34600 15514: 0f 90 pop r0 15516: 0f 90 pop r0 15518: 0f 90 pop r0 1551a: 0f 90 pop r0 1551c: 0c 94 45 a2 jmp 0x1448a ; 0x1448a #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 15520: 83 e5 ldi r24, 0x53 ; 83 15522: 0e 94 80 56 call 0xad00 ; 0xad00 15526: 88 23 and r24, r24 15528: 51 f0 breq .+20 ; 0x1553e { extrudemultiply = code_value_short(); 1552a: 0e 94 a2 56 call 0xad44 ; 0xad44 1552e: 90 93 76 02 sts 0x0276, r25 ; 0x800276 15532: 80 93 75 02 sts 0x0275, r24 ; 0x800275 calculate_extruder_multipliers(); 15536: 0e 94 a5 64 call 0xc94a ; 0xc94a 1553a: 0c 94 45 a2 jmp 0x1448a ; 0x1448a } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 1553e: 80 91 76 02 lds r24, 0x0276 ; 0x800276 15542: 8f 93 push r24 15544: 80 91 75 02 lds r24, 0x0275 ; 0x800275 15548: 8f 93 push r24 1554a: 85 e0 ldi r24, 0x05 ; 5 1554c: 90 e8 ldi r25, 0x80 ; 128 1554e: 9f 93 push r25 15550: 8f 93 push r24 15552: 0f 94 00 a3 call 0x34600 ; 0x34600 15556: 0f 90 pop r0 15558: 0f 90 pop r0 1555a: 0f 90 pop r0 1555c: 0f 90 pop r0 1555e: 0c 94 45 a2 jmp 0x1448a ; 0x1448a - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 15562: 80 e5 ldi r24, 0x50 ; 80 15564: 0e 94 80 56 call 0xad00 ; 0xad00 15568: 88 23 and r24, r24 1556a: 11 f4 brne .+4 ; 0x15570 1556c: 0c 94 45 a2 jmp 0x1448a ; 0x1448a int pin_number = code_value_short(); // pin number 15570: 0e 94 a2 56 call 0xad44 ; 0xad44 15574: 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 15576: 83 e5 ldi r24, 0x53 ; 83 15578: 0e 94 80 56 call 0xad00 ; 0xad00 */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 1557c: 0f ef ldi r16, 0xFF ; 255 1557e: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 15580: 88 23 and r24, r24 15582: 19 f0 breq .+6 ; 0x1558a 15584: 0e 94 a2 56 call 0xad44 ; 0xad44 15588: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 1558a: c8 01 movw r24, r16 1558c: 01 96 adiw r24, 0x01 ; 1 1558e: 03 97 sbiw r24, 0x03 ; 3 15590: 10 f0 brcs .+4 ; 0x15596 15592: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 15596: eb e0 ldi r30, 0x0B ; 11 15598: f1 e8 ldi r31, 0x81 ; 129 1559a: 27 e2 ldi r18, 0x27 ; 39 1559c: 31 e8 ldi r19, 0x81 ; 129 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)) 1559e: 84 91 lpm r24, Z 155a0: 08 2e mov r0, r24 155a2: 00 0c add r0, r0 155a4: 99 0b sbc r25, r25 155a6: e8 16 cp r14, r24 155a8: f9 06 cpc r15, r25 155aa: 11 f4 brne .+4 ; 0x155b0 155ac: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 155b0: 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++) 155b2: 2e 17 cp r18, r30 155b4: 3f 07 cpc r19, r31 155b6: 99 f7 brne .-26 ; 0x1559e pin_number = -1; break; } } if (pin_number > -1) 155b8: f7 fe sbrs r15, 7 155ba: 02 c0 rjmp .+4 ; 0x155c0 155bc: 0c 94 45 a2 jmp 0x1448a ; 0x1448a { int target = LOW; st_synchronize(); 155c0: 0f 94 5b 18 call 0x230b6 ; 0x230b6 pinMode(pin_number, INPUT); 155c4: de 2c mov r13, r14 155c6: 60 e0 ldi r22, 0x00 ; 0 155c8: 8e 2d mov r24, r14 155ca: 0e 94 28 d1 call 0x1a250 ; 0x1a250 switch(pin_state){ 155ce: 0f 3f cpi r16, 0xFF ; 255 155d0: 10 07 cpc r17, r16 155d2: b1 f0 breq .+44 ; 0x15600 155d4: 01 30 cpi r16, 0x01 ; 1 155d6: 11 05 cpc r17, r1 155d8: 11 f0 breq .+4 ; 0x155de } } if (pin_number > -1) { int target = LOW; 155da: 10 e0 ldi r17, 0x00 ; 0 155dc: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 155de: 8d 2d mov r24, r13 155e0: 0e 94 d1 d0 call 0x1a1a2 ; 0x1a1a2 155e4: 80 17 cp r24, r16 155e6: 91 07 cpc r25, r17 155e8: 11 f4 brne .+4 ; 0x155ee 155ea: 0c 94 45 a2 jmp 0x1448a ; 0x1448a manage_heater(); 155ee: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(); 155f2: 80 e0 ldi r24, 0x00 ; 0 155f4: 0e 94 b0 8a call 0x11560 ; 0x11560 lcd_update(0); 155f8: 80 e0 ldi r24, 0x00 ; 0 155fa: 0e 94 54 6f call 0xdea8 ; 0xdea8 155fe: ef cf rjmp .-34 ; 0x155de case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 15600: 8e 2d mov r24, r14 15602: 0e 94 d1 d0 call 0x1a1a2 ; 0x1a1a2 15606: 31 e0 ldi r19, 0x01 ; 1 15608: 20 e0 ldi r18, 0x00 ; 0 1560a: 89 2b or r24, r25 1560c: 09 f0 breq .+2 ; 0x15610 1560e: 30 e0 ldi r19, 0x00 ; 0 15610: 03 2f mov r16, r19 15612: 12 2f mov r17, r18 15614: e4 cf rjmp .-56 ; 0x155de case 300: // M300 { uint16_t beepP = code_seen('P') ? code_value() : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 15616: 70 e0 ldi r23, 0x00 ; 0 15618: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 1561a: 40 e0 ldi r20, 0x00 ; 0 1561c: c8 01 movw r24, r16 1561e: 0f 94 f3 24 call 0x249e6 ; 0x249e6 15622: 0c 94 45 a2 jmp 0x1448a ; 0x1448a - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 15626: 80 e5 ldi r24, 0x50 ; 80 15628: 0e 94 80 56 call 0xad00 ; 0xad00 1562c: 88 23 and r24, r24 1562e: 51 f0 breq .+20 ; 0x15644 15630: 0e 94 10 5b call 0xb620 ; 0xb620 15634: 60 93 cf 0d sts 0x0DCF, r22 ; 0x800dcf 15638: 70 93 d0 0d sts 0x0DD0, r23 ; 0x800dd0 1563c: 80 93 d1 0d sts 0x0DD1, r24 ; 0x800dd1 15640: 90 93 d2 0d sts 0x0DD2, r25 ; 0x800dd2 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 15644: 89 e4 ldi r24, 0x49 ; 73 15646: 0e 94 80 56 call 0xad00 ; 0xad00 1564a: 88 23 and r24, r24 1564c: 81 f0 breq .+32 ; 0x1566e 1564e: 0e 94 10 5b call 0xb620 ; 0xb620 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15652: 2c ea ldi r18, 0xAC ; 172 15654: 35 ec ldi r19, 0xC5 ; 197 15656: 47 e2 ldi r20, 0x27 ; 39 15658: 5e e3 ldi r21, 0x3E ; 62 1565a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1565e: 60 93 d3 0d sts 0x0DD3, r22 ; 0x800dd3 15662: 70 93 d4 0d sts 0x0DD4, r23 ; 0x800dd4 15666: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 1566a: 90 93 d6 0d sts 0x0DD6, r25 ; 0x800dd6 if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 1566e: 84 e4 ldi r24, 0x44 ; 68 15670: 0e 94 80 56 call 0xad00 ; 0xad00 15674: 88 23 and r24, r24 15676: 81 f0 breq .+32 ; 0x15698 15678: 0e 94 10 5b call 0xb620 ; 0xb620 } float unscalePID_i(float i) { return i/PID_dT; 1567c: 2c ea ldi r18, 0xAC ; 172 1567e: 35 ec ldi r19, 0xC5 ; 197 15680: 47 e2 ldi r20, 0x27 ; 39 15682: 5e e3 ldi r21, 0x3E ; 62 15684: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 15688: 60 93 d7 0d sts 0x0DD7, r22 ; 0x800dd7 1568c: 70 93 d8 0d sts 0x0DD8, r23 ; 0x800dd8 15690: 80 93 d9 0d sts 0x0DD9, r24 ; 0x800dd9 15694: 90 93 da 0d sts 0x0DDA, r25 ; 0x800dda updatePID(); 15698: 0f 94 1f 14 call 0x2283e ; 0x2283e SERIAL_PROTOCOLRPGM(MSG_OK); 1569c: 80 e9 ldi r24, 0x90 ; 144 1569e: 9a e6 ldi r25, 0x6A ; 106 156a0: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOLPGM(" p:"); 156a4: 81 e0 ldi r24, 0x01 ; 1 156a6: 90 e8 ldi r25, 0x80 ; 128 156a8: 0e 94 1f 7b call 0xf63e ; 0xf63e } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 156ac: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 156b0: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 156b4: 80 91 d1 0d lds r24, 0x0DD1 ; 0x800dd1 156b8: 90 91 d2 0d lds r25, 0x0DD2 ; 0x800dd2 156bc: 42 e0 ldi r20, 0x02 ; 2 156be: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 156c2: 8d ef ldi r24, 0xFD ; 253 156c4: 9f e7 ldi r25, 0x7F ; 127 156c6: 0e 94 1f 7b call 0xf63e ; 0xf63e 156ca: 2c ea ldi r18, 0xAC ; 172 156cc: 35 ec ldi r19, 0xC5 ; 197 156ce: 47 e2 ldi r20, 0x27 ; 39 156d0: 5e e3 ldi r21, 0x3E ; 62 156d2: 60 91 d3 0d lds r22, 0x0DD3 ; 0x800dd3 156d6: 70 91 d4 0d lds r23, 0x0DD4 ; 0x800dd4 156da: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 156de: 90 91 d6 0d lds r25, 0x0DD6 ; 0x800dd6 156e2: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 156e6: 42 e0 ldi r20, 0x02 ; 2 156e8: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 156ec: 89 ef ldi r24, 0xF9 ; 249 156ee: 9f e7 ldi r25, 0x7F ; 127 156f0: 0e 94 1f 7b call 0xf63e ; 0xf63e #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 156f4: 2c ea ldi r18, 0xAC ; 172 156f6: 35 ec ldi r19, 0xC5 ; 197 156f8: 47 e2 ldi r20, 0x27 ; 39 156fa: 5e e3 ldi r21, 0x3E ; 62 156fc: 60 91 d7 0d lds r22, 0x0DD7 ; 0x800dd7 15700: 70 91 d8 0d lds r23, 0x0DD8 ; 0x800dd8 15704: 80 91 d9 0d lds r24, 0x0DD9 ; 0x800dd9 15708: 90 91 da 0d lds r25, 0x0DDA ; 0x800dda 1570c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 15710: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 15714: 0c 94 45 a2 jmp 0x1448a ; 0x1448a - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 15718: 80 e5 ldi r24, 0x50 ; 80 1571a: 0e 94 80 56 call 0xad00 ; 0xad00 1571e: 88 23 and r24, r24 15720: 51 f0 breq .+20 ; 0x15736 15722: 0e 94 10 5b call 0xb620 ; 0xb620 15726: 60 93 db 0d sts 0x0DDB, r22 ; 0x800ddb 1572a: 70 93 dc 0d sts 0x0DDC, r23 ; 0x800ddc 1572e: 80 93 dd 0d sts 0x0DDD, r24 ; 0x800ddd 15732: 90 93 de 0d sts 0x0DDE, r25 ; 0x800dde if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 15736: 89 e4 ldi r24, 0x49 ; 73 15738: 0e 94 80 56 call 0xad00 ; 0xad00 1573c: 88 23 and r24, r24 1573e: 81 f0 breq .+32 ; 0x15760 15740: 0e 94 10 5b call 0xb620 ; 0xb620 15744: 2c ea ldi r18, 0xAC ; 172 15746: 35 ec ldi r19, 0xC5 ; 197 15748: 47 e2 ldi r20, 0x27 ; 39 1574a: 5e e3 ldi r21, 0x3E ; 62 1574c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 15750: 60 93 df 0d sts 0x0DDF, r22 ; 0x800ddf 15754: 70 93 e0 0d sts 0x0DE0, r23 ; 0x800de0 15758: 80 93 e1 0d sts 0x0DE1, r24 ; 0x800de1 1575c: 90 93 e2 0d sts 0x0DE2, r25 ; 0x800de2 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 15760: 84 e4 ldi r24, 0x44 ; 68 15762: 0e 94 80 56 call 0xad00 ; 0xad00 15766: 88 23 and r24, r24 15768: 81 f0 breq .+32 ; 0x1578a 1576a: 0e 94 10 5b call 0xb620 ; 0xb620 } float unscalePID_i(float i) { return i/PID_dT; 1576e: 2c ea ldi r18, 0xAC ; 172 15770: 35 ec ldi r19, 0xC5 ; 197 15772: 47 e2 ldi r20, 0x27 ; 39 15774: 5e e3 ldi r21, 0x3E ; 62 15776: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1577a: 60 93 e3 0d sts 0x0DE3, r22 ; 0x800de3 1577e: 70 93 e4 0d sts 0x0DE4, r23 ; 0x800de4 15782: 80 93 e5 0d sts 0x0DE5, r24 ; 0x800de5 15786: 90 93 e6 0d sts 0x0DE6, r25 ; 0x800de6 updatePID(); 1578a: 0f 94 1f 14 call 0x2283e ; 0x2283e SERIAL_PROTOCOLRPGM(MSG_OK); 1578e: 80 e9 ldi r24, 0x90 ; 144 15790: 9a e6 ldi r25, 0x6A ; 106 15792: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOLPGM(" p:"); 15796: 85 ef ldi r24, 0xF5 ; 245 15798: 9f e7 ldi r25, 0x7F ; 127 1579a: 0e 94 1f 7b call 0xf63e ; 0xf63e 1579e: 60 91 db 0d lds r22, 0x0DDB ; 0x800ddb 157a2: 70 91 dc 0d lds r23, 0x0DDC ; 0x800ddc 157a6: 80 91 dd 0d lds r24, 0x0DDD ; 0x800ddd 157aa: 90 91 de 0d lds r25, 0x0DDE ; 0x800dde 157ae: 42 e0 ldi r20, 0x02 ; 2 157b0: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 157b4: 81 ef ldi r24, 0xF1 ; 241 157b6: 9f e7 ldi r25, 0x7F ; 127 157b8: 0e 94 1f 7b call 0xf63e ; 0xf63e 157bc: 2c ea ldi r18, 0xAC ; 172 157be: 35 ec ldi r19, 0xC5 ; 197 157c0: 47 e2 ldi r20, 0x27 ; 39 157c2: 5e e3 ldi r21, 0x3E ; 62 157c4: 60 91 df 0d lds r22, 0x0DDF ; 0x800ddf 157c8: 70 91 e0 0d lds r23, 0x0DE0 ; 0x800de0 157cc: 80 91 e1 0d lds r24, 0x0DE1 ; 0x800de1 157d0: 90 91 e2 0d lds r25, 0x0DE2 ; 0x800de2 157d4: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 157d8: 42 e0 ldi r20, 0x02 ; 2 157da: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 157de: 8d ee ldi r24, 0xED ; 237 157e0: 9f e7 ldi r25, 0x7F ; 127 157e2: 0e 94 1f 7b call 0xf63e ; 0xf63e #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 157e6: 2c ea ldi r18, 0xAC ; 172 157e8: 35 ec ldi r19, 0xC5 ; 197 157ea: 47 e2 ldi r20, 0x27 ; 39 157ec: 5e e3 ldi r21, 0x3E ; 62 157ee: 60 91 e3 0d lds r22, 0x0DE3 ; 0x800de3 157f2: 70 91 e4 0d lds r23, 0x0DE4 ; 0x800de4 157f6: 80 91 e5 0d lds r24, 0x0DE5 ; 0x800de5 157fa: 90 91 e6 0d lds r25, 0x0DE6 ; 0x800de6 157fe: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 15802: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 15806: 0c 94 45 a2 jmp 0x1448a ; 0x1448a - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 1580a: 83 e5 ldi r24, 0x53 ; 83 1580c: 0e 94 80 56 call 0xad00 ; 0xad00 15810: 88 23 and r24, r24 15812: 41 f0 breq .+16 ; 0x15824 15814: 0e 94 a2 56 call 0xad44 ; 0xad44 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 15818: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1581c: 80 93 57 02 sts 0x0257, r24 ; 0x800257 15820: 0c 94 45 a2 jmp 0x1448a ; 0x1448a #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 15824: 90 e0 ldi r25, 0x00 ; 0 15826: 80 e0 ldi r24, 0x00 ; 0 15828: f7 cf rjmp .-18 ; 0x15818 */ case 303: { float temp = 150.0; int e = 0; int c = 5; 1582a: 85 e0 ldi r24, 0x05 ; 5 1582c: 90 e0 ldi r25, 0x00 ; 0 1582e: 0c 94 57 a0 jmp 0x140ae ; 0x140ae M400 */ case 400: { st_synchronize(); 15832: 0f 94 5b 18 call 0x230b6 ; 0x230b6 15836: 0c 94 45 a2 jmp 0x1448a ; 0x1448a */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 1583a: 81 e0 ldi r24, 0x01 ; 1 1583c: 0e 94 eb 77 call 0xefd6 ; 0xefd6 15840: 0c 94 45 a2 jmp 0x1448a ; 0x1448a */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 15844: 80 e0 ldi r24, 0x00 ; 0 15846: 0e 94 eb 77 call 0xefd6 ; 0xefd6 1584a: 0c 94 45 a2 jmp 0x1448a ; 0x1448a M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 1584e: 0e 94 d6 83 call 0x107ac ; 0x107ac 15852: 0c 94 45 a2 jmp 0x1448a ; 0x1448a M500 */ case 500: { Config_StoreSettings(); 15856: 0e 94 fb 85 call 0x10bf6 ; 0x10bf6 1585a: 0c 94 45 a2 jmp 0x1448a ; 0x1448a M502 */ case 502: { Config_ResetDefault(); 1585e: 0e 94 6a 85 call 0x10ad4 ; 0x10ad4 15862: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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( 15866: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1586a: 8f 93 push r24 1586c: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 15870: 8f 93 push r24 15872: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 15876: 8f 93 push r24 15878: 80 91 c7 0d lds r24, 0x0DC7 ; 0x800dc7 1587c: 8f 93 push r24 1587e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 15882: 8f 93 push r24 15884: 80 91 c5 0d lds r24, 0x0DC5 ; 0x800dc5 15888: 8f 93 push r24 1588a: 80 91 c4 0d lds r24, 0x0DC4 ; 0x800dc4 1588e: 8f 93 push r24 15890: 80 91 c3 0d lds r24, 0x0DC3 ; 0x800dc3 15894: 8f 93 push r24 15896: 80 91 c2 0d lds r24, 0x0DC2 ; 0x800dc2 1589a: 8f 93 push r24 1589c: 80 91 c1 0d lds r24, 0x0DC1 ; 0x800dc1 158a0: 8f 93 push r24 158a2: 80 91 c0 0d lds r24, 0x0DC0 ; 0x800dc0 158a6: 8f 93 push r24 158a8: 80 91 bf 0d lds r24, 0x0DBF ; 0x800dbf 158ac: 8f 93 push r24 158ae: 04 ee ldi r16, 0xE4 ; 228 158b0: 12 ea ldi r17, 0xA2 ; 162 158b2: 1f 93 push r17 158b4: 0f 93 push r16 158b6: 1f 93 push r17 158b8: 0f 93 push r16 158ba: 80 91 be 0d lds r24, 0x0DBE ; 0x800dbe 158be: 8f 93 push r24 158c0: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 158c4: 8f 93 push r24 158c6: 80 91 bc 0d lds r24, 0x0DBC ; 0x800dbc 158ca: 8f 93 push r24 158cc: 80 91 bb 0d lds r24, 0x0DBB ; 0x800dbb 158d0: 8f 93 push r24 158d2: 80 91 ba 0d lds r24, 0x0DBA ; 0x800dba 158d6: 8f 93 push r24 158d8: 80 91 b9 0d lds r24, 0x0DB9 ; 0x800db9 158dc: 8f 93 push r24 158de: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 158e2: 8f 93 push r24 158e4: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 158e8: 8f 93 push r24 158ea: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 158ee: 8f 93 push r24 158f0: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 158f4: 8f 93 push r24 158f6: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 158fa: 8f 93 push r24 158fc: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 15900: 8f 93 push r24 15902: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 15906: 8f 93 push r24 15908: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 1590c: 8f 93 push r24 1590e: 80 91 b0 0d lds r24, 0x0DB0 ; 0x800db0 15912: 8f 93 push r24 15914: 80 91 af 0d lds r24, 0x0DAF ; 0x800daf 15918: 8f 93 push r24 1591a: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae 1591e: 8f 93 push r24 15920: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad 15924: 8f 93 push r24 15926: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1592a: 8f 93 push r24 1592c: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 15930: 8f 93 push r24 15932: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa 15936: 8f 93 push r24 15938: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 1593c: 8f 93 push r24 1593e: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 15942: 8f 93 push r24 15944: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 15948: 8f 93 push r24 1594a: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 1594e: 8f 93 push r24 15950: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 15954: 8f 93 push r24 15956: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 1595a: 8f 93 push r24 1595c: 80 91 a3 0d lds r24, 0x0DA3 ; 0x800da3 15960: 8f 93 push r24 15962: 1f 93 push r17 15964: 0f 93 push r16 15966: 1f 93 push r17 15968: 0f 93 push r16 1596a: 80 91 2a 0e lds r24, 0x0E2A ; 0x800e2a 1596e: 8f 93 push r24 15970: 80 91 29 0e lds r24, 0x0E29 ; 0x800e29 15974: 8f 93 push r24 15976: 80 91 28 0e lds r24, 0x0E28 ; 0x800e28 1597a: 8f 93 push r24 1597c: 80 91 27 0e lds r24, 0x0E27 ; 0x800e27 15980: 8f 93 push r24 15982: 80 91 a2 0d lds r24, 0x0DA2 ; 0x800da2 15986: 8f 93 push r24 15988: 80 91 a1 0d lds r24, 0x0DA1 ; 0x800da1 1598c: 8f 93 push r24 1598e: 80 91 a0 0d lds r24, 0x0DA0 ; 0x800da0 15992: 8f 93 push r24 15994: 80 91 9f 0d lds r24, 0x0D9F ; 0x800d9f 15998: 8f 93 push r24 1599a: 80 91 9e 0d lds r24, 0x0D9E ; 0x800d9e 1599e: 8f 93 push r24 159a0: 80 91 9d 0d lds r24, 0x0D9D ; 0x800d9d 159a4: 8f 93 push r24 159a6: 80 91 9c 0d lds r24, 0x0D9C ; 0x800d9c 159aa: 8f 93 push r24 159ac: 80 91 9b 0d lds r24, 0x0D9B ; 0x800d9b 159b0: 8f 93 push r24 159b2: 1f 93 push r17 159b4: 0f 93 push r16 159b6: 1f 93 push r17 159b8: 0f 93 push r16 159ba: 80 91 9a 0d lds r24, 0x0D9A ; 0x800d9a 159be: 8f 93 push r24 159c0: 80 91 99 0d lds r24, 0x0D99 ; 0x800d99 159c4: 8f 93 push r24 159c6: 80 91 98 0d lds r24, 0x0D98 ; 0x800d98 159ca: 8f 93 push r24 159cc: 80 91 97 0d lds r24, 0x0D97 ; 0x800d97 159d0: 8f 93 push r24 159d2: 80 91 96 0d lds r24, 0x0D96 ; 0x800d96 159d6: 8f 93 push r24 159d8: 80 91 95 0d lds r24, 0x0D95 ; 0x800d95 159dc: 8f 93 push r24 159de: 80 91 94 0d lds r24, 0x0D94 ; 0x800d94 159e2: 8f 93 push r24 159e4: 80 91 93 0d lds r24, 0x0D93 ; 0x800d93 159e8: 8f 93 push r24 159ea: 80 91 92 0d lds r24, 0x0D92 ; 0x800d92 159ee: 8f 93 push r24 159f0: 80 91 91 0d lds r24, 0x0D91 ; 0x800d91 159f4: 8f 93 push r24 159f6: 80 91 90 0d lds r24, 0x0D90 ; 0x800d90 159fa: 8f 93 push r24 159fc: 80 91 8f 0d lds r24, 0x0D8F ; 0x800d8f 15a00: 8f 93 push r24 15a02: 80 91 8e 0d lds r24, 0x0D8E ; 0x800d8e 15a06: 8f 93 push r24 15a08: 80 91 8d 0d lds r24, 0x0D8D ; 0x800d8d 15a0c: 8f 93 push r24 15a0e: 80 91 8c 0d lds r24, 0x0D8C ; 0x800d8c 15a12: 8f 93 push r24 15a14: 80 91 8b 0d lds r24, 0x0D8B ; 0x800d8b 15a18: 8f 93 push r24 15a1a: 1f 93 push r17 15a1c: 0f 93 push r16 15a1e: 1f 93 push r17 15a20: 0f 93 push r16 15a22: 80 91 8a 0d lds r24, 0x0D8A ; 0x800d8a 15a26: 8f 93 push r24 15a28: 80 91 89 0d lds r24, 0x0D89 ; 0x800d89 15a2c: 8f 93 push r24 15a2e: 80 91 88 0d lds r24, 0x0D88 ; 0x800d88 15a32: 8f 93 push r24 15a34: 80 91 87 0d lds r24, 0x0D87 ; 0x800d87 15a38: 8f 93 push r24 15a3a: 80 91 86 0d lds r24, 0x0D86 ; 0x800d86 15a3e: 8f 93 push r24 15a40: 80 91 85 0d lds r24, 0x0D85 ; 0x800d85 15a44: 8f 93 push r24 15a46: 80 91 84 0d lds r24, 0x0D84 ; 0x800d84 15a4a: 8f 93 push r24 15a4c: 80 91 83 0d lds r24, 0x0D83 ; 0x800d83 15a50: 8f 93 push r24 15a52: 80 91 82 0d lds r24, 0x0D82 ; 0x800d82 15a56: 8f 93 push r24 15a58: 80 91 81 0d lds r24, 0x0D81 ; 0x800d81 15a5c: 8f 93 push r24 15a5e: 80 91 80 0d lds r24, 0x0D80 ; 0x800d80 15a62: 8f 93 push r24 15a64: 80 91 7f 0d lds r24, 0x0D7F ; 0x800d7f 15a68: 8f 93 push r24 15a6a: 80 91 7e 0d lds r24, 0x0D7E ; 0x800d7e 15a6e: 8f 93 push r24 15a70: 80 91 7d 0d lds r24, 0x0D7D ; 0x800d7d 15a74: 8f 93 push r24 15a76: 80 91 7c 0d lds r24, 0x0D7C ; 0x800d7c 15a7a: 8f 93 push r24 15a7c: 80 91 7b 0d lds r24, 0x0D7B ; 0x800d7b 15a80: 8f 93 push r24 15a82: 1f 93 push r17 15a84: 0f 93 push r16 15a86: 1f 93 push r17 15a88: 0f 93 push r16 15a8a: 80 91 7a 0d lds r24, 0x0D7A ; 0x800d7a 15a8e: 8f 93 push r24 15a90: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 15a94: 8f 93 push r24 15a96: 80 91 78 0d lds r24, 0x0D78 ; 0x800d78 15a9a: 8f 93 push r24 15a9c: 80 91 77 0d lds r24, 0x0D77 ; 0x800d77 15aa0: 8f 93 push r24 15aa2: 80 91 76 0d lds r24, 0x0D76 ; 0x800d76 15aa6: 8f 93 push r24 15aa8: 80 91 75 0d lds r24, 0x0D75 ; 0x800d75 15aac: 8f 93 push r24 15aae: 80 91 74 0d lds r24, 0x0D74 ; 0x800d74 15ab2: 8f 93 push r24 15ab4: 80 91 73 0d lds r24, 0x0D73 ; 0x800d73 15ab8: 8f 93 push r24 15aba: 80 91 72 0d lds r24, 0x0D72 ; 0x800d72 15abe: 8f 93 push r24 15ac0: 80 91 71 0d lds r24, 0x0D71 ; 0x800d71 15ac4: 8f 93 push r24 15ac6: 80 91 70 0d lds r24, 0x0D70 ; 0x800d70 15aca: 8f 93 push r24 15acc: 80 91 6f 0d lds r24, 0x0D6F ; 0x800d6f 15ad0: 8f 93 push r24 15ad2: 80 91 6e 0d lds r24, 0x0D6E ; 0x800d6e 15ad6: 8f 93 push r24 15ad8: 80 91 6d 0d lds r24, 0x0D6D ; 0x800d6d 15adc: 8f 93 push r24 15ade: 80 91 6c 0d lds r24, 0x0D6C ; 0x800d6c 15ae2: 8f 93 push r24 15ae4: 80 91 6b 0d lds r24, 0x0D6B ; 0x800d6b 15ae8: 8f 93 push r24 15aea: 1f 93 push r17 15aec: 0f 93 push r16 15aee: 1f 93 push r17 15af0: 0f 93 push r16 15af2: 80 e3 ldi r24, 0x30 ; 48 15af4: 9c e7 ldi r25, 0x7C ; 124 15af6: 9f 93 push r25 15af8: 8f 93 push r24 15afa: 0f 94 00 a3 call 0x34600 ; 0x34600 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"), 15afe: 0f b6 in r0, 0x3f ; 63 15b00: f8 94 cli 15b02: de bf out 0x3e, r29 ; 62 15b04: 0f be out 0x3f, r0 ; 63 15b06: cd bf out 0x3d, r28 ; 61 15b08: 2c ea ldi r18, 0xAC ; 172 15b0a: 35 ec ldi r19, 0xC5 ; 197 15b0c: 47 e2 ldi r20, 0x27 ; 39 15b0e: 5e e3 ldi r21, 0x3E ; 62 15b10: 60 91 d7 0d lds r22, 0x0DD7 ; 0x800dd7 15b14: 70 91 d8 0d lds r23, 0x0DD8 ; 0x800dd8 15b18: 80 91 d9 0d lds r24, 0x0DD9 ; 0x800dd9 15b1c: 90 91 da 0d lds r25, 0x0DDA ; 0x800dda 15b20: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 15b24: 9f 93 push r25 15b26: 8f 93 push r24 15b28: 7f 93 push r23 15b2a: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 15b2c: 2c ea ldi r18, 0xAC ; 172 15b2e: 35 ec ldi r19, 0xC5 ; 197 15b30: 47 e2 ldi r20, 0x27 ; 39 15b32: 5e e3 ldi r21, 0x3E ; 62 15b34: 60 91 d3 0d lds r22, 0x0DD3 ; 0x800dd3 15b38: 70 91 d4 0d lds r23, 0x0DD4 ; 0x800dd4 15b3c: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 15b40: 90 91 d6 0d lds r25, 0x0DD6 ; 0x800dd6 15b44: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 15b48: 9f 93 push r25 15b4a: 8f 93 push r24 15b4c: 7f 93 push r23 15b4e: 6f 93 push r22 15b50: 80 91 d2 0d lds r24, 0x0DD2 ; 0x800dd2 15b54: 8f 93 push r24 15b56: 80 91 d1 0d lds r24, 0x0DD1 ; 0x800dd1 15b5a: 8f 93 push r24 15b5c: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 15b60: 8f 93 push r24 15b62: 80 91 cf 0d lds r24, 0x0DCF ; 0x800dcf 15b66: 8f 93 push r24 15b68: 1f 93 push r17 15b6a: 0f 93 push r16 15b6c: 1f 93 push r17 15b6e: 0f 93 push r16 15b70: 83 e0 ldi r24, 0x03 ; 3 15b72: 9c e7 ldi r25, 0x7C ; 124 15b74: 9f 93 push r25 15b76: 8f 93 push r24 15b78: 0f 94 00 a3 call 0x34600 ; 0x34600 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15b7c: 2c ea ldi r18, 0xAC ; 172 15b7e: 35 ec ldi r19, 0xC5 ; 197 15b80: 47 e2 ldi r20, 0x27 ; 39 15b82: 5e e3 ldi r21, 0x3E ; 62 15b84: 60 91 e3 0d lds r22, 0x0DE3 ; 0x800de3 15b88: 70 91 e4 0d lds r23, 0x0DE4 ; 0x800de4 15b8c: 80 91 e5 0d lds r24, 0x0DE5 ; 0x800de5 15b90: 90 91 e6 0d lds r25, 0x0DE6 ; 0x800de6 15b94: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__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"), 15b98: 9f 93 push r25 15b9a: 8f 93 push r24 15b9c: 7f 93 push r23 15b9e: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 15ba0: 2c ea ldi r18, 0xAC ; 172 15ba2: 35 ec ldi r19, 0xC5 ; 197 15ba4: 47 e2 ldi r20, 0x27 ; 39 15ba6: 5e e3 ldi r21, 0x3E ; 62 15ba8: 60 91 df 0d lds r22, 0x0DDF ; 0x800ddf 15bac: 70 91 e0 0d lds r23, 0x0DE0 ; 0x800de0 15bb0: 80 91 e1 0d lds r24, 0x0DE1 ; 0x800de1 15bb4: 90 91 e2 0d lds r25, 0x0DE2 ; 0x800de2 15bb8: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 15bbc: 9f 93 push r25 15bbe: 8f 93 push r24 15bc0: 7f 93 push r23 15bc2: 6f 93 push r22 15bc4: 80 91 de 0d lds r24, 0x0DDE ; 0x800dde 15bc8: 8f 93 push r24 15bca: 80 91 dd 0d lds r24, 0x0DDD ; 0x800ddd 15bce: 8f 93 push r24 15bd0: 80 91 dc 0d lds r24, 0x0DDC ; 0x800ddc 15bd4: 8f 93 push r24 15bd6: 80 91 db 0d lds r24, 0x0DDB ; 0x800ddb 15bda: 8f 93 push r24 15bdc: 1f 93 push r17 15bde: 0f 93 push r16 15be0: 1f 93 push r17 15be2: 0f 93 push r16 15be4: 8e ec ldi r24, 0xCE ; 206 15be6: 9b e7 ldi r25, 0x7B ; 123 15be8: 9f 93 push r25 15bea: 8f 93 push r24 15bec: 0f 94 00 a3 call 0x34600 ; 0x34600 echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 15bf0: 0f b6 in r0, 0x3f ; 63 15bf2: f8 94 cli 15bf4: de bf out 0x3e, r29 ; 62 15bf6: 0f be out 0x3f, r0 ; 63 15bf8: cd bf out 0x3d, r28 ; 61 15bfa: 80 91 e9 0d lds r24, 0x0DE9 ; 0x800de9 15bfe: 1f 92 push r1 15c00: 8f 93 push r24 15c02: 1f 93 push r17 15c04: 0f 93 push r16 15c06: 1f 93 push r17 15c08: 0f 93 push r16 15c0a: 20 e0 ldi r18, 0x00 ; 0 15c0c: 30 e0 ldi r19, 0x00 ; 0 15c0e: 40 e7 ldi r20, 0x70 ; 112 15c10: 52 e4 ldi r21, 0x42 ; 66 15c12: 60 91 fa 0d lds r22, 0x0DFA ; 0x800dfa 15c16: 70 91 fb 0d lds r23, 0x0DFB ; 0x800dfb 15c1a: 80 91 fc 0d lds r24, 0x0DFC ; 0x800dfc 15c1e: 90 91 fd 0d lds r25, 0x0DFD ; 0x800dfd 15c22: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 15c26: 9f 93 push r25 15c28: 8f 93 push r24 15c2a: 7f 93 push r23 15c2c: 6f 93 push r22 15c2e: 80 91 f9 0d lds r24, 0x0DF9 ; 0x800df9 15c32: 8f 93 push r24 15c34: 80 91 f8 0d lds r24, 0x0DF8 ; 0x800df8 15c38: 8f 93 push r24 15c3a: 80 91 f7 0d lds r24, 0x0DF7 ; 0x800df7 15c3e: 8f 93 push r24 15c40: 80 91 f6 0d lds r24, 0x0DF6 ; 0x800df6 15c44: 8f 93 push r24 15c46: 1f 93 push r17 15c48: 0f 93 push r16 15c4a: 1f 93 push r17 15c4c: 0f 93 push r16 15c4e: 80 91 f5 0d lds r24, 0x0DF5 ; 0x800df5 15c52: 8f 93 push r24 15c54: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 15c58: 8f 93 push r24 15c5a: 80 91 f3 0d lds r24, 0x0DF3 ; 0x800df3 15c5e: 8f 93 push r24 15c60: 80 91 f2 0d lds r24, 0x0DF2 ; 0x800df2 15c64: 8f 93 push r24 15c66: 20 e0 ldi r18, 0x00 ; 0 15c68: 30 e0 ldi r19, 0x00 ; 0 15c6a: 40 e7 ldi r20, 0x70 ; 112 15c6c: 52 e4 ldi r21, 0x42 ; 66 15c6e: 60 91 ee 0d lds r22, 0x0DEE ; 0x800dee 15c72: 70 91 ef 0d lds r23, 0x0DEF ; 0x800def 15c76: 80 91 f0 0d lds r24, 0x0DF0 ; 0x800df0 15c7a: 90 91 f1 0d lds r25, 0x0DF1 ; 0x800df1 15c7e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 15c82: 9f 93 push r25 15c84: 8f 93 push r24 15c86: 7f 93 push r23 15c88: 6f 93 push r22 15c8a: 80 91 ed 0d lds r24, 0x0DED ; 0x800ded 15c8e: 8f 93 push r24 15c90: 80 91 ec 0d lds r24, 0x0DEC ; 0x800dec 15c94: 8f 93 push r24 15c96: 80 91 eb 0d lds r24, 0x0DEB ; 0x800deb 15c9a: 8f 93 push r24 15c9c: 80 91 ea 0d lds r24, 0x0DEA ; 0x800dea 15ca0: 8f 93 push r24 15ca2: 1f 93 push r17 15ca4: 0f 93 push r16 15ca6: 1f 93 push r17 15ca8: 0f 93 push r16 15caa: 8d ec ldi r24, 0xCD ; 205 15cac: 9a e7 ldi r25, 0x7A ; 122 15cae: 9f 93 push r25 15cb0: 8f 93 push r24 15cb2: 0f 94 00 a3 call 0x34600 ; 0x34600 ); #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) { 15cb6: 0f b6 in r0, 0x3f ; 63 15cb8: f8 94 cli 15cba: de bf out 0x3e, r29 ; 62 15cbc: 0f be out 0x3f, r0 ; 63 15cbe: cd bf out 0x3d, r28 ; 61 15cc0: 80 91 fe 0d lds r24, 0x0DFE ; 0x800dfe 15cc4: 88 23 and r24, r24 15cc6: 09 f4 brne .+2 ; 0x15cca 15cc8: 56 c0 rjmp .+172 ; 0x15d76 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 15cca: 80 91 02 0e lds r24, 0x0E02 ; 0x800e02 15cce: 8f 93 push r24 15cd0: 80 91 01 0e lds r24, 0x0E01 ; 0x800e01 15cd4: 8f 93 push r24 15cd6: 80 91 00 0e lds r24, 0x0E00 ; 0x800e00 15cda: 8f 93 push r24 15cdc: 80 91 ff 0d lds r24, 0x0DFF ; 0x800dff 15ce0: 8f 93 push r24 15ce2: 1f 93 push r17 15ce4: 0f 93 push r16 15ce6: 1f 93 push r17 15ce8: 0f 93 push r16 15cea: 87 ea ldi r24, 0xA7 ; 167 15cec: 9a e7 ldi r25, 0x7A ; 122 15cee: 9f 93 push r25 15cf0: 8f 93 push r24 15cf2: 0f 94 00 a3 call 0x34600 ; 0x34600 15cf6: 0f b6 in r0, 0x3f ; 63 15cf8: f8 94 cli 15cfa: de bf out 0x3e, r29 ; 62 15cfc: 0f be out 0x3f, r0 ; 63 15cfe: 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( 15d00: 80 91 37 0e lds r24, 0x0E37 ; 0x800e37 15d04: 8f 93 push r24 15d06: 80 91 36 0e lds r24, 0x0E36 ; 0x800e36 15d0a: 8f 93 push r24 15d0c: 80 91 35 0e lds r24, 0x0E35 ; 0x800e35 15d10: 8f 93 push r24 15d12: 80 91 34 0e lds r24, 0x0E34 ; 0x800e34 15d16: 8f 93 push r24 15d18: 80 91 33 0e lds r24, 0x0E33 ; 0x800e33 15d1c: 1f 92 push r1 15d1e: 8f 93 push r24 15d20: 80 91 32 0e lds r24, 0x0E32 ; 0x800e32 15d24: 8f 93 push r24 15d26: 80 91 31 0e lds r24, 0x0E31 ; 0x800e31 15d2a: 8f 93 push r24 15d2c: 80 91 30 0e lds r24, 0x0E30 ; 0x800e30 15d30: 8f 93 push r24 15d32: 80 91 2f 0e lds r24, 0x0E2F ; 0x800e2f 15d36: 8f 93 push r24 15d38: 80 91 2e 0e lds r24, 0x0E2E ; 0x800e2e 15d3c: 8f 93 push r24 15d3e: 80 91 2d 0e lds r24, 0x0E2D ; 0x800e2d 15d42: 8f 93 push r24 15d44: 80 91 2c 0e lds r24, 0x0E2C ; 0x800e2c 15d48: 8f 93 push r24 15d4a: 80 91 2b 0e lds r24, 0x0E2B ; 0x800e2b 15d4e: 8f 93 push r24 15d50: 84 ee ldi r24, 0xE4 ; 228 15d52: 92 ea ldi r25, 0xA2 ; 162 15d54: 9f 93 push r25 15d56: 8f 93 push r24 15d58: 9f 93 push r25 15d5a: 8f 93 push r24 15d5c: 86 e0 ldi r24, 0x06 ; 6 15d5e: 9a e7 ldi r25, 0x7A ; 122 15d60: 9f 93 push r25 15d62: 8f 93 push r24 15d64: 0f 94 00 a3 call 0x34600 ; 0x34600 15d68: 0f b6 in r0, 0x3f ; 63 15d6a: f8 94 cli 15d6c: de bf out 0x3e, r29 ; 62 15d6e: 0f be out 0x3f, r0 ; 63 15d70: cd bf out 0x3d, r28 ; 61 15d72: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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); 15d76: 1f 93 push r17 15d78: 0f 93 push r16 15d7a: 88 e8 ldi r24, 0x88 ; 136 15d7c: 9a e7 ldi r25, 0x7A ; 122 15d7e: 9f 93 push r25 15d80: 8f 93 push r24 15d82: 0f 94 00 a3 call 0x34600 ; 0x34600 15d86: 0f 90 pop r0 15d88: 0f 90 pop r0 15d8a: 0f 90 pop r0 15d8c: 0f 90 pop r0 15d8e: b8 cf rjmp .-144 ; 0x15d00 #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 15d90: 80 e5 ldi r24, 0x50 ; 80 15d92: 0e 94 80 56 call 0xad00 ; 0xad00 15d96: 88 23 and r24, r24 15d98: 11 f4 brne .+4 ; 0x15d9e 15d9a: 0c 94 45 a2 jmp 0x1448a ; 0x1448a { uint8_t valCnt = 0; IP_address = 0; 15d9e: 10 92 10 06 sts 0x0610, r1 ; 0x800610 15da2: 10 92 11 06 sts 0x0611, r1 ; 0x800611 15da6: 10 92 12 06 sts 0x0612, r1 ; 0x800612 15daa: 10 92 13 06 sts 0x0613, r1 ; 0x800613 15dae: 00 e1 ldi r16, 0x10 ; 16 15db0: 16 e0 ldi r17, 0x06 ; 6 15db2: 44 e1 ldi r20, 0x14 ; 20 15db4: e4 2e mov r14, r20 15db6: 46 e0 ldi r20, 0x06 ; 6 15db8: f4 2e mov r15, r20 do { *strchr_pointer = '*'; 15dba: 5a e2 ldi r21, 0x2A ; 42 15dbc: d5 2e mov r13, r21 15dbe: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 15dc2: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 15dc6: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 15dc8: 0e 94 a2 56 call 0xad44 ; 0xad44 15dcc: d8 01 movw r26, r16 15dce: 8d 93 st X+, r24 15dd0: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 15dd2: ea 16 cp r14, r26 15dd4: fb 06 cpc r15, r27 15dd6: 11 f4 brne .+4 ; 0x15ddc 15dd8: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 15ddc: 8e e2 ldi r24, 0x2E ; 46 15dde: 0e 94 80 56 call 0xad00 ; 0xad00 15de2: 81 11 cpse r24, r1 15de4: ec cf rjmp .-40 ; 0x15dbe if (valCnt != 4) IP_address = 0; 15de6: 10 92 10 06 sts 0x0610, r1 ; 0x800610 15dea: 10 92 11 06 sts 0x0611, r1 ; 0x800611 15dee: 10 92 12 06 sts 0x0612, r1 ; 0x800612 15df2: 10 92 13 06 sts 0x0613, r1 ; 0x800613 15df6: 0c 94 45 a2 jmp 0x1448a ; 0x1448a - `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(); 15dfa: 0f 94 5b 18 call 0x230b6 ; 0x230b6 /// 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; 15dfe: 80 91 73 12 lds r24, 0x1273 ; 0x801273 15e02: 81 11 cpse r24, r1 15e04: 02 c0 rjmp .+4 ; 0x15e0a 15e06: 0e 94 01 64 call 0xc802 ; 0xc802 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(); 15e0a: 85 e4 ldi r24, 0x45 ; 69 15e0c: 0e 94 80 56 call 0xad00 ; 0xad00 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; 15e10: 81 2c mov r8, r1 15e12: 91 2c mov r9, r1 15e14: a1 2c mov r10, r1 15e16: 30 ec ldi r19, 0xC0 ; 192 15e18: 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(); 15e1a: 88 23 and r24, r24 15e1c: 21 f0 breq .+8 ; 0x15e26 15e1e: 0e 94 10 5b call 0xb620 ; 0xb620 15e22: 4b 01 movw r8, r22 15e24: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 15e26: 8c e4 ldi r24, 0x4C ; 76 15e28: 0e 94 80 56 call 0xad00 ; 0xad00 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; 15e2c: c1 2c mov r12, r1 15e2e: d1 2c mov r13, r1 15e30: 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(); 15e32: 88 23 and r24, r24 15e34: 21 f0 breq .+8 ; 0x15e3e 15e36: 0e 94 10 5b call 0xb620 ; 0xb620 15e3a: 6b 01 movw r12, r22 15e3c: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 15e3e: 8a e5 ldi r24, 0x5A ; 90 15e40: 0e 94 80 56 call 0xad00 ; 0xad00 // 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; 15e44: 41 2c mov r4, r1 15e46: 51 2c mov r5, r1 15e48: 28 ed ldi r18, 0xD8 ; 216 15e4a: 62 2e mov r6, r18 15e4c: 21 e4 ldi r18, 0x41 ; 65 15e4e: 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()); 15e50: 88 23 and r24, r24 15e52: 31 f0 breq .+12 ; 0x15e60 15e54: 0e 94 10 5b call 0xb620 ; 0xb620 15e58: 2b 01 movw r4, r22 15e5a: 3c 01 movw r6, r24 15e5c: e8 94 clt 15e5e: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 15e60: 88 e5 ldi r24, 0x58 ; 88 15e62: 0e 94 80 56 call 0xad00 ; 0xad00 15e66: 88 23 and r24, r24 15e68: 09 f4 brne .+2 ; 0x15e6c 15e6a: 40 c1 rjmp .+640 ; 0x160ec 15e6c: 0e 94 10 5b call 0xb620 ; 0xb620 15e70: 68 a7 std Y+40, r22 ; 0x28 15e72: 79 a7 std Y+41, r23 ; 0x29 15e74: 8a a7 std Y+42, r24 ; 0x2a 15e76: 9b a7 std Y+43, r25 ; 0x2b if (code_seen('Y')) y_position = code_value(); 15e78: 89 e5 ldi r24, 0x59 ; 89 15e7a: 0e 94 80 56 call 0xad00 ; 0xad00 15e7e: 88 23 and r24, r24 15e80: 09 f4 brne .+2 ; 0x15e84 15e82: 3d c1 rjmp .+634 ; 0x160fe 15e84: 0e 94 10 5b call 0xb620 ; 0xb620 15e88: 6c a7 std Y+44, r22 ; 0x2c 15e8a: 7d a7 std Y+45, r23 ; 0x2d 15e8c: 8e a7 std Y+46, r24 ; 0x2e 15e8e: 9f a7 std Y+47, r25 ; 0x2f // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 15e90: 1a 82 std Y+2, r1 ; 0x02 15e92: 19 82 std Y+1, r1 ; 0x01 15e94: fe 01 movw r30, r28 15e96: 33 96 adiw r30, 0x03 ; 3 15e98: 83 e1 ldi r24, 0x13 ; 19 15e9a: df 01 movw r26, r30 15e9c: 1d 92 st X+, r1 15e9e: 8a 95 dec r24 15ea0: e9 f7 brne .-6 ; 0x15e9c if (code_seen('C')) { 15ea2: 83 e4 ldi r24, 0x43 ; 67 15ea4: 0e 94 80 56 call 0xad00 ; 0xad00 15ea8: 88 23 and r24, r24 15eaa: f9 f0 breq .+62 ; 0x15eea , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 15eac: 62 e2 ldi r22, 0x22 ; 34 15eae: 70 e0 ldi r23, 0x00 ; 0 15eb0: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 15eb4: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 15eb8: 0f 94 95 aa call 0x3552a ; 0x3552a 15ebc: 8c 01 movw r16, r24 if (!this->ptr) { 15ebe: 89 2b or r24, r25 15ec0: a1 f0 breq .+40 ; 0x15eea // First quote not found return; } // Skip the leading quote this->ptr++; 15ec2: 0f 5f subi r16, 0xFF ; 255 15ec4: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 15ec6: 62 e2 ldi r22, 0x22 ; 34 15ec8: 70 e0 ldi r23, 0x00 ; 0 15eca: c8 01 movw r24, r16 15ecc: 0f 94 95 aa call 0x3552a ; 0x3552a if(!pStrEnd) { 15ed0: 00 97 sbiw r24, 0x00 ; 0 15ed2: 59 f0 breq .+22 ; 0x15eea // Second quote not found return; } this->len = pStrEnd - this->ptr; 15ed4: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 15ed6: 84 31 cpi r24, 0x14 ; 20 15ed8: 08 f0 brcs .+2 ; 0x15edc 15eda: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 15edc: 48 2f mov r20, r24 15ede: 50 e0 ldi r21, 0x00 ; 0 15ee0: b8 01 movw r22, r16 15ee2: ce 01 movw r24, r28 15ee4: 01 96 adiw r24, 0x01 ; 1 15ee6: 0f 94 67 aa call 0x354ce ; 0x354ce } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 15eea: 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; 15eee: 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"))) 15ef0: 81 30 cpi r24, 0x01 ; 1 15ef2: 29 f4 brne .+10 ; 0x15efe 15ef4: 88 ed ldi r24, 0xD8 ; 216 15ef6: 9f e7 ldi r25, 0x7F ; 127 15ef8: 0f 94 89 39 call 0x27312 ; 0x27312 15efc: 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(); 15efe: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // 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); 15f02: 86 e1 ldi r24, 0x16 ; 22 15f04: 0f 94 a0 2f call 0x25f40 ; 0x25f40 // Turn off the fan fanSpeed = 0; 15f08: 10 92 55 12 sts 0x1255, r1 ; 0x801255 // Retract E if (!printingIsPaused()) 15f0c: 0e 94 90 66 call 0xcd20 ; 0xcd20 15f10: 81 11 cpse r24, r1 15f12: fa c0 rjmp .+500 ; 0x16108 { current_position[E_AXIS] += e_shift; 15f14: a5 01 movw r20, r10 15f16: 94 01 movw r18, r8 15f18: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 15f1c: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 15f20: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 15f24: 90 91 70 12 lds r25, 0x1270 ; 0x801270 15f28: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 15f2c: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 15f30: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 15f34: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 15f38: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 15f3c: 60 e0 ldi r22, 0x00 ; 0 15f3e: 70 e0 ldi r23, 0x00 ; 0 15f40: 88 ee ldi r24, 0xE8 ; 232 15f42: 92 e4 ldi r25, 0x42 ; 66 15f44: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 15f48: 0f 94 5b 18 call 0x230b6 ; 0x230b6 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 15f4c: 8f e5 ldi r24, 0x5F ; 95 15f4e: 9b e6 ldi r25, 0x6B ; 107 15f50: 0e 94 18 7d call 0xfa30 ; 0xfa30 // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 15f54: c3 01 movw r24, r6 15f56: b2 01 movw r22, r4 15f58: 0e 94 ef 6c call 0xd9de ; 0xd9de // Move XY to side current_position[X_AXIS] = x_position; 15f5c: 28 a5 ldd r18, Y+40 ; 0x28 15f5e: 39 a5 ldd r19, Y+41 ; 0x29 15f60: 4a a5 ldd r20, Y+42 ; 0x2a 15f62: 5b a5 ldd r21, Y+43 ; 0x2b 15f64: 20 93 61 12 sts 0x1261, r18 ; 0x801261 15f68: 30 93 62 12 sts 0x1262, r19 ; 0x801262 15f6c: 40 93 63 12 sts 0x1263, r20 ; 0x801263 15f70: 50 93 64 12 sts 0x1264, r21 ; 0x801264 current_position[Y_AXIS] = y_position; 15f74: 8c a5 ldd r24, Y+44 ; 0x2c 15f76: 9d a5 ldd r25, Y+45 ; 0x2d 15f78: ae a5 ldd r26, Y+46 ; 0x2e 15f7a: bf a5 ldd r27, Y+47 ; 0x2f 15f7c: 80 93 65 12 sts 0x1265, r24 ; 0x801265 15f80: 90 93 66 12 sts 0x1266, r25 ; 0x801266 15f84: a0 93 67 12 sts 0x1267, r26 ; 0x801267 15f88: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 15f8c: 60 e0 ldi r22, 0x00 ; 0 15f8e: 70 e0 ldi r23, 0x00 ; 0 15f90: 88 e4 ldi r24, 0x48 ; 72 15f92: 92 e4 ldi r25, 0x42 ; 66 15f94: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 15f98: 0f 94 5b 18 call 0x230b6 ; 0x230b6 bool repeat = false; 15f9c: 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; 15f9e: 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)); 15fa0: 02 ef ldi r16, 0xF2 ; 242 15fa2: 20 2e mov r2, r16 15fa4: 09 e7 ldi r16, 0x79 ; 121 15fa6: 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; 15fa8: 82 e0 ldi r24, 0x02 ; 2 15faa: 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)); 15fac: 9a ef ldi r25, 0xFA ; 250 15fae: 89 2e mov r8, r25 15fb0: 99 e7 ldi r25, 0x79 ; 121 15fb2: 99 2e mov r9, r25 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 15fb4: 80 91 01 13 lds r24, 0x1301 ; 0x801301 15fb8: 81 30 cpi r24, 0x01 ; 1 15fba: 09 f0 breq .+2 ; 0x15fbe 15fbc: a8 c0 rjmp .+336 ; 0x1610e eject_slot = MMU2::mmu2.get_current_tool(); 15fbe: 0f 94 1d 65 call 0x2ca3a ; 0x2ca3a 15fc2: b8 2e mov r11, r24 mmu_M600_unload_filament(); 15fc4: 0e 94 17 77 call 0xee2e ; 0xee2e } 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 15fc8: 0f 94 5b 18 call 0x230b6 ; 0x230b6 FSensorBlockRunout fsBlockRunout; 15fcc: 0f 94 86 78 call 0x2f10c ; 0x2f10c if (!MMU2::mmu2.Enabled()) 15fd0: 80 91 01 13 lds r24, 0x1301 ; 0x801301 15fd4: 81 30 cpi r24, 0x01 ; 1 15fd6: 09 f4 brne .+2 ; 0x15fda 15fd8: 64 c1 rjmp .+712 ; 0x162a2 { KEEPALIVE_STATE(PAUSED_FOR_USER); 15fda: 84 e0 ldi r24, 0x04 ; 4 15fdc: 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); 15fe0: 8e e3 ldi r24, 0x3E ; 62 15fe2: 99 e3 ldi r25, 0x39 ; 57 15fe4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 15fe8: 40 e0 ldi r20, 0x00 ; 0 15fea: 60 e0 ldi r22, 0x00 ; 0 15fec: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 15ff0: 08 2f mov r16, r24 lcd_update_enable(false); 15ff2: 80 e0 ldi r24, 0x00 ; 0 15ff4: 0e 94 93 70 call 0xe126 ; 0xe126 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 15ff8: 01 30 cpi r16, 0x01 ; 1 15ffa: 29 f5 brne .+74 ; 0x16046 lcd_clear(); 15ffc: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 16000: 86 eb ldi r24, 0xB6 ; 182 16002: 99 e3 ldi r25, 0x39 ; 57 16004: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16008: ac 01 movw r20, r24 1600a: 62 e0 ldi r22, 0x02 ; 2 1600c: 80 e0 ldi r24, 0x00 ; 0 1600e: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 current_position[X_AXIS] = 100; 16012: 80 e0 ldi r24, 0x00 ; 0 16014: 90 e0 ldi r25, 0x00 ; 0 16016: a8 ec ldi r26, 0xC8 ; 200 16018: b2 e4 ldi r27, 0x42 ; 66 1601a: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1601e: 90 93 62 12 sts 0x1262, r25 ; 0x801262 16022: a0 93 63 12 sts 0x1263, r26 ; 0x801263 16026: b0 93 64 12 sts 0x1264, r27 ; 0x801264 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 1602a: 60 e0 ldi r22, 0x00 ; 0 1602c: 70 e0 ldi r23, 0x00 ; 0 1602e: 88 e4 ldi r24, 0x48 ; 72 16030: 92 e4 ldi r25, 0x42 ; 66 16032: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 16036: 0f 94 5b 18 call 0x230b6 ; 0x230b6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 1603a: 8c e0 ldi r24, 0x0C ; 12 1603c: 99 e3 ldi r25, 0x39 ; 57 1603e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16042: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 16046: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 1604a: 8a e9 ldi r24, 0x9A ; 154 1604c: 98 e3 ldi r25, 0x38 ; 56 1604e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16052: ac 01 movw r20, r24 16054: 60 e0 ldi r22, 0x00 ; 0 16056: 80 e0 ldi r24, 0x00 ; 0 16058: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(0, 1); 1605c: 61 e0 ldi r22, 0x01 ; 1 1605e: 80 e0 ldi r24, 0x00 ; 0 16060: 0e 94 b5 6f call 0xdf6a ; 0xdf6a if (filament_name[0]) { 16064: 89 81 ldd r24, Y+1 ; 0x01 16066: 88 23 and r24, r24 16068: 41 f0 breq .+16 ; 0x1607a lcd_print(filament_name); 1606a: ce 01 movw r24, r28 1606c: 01 96 adiw r24, 0x01 ; 1 1606e: 0e 94 ba 73 call 0xe774 ; 0xe774 lcd_set_cursor(0, 2); 16072: 62 e0 ldi r22, 0x02 ; 2 16074: 80 e0 ldi r24, 0x00 ; 0 16076: 0e 94 b5 6f call 0xdf6a ; 0xdf6a } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 1607a: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 1607e: 81 11 cpse r24, r1 16080: 06 c0 rjmp .+12 ; 0x1608e #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 16082: 85 e8 ldi r24, 0x85 ; 133 16084: 98 e3 ldi r25, 0x38 ; 56 16086: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1608a: 0e 94 78 6f call 0xdef0 ; 0xdef0 void M600_load_filament(const char* filament_name) { //load filament for single material and MMU lcd_wait_interact(filament_name); KEEPALIVE_STATE(PAUSED_FOR_USER); 1608e: 84 e0 ldi r24, 0x04 ; 4 16090: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(!lcd_clicked()) 16094: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 16098: 81 11 cpse r24, r1 1609a: 10 c0 rjmp .+32 ; 0x160bc { manage_heater(); 1609c: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 160a0: 81 e0 ldi r24, 0x01 ; 1 160a2: 0e 94 b0 8a call 0x11560 ; 0x11560 #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 160a6: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 160aa: 88 23 and r24, r24 160ac: 99 f3 breq .-26 ; 0x16094 Sound_MakeCustom(50,1000,false); 160ae: 40 e0 ldi r20, 0x00 ; 0 160b0: 68 ee ldi r22, 0xE8 ; 232 160b2: 73 e0 ldi r23, 0x03 ; 3 160b4: 82 e3 ldi r24, 0x32 ; 50 160b6: 90 e0 ldi r25, 0x00 ; 0 160b8: 0f 94 f3 24 call 0x249e6 ; 0x249e6 break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 160bc: a0 92 78 02 sts 0x0278, r10 ; 0x800278 M600_load_filament_movements(filament_name); 160c0: ce 01 movw r24, r28 160c2: 01 96 adiw r24, 0x01 ; 1 160c4: 0e 94 d0 76 call 0xeda0 ; 0xeda0 Sound_MakeCustom(50,1000,false); 160c8: 40 e0 ldi r20, 0x00 ; 0 160ca: 68 ee ldi r22, 0xE8 ; 232 160cc: 73 e0 ldi r23, 0x03 ; 3 160ce: 82 e3 ldi r24, 0x32 ; 50 160d0: 90 e0 ldi r25, 0x00 ; 0 160d2: 0f 94 f3 24 call 0x249e6 ; 0x249e6 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); 160d6: b4 e0 ldi r27, 0x04 ; 4 160d8: 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) 160da: 11 23 and r17, r17 160dc: 09 f4 brne .+2 ; 0x160e0 160de: f6 c0 rjmp .+492 ; 0x162cc #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 160e0: 0f 94 dd 6c call 0x2d9ba ; 0x2d9ba current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 160e4: 48 a5 ldd r20, Y+40 ; 0x28 160e6: 41 11 cpse r20, r1 160e8: 65 cf rjmp .-310 ; 0x15fb4 160ea: 99 c1 rjmp .+818 ; 0x1641e // 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; 160ec: 20 e0 ldi r18, 0x00 ; 0 160ee: 30 e0 ldi r19, 0x00 ; 0 160f0: 43 e5 ldi r20, 0x53 ; 83 160f2: 53 e4 ldi r21, 0x43 ; 67 160f4: 28 a7 std Y+40, r18 ; 0x28 160f6: 39 a7 std Y+41, r19 ; 0x29 160f8: 4a a7 std Y+42, r20 ; 0x2a 160fa: 5b a7 std Y+43, r21 ; 0x2b 160fc: bd ce rjmp .-646 ; 0x15e78 float y_position = FILAMENTCHANGE_YPOS; 160fe: 1c a6 std Y+44, r1 ; 0x2c 16100: 1d a6 std Y+45, r1 ; 0x2d 16102: 1e a6 std Y+46, r1 ; 0x2e 16104: 1f a6 std Y+47, r1 ; 0x2f 16106: c4 ce rjmp .-632 ; 0x15e90 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(); 16108: 0e 94 7e 64 call 0xc8fc ; 0xc8fc 1610c: 23 cf rjmp .-442 ; 0x15f54 //! //! 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); 1610e: 84 e0 ldi r24, 0x04 ; 4 16110: 80 93 78 02 sts 0x0278, r24 ; 0x800278 unsigned long waiting_start_time = _millis(); 16114: 0f 94 01 0b call 0x21602 ; 0x21602 16118: 2b 01 movw r4, r22 1611a: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 1611c: 8a e5 ldi r24, 0x5A ; 90 1611e: 98 e3 ldi r25, 0x38 ; 56 16120: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16124: 0e 94 94 de call 0x1bd28 ; 0x1bd28 while (!(wait_for_user_state == 0 && lcd_clicked())){ 16128: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1612c: 08 2f mov r16, r24 1612e: 81 11 cpse r24, r1 16130: 34 c0 rjmp .+104 ; 0x1619a 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) { 16132: a3 01 movw r20, r6 16134: 92 01 movw r18, r4 16136: 20 54 subi r18, 0x40 ; 64 16138: 38 4d sbci r19, 0xD8 ; 216 1613a: 46 4f sbci r20, 0xF6 ; 246 1613c: 5f 4f sbci r21, 0xFF ; 255 1613e: 2c a7 std Y+44, r18 ; 0x2c 16140: 3d a7 std Y+45, r19 ; 0x2d 16142: 4e a7 std Y+46, r20 ; 0x2e 16144: 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(); 16146: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 1614a: 81 e0 ldi r24, 0x01 ; 1 1614c: 0e 94 b0 8a call 0x11560 ; 0x11560 if (wait_for_user_state != 2) sound_wait_for_user(); 16150: 02 30 cpi r16, 0x02 ; 2 16152: 09 f4 brne .+2 ; 0x16156 16154: 65 c0 rjmp .+202 ; 0x16220 16156: 0f 94 89 25 call 0x24b12 ; 0x24b12 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); 1615a: 84 e0 ldi r24, 0x04 ; 4 1615c: 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) { 1615e: 01 30 cpi r16, 0x01 ; 1 16160: 29 f1 breq .+74 ; 0x161ac case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 16162: 0e 94 0a 8d call 0x11a14 ; 0x11a14 if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 16166: 0f 94 01 0b call 0x21602 ; 0x21602 1616a: 2c a5 ldd r18, Y+44 ; 0x2c 1616c: 3d a5 ldd r19, Y+45 ; 0x2d 1616e: 4e a5 ldd r20, Y+46 ; 0x2e 16170: 5f a5 ldd r21, Y+47 ; 0x2f 16172: 26 17 cp r18, r22 16174: 37 07 cpc r19, r23 16176: 48 07 cpc r20, r24 16178: 59 07 cpc r21, r25 1617a: b0 f6 brcc .-84 ; 0x16128 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 1617c: 89 e2 ldi r24, 0x29 ; 41 1617e: 98 e3 ldi r25, 0x38 ; 56 16180: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16184: 0e 94 94 de call 0x1bd28 ; 0x1bd28 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 16188: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1618c: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 16190: 0f 94 5b 18 call 0x230b6 ; 0x230b6 disable_e0(); 16194: 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; 16196: 01 e0 ldi r16, 0x01 ; 1 16198: d6 cf rjmp .-84 ; 0x16146 1619a: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL10beep_timer.lto_priv.497> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 1619e: 10 92 c1 04 sts 0x04C1, r1 ; 0x8004c1 <_ZL6bFirst.lto_priv.498> 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); 161a2: c7 01 movw r24, r14 161a4: b6 01 movw r22, r12 161a6: 0e 94 69 e1 call 0x1c2d2 ; 0x1c2d2 161aa: 0e cf rjmp .-484 ; 0x15fc8 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); 161ac: 0e 94 0a 8d call 0x11a14 ; 0x11a14 if (lcd_clicked()) { 161b0: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 161b4: 88 23 and r24, r24 161b6: 39 f2 breq .-114 ; 0x16146 161b8: 80 91 5b 12 lds r24, 0x125B ; 0x80125b 161bc: 90 91 5c 12 lds r25, 0x125C ; 0x80125c 161c0: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 161c4: 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)); 161c8: 82 e9 ldi r24, 0x92 ; 146 161ca: 9d e3 ldi r25, 0x3D ; 61 161cc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 161d0: 0e 94 94 de call 0x1bd28 ; 0x1bd28 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 161d4: 42 e8 ldi r20, 0x82 ; 130 161d6: 64 e0 ldi r22, 0x04 ; 4 161d8: 80 e0 ldi r24, 0x00 ; 0 161da: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 161de: 80 91 5e 12 lds r24, 0x125E ; 0x80125e 161e2: 8f 93 push r24 161e4: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 161e8: 8f 93 push r24 161ea: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 161ee: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 161f2: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 161f6: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 161fa: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 161fe: 7f 93 push r23 16200: 6f 93 push r22 16202: 3f 92 push r3 16204: 2f 92 push r2 16206: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_putc(LCD_STR_DEGREE[0]); 1620a: 81 e8 ldi r24, 0x81 ; 129 1620c: 0e 94 7c 6f call 0xdef8 ; 0xdef8 16210: 0f 90 pop r0 16212: 0f 90 pop r0 16214: 0f 90 pop r0 16216: 0f 90 pop r0 16218: 0f 90 pop r0 1621a: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 1621c: 02 e0 ldi r16, 0x02 ; 2 1621e: 93 cf rjmp .-218 ; 0x16146 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 16220: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 16224: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 16228: 07 2e mov r0, r23 1622a: 00 0c add r0, r0 1622c: 88 0b sbc r24, r24 1622e: 99 0b sbc r25, r25 16230: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 16234: 20 91 5a 0d lds r18, 0x0D5A ; 0x800d5a 16238: 30 91 5b 0d lds r19, 0x0D5B ; 0x800d5b 1623c: 40 91 5c 0d lds r20, 0x0D5C ; 0x800d5c 16240: 50 91 5d 0d lds r21, 0x0D5D ; 0x800d5d 16244: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 16248: 9f 77 andi r25, 0x7F ; 127 1624a: 20 e0 ldi r18, 0x00 ; 0 1624c: 30 e0 ldi r19, 0x00 ; 0 1624e: 40 ea ldi r20, 0xA0 ; 160 16250: 50 e4 ldi r21, 0x40 ; 64 16252: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 16256: 87 ff sbrs r24, 7 16258: 0b c0 rjmp .+22 ; 0x16270 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 1625a: 8a e5 ldi r24, 0x5A ; 90 1625c: 98 e3 ldi r25, 0x38 ; 56 1625e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16262: 0e 94 94 de call 0x1bd28 ; 0x1bd28 waiting_start_time = _millis(); 16266: 0f 94 01 0b call 0x21602 ; 0x21602 1626a: 2b 01 movw r4, r22 1626c: 3c 01 movw r6, r24 1626e: 5c cf rjmp .-328 ; 0x16128 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 16270: 64 e0 ldi r22, 0x04 ; 4 16272: 81 e0 ldi r24, 0x01 ; 1 16274: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 16278: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1627c: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 16280: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 16284: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 16288: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1628c: 7f 93 push r23 1628e: 6f 93 push r22 16290: 9f 92 push r9 16292: 8f 92 push r8 16294: 0e 94 66 6f call 0xdecc ; 0xdecc 16298: 0f 90 pop r0 1629a: 0f 90 pop r0 1629c: 0f 90 pop r0 1629e: 0f 90 pop r0 162a0: 52 cf rjmp .-348 ; 0x16146 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 162a2: 11 11 cpse r17, r1 162a4: 03 c0 rjmp .+6 ; 0x162ac 162a6: 8b 2d mov r24, r11 162a8: 0e 94 2d 8d call 0x11a5a ; 0x11a5a mmu_M600_load_filament(automatic); 162ac: 81 2f mov r24, r17 162ae: 0e 94 dd 7b call 0xf7ba ; 0xf7ba 162b2: 11 cf rjmp .-478 ; 0x160d6 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 162b4: 03 30 cpi r16, 0x03 ; 3 162b6: 10 f4 brcc .+4 ; 0x162bc cursor_pos++; 162b8: 0f 5f subi r16, 0xFF ; 255 162ba: 49 c0 rjmp .+146 ; 0x1634e else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 162bc: 87 e0 ldi r24, 0x07 ; 7 162be: 0f 94 06 23 call 0x2460c ; 0x2460c 162c2: 45 c0 rjmp .+138 ; 0x1634e 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); 162c4: ce 01 movw r24, r28 162c6: 01 96 adiw r24, 0x01 ; 1 162c8: 0e 94 d0 76 call 0xeda0 ; 0xeda0 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); 162cc: 70 92 78 02 sts 0x0278, r7 ; 0x800278 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 162d0: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 162d4: 86 ed ldi r24, 0xD6 ; 214 162d6: 98 e3 ldi r25, 0x38 ; 56 162d8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 162dc: ac 01 movw r20, r24 162de: 60 e0 ldi r22, 0x00 ; 0 162e0: 81 e0 ldi r24, 0x01 ; 1 162e2: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 162e6: 80 ec ldi r24, 0xC0 ; 192 162e8: 98 e3 ldi r25, 0x38 ; 56 162ea: 0e 94 95 75 call 0xeb2a ; 0xeb2a 162ee: ac 01 movw r20, r24 162f0: 61 e0 ldi r22, 0x01 ; 1 162f2: 81 e0 ldi r24, 0x01 ; 1 162f4: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 162f8: 8c ea ldi r24, 0xAC ; 172 162fa: 98 e3 ldi r25, 0x38 ; 56 162fc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16300: ac 01 movw r20, r24 16302: 62 e0 ldi r22, 0x02 ; 2 16304: 81 e0 ldi r24, 0x01 ; 1 16306: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 1630a: 8b e5 ldi r24, 0x5B ; 91 1630c: 97 e4 ldi r25, 0x47 ; 71 1630e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16312: ac 01 movw r20, r24 16314: 63 e0 ldi r22, 0x03 ; 3 16316: 81 e0 ldi r24, 0x01 ; 1 16318: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_putc_at(0, cursor_pos, '>'); 1631c: 4e e3 ldi r20, 0x3E ; 62 1631e: 60 e0 ldi r22, 0x00 ; 0 16320: 80 e0 ldi r24, 0x00 ; 0 16322: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_consume_click(); 16326: 0e 94 cb 73 call 0xe796 ; 0xe796 uint8_t lcd_alright() { uint8_t cursor_pos = 0; 1632a: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 1632c: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 16330: 81 e0 ldi r24, 0x01 ; 1 16332: 0e 94 b0 8a call 0x11560 ; 0x11560 if (lcd_encoder) 16336: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1633a: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1633e: 00 97 sbiw r24, 0x00 ; 0 16340: d9 f0 breq .+54 ; 0x16378 { if (lcd_encoder < 0 ) { 16342: 97 ff sbrs r25, 7 16344: b7 cf rjmp .-146 ; 0x162b4 // Rotating knob counter clockwise if (cursor_pos > 0) 16346: 00 23 and r16, r16 16348: 09 f4 brne .+2 ; 0x1634c 1634a: b8 cf rjmp .-144 ; 0x162bc cursor_pos--; 1634c: 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 ")); 1634e: 4e ef ldi r20, 0xFE ; 254 16350: 59 e7 ldi r21, 0x79 ; 121 16352: 60 e0 ldi r22, 0x00 ; 0 16354: 80 e0 ldi r24, 0x00 ; 0 16356: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_putc_at(0, cursor_pos, '>'); 1635a: 4e e3 ldi r20, 0x3E ; 62 1635c: 60 2f mov r22, r16 1635e: 80 e0 ldi r24, 0x00 ; 0 16360: 0e 94 6e 70 call 0xe0dc ; 0xe0dc // Consume rotation event and make feedback sound lcd_encoder = 0; 16364: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 16368: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e _delay(100); 1636c: 64 e6 ldi r22, 0x64 ; 100 1636e: 70 e0 ldi r23, 0x00 ; 0 16370: 80 e0 ldi r24, 0x00 ; 0 16372: 90 e0 ldi r25, 0x00 ; 0 16374: 0f 94 ce 0a call 0x2159c ; 0x2159c } if (lcd_clicked()) 16378: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1637c: 88 23 and r24, r24 1637e: b1 f2 breq .-84 ; 0x1632c { lcd_clear(); 16380: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_return_to_status(); 16384: 0f 94 18 05 call 0x20a30 ; 0x20a30 lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 16388: a0 92 78 02 sts 0x0278, r10 ; 0x800278 switch(lcd_change_filament_state) 1638c: 02 30 cpi r16, 0x02 ; 2 1638e: b1 f0 breq .+44 ; 0x163bc 16390: 03 30 cpi r16, 0x03 ; 3 16392: 09 f4 brne .+2 ; 0x16396 16394: f6 c0 rjmp .+492 ; 0x16582 16396: 01 30 cpi r16, 0x01 ; 1 16398: 81 f5 brne .+96 ; 0x163fa { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 1639a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1639e: 81 30 cpi r24, 0x01 ; 1 163a0: 09 f0 breq .+2 ; 0x163a4 163a2: 90 cf rjmp .-224 ; 0x162c4 uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 163a4: 0f 94 1d 65 call 0x2ca3a ; 0x2ca3a 163a8: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 163aa: 0e 94 17 77 call 0xee2e ; 0xee2e // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 163ae: 80 2f mov r24, r16 163b0: 0e 94 2d 8d call 0x11a5a ; 0x11a5a // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 163b4: 80 e0 ldi r24, 0x00 ; 0 163b6: 0e 94 dd 7b call 0xf7ba ; 0xf7ba 163ba: 88 cf rjmp .-240 ; 0x162cc } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 163bc: 0f 94 5b 18 call 0x230b6 ; 0x230b6 load_filament_final_feed(); 163c0: 0e 94 48 64 call 0xc890 ; 0xc890 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(); 163c4: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 163c8: 8a ee ldi r24, 0xEA ; 234 163ca: 98 e3 ldi r25, 0x38 ; 56 163cc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 163d0: ac 01 movw r20, r24 163d2: 60 e0 ldi r22, 0x00 ; 0 163d4: 80 e0 ldi r24, 0x00 ; 0 163d6: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 163da: 86 eb ldi r24, 0xB6 ; 182 163dc: 99 e3 ldi r25, 0x39 ; 57 163de: 0e 94 95 75 call 0xeb2a ; 0xeb2a 163e2: ac 01 movw r20, r24 163e4: 62 e0 ldi r22, 0x02 ; 2 163e6: 80 e0 ldi r24, 0x00 ; 0 163e8: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 163ec: 87 e9 ldi r24, 0x97 ; 151 163ee: 9d e1 ldi r25, 0x1D ; 29 163f0: 0f 94 e9 08 call 0x211d2 ; 0x211d2 lcd_loading_color(); st_synchronize(); 163f4: 0f 94 5b 18 call 0x230b6 ; 0x230b6 163f8: 69 cf rjmp .-302 ; 0x162cc } void lcd_change_success() { lcd_clear(); 163fa: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 163fe: 8a ef ldi r24, 0xFA ; 250 16400: 98 e3 ldi r25, 0x38 ; 56 16402: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16406: ac 01 movw r20, r24 16408: 62 e0 ldi r22, 0x02 ; 2 1640a: 80 e0 ldi r24, 0x00 ; 0 1640c: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 //! @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) 16410: 00 23 and r16, r16 16412: 19 f0 breq .+6 ; 0x1641a 16414: 03 30 cpi r16, 0x03 ; 3 16416: 09 f0 breq .+2 ; 0x1641a 16418: 59 cf rjmp .-334 ; 0x162cc 1641a: 0f 94 dd 6c call 0x2d9ba ; 0x2d9ba if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 1641e: 81 e0 ldi r24, 0x01 ; 1 16420: 0e 94 93 70 call 0xe126 ; 0xe126 // Not let's go back to print fanSpeed = saved_fan_speed; 16424: 80 91 54 12 lds r24, 0x1254 ; 0x801254 16428: 80 93 55 12 sts 0x1255, r24 ; 0x801255 // Feed a little of filament to stabilize pressure if (!automatic) { 1642c: 11 11 cpse r17, r1 1642e: 27 c0 rjmp .+78 ; 0x1647e if (printingIsPaused()) 16430: 0e 94 90 66 call 0xcd20 ; 0xcd20 16434: c0 90 6d 12 lds r12, 0x126D ; 0x80126d 16438: d0 90 6e 12 lds r13, 0x126E ; 0x80126e 1643c: e0 90 6f 12 lds r14, 0x126F ; 0x80126f 16440: f0 90 70 12 lds r15, 0x1270 ; 0x801270 16444: 88 23 and r24, r24 16446: 09 f4 brne .+2 ; 0x1644a 16448: 9f c0 rjmp .+318 ; 0x16588 { // 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; 1644a: 20 e0 ldi r18, 0x00 ; 0 1644c: 30 e0 ldi r19, 0x00 ; 0 1644e: 40 e8 ldi r20, 0x80 ; 128 16450: 5f e3 ldi r21, 0x3F ; 63 16452: c7 01 movw r24, r14 16454: b6 01 movw r22, r12 16456: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1645a: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 1645e: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 16462: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 16466: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 1646a: 60 e0 ldi r22, 0x00 ; 0 1646c: 70 e0 ldi r23, 0x00 ; 0 1646e: 88 ee ldi r24, 0xE8 ; 232 16470: 92 e4 ldi r25, 0x42 ; 66 16472: 0f 94 a8 49 call 0x29350 ; 0x29350 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 16476: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1647a: 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); 1647e: e0 90 69 12 lds r14, 0x1269 ; 0x801269 16482: f0 90 6a 12 lds r15, 0x126A ; 0x80126a 16486: 00 91 6b 12 lds r16, 0x126B ; 0x80126b 1648a: 10 91 6c 12 lds r17, 0x126C ; 0x80126c 1648e: 20 91 94 02 lds r18, 0x0294 ; 0x800294 16492: 30 91 95 02 lds r19, 0x0295 ; 0x800295 16496: 40 91 96 02 lds r20, 0x0296 ; 0x800296 1649a: 50 91 97 02 lds r21, 0x0297 ; 0x800297 1649e: 60 91 90 02 lds r22, 0x0290 ; 0x800290 164a2: 70 91 91 02 lds r23, 0x0291 ; 0x800291 164a6: 80 91 92 02 lds r24, 0x0292 ; 0x800292 164aa: 90 91 93 02 lds r25, 0x0293 ; 0x800293 164ae: 1f 92 push r1 164b0: 1f 92 push r1 164b2: 1f 92 push r1 164b4: 1f 92 push r1 164b6: 81 2c mov r8, r1 164b8: 91 2c mov r9, r1 164ba: e8 e4 ldi r30, 0x48 ; 72 164bc: ae 2e mov r10, r30 164be: e2 e4 ldi r30, 0x42 ; 66 164c0: be 2e mov r11, r30 164c2: fd e6 ldi r31, 0x6D ; 109 164c4: cf 2e mov r12, r31 164c6: f2 e1 ldi r31, 0x12 ; 18 164c8: df 2e mov r13, r31 164ca: 0f 94 5a 3a call 0x274b4 ; 0x274b4 st_synchronize(); 164ce: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 164d2: e0 90 98 02 lds r14, 0x0298 ; 0x800298 164d6: f0 90 99 02 lds r15, 0x0299 ; 0x800299 164da: 00 91 9a 02 lds r16, 0x029A ; 0x80029a 164de: 10 91 9b 02 lds r17, 0x029B ; 0x80029b 164e2: 20 91 94 02 lds r18, 0x0294 ; 0x800294 164e6: 30 91 95 02 lds r19, 0x0295 ; 0x800295 164ea: 40 91 96 02 lds r20, 0x0296 ; 0x800296 164ee: 50 91 97 02 lds r21, 0x0297 ; 0x800297 164f2: 60 91 90 02 lds r22, 0x0290 ; 0x800290 164f6: 70 91 91 02 lds r23, 0x0291 ; 0x800291 164fa: 80 91 92 02 lds r24, 0x0292 ; 0x800292 164fe: 90 91 93 02 lds r25, 0x0293 ; 0x800293 16502: 1f 92 push r1 16504: 1f 92 push r1 16506: 1f 92 push r1 16508: 1f 92 push r1 1650a: 81 2c mov r8, r1 1650c: 91 2c mov r9, r1 1650e: a0 e7 ldi r26, 0x70 ; 112 16510: aa 2e mov r10, r26 16512: a1 e4 ldi r26, 0x41 ; 65 16514: ba 2e mov r11, r26 16516: 0f 94 5a 3a call 0x274b4 ; 0x274b4 st_synchronize(); 1651a: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 1651e: 8c e9 ldi r24, 0x9C ; 156 16520: 92 e0 ldi r25, 0x02 ; 2 16522: 0f 94 00 3a call 0x27400 ; 0x27400 memcpy(current_position, saved_pos, sizeof(saved_pos)); 16526: 80 e1 ldi r24, 0x10 ; 16 16528: e0 e9 ldi r30, 0x90 ; 144 1652a: f2 e0 ldi r31, 0x02 ; 2 1652c: a1 e6 ldi r26, 0x61 ; 97 1652e: b2 e1 ldi r27, 0x12 ; 18 16530: 01 90 ld r0, Z+ 16532: 0d 92 st X+, r0 16534: 8a 95 dec r24 16536: e1 f7 brne .-8 ; 0x16530 set_destination_to_current(); 16538: 0e 94 09 67 call 0xce12 ; 0xce12 // Recover feed rate feedmultiply = saved_feedmultiply2; 1653c: 80 91 5f 12 lds r24, 0x125F ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.496> 16540: 90 91 60 12 lds r25, 0x1260 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.496+0x1> 16544: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 16548: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f enquecommandf_P(MSG_M220, saved_feedmultiply2); 1654c: 9f 93 push r25 1654e: 8f 93 push r24 16550: 89 ea ldi r24, 0xA9 ; 169 16552: 95 e6 ldi r25, 0x65 ; 101 16554: 9f 93 push r25 16556: 8f 93 push r24 16558: 0e 94 2b 8e call 0x11c56 ; 0x11c56 if (printingIsPaused()) { 1655c: 0e 94 90 66 call 0xcd20 ; 0xcd20 16560: 0f b6 in r0, 0x3f ; 63 16562: f8 94 cli 16564: de bf out 0x3e, r29 ; 62 16566: 0f be out 0x3f, r0 ; 63 16568: cd bf out 0x3d, r28 ; 61 1656a: 88 23 and r24, r24 1656c: 21 f1 breq .+72 ; 0x165b6 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 1656e: 89 ed ldi r24, 0xD9 ; 217 16570: 9b e4 ldi r25, 0x4B ; 75 16572: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16576: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 1657a: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 1657e: 0c 94 45 a2 jmp 0x1448a ; 0x1448a st_synchronize(); break; // Unload filament case 3: return true; 16582: 31 e0 ldi r19, 0x01 ; 1 16584: 38 a7 std Y+40, r19 ; 0x28 16586: ac cd rjmp .-1192 ; 0x160e0 setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 16588: 20 e0 ldi r18, 0x00 ; 0 1658a: 30 e0 ldi r19, 0x00 ; 0 1658c: 40 ea ldi r20, 0xA0 ; 160 1658e: 50 e4 ldi r21, 0x40 ; 64 16590: c7 01 movw r24, r14 16592: b6 01 movw r22, r12 16594: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 16598: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 1659c: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 165a0: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 165a4: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 165a8: 60 e0 ldi r22, 0x00 ; 0 165aa: 70 e0 ldi r23, 0x00 ; 0 165ac: 80 e0 ldi r24, 0x00 ; 0 165ae: 90 e4 ldi r25, 0x40 ; 64 165b0: 0f 94 a8 49 call 0x29350 ; 0x29350 165b4: 64 cf rjmp .-312 ; 0x1647e if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 165b6: 8a e8 ldi r24, 0x8A ; 138 165b8: 9c e6 ldi r25, 0x6C ; 108 165ba: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 165be: 8f ed ldi r24, 0xDF ; 223 165c0: 98 e6 ldi r25, 0x68 ; 104 165c2: 0e 94 18 7d call 0xfa30 ; 0xfa30 165c6: d9 cf rjmp .-78 ; 0x1657a SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 165c8: 0e 94 90 66 call 0xcd20 ; 0xcd20 165cc: 81 11 cpse r24, r1 165ce: 0c 94 45 a2 jmp 0x1448a ; 0x1448a st_synchronize(); 165d2: 0f 94 5b 18 call 0x230b6 ; 0x230b6 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 165d6: 0e 94 a5 83 call 0x1074a ; 0x1074a cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 165da: 0e 94 9e 79 call 0xf33c ; 0xf33c lcd_pause_print(); 165de: 0f 94 0d 0b call 0x2161a ; 0x2161a 165e2: 0c 94 45 a2 jmp 0x1448a ; 0x1448a /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 165e6: 0e 94 90 66 call 0xcd20 ; 0xcd20 165ea: 88 23 and r24, r24 165ec: 11 f4 brne .+4 ; 0x165f2 165ee: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 165f2: 0c 94 9a a2 jmp 0x14534 ; 0x14534 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 165f6: 81 ea ldi r24, 0xA1 ; 161 165f8: 9d e0 ldi r25, 0x0D ; 13 165fa: 0f 94 3e a4 call 0x3487c ; 0x3487c 165fe: 18 2f mov r17, r24 } if (code_seen('Z')){ 16600: 8a e5 ldi r24, 0x5A ; 90 16602: 0e 94 80 56 call 0xad00 ; 0xad00 16606: 88 23 and r24, r24 16608: 09 f4 brne .+2 ; 0x1660c 1660a: d7 c0 rjmp .+430 ; 0x167ba z_val = code_value(); 1660c: 0e 94 10 5b call 0xb620 ; 0xb620 16610: 2b 01 movw r4, r22 16612: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 16614: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 16618: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1661c: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 16620: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 16624: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 16628: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1662c: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 1662e: 9b 01 movw r18, r22 16630: 21 56 subi r18, 0x61 ; 97 16632: 30 4f sbci r19, 0xF0 ; 240 16634: 20 3a cpi r18, 0xA0 ; 160 16636: 3f 40 sbci r19, 0x0F ; 15 16638: 30 f0 brcs .+12 ; 0x16646 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 1663a: 83 ea ldi r24, 0xA3 ; 163 1663c: 9f e7 ldi r25, 0x7F ; 127 1663e: 0e 94 18 7d call 0xfa30 ; 0xfa30 16642: 0c 94 45 a2 jmp 0x1448a ; 0x1448a break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 16646: 5b e0 ldi r21, 0x0B ; 11 16648: 15 9f mul r17, r21 1664a: 90 01 movw r18, r0 1664c: 11 24 eor r1, r1 1664e: c9 01 movw r24, r18 16650: 80 5b subi r24, 0xB0 ; 176 16652: 92 4f sbci r25, 0xF2 ; 242 16654: 0f 94 80 a4 call 0x34900 ; 0x34900 { 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')) 16658: 8c e4 ldi r24, 0x4C ; 76 1665a: 0e 94 80 56 call 0xad00 ; 0xad00 1665e: bb e0 ldi r27, 0x0B ; 11 16660: 1b 9f mul r17, r27 16662: 70 01 movw r14, r0 16664: 11 24 eor r1, r1 16666: 57 01 movw r10, r14 16668: e7 eb ldi r30, 0xB7 ; 183 1666a: ae 1a sub r10, r30 1666c: e2 ef ldi r30, 0xF2 ; 242 1666e: be 0a sbc r11, r30 16670: 88 23 and r24, r24 16672: 09 f4 brne .+2 ; 0x16676 16674: be c0 rjmp .+380 ; 0x167f2 { char *src = strchr_pointer + 1; 16676: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 1667a: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 1667e: 31 96 adiw r30, 0x01 ; 1 16680: bf 01 movw r22, r30 while (*src == ' ') ++src; 16682: 81 91 ld r24, Z+ 16684: 80 32 cpi r24, 0x20 ; 32 16686: e1 f3 breq .-8 ; 0x16680 if (*src != '\0') 16688: 88 23 and r24, r24 1668a: 31 f0 breq .+12 ; 0x16698 { strncpy(strLabel,src,7); 1668c: 47 e0 ldi r20, 0x07 ; 7 1668e: 50 e0 ldi r21, 0x00 ; 0 16690: ce 01 movw r24, r28 16692: 01 96 adiw r24, 0x01 ; 1 16694: 0f 94 be aa call 0x3557c ; 0x3557c #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); 16698: 47 e0 ldi r20, 0x07 ; 7 1669a: 50 e0 ldi r21, 0x00 ; 0 1669c: b5 01 movw r22, r10 1669e: ce 01 movw r24, r28 166a0: 01 96 adiw r24, 0x01 ; 1 166a2: 0f 94 52 a4 call 0x348a4 ; 0x348a4 else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 166a6: 82 e4 ldi r24, 0x42 ; 66 166a8: 0e 94 80 56 call 0xad00 ; 0xad00 166ac: 57 01 movw r10, r14 166ae: fe ea ldi r31, 0xAE ; 174 166b0: af 1a sub r10, r31 166b2: f2 ef ldi r31, 0xF2 ; 242 166b4: bf 0a sbc r11, r31 166b6: 88 23 and r24, r24 166b8: 09 f4 brne .+2 ; 0x166bc 166ba: a3 c0 rjmp .+326 ; 0x16802 { iBedC = code_value_uint8(); 166bc: 0e 94 95 56 call 0xad2a ; 0xad2a 166c0: 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); 166c2: 68 2f mov r22, r24 166c4: c5 01 movw r24, r10 166c6: 0f 94 62 a4 call 0x348c4 ; 0x348c4 else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 166ca: 80 e5 ldi r24, 0x50 ; 80 166cc: 0e 94 80 56 call 0xad00 ; 0xad00 166d0: 2d ea ldi r18, 0xAD ; 173 166d2: e2 1a sub r14, r18 166d4: 22 ef ldi r18, 0xF2 ; 242 166d6: f2 0a sbc r15, r18 166d8: 88 23 and r24, r24 166da: 09 f4 brne .+2 ; 0x166de 166dc: 97 c0 rjmp .+302 ; 0x1680c { iPindaC = code_value_uint8(); 166de: 0e 94 95 56 call 0xad2a ; 0xad2a 166e2: b8 2e mov r11, r24 166e4: 68 2f mov r22, r24 166e6: c7 01 movw r24, r14 166e8: 0f 94 62 a4 call 0x348c4 ; 0x348c4 else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 166ec: 81 e4 ldi r24, 0x41 ; 65 166ee: 0e 94 80 56 call 0xad00 ; 0xad00 166f2: 88 23 and r24, r24 166f4: 09 f4 brne .+2 ; 0x166f8 166f6: 8f c0 rjmp .+286 ; 0x16816 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 166f8: 0e 94 95 56 call 0xad2a ; 0xad2a 166fc: 81 11 cpse r24, r1 166fe: 06 c0 rjmp .+12 ; 0x1670c 16700: 81 ea ldi r24, 0xA1 ; 161 16702: 9d e0 ldi r25, 0x0D ; 13 16704: 0f 94 3e a4 call 0x3487c ; 0x3487c 16708: 18 13 cpse r17, r24 1670a: 8d c0 rjmp .+282 ; 0x16826 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 1670c: 81 2f mov r24, r17 1670e: 0e 94 e3 78 call 0xf1c6 ; 0xf1c6 16712: 08 2f mov r16, r24 16714: 88 23 and r24, r24 16716: 29 f0 breq .+10 ; 0x16722 16718: 61 2f mov r22, r17 1671a: 81 ea ldi r24, 0xA1 ; 161 1671c: 9d e0 ldi r25, 0x0D ; 13 1671e: 0f 94 62 a4 call 0x348c4 ; 0x348c4 else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 16722: 8c e9 ldi r24, 0x9C ; 156 16724: 9f e7 ldi r25, 0x7F ; 127 16726: 0e 94 1f 7b call 0xf63e ; 0xf63e print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1672a: 61 2f mov r22, r17 1672c: 70 e0 ldi r23, 0x00 ; 0 1672e: 90 e0 ldi r25, 0x00 ; 0 16730: 80 e0 ldi r24, 0x00 ; 0 16732: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 16736: 81 2f mov r24, r17 16738: 0e 94 e3 78 call 0xf1c6 ; 0xf1c6 1673c: 81 11 cpse r24, r1 1673e: 04 c0 rjmp .+8 ; 0x16748 SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 16740: 8b e8 ldi r24, 0x8B ; 139 16742: 9f e7 ldi r25, 0x7F ; 127 16744: 0e 94 18 7d call 0xfa30 ; 0xfa30 SERIAL_PROTOCOLPGM(" Z"); 16748: 88 e8 ldi r24, 0x88 ; 136 1674a: 9f e7 ldi r25, 0x7F ; 127 1674c: 0e 94 1f 7b call 0xf63e ; 0xf63e else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 16750: 44 e0 ldi r20, 0x04 ; 4 16752: c3 01 movw r24, r6 16754: b2 01 movw r22, r4 16756: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 1675a: 85 e8 ldi r24, 0x85 ; 133 1675c: 9f e7 ldi r25, 0x7F ; 127 1675e: 0e 94 1f 7b call 0xf63e ; 0xf63e print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 16762: b6 01 movw r22, r12 16764: dd 0c add r13, r13 16766: 88 0b sbc r24, r24 16768: 99 0b sbc r25, r25 1676a: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 1676e: 82 e8 ldi r24, 0x82 ; 130 16770: 9f e7 ldi r25, 0x7F ; 127 16772: 0e 94 1f 7b call 0xf63e ; 0xf63e 16776: ce 01 movw r24, r28 16778: 01 96 adiw r24, 0x01 ; 1 1677a: 0e 94 11 86 call 0x10c22 ; 0x10c22 SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 1677e: 8f e7 ldi r24, 0x7F ; 127 16780: 9f e7 ldi r25, 0x7F ; 127 16782: 0e 94 1f 7b call 0xf63e ; 0xf63e 16786: 69 2d mov r22, r9 16788: 70 e0 ldi r23, 0x00 ; 0 1678a: 90 e0 ldi r25, 0x00 ; 0 1678c: 80 e0 ldi r24, 0x00 ; 0 1678e: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 16792: 8c e7 ldi r24, 0x7C ; 124 16794: 9f e7 ldi r25, 0x7F ; 127 16796: 0e 94 1f 7b call 0xf63e ; 0xf63e 1679a: 6b 2d mov r22, r11 1679c: 70 e0 ldi r23, 0x00 ; 0 1679e: 90 e0 ldi r25, 0x00 ; 0 167a0: 80 e0 ldi r24, 0x00 ; 0 167a2: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 167a6: 89 e7 ldi r24, 0x79 ; 121 167a8: 9f e7 ldi r25, 0x7F ; 127 167aa: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOLLN((int)bIsActive); 167ae: 80 2f mov r24, r16 167b0: 90 e0 ldi r25, 0x00 ; 0 167b2: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a 167b6: 0c 94 45 a2 jmp 0x1448a ; 0x1448a } 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))); 167ba: ab e0 ldi r26, 0x0B ; 11 167bc: 1a 9f mul r17, r26 167be: c0 01 movw r24, r0 167c0: 11 24 eor r1, r1 167c2: 80 5b subi r24, 0xB0 ; 176 167c4: 92 4f sbci r25, 0xF2 ; 242 167c6: 0f 94 4c a4 call 0x34898 ; 0x34898 167ca: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 167cc: bc 01 movw r22, r24 167ce: 99 0f add r25, r25 167d0: 88 0b sbc r24, r24 167d2: 99 0b sbc r25, r25 167d4: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 167d8: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 167dc: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 167e0: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 167e4: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 167e8: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 167ec: 2b 01 movw r4, r22 167ee: 3c 01 movw r6, r24 167f0: 33 cf rjmp .-410 ; 0x16658 } 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)); 167f2: 47 e0 ldi r20, 0x07 ; 7 167f4: 50 e0 ldi r21, 0x00 ; 0 167f6: b5 01 movw r22, r10 167f8: ce 01 movw r24, r28 167fa: 01 96 adiw r24, 0x01 ; 1 167fc: 0f 94 2e a4 call 0x3485c ; 0x3485c 16800: 52 cf rjmp .-348 ; 0x166a6 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); 16802: c5 01 movw r24, r10 16804: 0f 94 3e a4 call 0x3487c ; 0x3487c 16808: 98 2e mov r9, r24 1680a: 5f cf rjmp .-322 ; 0x166ca 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); 1680c: c7 01 movw r24, r14 1680e: 0f 94 3e a4 call 0x3487c ; 0x3487c 16812: b8 2e mov r11, r24 16814: 6b cf rjmp .-298 ; 0x166ec bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 16816: 81 ea ldi r24, 0xA1 ; 161 16818: 9d e0 ldi r25, 0x0D ; 13 1681a: 0f 94 3e a4 call 0x3487c ; 0x3487c 1681e: 01 e0 ldi r16, 0x01 ; 1 16820: 18 17 cp r17, r24 16822: 09 f4 brne .+2 ; 0x16826 16824: 7e cf rjmp .-260 ; 0x16722 { 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; 16826: 00 e0 ldi r16, 0x00 ; 0 16828: 7c cf rjmp .-264 ; 0x16722 */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 1682a: 83 e5 ldi r24, 0x53 ; 83 1682c: 0e 94 80 56 call 0xad00 ; 0xad00 16830: 88 23 and r24, r24 16832: 11 f4 brne .+4 ; 0x16838 16834: 0c 94 45 a2 jmp 0x1448a ; 0x1448a set_target_pinda = code_value_short(); 16838: 0e 94 a2 56 call 0xad44 ; 0xad44 1683c: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 1683e: 86 eb ldi r24, 0xB6 ; 182 16840: 99 e3 ldi r25, 0x39 ; 57 16842: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16846: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 1684a: 86 e5 ldi r24, 0x56 ; 86 1684c: 9f e7 ldi r25, 0x7F ; 127 1684e: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOLLN(set_target_pinda); 16852: c8 01 movw r24, r16 16854: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a codenum = _millis(); 16858: 0f 94 01 0b call 0x21602 ; 0x21602 1685c: 4b 01 movw r8, r22 1685e: 5c 01 movw r10, r24 cancel_heatup = false; 16860: 10 92 5f 0d sts 0x0D5F, r1 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.390> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 16864: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 16868: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 1686c: 89 2b or r24, r25 1686e: 41 f4 brne .+16 ; 0x16880 16870: ff 24 eor r15, r15 16872: f3 94 inc r15 16874: 80 91 59 12 lds r24, 0x1259 ; 0x801259 16878: 90 91 5a 12 lds r25, 0x125A ; 0x80125a 1687c: 89 2b or r24, r25 1687e: 09 f0 breq .+2 ; 0x16882 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 16880: 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)) ) { 16882: 28 01 movw r4, r16 16884: 01 2e mov r0, r17 16886: 00 0c add r0, r0 16888: 66 08 sbc r6, r6 1688a: 77 08 sbc r7, r7 1688c: f1 10 cpse r15, r1 1688e: 1a c0 rjmp .+52 ; 0x168c4 16890: 80 91 5f 0d lds r24, 0x0D5F ; 0x800d5f <_ZL13cancel_heatup.lto_priv.390> 16894: 81 11 cpse r24, r1 16896: 10 c0 rjmp .+32 ; 0x168b8 16898: c3 01 movw r24, r6 1689a: b2 01 movw r22, r4 1689c: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 168a0: 20 91 85 03 lds r18, 0x0385 ; 0x800385 168a4: 30 91 86 03 lds r19, 0x0386 ; 0x800386 168a8: 40 91 87 03 lds r20, 0x0387 ; 0x800387 168ac: 50 91 88 03 lds r21, 0x0388 ; 0x800388 168b0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 168b4: 18 16 cp r1, r24 168b6: b4 f0 brlt .+44 ; 0x168e4 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 168b8: 80 e9 ldi r24, 0x90 ; 144 168ba: 9a e6 ldi r25, 0x6A ; 106 168bc: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe 168c0: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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)) ) { 168c4: c3 01 movw r24, r6 168c6: b2 01 movw r22, r4 168c8: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 168cc: 20 91 85 03 lds r18, 0x0385 ; 0x800385 168d0: 30 91 86 03 lds r19, 0x0386 ; 0x800386 168d4: 40 91 87 03 lds r20, 0x0387 ; 0x800387 168d8: 50 91 88 03 lds r21, 0x0388 ; 0x800388 168dc: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 168e0: 87 ff sbrs r24, 7 168e2: ea cf rjmp .-44 ; 0x168b8 if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 168e4: 0f 94 01 0b call 0x21602 ; 0x21602 168e8: 68 19 sub r22, r8 168ea: 79 09 sbc r23, r9 168ec: 8a 09 sbc r24, r10 168ee: 9b 09 sbc r25, r11 168f0: 69 3e cpi r22, 0xE9 ; 233 168f2: 73 40 sbci r23, 0x03 ; 3 168f4: 81 05 cpc r24, r1 168f6: 91 05 cpc r25, r1 168f8: c8 f0 brcs .+50 ; 0x1692c { SERIAL_PROTOCOLPGM("P:"); 168fa: 83 e5 ldi r24, 0x53 ; 83 168fc: 9f e7 ldi r25, 0x7F ; 127 168fe: 0e 94 1f 7b call 0xf63e ; 0xf63e else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 16902: 60 91 85 03 lds r22, 0x0385 ; 0x800385 16906: 70 91 86 03 lds r23, 0x0386 ; 0x800386 1690a: 80 91 87 03 lds r24, 0x0387 ; 0x800387 1690e: 90 91 88 03 lds r25, 0x0388 ; 0x800388 16912: 41 e0 ldi r20, 0x01 ; 1 16914: 0e 94 a1 7a call 0xf542 ; 0xf542 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 16918: 8f e2 ldi r24, 0x2F ; 47 1691a: 0e 94 0c 7a call 0xf418 ; 0xf418 SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 1691e: c8 01 movw r24, r16 16920: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a codenum = _millis(); 16924: 0f 94 01 0b call 0x21602 ; 0x21602 16928: 4b 01 movw r8, r22 1692a: 5c 01 movw r10, r24 } manage_heater(); 1692c: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(); 16930: 80 e0 ldi r24, 0x00 ; 0 16932: 0e 94 b0 8a call 0x11560 ; 0x11560 lcd_update(0); 16936: 80 e0 ldi r24, 0x00 ; 0 16938: 0e 94 54 6f call 0xdea8 ; 0xdea8 1693c: a7 cf rjmp .-178 ; 0x1688c - `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 1693e: 8f e3 ldi r24, 0x3F ; 63 16940: 0e 94 80 56 call 0xad00 ; 0xad00 16944: 88 23 and r24, r24 16946: c9 f0 breq .+50 ; 0x1697a SERIAL_PROTOCOLPGM("PINDA cal status: "); 16948: 80 e4 ldi r24, 0x40 ; 64 1694a: 9f e7 ldi r25, 0x7F ; 127 1694c: 0e 94 1f 7b call 0xf63e ; 0xf63e 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); } 16950: 86 ea ldi r24, 0xA6 ; 166 16952: 9f e0 ldi r25, 0x0F ; 15 16954: 0f 94 3e a4 call 0x3487c ; 0x3487c 16958: 21 e0 ldi r18, 0x01 ; 1 1695a: 30 e0 ldi r19, 0x00 ; 0 1695c: 81 11 cpse r24, r1 1695e: 02 c0 rjmp .+4 ; 0x16964 16960: 30 e0 ldi r19, 0x00 ; 0 16962: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 16964: c9 01 movw r24, r18 16966: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a SERIAL_PROTOCOLLNRPGM(_header); 1696a: 89 e2 ldi r24, 0x29 ; 41 1696c: 9f e7 ldi r25, 0x7F ; 127 1696e: 0e 94 18 7d call 0xfa30 ; 0xfa30 gcode_M861_print_pinda_cal_eeprom(); 16972: 0e 94 57 7b call 0xf6ae ; 0xf6ae 16976: 0c 94 45 a2 jmp 0x1448a ; 0x1448a } else if (code_seen('!')) { // ! - Set factory default values 1697a: 81 e2 ldi r24, 0x21 ; 33 1697c: 0e 94 80 56 call 0xad00 ; 0xad00 16980: 88 23 and r24, r24 16982: 49 f1 breq .+82 ; 0x169d6 16984: 61 e0 ldi r22, 0x01 ; 1 16986: 86 ea ldi r24, 0xA6 ; 166 16988: 9f e0 ldi r25, 0x0F ; 15 1698a: 0f 94 62 a4 call 0x348c4 ; 0x348c4 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1698e: 68 e0 ldi r22, 0x08 ; 8 16990: 70 e0 ldi r23, 0x00 ; 0 16992: 80 eb ldi r24, 0xB0 ; 176 16994: 9f e0 ldi r25, 0x0F ; 15 16996: 0f 94 80 a4 call 0x34900 ; 0x34900 1699a: 68 e1 ldi r22, 0x18 ; 24 1699c: 70 e0 ldi r23, 0x00 ; 0 1699e: 82 eb ldi r24, 0xB2 ; 178 169a0: 9f e0 ldi r25, 0x0F ; 15 169a2: 0f 94 80 a4 call 0x34900 ; 0x34900 169a6: 60 e3 ldi r22, 0x30 ; 48 169a8: 70 e0 ldi r23, 0x00 ; 0 169aa: 84 eb ldi r24, 0xB4 ; 180 169ac: 9f e0 ldi r25, 0x0F ; 15 169ae: 0f 94 80 a4 call 0x34900 ; 0x34900 169b2: 60 e5 ldi r22, 0x50 ; 80 169b4: 70 e0 ldi r23, 0x00 ; 0 169b6: 86 eb ldi r24, 0xB6 ; 182 169b8: 9f e0 ldi r25, 0x0F ; 15 169ba: 0f 94 80 a4 call 0x34900 ; 0x34900 169be: 68 e7 ldi r22, 0x78 ; 120 169c0: 70 e0 ldi r23, 0x00 ; 0 169c2: 88 eb ldi r24, 0xB8 ; 184 169c4: 9f e0 ldi r25, 0x0F ; 15 169c6: 0f 94 80 a4 call 0x34900 ; 0x34900 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"); 169ca: 88 e1 ldi r24, 0x18 ; 24 169cc: 9f e7 ldi r25, 0x7F ; 127 169ce: 0e 94 18 7d call 0xfa30 ; 0xfa30 169d2: 0c 94 45 a2 jmp 0x1448a ; 0x1448a } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 169d6: 8a e5 ldi r24, 0x5A ; 90 169d8: 0e 94 80 56 call 0xad00 ; 0xad00 169dc: 88 23 and r24, r24 169de: c1 f0 breq .+48 ; 0x16a10 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 169e0: 61 e0 ldi r22, 0x01 ; 1 169e2: 86 ea ldi r24, 0xA6 ; 166 169e4: 9f e0 ldi r25, 0x0F ; 15 169e6: 0f 94 62 a4 call 0x348c4 ; 0x348c4 169ea: 00 eb ldi r16, 0xB0 ; 176 169ec: 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); 169ee: 70 e0 ldi r23, 0x00 ; 0 169f0: 60 e0 ldi r22, 0x00 ; 0 169f2: c8 01 movw r24, r16 169f4: 0f 94 80 a4 call 0x34900 ; 0x34900 169f8: 0e 5f subi r16, 0xFE ; 254 169fa: 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++) { 169fc: 0a 3b cpi r16, 0xBA ; 186 169fe: 4f e0 ldi r20, 0x0F ; 15 16a00: 14 07 cpc r17, r20 16a02: a9 f7 brne .-22 ; 0x169ee eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 16a04: 8e e0 ldi r24, 0x0E ; 14 16a06: 9f e7 ldi r25, 0x7F ; 127 16a08: 0e 94 18 7d call 0xfa30 ; 0xfa30 16a0c: 0c 94 45 a2 jmp 0x1448a ; 0x1448a } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 16a10: 83 e5 ldi r24, 0x53 ; 83 16a12: 0e 94 80 56 call 0xad00 ; 0xad00 16a16: 88 23 and r24, r24 16a18: 21 f1 breq .+72 ; 0x16a62 int16_t usteps = code_value_short(); 16a1a: 0e 94 a2 56 call 0xad44 ; 0xad44 16a1e: 8c 01 movw r16, r24 if (code_seen('I')) { 16a20: 89 e4 ldi r24, 0x49 ; 73 16a22: 0e 94 80 56 call 0xad00 ; 0xad00 16a26: 88 23 and r24, r24 16a28: 11 f4 brne .+4 ; 0x16a2e 16a2a: 0c 94 45 a2 jmp 0x1448a ; 0x1448a uint8_t index = code_value_uint8(); 16a2e: 0e 94 95 56 call 0xad2a ; 0xad2a if (index < 5) { 16a32: 85 30 cpi r24, 0x05 ; 5 16a34: 10 f0 brcs .+4 ; 0x16a3a 16a36: 0c 94 45 a2 jmp 0x1448a ; 0x1448a eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 16a3a: 90 e0 ldi r25, 0x00 ; 0 16a3c: 88 52 subi r24, 0x28 ; 40 16a3e: 98 4f sbci r25, 0xF8 ; 248 16a40: b8 01 movw r22, r16 16a42: 88 0f add r24, r24 16a44: 99 1f adc r25, r25 16a46: 0f 94 80 a4 call 0x34900 ; 0x34900 SERIAL_PROTOCOLLNRPGM(MSG_OK); 16a4a: 80 e9 ldi r24, 0x90 ; 144 16a4c: 9a e6 ldi r25, 0x6A ; 106 16a4e: 0e 94 18 7d call 0xfa30 ; 0xfa30 SERIAL_PROTOCOLLNRPGM(_header); 16a52: 89 e2 ldi r24, 0x29 ; 41 16a54: 9f e7 ldi r25, 0x7F ; 127 16a56: 0e 94 18 7d call 0xfa30 ; 0xfa30 gcode_M861_print_pinda_cal_eeprom(); 16a5a: 0e 94 57 7b call 0xf6ae ; 0xf6ae 16a5e: 0c 94 45 a2 jmp 0x1448a ; 0x1448a } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 16a62: 8d ef ldi r24, 0xFD ; 253 16a64: 9e e7 ldi r25, 0x7E ; 126 16a66: 0e 94 18 7d call 0xfa30 ; 0xfa30 16a6a: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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) 16a6e: 64 30 cpi r22, 0x04 ; 4 16a70: 09 f4 brne .+2 ; 0x16a74 16a72: be c0 rjmp .+380 ; 0x16bf0 16a74: 65 30 cpi r22, 0x05 ; 5 16a76: 11 f0 breq .+4 ; 0x16a7c 16a78: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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')) 16a7c: 80 e5 ldi r24, 0x50 ; 80 16a7e: 0e 94 80 56 call 0xad00 ; 0xad00 16a82: 88 23 and r24, r24 16a84: 09 f4 brne .+2 ; 0x16a88 16a86: 3a c1 rjmp .+628 ; 0x16cfc { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 16a88: 0e 94 e8 56 call 0xadd0 ; 0xadd0 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 16a8c: 10 91 e8 03 lds r17, 0x03E8 ; 0x8003e8 16a90: 11 23 and r17, r17 16a92: 11 f4 brne .+4 ; 0x16a98 16a94: 0c 94 45 a2 jmp 0x1448a ; 0x1448a return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 16a98: 62 30 cpi r22, 0x02 ; 2 16a9a: 71 05 cpc r23, r1 16a9c: 10 f4 brcc .+4 ; 0x16aa2 16a9e: 0c 94 45 a2 jmp 0x1448a ; 0x1448a // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 16aa2: 85 eb ldi r24, 0xB5 ; 181 16aa4: 96 e3 ldi r25, 0x36 ; 54 16aa6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16aaa: 7c 01 movw r14, r24 16aac: 84 e8 ldi r24, 0x84 ; 132 16aae: 96 e3 ldi r25, 0x36 ; 54 16ab0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16ab4: 41 2f mov r20, r17 16ab6: b7 01 movw r22, r14 16ab8: 0e 94 a3 e8 call 0x1d146 ; 0x1d146 16abc: 0c 94 45 a2 jmp 0x1448a ; 0x1448a ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 16ac0: 80 e5 ldi r24, 0x50 ; 80 16ac2: 0e 94 80 56 call 0xad00 ; 0xad00 16ac6: 88 23 and r24, r24 16ac8: a9 f0 breq .+42 ; 0x16af4 { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 16aca: 0e 94 10 5b call 0xb620 ; 0xb620 16ace: 20 e0 ldi r18, 0x00 ; 0 16ad0: 30 e0 ldi r19, 0x00 ; 0 16ad2: 4a e7 ldi r20, 0x7A ; 122 16ad4: 54 e4 ldi r21, 0x44 ; 68 16ad6: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 16ada: 20 e0 ldi r18, 0x00 ; 0 16adc: 30 e0 ldi r19, 0x00 ; 0 16ade: 40 e0 ldi r20, 0x00 ; 0 16ae0: 5f e3 ldi r21, 0x3F ; 63 16ae2: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 16ae6: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> nozzle_diameter_check(nDiameter); 16aea: cb 01 movw r24, r22 16aec: 0e 94 e2 e8 call 0x1d1c4 ; 0x1d1c4 16af0: 0c 94 45 a2 jmp 0x1448a ; 0x1448a } else if(code_seen('Q')) 16af4: 81 e5 ldi r24, 0x51 ; 81 16af6: 0e 94 80 56 call 0xad00 ; 0xad00 16afa: 88 23 and r24, r24 16afc: 11 f4 brne .+4 ; 0x16b02 16afe: 0c 94 45 a2 jmp 0x1448a ; 0x1448a SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 16b02: 85 ea ldi r24, 0xA5 ; 165 16b04: 9d e0 ldi r25, 0x0D ; 13 16b06: 0f 94 4c a4 call 0x34898 ; 0x34898 16b0a: bc 01 movw r22, r24 16b0c: 90 e0 ldi r25, 0x00 ; 0 16b0e: 80 e0 ldi r24, 0x00 ; 0 16b10: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 16b14: 20 e0 ldi r18, 0x00 ; 0 16b16: 30 e0 ldi r19, 0x00 ; 0 16b18: 4a e7 ldi r20, 0x7A ; 122 16b1a: 54 e4 ldi r21, 0x44 ; 68 16b1c: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 16b20: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 16b24: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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')) 16b28: 81 e5 ldi r24, 0x51 ; 81 16b2a: 0e 94 80 56 call 0xad00 ; 0xad00 16b2e: 88 23 and r24, r24 16b30: 11 f4 brne .+4 ; 0x16b36 16b32: 0c 94 45 a2 jmp 0x1448a ; 0x1448a print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 16b36: b8 01 movw r22, r16 16b38: 90 e0 ldi r25, 0x00 ; 0 16b3a: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 16b3c: 4a e0 ldi r20, 0x0A ; 10 16b3e: 0e 94 20 7a call 0xf440 ; 0xf440 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 16b42: 0e 94 17 7b call 0xf62e ; 0xf62e 16b46: 0c 94 45 a2 jmp 0x1448a ; 0x1448a return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 16b4a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 return _sPrinterMmuName; 16b4e: 74 ee ldi r23, 0xE4 ; 228 16b50: e7 2e mov r14, r23 16b52: 79 e7 ldi r23, 0x79 ; 121 16b54: f7 2e mov r15, r23 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 16b56: 81 30 cpi r24, 0x01 ; 1 16b58: 21 f0 breq .+8 ; 0x16b62 return _sPrinterMmuName; } else { return _sPrinterName; 16b5a: 6e ed ldi r22, 0xDE ; 222 16b5c: e6 2e mov r14, r22 16b5e: 69 e7 ldi r22, 0x79 ; 121 16b60: f6 2e mov r15, r22 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 16b62: 80 e5 ldi r24, 0x50 ; 80 16b64: 0e 94 80 56 call 0xad00 ; 0xad00 16b68: 88 23 and r24, r24 16b6a: b1 f1 breq .+108 ; 0x16bd8 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 16b6c: 62 e2 ldi r22, 0x22 ; 34 16b6e: 70 e0 ldi r23, 0x00 ; 0 16b70: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 16b74: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 16b78: 0f 94 95 aa call 0x3552a ; 0x3552a 16b7c: 8c 01 movw r16, r24 if (!this->ptr) { 16b7e: 89 2b or r24, r25 16b80: d1 f0 breq .+52 ; 0x16bb6 // First quote not found return; } // Skip the leading quote this->ptr++; 16b82: 0f 5f subi r16, 0xFF ; 255 16b84: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 16b86: 62 e2 ldi r22, 0x22 ; 34 16b88: 70 e0 ldi r23, 0x00 ; 0 16b8a: c8 01 movw r24, r16 16b8c: 0f 94 95 aa call 0x3552a ; 0x3552a if(!pStrEnd) { 16b90: 00 97 sbiw r24, 0x00 ; 0 16b92: 89 f0 breq .+34 ; 0x16bb6 // Second quote not found return; } this->len = pStrEnd - this->ptr; 16b94: d8 2e mov r13, r24 16b96: d0 1a sub r13, r16 16b98: c7 01 movw r24, r14 16b9a: 0f 94 fc a1 call 0x343f8 ; 0x343f8 <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 16b9e: d8 12 cpse r13, r24 16ba0: 0a c0 rjmp .+20 ; 0x16bb6 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 16ba2: ac 01 movw r20, r24 16ba4: 55 27 eor r21, r21 16ba6: b7 01 movw r22, r14 16ba8: c8 01 movw r24, r16 16baa: 0f 94 1d a2 call 0x3443a ; 0x3443a 16bae: 89 2b or r24, r25 16bb0: 11 f4 brne .+4 ; 0x16bb6 16bb2: 0c 94 45 a2 jmp 0x1448a ; 0x1448a } } render_M862_warnings( 16bb6: f0 90 ea 03 lds r15, 0x03EA ; 0x8003ea 16bba: 89 ec ldi r24, 0xC9 ; 201 16bbc: 97 e3 ldi r25, 0x37 ; 55 16bbe: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16bc2: 8c 01 movw r16, r24 16bc4: 81 e9 ldi r24, 0x91 ; 145 16bc6: 97 e3 ldi r25, 0x37 ; 55 16bc8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16bcc: 4f 2d mov r20, r15 16bce: b8 01 movw r22, r16 16bd0: 0e 94 a3 e8 call 0x1d146 ; 0x1d146 16bd4: 0c 94 45 a2 jmp 0x1448a ; 0x1448a { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 16bd8: 81 e5 ldi r24, 0x51 ; 81 16bda: 0e 94 80 56 call 0xad00 ; 0xad00 16bde: 88 23 and r24, r24 16be0: 11 f4 brne .+4 ; 0x16be6 16be2: 0c 94 45 a2 jmp 0x1448a ; 0x1448a SERIAL_PROTOCOLLNRPGM(type); 16be6: c7 01 movw r24, r14 16be8: 0e 94 18 7d call 0xfa30 ; 0xfa30 16bec: 0c 94 45 a2 jmp 0x1448a ; 0x1448a } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 16bf0: 80 e5 ldi r24, 0x50 ; 80 16bf2: 0e 94 80 56 call 0xad00 ; 0xad00 16bf6: 88 23 and r24, r24 16bf8: 09 f4 brne .+2 ; 0x16bfc 16bfa: 77 c0 rjmp .+238 ; 0x16cea fw_version_check(++strchr_pointer); 16bfc: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 16c00: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 16c04: 01 96 adiw r24, 0x01 ; 1 16c06: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 16c0a: 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) 16c0e: 20 91 e9 03 lds r18, 0x03E9 ; 0x8003e9 16c12: 22 23 and r18, r18 16c14: 11 f4 brne .+4 ; 0x16c1a 16c16: 0c 94 45 a2 jmp 0x1448a ; 0x1448a return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 16c1a: be 01 movw r22, r28 16c1c: 6f 5f subi r22, 0xFF ; 255 16c1e: 7f 4f sbci r23, 0xFF ; 255 16c20: 0e 94 86 d7 call 0x1af0c ; 0x1af0c nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 16c24: 8a e0 ldi r24, 0x0A ; 10 16c26: 90 e0 ldi r25, 0x00 ; 0 16c28: 0f 94 4c a4 call 0x34898 ; 0x34898 16c2c: 29 81 ldd r18, Y+1 ; 0x01 16c2e: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16c30: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16c32: 82 17 cp r24, r18 16c34: 93 07 cpc r25, r19 16c36: 28 f0 brcs .+10 ; 0x16c42 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16c38: 11 e0 ldi r17, 0x01 ; 1 16c3a: 28 17 cp r18, r24 16c3c: 39 07 cpc r19, r25 16c3e: 08 f4 brcc .+2 ; 0x16c42 16c40: 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; 16c42: 12 95 swap r17 16c44: 11 0f add r17, r17 16c46: 11 0f add r17, r17 16c48: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 16c4a: 8c e0 ldi r24, 0x0C ; 12 16c4c: 90 e0 ldi r25, 0x00 ; 0 16c4e: 0f 94 4c a4 call 0x34898 ; 0x34898 16c52: ac 01 movw r20, r24 16c54: 2b 81 ldd r18, Y+3 ; 0x03 16c56: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16c58: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16c5a: 42 17 cp r20, r18 16c5c: 53 07 cpc r21, r19 16c5e: 28 f0 brcs .+10 ; 0x16c6a return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16c60: 81 e0 ldi r24, 0x01 ; 1 16c62: 24 17 cp r18, r20 16c64: 35 07 cpc r19, r21 16c66: 08 f4 brcc .+2 ; 0x16c6a 16c68: 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; 16c6a: 50 e1 ldi r21, 0x10 ; 16 16c6c: 85 9f mul r24, r21 16c6e: c0 01 movw r24, r0 16c70: 11 24 eor r1, r1 16c72: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 16c74: 8e e0 ldi r24, 0x0E ; 14 16c76: 90 e0 ldi r25, 0x00 ; 0 16c78: 0f 94 4c a4 call 0x34898 ; 0x34898 16c7c: ac 01 movw r20, r24 16c7e: 2d 81 ldd r18, Y+5 ; 0x05 16c80: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16c82: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16c84: 42 17 cp r20, r18 16c86: 53 07 cpc r21, r19 16c88: 28 f0 brcs .+10 ; 0x16c94 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16c8a: 81 e0 ldi r24, 0x01 ; 1 16c8c: 24 17 cp r18, r20 16c8e: 35 07 cpc r19, r21 16c90: 08 f4 brcc .+2 ; 0x16c94 16c92: 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; 16c94: a4 e0 ldi r26, 0x04 ; 4 16c96: 8a 9f mul r24, r26 16c98: c0 01 movw r24, r0 16c9a: 11 24 eor r1, r1 16c9c: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 16c9e: 80 e1 ldi r24, 0x10 ; 16 16ca0: 90 e0 ldi r25, 0x00 ; 0 16ca2: 0f 94 4c a4 call 0x34898 ; 0x34898 16ca6: ac 01 movw r20, r24 16ca8: 2f 81 ldd r18, Y+7 ; 0x07 16caa: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16cac: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16cae: 42 17 cp r20, r18 16cb0: 53 07 cpc r21, r19 16cb2: 28 f0 brcs .+10 ; 0x16cbe return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16cb4: 91 e0 ldi r25, 0x01 ; 1 16cb6: 24 17 cp r18, r20 16cb8: 35 07 cpc r19, r21 16cba: 08 f4 brcc .+2 ; 0x16cbe 16cbc: 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)); 16cbe: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 16cc0: 16 35 cpi r17, 0x56 ; 86 16cc2: 10 f4 brcc .+4 ; 0x16cc8 16cc4: 0c 94 45 a2 jmp 0x1448a ; 0x1448a SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 16cc8: f0 90 e9 03 lds r15, 0x03E9 ; 0x8003e9 16ccc: 8e e3 ldi r24, 0x3E ; 62 16cce: 97 e3 ldi r25, 0x37 ; 55 16cd0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16cd4: 8c 01 movw r16, r24 16cd6: 8e e0 ldi r24, 0x0E ; 14 16cd8: 97 e3 ldi r25, 0x37 ; 55 16cda: 0e 94 95 75 call 0xeb2a ; 0xeb2a 16cde: 4f 2d mov r20, r15 16ce0: b8 01 movw r22, r16 16ce2: 0e 94 a3 e8 call 0x1d146 ; 0x1d146 16ce6: 0c 94 45 a2 jmp 0x1448a ; 0x1448a else if(code_seen('Q')) 16cea: 81 e5 ldi r24, 0x51 ; 81 16cec: 0e 94 80 56 call 0xad00 ; 0xad00 16cf0: 88 23 and r24, r24 16cf2: 11 f4 brne .+4 ; 0x16cf8 16cf4: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 16cf8: 0c 94 0f 9e jmp 0x13c1e ; 0x13c1e { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 16cfc: 81 e5 ldi r24, 0x51 ; 81 16cfe: 0e 94 80 56 call 0xad00 ; 0xad00 16d02: 88 23 and r24, r24 16d04: 11 f4 brne .+4 ; 0x16d0a 16d06: 0c 94 45 a2 jmp 0x1448a ; 0x1448a SERIAL_PROTOCOLLN(GCODE_LEVEL); 16d0a: 81 e0 ldi r24, 0x01 ; 1 16d0c: 90 e0 ldi r25, 0x00 ; 0 16d0e: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a 16d12: 0c 94 45 a2 jmp 0x1448a ; 0x1448a * 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; 16d16: 8b e4 ldi r24, 0x4B ; 75 16d18: 0e 94 80 56 call 0xad00 ; 0xad00 16d1c: c1 2c mov r12, r1 16d1e: d1 2c mov r13, r1 16d20: e1 2c mov r14, r1 16d22: 50 ec ldi r21, 0xC0 ; 192 16d24: f5 2e mov r15, r21 16d26: 88 23 and r24, r24 16d28: 49 f1 breq .+82 ; 0x16d7c 16d2a: 0e 94 10 5b call 0xb620 ; 0xb620 16d2e: 6b 01 movw r12, r22 16d30: 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) 16d32: 20 e0 ldi r18, 0x00 ; 0 16d34: 30 e0 ldi r19, 0x00 ; 0 16d36: a9 01 movw r20, r18 16d38: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 16d3c: 81 11 cpse r24, r1 16d3e: 1e c0 rjmp .+60 ; 0x16d7c { extruder_advance_K = 0; 16d40: 10 92 a7 04 sts 0x04A7, r1 ; 0x8004a7 16d44: 10 92 a8 04 sts 0x04A8, r1 ; 0x8004a8 16d48: 10 92 a9 04 sts 0x04A9, r1 ; 0x8004a9 16d4c: 10 92 aa 04 sts 0x04AA, r1 ; 0x8004aa 16d50: 0e 94 87 84 call 0x1090e ; 0x1090e else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 16d54: 84 ee ldi r24, 0xE4 ; 228 16d56: 92 ea ldi r25, 0xA2 ; 162 16d58: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOPGM("Advance K="); 16d5c: 8b eb ldi r24, 0xBB ; 187 16d5e: 99 e7 ldi r25, 0x79 ; 121 16d60: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN(extruder_advance_K); 16d64: 60 91 a7 04 lds r22, 0x04A7 ; 0x8004a7 16d68: 70 91 a8 04 lds r23, 0x04A8 ; 0x8004a8 16d6c: 80 91 a9 04 lds r24, 0x04A9 ; 0x8004a9 16d70: 90 91 aa 04 lds r25, 0x04AA ; 0x8004aa 16d74: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 16d78: 0c 94 45 a2 jmp 0x1448a ; 0x1448a } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 16d7c: 80 91 43 03 lds r24, 0x0343 ; 0x800343 16d80: 81 11 cpse r24, r1 16d82: 1b c0 rjmp .+54 ; 0x16dba { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 16d84: 20 e0 ldi r18, 0x00 ; 0 16d86: 30 e0 ldi r19, 0x00 ; 0 16d88: a9 01 movw r20, r18 16d8a: c7 01 movw r24, r14 16d8c: b6 01 movw r22, r12 16d8e: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 16d92: 87 ff sbrs r24, 7 16d94: 05 c0 rjmp .+10 ; 0x16da0 } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 16d96: 86 ec ldi r24, 0xC6 ; 198 16d98: 99 e7 ldi r25, 0x79 ; 121 16d9a: 0e 94 18 7d call 0xfa30 ; 0xfa30 16d9e: da cf rjmp .-76 ; 0x16d54 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 16da0: 20 e0 ldi r18, 0x00 ; 0 16da2: 30 e0 ldi r19, 0x00 ; 0 16da4: 40 e2 ldi r20, 0x20 ; 32 16da6: 51 e4 ldi r21, 0x41 ; 65 16da8: c7 01 movw r24, r14 16daa: b6 01 movw r22, r12 16dac: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 16db0: 87 ff sbrs r24, 7 16db2: 2c c0 rjmp .+88 ; 0x16e0c 16db4: 81 e0 ldi r24, 0x01 ; 1 16db6: 0e 94 87 84 call 0x1090e ; 0x1090e } if(la10c_mode == LA10C_LA15) 16dba: 80 91 43 03 lds r24, 0x0343 ; 0x800343 return (k >= 0 && k < LA_K_MAX? k: -1); 16dbe: 20 e0 ldi r18, 0x00 ; 0 16dc0: 30 e0 ldi r19, 0x00 ; 0 16dc2: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 16dc4: 81 30 cpi r24, 0x01 ; 1 16dc6: 21 f5 brne .+72 ; 0x16e10 return (k >= 0 && k < LA_K_MAX? k: -1); 16dc8: c7 01 movw r24, r14 16dca: b6 01 movw r22, r12 16dcc: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 16dd0: 87 fd sbrc r24, 7 16dd2: e1 cf rjmp .-62 ; 0x16d96 16dd4: 20 e0 ldi r18, 0x00 ; 0 16dd6: 30 e0 ldi r19, 0x00 ; 0 16dd8: 40 e2 ldi r20, 0x20 ; 32 16dda: 51 e4 ldi r21, 0x41 ; 65 16ddc: c7 01 movw r24, r14 16dde: b6 01 movw r22, r12 16de0: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 16de4: 87 ff sbrs r24, 7 16de6: d7 cf rjmp .-82 ; 0x16d96 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 16de8: 20 e0 ldi r18, 0x00 ; 0 16dea: 30 e0 ldi r19, 0x00 ; 0 16dec: a9 01 movw r20, r18 16dee: c7 01 movw r24, r14 16df0: b6 01 movw r22, r12 16df2: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 16df6: 87 fd sbrc r24, 7 16df8: ce cf rjmp .-100 ; 0x16d96 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 16dfa: c0 92 a7 04 sts 0x04A7, r12 ; 0x8004a7 16dfe: d0 92 a8 04 sts 0x04A8, r13 ; 0x8004a8 16e02: e0 92 a9 04 sts 0x04A9, r14 ; 0x8004a9 16e06: f0 92 aa 04 sts 0x04AA, r15 ; 0x8004aa 16e0a: a4 cf rjmp .-184 ; 0x16d54 if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 16e0c: 82 e0 ldi r24, 0x02 ; 2 16e0e: d3 cf rjmp .-90 ; 0x16db6 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 16e10: c7 01 movw r24, r14 16e12: b6 01 movw r22, r12 16e14: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 16e18: 87 fd sbrc r24, 7 16e1a: bd cf rjmp .-134 ; 0x16d96 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 16e1c: 2f e6 ldi r18, 0x6F ; 111 16e1e: 32 e1 ldi r19, 0x12 ; 18 16e20: 43 e0 ldi r20, 0x03 ; 3 16e22: 5b e3 ldi r21, 0x3B ; 59 16e24: c7 01 movw r24, r14 16e26: b6 01 movw r22, r12 16e28: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 16e2c: 2a e0 ldi r18, 0x0A ; 10 16e2e: 37 ed ldi r19, 0xD7 ; 215 16e30: 43 e2 ldi r20, 0x23 ; 35 16e32: 5c e3 ldi r21, 0x3C ; 60 16e34: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 16e38: 6b 01 movw r12, r22 16e3a: 7c 01 movw r14, r24 return new_K < 0? 0: 16e3c: 20 e0 ldi r18, 0x00 ; 0 16e3e: 30 e0 ldi r19, 0x00 ; 0 16e40: a9 01 movw r20, r18 16e42: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 16e46: 87 fd sbrc r24, 7 16e48: 11 c0 rjmp .+34 ; 0x16e6c new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 16e4a: 20 e0 ldi r18, 0x00 ; 0 16e4c: 30 e0 ldi r19, 0x00 ; 0 16e4e: 40 e2 ldi r20, 0x20 ; 32 16e50: 51 e4 ldi r21, 0x41 ; 65 16e52: c7 01 movw r24, r14 16e54: b6 01 movw r22, r12 16e56: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 16e5a: 18 16 cp r1, r24 16e5c: 2c f6 brge .-118 ; 0x16de8 16e5e: c1 2c mov r12, r1 16e60: d1 2c mov r13, r1 16e62: 40 e2 ldi r20, 0x20 ; 32 16e64: e4 2e mov r14, r20 16e66: 41 e4 ldi r20, 0x41 ; 65 16e68: f4 2e mov r15, r20 16e6a: c7 cf rjmp .-114 ; 0x16dfa // 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: 16e6c: c1 2c mov r12, r1 16e6e: d1 2c mov r13, r1 16e70: 76 01 movw r14, r12 16e72: c3 cf rjmp .-122 ; 0x16dfa } } 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()); 16e74: 83 e5 ldi r24, 0x53 ; 83 16e76: 0e 94 80 56 call 0xad00 ; 0xad00 16e7a: 88 23 and r24, r24 16e7c: 59 f0 breq .+22 ; 0x16e94 16e7e: 10 e0 ldi r17, 0x00 ; 0 16e80: 0e 94 10 5b call 0xb620 ; 0xb620 16e84: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 16e88: 81 2f mov r24, r17 16e8a: 0f 94 a7 17 call 0x22f4e ; 0x22f4e 16e8e: 1f 5f subi r17, 0xFF ; 255 16e90: 15 30 cpi r17, 0x05 ; 5 16e92: b1 f7 brne .-20 ; 0x16e80 16e94: 34 ec ldi r19, 0xC4 ; 196 16e96: e3 2e mov r14, r19 16e98: 32 e0 ldi r19, 0x02 ; 2 16e9a: f3 2e mov r15, r19 16e9c: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i 16ea8: 88 23 and r24, r24 16eaa: 39 f0 breq .+14 ; 0x16eba 16eac: 0e 94 10 5b call 0xb620 ; 0xb620 16eb0: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 16eb4: 81 2f mov r24, r17 16eb6: 0f 94 a7 17 call 0x22f4e ; 0x22f4e 16eba: 1f 5f subi r17, 0xFF ; 255 16ebc: 14 30 cpi r17, 0x04 ; 4 16ebe: 79 f7 brne .-34 ; 0x16e9e if(code_seen('B')) microstep_mode(4,code_value()); 16ec0: 82 e4 ldi r24, 0x42 ; 66 16ec2: 0e 94 80 56 call 0xad00 ; 0xad00 16ec6: 88 23 and r24, r24 16ec8: 39 f0 breq .+14 ; 0x16ed8 16eca: 0e 94 10 5b call 0xb620 ; 0xb620 16ece: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 16ed2: 84 e0 ldi r24, 0x04 ; 4 16ed4: 0f 94 a7 17 call 0x22f4e ; 0x22f4e microstep_readings(); 16ed8: 0f 94 cd 16 call 0x22d9a ; 0x22d9a 16edc: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 16ee0: 24 ec ldi r18, 0xC4 ; 196 16ee2: e2 2e mov r14, r18 16ee4: 22 e0 ldi r18, 0x02 ; 2 16ee6: 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()) 16ee8: 10 e0 ldi r17, 0x00 ; 0 { case 1: for(int i=0;i 16ef4: 88 23 and r24, r24 16ef6: 41 f0 breq .+16 ; 0x16f08 16ef8: 0e 94 10 5b call 0xb620 ; 0xb620 16efc: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 16f00: 4f ef ldi r20, 0xFF ; 255 16f02: 81 2f mov r24, r17 16f04: 0f 94 28 17 call 0x22e50 ; 0x22e50 16f08: 1f 5f subi r17, 0xFF ; 255 16f0a: 14 30 cpi r17, 0x04 ; 4 16f0c: 71 f7 brne .-36 ; 0x16eea if(code_seen('B')) microstep_ms(4,code_value(),-1); 16f0e: 82 e4 ldi r24, 0x42 ; 66 16f10: 0e 94 80 56 call 0xad00 ; 0xad00 16f14: 88 23 and r24, r24 16f16: 11 f4 brne .+4 ; 0x16f1c 16f18: 0c 94 82 a0 jmp 0x14104 ; 0x14104 16f1c: 0e 94 10 5b call 0xb620 ; 0xb620 16f20: 0c 94 82 a0 jmp 0x14104 ; 0x14104 16f24: 94 ec ldi r25, 0xC4 ; 196 16f26: e9 2e mov r14, r25 16f28: 92 e0 ldi r25, 0x02 ; 2 16f2a: 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()) 16f2c: 10 e0 ldi r17, 0x00 ; 0 case 1: for(int i=0;i 16f38: 88 23 and r24, r24 16f3a: 49 f0 breq .+18 ; 0x16f4e 16f3c: 0e 94 10 5b call 0xb620 ; 0xb620 16f40: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 16f44: 46 2f mov r20, r22 16f46: 6f ef ldi r22, 0xFF ; 255 16f48: 81 2f mov r24, r17 16f4a: 0f 94 28 17 call 0x22e50 ; 0x22e50 16f4e: 1f 5f subi r17, 0xFF ; 255 16f50: 14 30 cpi r17, 0x04 ; 4 16f52: 69 f7 brne .-38 ; 0x16f2e 16f54: dc cf rjmp .-72 ; 0x16f0e case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 16f56: 80 91 01 13 lds r24, 0x1301 ; 0x801301 16f5a: 81 30 cpi r24, 0x01 ; 1 16f5c: 99 f1 breq .+102 ; 0x16fc4 - `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; 16f5e: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 16f60: 8c e4 ldi r24, 0x4C ; 76 16f62: 0e 94 80 56 call 0xad00 ; 0xad00 16f66: 88 23 and r24, r24 16f68: e1 f1 breq .+120 ; 0x16fe2 16f6a: 0e 94 10 5b call 0xb620 ; 0xb620 16f6e: 6b 01 movw r12, r22 16f70: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 16f72: 8a e5 ldi r24, 0x5A ; 90 16f74: 0e 94 80 56 call 0xad00 ; 0xad00 16f78: 88 23 and r24, r24 16f7a: d1 f1 breq .+116 ; 0x16ff0 16f7c: 0e 94 10 5b call 0xb620 ; 0xb620 16f80: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 16f82: 0e 94 ef 6c call 0xd9de ; 0xd9de 16f86: 4b 01 movw r8, r22 16f88: 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 16f8a: 8a e5 ldi r24, 0x5A ; 90 16f8c: 0e 94 80 56 call 0xad00 ; 0xad00 16f90: 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; 16f92: 0f 94 86 78 call 0x2f10c ; 0x2f10c prusa_statistics(22); 16f96: 86 e1 ldi r24, 0x16 ; 22 16f98: 0f 94 a0 2f call 0x25f40 ; 0x25f40 if (MMU2::mmu2.Enabled()) { 16f9c: 80 91 01 13 lds r24, 0x1301 ; 0x801301 16fa0: 81 30 cpi r24, 0x01 ; 1 16fa2: 51 f5 brne .+84 ; 0x16ff8 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 16fa4: 15 30 cpi r17, 0x05 ; 5 16fa6: 18 f4 brcc .+6 ; 0x16fae MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 16fa8: 81 2f mov r24, r17 16faa: 0e 94 96 fb call 0x1f72c ; 0x1f72c lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 16fae: 10 92 94 03 sts 0x0394, r1 ; 0x800394 16fb2: 0f 94 dd 6c call 0x2d9ba ; 0x2d9ba // 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); 16fb6: c5 01 movw r24, r10 16fb8: b4 01 movw r22, r8 16fba: 90 58 subi r25, 0x80 ; 128 16fbc: 0e 94 ef 6c call 0xd9de ; 0xd9de 16fc0: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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') ) { 16fc4: 80 e5 ldi r24, 0x50 ; 80 16fc6: 0e 94 80 56 call 0xad00 ; 0xad00 16fca: 88 23 and r24, r24 16fcc: 21 f0 breq .+8 ; 0x16fd6 mmuSlotIndex = code_value_uint8(); 16fce: 0e 94 95 56 call 0xad2a ; 0xad2a 16fd2: 18 2f mov r17, r24 16fd4: c5 cf rjmp .-118 ; 0x16f60 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') ) { 16fd6: 84 e5 ldi r24, 0x54 ; 84 16fd8: 0e 94 80 56 call 0xad00 ; 0xad00 16fdc: 81 11 cpse r24, r1 16fde: f7 cf rjmp .-18 ; 0x16fce 16fe0: be cf rjmp .-132 ; 0x16f5e - `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 16fe2: c1 2c mov r12, r1 16fe4: d1 2c mov r13, r1 16fe6: 8c e8 ldi r24, 0x8C ; 140 16fe8: e8 2e mov r14, r24 16fea: 82 e4 ldi r24, 0x42 ; 66 16fec: f8 2e mov r15, r24 16fee: c1 cf rjmp .-126 ; 0x16f72 float z_target = 0; 16ff0: 60 e0 ldi r22, 0x00 ; 0 16ff2: 70 e0 ldi r23, 0x00 ; 0 16ff4: cb 01 movw r24, r22 16ff6: c5 cf rjmp .-118 ; 0x16f82 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; 16ff8: 82 e0 ldi r24, 0x02 ; 2 16ffa: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 16ffe: 8f ea ldi r24, 0xAF ; 175 17000: 92 e6 ldi r25, 0x62 ; 98 17002: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17006: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe current_position[E_AXIS] += fastLoadLength; 1700a: a7 01 movw r20, r14 1700c: 96 01 movw r18, r12 1700e: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 17012: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 17016: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 1701a: 90 91 70 12 lds r25, 0x1270 ; 0x801270 1701e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 17022: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 17026: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1702a: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 1702e: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 17032: 60 e0 ldi r22, 0x00 ; 0 17034: 70 e0 ldi r23, 0x00 ; 0 17036: 80 ea ldi r24, 0xA0 ; 160 17038: 91 e4 ldi r25, 0x41 ; 65 1703a: 0f 94 a8 49 call 0x29350 ; 0x29350 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 1703e: 01 11 cpse r16, r1 17040: 06 c0 rjmp .+12 ; 0x1704e raise_z_above(MIN_Z_FOR_LOAD); 17042: 60 e0 ldi r22, 0x00 ; 0 17044: 70 e0 ldi r23, 0x00 ; 0 17046: 88 e4 ldi r24, 0x48 ; 72 17048: 92 e4 ldi r25, 0x42 ; 66 1704a: 0e 94 51 6d call 0xdaa2 ; 0xdaa2 } load_filament_final_feed(); // slow sequence 1704e: 0e 94 48 64 call 0xc890 ; 0xc890 st_synchronize(); 17052: 0f 94 5b 18 call 0x230b6 ; 0x230b6 Sound_MakeCustom(50, 500, false); 17056: 40 e0 ldi r20, 0x00 ; 0 17058: 64 ef ldi r22, 0xF4 ; 244 1705a: 71 e0 ldi r23, 0x01 ; 1 1705c: 82 e3 ldi r24, 0x32 ; 50 1705e: 90 e0 ldi r25, 0x00 ; 0 17060: 0f 94 f3 24 call 0x249e6 ; 0x249e6 if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 17064: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 17068: 81 11 cpse r24, r1 1706a: 05 c0 rjmp .+10 ; 0x17076 1706c: 80 91 94 03 lds r24, 0x0394 ; 0x800394 17070: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 17072: 0f 94 67 18 call 0x230ce ; 0x230ce #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 17076: 81 e0 ldi r24, 0x01 ; 1 17078: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_update(2); 1707c: 82 e0 ldi r24, 0x02 ; 2 1707e: 0e 94 54 6f call 0xdea8 ; 0xdea8 lcd_setstatuspgm(MSG_WELCOME); 17082: 8a e8 ldi r24, 0x8A ; 138 17084: 9c e6 ldi r25, 0x6C ; 108 17086: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe custom_message_type = CustomMsg::Status; 1708a: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 1708e: 8f cf rjmp .-226 ; 0x16fae */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 17090: 85 e5 ldi r24, 0x55 ; 85 17092: 0e 94 80 56 call 0xad00 ; 0xad00 - `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; 17096: c1 2c mov r12, r1 17098: d1 2c mov r13, r1 1709a: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 1709c: 88 23 and r24, r24 1709e: 21 f0 breq .+8 ; 0x170a8 170a0: 0e 94 10 5b call 0xb620 ; 0xb620 170a4: 6b 01 movw r12, r22 170a6: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 170a8: 8a e5 ldi r24, 0x5A ; 90 170aa: 0e 94 80 56 call 0xad00 ; 0xad00 170ae: 88 23 and r24, r24 170b0: a1 f0 breq .+40 ; 0x170da 170b2: 0e 94 10 5b call 0xb620 ; 0xb620 170b6: 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); 170b8: 0e 94 ef 6c call 0xd9de ; 0xd9de 170bc: 4b 01 movw r8, r22 170be: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 170c0: 80 91 01 13 lds r24, 0x1301 ; 0x801301 170c4: 81 30 cpi r24, 0x01 ; 1 170c6: 99 f4 brne .+38 ; 0x170ee 170c8: 0f 94 cf 9d call 0x33b9e ; 0x33b9e else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 170cc: c5 01 movw r24, r10 170ce: b4 01 movw r22, r8 170d0: 90 58 subi r25, 0x80 ; 128 170d2: 0e 94 ef 6c call 0xd9de ; 0xd9de 170d6: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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 170da: 60 e0 ldi r22, 0x00 ; 0 170dc: 70 e0 ldi r23, 0x00 ; 0 170de: 80 ea ldi r24, 0xA0 ; 160 170e0: 91 e4 ldi r25, 0x41 ; 65 170e2: 0e 94 51 6d call 0xdaa2 ; 0xdaa2 - `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; 170e6: 60 e0 ldi r22, 0x00 ; 0 170e8: 70 e0 ldi r23, 0x00 ; 0 170ea: cb 01 movw r24, r22 170ec: e5 cf rjmp .-54 ; 0x170b8 // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 170ee: c7 01 movw r24, r14 170f0: b6 01 movw r22, r12 170f2: 0e 94 69 e1 call 0x1c2d2 ; 0x1c2d2 170f6: ea cf rjmp .-44 ; 0x170cc #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 170f8: 80 ec ldi r24, 0xC0 ; 192 170fa: 92 e0 ldi r25, 0x02 ; 2 170fc: 0e 94 d6 5a call 0xb5ac ; 0xb5ac 17100: 0c 94 45 a2 jmp 0x1448a ; 0x1448a #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 17104: 81 ec ldi r24, 0xC1 ; 193 17106: 92 e0 ldi r25, 0x02 ; 2 17108: 0e 94 d6 5a call 0xb5ac ; 0xb5ac 1710c: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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() ) { 17110: 80 91 01 13 lds r24, 0x1301 ; 0x801301 17114: 81 30 cpi r24, 0x01 ; 1 17116: 11 f0 breq .+4 ; 0x1711c 17118: 0c 94 45 a2 jmp 0x1448a ; 0x1448a if( code_seen('A') ) { 1711c: 81 e4 ldi r24, 0x41 ; 65 1711e: 0e 94 80 56 call 0xad00 ; 0xad00 17122: 88 23 and r24, r24 17124: 11 f4 brne .+4 ; 0x1712a 17126: 0c 94 45 a2 jmp 0x1448a ; 0x1448a MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 1712a: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 1712e: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 17132: 40 e1 ldi r20, 0x10 ; 16 17134: 50 e0 ldi r21, 0x00 ; 0 17136: 70 e0 ldi r23, 0x00 ; 0 17138: 60 e0 ldi r22, 0x00 ; 0 1713a: 01 96 adiw r24, 0x01 ; 1 1713c: 0f 94 c9 9f call 0x33f92 ; 0x33f92 17140: 86 2f mov r24, r22 17142: 0e 94 62 fc call 0x1f8c4 ; 0x1f8c4 17146: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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() ){ 1714a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1714e: 81 30 cpi r24, 0x01 ; 1 17150: 11 f0 breq .+4 ; 0x17156 17152: 0c 94 45 a2 jmp 0x1448a ; 0x1448a uint8_t addr = 0; if( code_seen('A') ) { 17156: 81 e4 ldi r24, 0x41 ; 65 17158: 0e 94 80 56 call 0xad00 ; 0xad00 Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 1715c: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 1715e: 88 23 and r24, r24 17160: 61 f0 breq .+24 ; 0x1717a addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 17162: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 17166: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 1716a: 40 e1 ldi r20, 0x10 ; 16 1716c: 50 e0 ldi r21, 0x00 ; 0 1716e: 70 e0 ldi r23, 0x00 ; 0 17170: 60 e0 ldi r22, 0x00 ; 0 17172: 01 96 adiw r24, 0x01 ; 1 17174: 0f 94 c9 9f call 0x33f92 ; 0x33f92 17178: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 1717a: 88 e5 ldi r24, 0x58 ; 88 1717c: 0e 94 80 56 call 0xad00 ; 0xad00 17180: 88 23 and r24, r24 17182: 61 f0 breq .+24 ; 0x1719c data = code_value_short(); 17184: 0e 94 a2 56 call 0xad44 ; 0xad44 } if(addr){ 17188: 11 23 and r17, r17 1718a: 11 f4 brne .+4 ; 0x17190 1718c: 0c 94 45 a2 jmp 0x1448a ; 0x1448a MMU2::mmu2.WriteRegister(addr, data); 17190: bc 01 movw r22, r24 17192: 81 2f mov r24, r17 17194: 0e 94 87 d0 call 0x1a10e ; 0x1a10e 17198: 0c 94 45 a2 jmp 0x1448a ; 0x1448a 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; 1719c: 90 e0 ldi r25, 0x00 ; 0 1719e: 80 e0 ldi r24, 0x00 ; 0 171a0: f3 cf rjmp .-26 ; 0x17188 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 171a2: 83 e5 ldi r24, 0x53 ; 83 171a4: 0e 94 80 56 call 0xad00 ; 0xad00 171a8: 88 23 and r24, r24 171aa: 31 f0 breq .+12 ; 0x171b8 { switch (code_value_uint8()) 171ac: 0e 94 95 56 call 0xad2a ; 0xad2a 171b0: 88 23 and r24, r24 171b2: a9 f0 breq .+42 ; 0x171de 171b4: 81 30 cpi r24, 0x01 ; 1 171b6: f9 f0 breq .+62 ; 0x171f6 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 171b8: 80 91 01 13 lds r24, 0x1301 ; 0x801301 171bc: 81 30 cpi r24, 0x01 ; 1 171be: 59 f4 brne .+22 ; 0x171d6 171c0: 88 e5 ldi r24, 0x58 ; 88 171c2: 0e 94 80 56 call 0xad00 ; 0xad00 171c6: 88 23 and r24, r24 171c8: 31 f0 breq .+12 ; 0x171d6 { switch (code_value_uint8()) 171ca: 0e 94 95 56 call 0xad2a ; 0xad2a 171ce: 82 30 cpi r24, 0x02 ; 2 171d0: d0 f0 brcs .+52 ; 0x17206 171d2: 8a 32 cpi r24, 0x2A ; 42 171d4: e1 f0 breq .+56 ; 0x1720e break; default: break; } } MMU2::mmu2.Status(); 171d6: 0f 94 23 65 call 0x2ca46 ; 0x2ca46 171da: 0c 94 45 a2 jmp 0x1448a ; 0x1448a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 171de: 60 e0 ldi r22, 0x00 ; 0 171e0: 8c ea ldi r24, 0xAC ; 172 171e2: 9c e0 ldi r25, 0x0C ; 12 171e4: 0f 94 62 a4 call 0x348c4 ; 0x348c4 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 171e8: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 171ec: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 171f0: 10 92 94 12 sts 0x1294, r1 ; 0x801294 171f4: e1 cf rjmp .-62 ; 0x171b8 171f6: 61 e0 ldi r22, 0x01 ; 1 171f8: 8c ea ldi r24, 0xAC ; 172 171fa: 9c e0 ldi r25, 0x0C ; 12 171fc: 0f 94 62 a4 call 0x348c4 ; 0x348c4 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(); 17200: 0f 94 de 95 call 0x32bbc ; 0x32bbc 17204: d9 cf rjmp .-78 ; 0x171b8 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 17206: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 17208: 0f 94 a1 95 call 0x32b42 ; 0x32b42 1720c: e4 cf rjmp .-56 ; 0x171d6 1720e: 8a e2 ldi r24, 0x2A ; 42 17210: fb cf rjmp .-10 ; 0x17208 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') { 17212: 84 35 cpi r24, 0x54 ; 84 17214: 09 f0 breq .+2 ; 0x17218 17216: 79 c0 rjmp .+242 ; 0x1730a strchr_pointer = CMDBUFFER_CURRENT_STRING; 17218: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 1721c: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb processing_tcode = true; 17220: 81 e0 ldi r24, 0x01 ; 1 17222: 80 93 91 03 sts 0x0391, r24 ; 0x800391 TCodes(strchr_pointer, code_value_uint8()); 17226: 0e 94 95 56 call 0xad2a ; 0xad2a 1722a: 18 2f mov r17, r24 1722c: 20 91 bb 04 lds r18, 0x04BB ; 0x8004bb 17230: 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; 17234: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 17236: 79 01 movw r14, r18 17238: e9 0e add r14, r25 1723a: f1 1c adc r15, r1 1723c: d7 01 movw r26, r14 1723e: 8c 91 ld r24, X 17240: 80 32 cpi r24, 0x20 ; 32 17242: 11 f0 breq .+4 ; 0x17248 17244: 89 30 cpi r24, 0x09 ; 9 17246: 11 f4 brne .+4 ; 0x1724c 17248: 9f 5f subi r25, 0xFF ; 255 1724a: f5 cf rjmp .-22 ; 0x17236 ; strchr_pointer[index] = tolower(strchr_pointer[index]); 1724c: 08 2e mov r0, r24 1724e: 00 0c add r0, r0 17250: 99 0b sbc r25, r25 17252: 0f 94 52 aa call 0x354a4 ; 0x354a4 17256: f7 01 movw r30, r14 17258: 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'); 1725a: 90 ed ldi r25, 0xD0 ; 208 1725c: 98 0f add r25, r24 1725e: 95 30 cpi r25, 0x05 ; 5 17260: 58 f0 brcs .+22 ; 0x17278 17262: 8f 33 cpi r24, 0x3F ; 63 17264: 69 f0 breq .+26 ; 0x17280 17266: 88 37 cpi r24, 0x78 ; 120 17268: 59 f0 breq .+22 ; 0x17280 1726a: 83 36 cpi r24, 0x63 ; 99 1726c: 01 f1 breq .+64 ; 0x172ae } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 1726e: 81 e9 ldi r24, 0x91 ; 145 17270: 99 e7 ldi r25, 0x79 ; 121 } else { SERIAL_ECHO_START; if (codeValue >= EXTRUDERS) { SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 17272: 0e 94 18 7d call 0xfa30 ; 0xfa30 17276: 15 c0 rjmp .+42 ; 0x172a2 17278: 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] == '?'){ 1727c: 8f 33 cpi r24, 0x3F ; 63 1727e: a9 f4 brne .+42 ; 0x172aa // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 17280: 80 91 01 13 lds r24, 0x1301 ; 0x801301 17284: 81 30 cpi r24, 0x01 ; 1 17286: 69 f4 brne .+26 ; 0x172a2 MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 17288: 84 e1 ldi r24, 0x14 ; 20 1728a: 9d e3 ldi r25, 0x3D ; 61 1728c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17290: 70 e0 ldi r23, 0x00 ; 0 17292: 60 e0 ldi r22, 0x00 ; 0 17294: 0e 94 b3 cf call 0x19f66 ; 0x19f66 17298: 68 2f mov r22, r24 1729a: d7 01 movw r26, r14 1729c: 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()); 1729e: 0e 94 00 fc call 0x1f800 ; 0x1f800 processing_tcode = false; 172a2: 10 92 91 03 sts 0x0391, r1 ; 0x800391 172a6: 0c 94 a0 8e jmp 0x11d40 ; 0x11d40 } 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'){ 172aa: 83 36 cpi r24, 0x63 ; 99 172ac: 49 f4 brne .+18 ; 0x172c0 // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 172ae: 80 91 01 13 lds r24, 0x1301 ; 0x801301 172b2: 81 30 cpi r24, 0x01 ; 1 172b4: b1 f7 brne .-20 ; 0x172a2 MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 172b6: 0f 94 1d 65 call 0x2ca3a ; 0x2ca3a 172ba: 68 2f mov r22, r24 172bc: 83 e6 ldi r24, 0x63 ; 99 172be: ef cf rjmp .-34 ; 0x1729e } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 172c0: 91 30 cpi r25, 0x01 ; 1 172c2: 69 f4 brne .+26 ; 0x172de if (codeValue == MMU2::mmu2.get_current_tool()){ 172c4: 0f 94 1d 65 call 0x2ca3a ; 0x2ca3a 172c8: 18 13 cpse r17, r24 172ca: 05 c0 rjmp .+10 ; 0x172d6 // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 172cc: 81 ea ldi r24, 0xA1 ; 161 172ce: 99 e7 ldi r25, 0x79 ; 121 172d0: 0f 94 27 a3 call 0x3464e ; 0x3464e 172d4: e6 cf rjmp .-52 ; 0x172a2 #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); 172d6: 81 2f mov r24, r17 172d8: 0e 94 dd fb call 0x1f7ba ; 0x1f7ba 172dc: e2 cf rjmp .-60 ; 0x172a2 } } else { SERIAL_ECHO_START; 172de: 84 ee ldi r24, 0xE4 ; 228 172e0: 92 ea ldi r25, 0xA2 ; 162 172e2: 0e 94 1f 7b call 0xf63e ; 0xf63e if (codeValue >= EXTRUDERS) { 172e6: 11 23 and r17, r17 172e8: 59 f0 breq .+22 ; 0x17300 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 172ea: 84 e5 ldi r24, 0x54 ; 84 172ec: 0e 94 0c 7a call 0xf418 ; 0xf418 SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 172f0: 81 2f mov r24, r17 172f2: 90 e0 ldi r25, 0x00 ; 0 172f4: c0 96 adiw r24, 0x30 ; 48 172f6: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 172fa: 88 e9 ldi r24, 0x98 ; 152 172fc: 95 e6 ldi r25, 0x65 ; 101 172fe: b9 cf rjmp .-142 ; 0x17272 // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 17300: 85 e8 ldi r24, 0x85 ; 133 17302: 95 e6 ldi r25, 0x65 ; 101 17304: 0e 94 1f 7b call 0xf63e ; 0xf63e 17308: cc cf rjmp .-104 ; 0x172a2 /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 1730a: 84 34 cpi r24, 0x44 ; 68 1730c: 09 f0 breq .+2 ; 0x17310 1730e: 5d c0 rjmp .+186 ; 0x173ca { strchr_pointer = CMDBUFFER_CURRENT_STRING; 17310: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 17314: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb switch(code_value_short()) 17318: 0e 94 a2 56 call 0xad44 ; 0xad44 1731c: 82 30 cpi r24, 0x02 ; 2 1731e: 91 05 cpc r25, r1 17320: 41 f1 breq .+80 ; 0x17372 17322: 8c f4 brge .+34 ; 0x17346 17324: 01 96 adiw r24, 0x01 ; 1 17326: e1 f0 breq .+56 ; 0x17360 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 17328: 80 91 38 12 lds r24, 0x1238 ; 0x801238 1732c: 90 91 39 12 lds r25, 0x1239 ; 0x801239 17330: 82 5b subi r24, 0xB2 ; 178 17332: 9f 4e sbci r25, 0xEF ; 239 17334: 9f 93 push r25 17336: 8f 93 push r24 17338: 1f 92 push r1 1733a: 84 e4 ldi r24, 0x44 ; 68 1733c: 8f 93 push r24 1733e: 84 e0 ldi r24, 0x04 ; 4 17340: 97 e6 ldi r25, 0x67 ; 103 17342: 0c 94 f5 8e jmp 0x11dea ; 0x11dea *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 17346: 83 30 cpi r24, 0x03 ; 3 17348: 91 05 cpc r25, r1 1734a: f9 f0 breq .+62 ; 0x1738a 1734c: 47 97 sbiw r24, 0x17 ; 23 1734e: 61 f7 brne .-40 ; 0x17328 bool emergency_serial_dump = false; void dcode_23() { if(code_seen('E')) 17350: 85 e4 ldi r24, 0x45 ; 69 17352: 0e 94 80 56 call 0xad00 ; 0xad00 17356: 88 23 and r24, r24 17358: 09 f1 breq .+66 ; 0x1739c serial_dump_and_reset(dump_crash_reason::manual); 1735a: 80 e0 ldi r24, 0x00 ; 0 1735c: 0e 94 fc 84 call 0x109f8 ; 0x109f8 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 17360: 81 e7 ldi r24, 0x71 ; 113 17362: 95 e6 ldi r25, 0x65 ; 101 17364: 9f 93 push r25 17366: 8f 93 push r24 17368: 0f 94 00 a3 call 0x34600 ; 0x34600 1736c: 0f 90 pop r0 1736e: 0f 90 pop r0 17370: ff cf rjmp .-2 ; 0x17370 - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 17372: 0c e6 ldi r16, 0x6C ; 108 17374: 15 e6 ldi r17, 0x65 ; 101 17376: 22 e0 ldi r18, 0x02 ; 2 17378: 40 e0 ldi r20, 0x00 ; 0 1737a: 60 e0 ldi r22, 0x00 ; 0 1737c: 72 e2 ldi r23, 0x22 ; 34 1737e: 80 e0 ldi r24, 0x00 ; 0 17380: 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")); 17382: 0e 94 51 5e call 0xbca2 ; 0xbca2 17386: 0c 94 a0 8e jmp 0x11d40 ; 0x11d40 1738a: 05 e6 ldi r16, 0x65 ; 101 1738c: 15 e6 ldi r17, 0x65 ; 101 1738e: 23 e0 ldi r18, 0x03 ; 3 17390: 41 e0 ldi r20, 0x01 ; 1 17392: 60 e0 ldi r22, 0x00 ; 0 17394: 70 e1 ldi r23, 0x10 ; 16 17396: 90 e0 ldi r25, 0x00 ; 0 17398: 80 e0 ldi r24, 0x00 ; 0 1739a: f3 cf rjmp .-26 ; 0x17382 { if(code_seen('E')) serial_dump_and_reset(dump_crash_reason::manual); else { emergency_serial_dump = !code_seen('R'); 1739c: 82 e5 ldi r24, 0x52 ; 82 1739e: 0e 94 80 56 call 0xad00 ; 0xad00 173a2: 91 e0 ldi r25, 0x01 ; 1 173a4: 89 27 eor r24, r25 173a6: 80 93 0f 06 sts 0x060F, r24 ; 0x80060f SERIAL_ECHOPGM("serial dump "); 173aa: 84 e8 ldi r24, 0x84 ; 132 173ac: 99 e7 ldi r25, 0x79 ; 121 173ae: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); 173b2: 80 91 0f 06 lds r24, 0x060F ; 0x80060f 173b6: 88 23 and r24, r24 173b8: 21 f0 breq .+8 ; 0x173c2 173ba: 8d e5 ldi r24, 0x5D ; 93 173bc: 95 e6 ldi r25, 0x65 ; 101 173be: 0c 94 5c 8f jmp 0x11eb8 ; 0x11eb8 173c2: 84 e5 ldi r24, 0x54 ; 84 173c4: 95 e6 ldi r25, 0x65 ; 101 173c6: 0c 94 5c 8f jmp 0x11eb8 ; 0x11eb8 } } else { SERIAL_ECHO_START; 173ca: 84 ee ldi r24, 0xE4 ; 228 173cc: 92 ea ldi r25, 0xA2 ; 162 173ce: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 173d2: 87 ec ldi r24, 0xC7 ; 199 173d4: 95 e6 ldi r25, 0x65 ; 101 173d6: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 173da: 80 91 38 12 lds r24, 0x1238 ; 0x801238 173de: 90 91 39 12 lds r25, 0x1239 ; 0x801239 173e2: 82 5b subi r24, 0xB2 ; 178 173e4: 9f 4e sbci r25, 0xEF ; 239 173e6: 0e 94 11 86 call 0x10c22 ; 0x10c22 SERIAL_ECHOLNPGM("\"(2)"); 173ea: 88 ef ldi r24, 0xF8 ; 248 173ec: 9e e7 ldi r25, 0x7E ; 126 173ee: 0c 94 5c 8f jmp 0x11eb8 ; 0x11eb8 #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 173f2: 2d ec ldi r18, 0xCD ; 205 173f4: 3c ec ldi r19, 0xCC ; 204 173f6: 4c ec ldi r20, 0xCC ; 204 173f8: 5d e3 ldi r21, 0x3D ; 61 173fa: c7 01 movw r24, r14 173fc: b6 01 movw r22, r12 173fe: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 17402: 18 16 cp r1, r24 17404: 14 f4 brge .+4 ; 0x1740a 17406: 0c 94 c4 90 jmp 0x12188 ; 0x12188 1740a: 0c 94 d4 91 jmp 0x123a8 ; 0x123a8 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; 1740e: a3 01 movw r20, r6 17410: 92 01 movw r18, r4 17412: 62 2d mov r22, r2 17414: 73 2d mov r23, r3 17416: 8e 2d mov r24, r14 17418: 9f 2d mov r25, r15 1741a: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1741e: 18 16 cp r1, r24 17420: 14 f0 brlt .+4 ; 0x17426 17422: 0c 94 46 99 jmp 0x1328c ; 0x1328c 17426: e5 e0 ldi r30, 0x05 ; 5 17428: ce 0e add r12, r30 1742a: d1 1c adc r13, r1 1742c: f2 e0 ldi r31, 0x02 ; 2 1742e: 8f 0e add r8, r31 17430: 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; 17432: 85 01 movw r16, r10 17434: 0c 94 0d 99 jmp 0x1321a ; 0x1321a 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)); 17438: 82 e7 ldi r24, 0x72 ; 114 1743a: 99 e3 ldi r25, 0x39 ; 57 1743c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17440: 0e 94 94 de call 0x1bd28 ; 0x1bd28 lcd_puts_at_P(0, 2, PSTR("")); 17444: 42 e9 ldi r20, 0x92 ; 146 17446: 5e e7 ldi r21, 0x7E ; 126 17448: 62 e0 ldi r22, 0x02 ; 2 1744a: 80 e0 ldi r24, 0x00 ; 0 1744c: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 17450: f8 01 movw r30, r16 17452: 81 91 ld r24, Z+ 17454: 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'; 17456: 98 2f mov r25, r24 17458: 9f 7d andi r25, 0xDF ; 223 1745a: 11 f4 brne .+4 ; 0x17460 1745c: 0c 94 11 a8 jmp 0x15022 ; 0x15022 17460: 97 ef ldi r25, 0xF7 ; 247 17462: 98 0f add r25, r24 17464: 92 30 cpi r25, 0x02 ; 2 17466: 10 f4 brcc .+4 ; 0x1746c 17468: 0c 94 11 a8 jmp 0x15022 ; 0x15022 1746c: 8d 30 cpi r24, 0x0D ; 13 1746e: 11 f4 brne .+4 ; 0x17474 17470: 0c 94 11 a8 jmp 0x15022 ; 0x15022 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); 17474: 0e 94 7c 6f call 0xdef8 ; 0xdef8 17478: eb cf rjmp .-42 ; 0x17450 0001747a <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 1747a: 1f 92 push r1 1747c: 0f 92 push r0 1747e: 0f b6 in r0, 0x3f ; 63 17480: 0f 92 push r0 17482: 11 24 eor r1, r1 17484: 0b b6 in r0, 0x3b ; 59 17486: 0f 92 push r0 17488: 2f 93 push r18 1748a: 3f 93 push r19 1748c: 4f 93 push r20 1748e: 5f 93 push r21 17490: 6f 93 push r22 17492: 7f 93 push r23 17494: 8f 93 push r24 17496: 9f 93 push r25 17498: af 93 push r26 1749a: bf 93 push r27 1749c: ef 93 push r30 1749e: ff 93 push r31 adc_values[adc_channel] += ADC; 174a0: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 174a4: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 174a8: e0 91 14 03 lds r30, 0x0314 ; 0x800314 174ac: f0 e0 ldi r31, 0x00 ; 0 174ae: ee 0f add r30, r30 174b0: ff 1f adc r31, r31 174b2: ec 5f subi r30, 0xFC ; 252 174b4: fc 4f sbci r31, 0xFC ; 252 174b6: 80 81 ld r24, Z 174b8: 91 81 ldd r25, Z+1 ; 0x01 174ba: 82 0f add r24, r18 174bc: 93 1f adc r25, r19 174be: 91 83 std Z+1, r25 ; 0x01 174c0: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 174c2: 80 91 03 03 lds r24, 0x0303 ; 0x800303 174c6: 8f 5f subi r24, 0xFF ; 255 174c8: 80 93 03 03 sts 0x0303, r24 ; 0x800303 174cc: 80 31 cpi r24, 0x10 ; 16 174ce: e9 f5 brne .+122 ; 0x1754a <__vector_29+0xd0> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 174d0: 80 91 14 03 lds r24, 0x0314 ; 0x800314 174d4: 8f 5f subi r24, 0xFF ; 255 174d6: 80 93 14 03 sts 0x0314, r24 ; 0x800314 174da: 88 30 cpi r24, 0x08 ; 8 174dc: 71 f5 brne .+92 ; 0x1753a <__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 174de: 80 91 04 03 lds r24, 0x0304 ; 0x800304 174e2: 90 91 05 03 lds r25, 0x0305 ; 0x800305 174e6: 90 93 dd 05 sts 0x05DD, r25 ; 0x8005dd 174ea: 80 93 dc 05 sts 0x05DC, r24 ; 0x8005dc current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 174ee: 80 91 08 03 lds r24, 0x0308 ; 0x800308 174f2: 90 91 09 03 lds r25, 0x0309 ; 0x800309 174f6: 90 93 df 05 sts 0x05DF, r25 ; 0x8005df 174fa: 80 93 de 05 sts 0x05DE, r24 ; 0x8005de #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 174fe: 80 91 06 03 lds r24, 0x0306 ; 0x800306 17502: 90 91 07 03 lds r25, 0x0307 ; 0x800307 17506: 90 93 db 05 sts 0x05DB, r25 ; 0x8005db 1750a: 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; 1750e: 81 e0 ldi r24, 0x01 ; 1 17510: 80 93 f6 05 sts 0x05F6, r24 ; 0x8005f6 <_ZL16adc_values_ready.lto_priv.515> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 17514: ff 91 pop r31 17516: ef 91 pop r30 17518: bf 91 pop r27 1751a: af 91 pop r26 1751c: 9f 91 pop r25 1751e: 8f 91 pop r24 17520: 7f 91 pop r23 17522: 6f 91 pop r22 17524: 5f 91 pop r21 17526: 4f 91 pop r20 17528: 3f 91 pop r19 1752a: 2f 91 pop r18 1752c: 0f 90 pop r0 1752e: 0b be out 0x3b, r0 ; 59 17530: 0f 90 pop r0 17532: 0f be out 0x3f, r0 ; 63 17534: 0f 90 pop r0 17536: 1f 90 pop r1 17538: 18 95 reti 1753a: 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)) { 1753e: 4f e5 ldi r20, 0x5F ; 95 17540: 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) { 17542: 8f 5f subi r24, 0xFF ; 255 17544: 41 f4 brne .+16 ; 0x17556 <__vector_29+0xdc> 17546: 10 92 02 03 sts 0x0302, r1 ; 0x800302 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 1754a: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1754e: 80 64 ori r24, 0x40 ; 64 17550: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 17554: df cf rjmp .-66 ; 0x17514 <__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)) { 17556: 9a 01 movw r18, r20 17558: 08 2e mov r0, r24 1755a: 02 c0 rjmp .+4 ; 0x17560 <__vector_29+0xe6> 1755c: 35 95 asr r19 1755e: 27 95 ror r18 17560: 0a 94 dec r0 17562: e2 f7 brpl .-8 ; 0x1755c <__vector_29+0xe2> 17564: 20 ff sbrs r18, 0 17566: ed cf rjmp .-38 ; 0x17542 <__vector_29+0xc8> 17568: 80 93 02 03 sts 0x0302, r24 ; 0x800302 <__data_end> adc_setmux(adc_channel_idx); 1756c: 0e 94 94 55 call 0xab28 ; 0xab28 adc_count = 0; 17570: 10 92 03 03 sts 0x0303, r1 ; 0x800303 17574: ea cf rjmp .-44 ; 0x1754a <__vector_29+0xd0> 00017576 : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 17576: cf 93 push r28 17578: 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 1757a: ca e7 ldi r28, 0x7A ; 122 1757c: d0 e0 ldi r29, 0x00 ; 0 1757e: 88 81 ld r24, Y 17580: 8f 7b andi r24, 0xBF ; 191 17582: 88 83 st Y, r24 adc_count = 0; 17584: 10 92 03 03 sts 0x0303, r1 ; 0x800303 adc_channel = 0; 17588: 10 92 14 03 sts 0x0314, r1 ; 0x800314 adc_channel_idx = first_channel_idx; 1758c: 10 92 02 03 sts 0x0302, r1 ; 0x800302 <__data_end> adc_setmux(adc_channel_idx); 17590: 80 e0 ldi r24, 0x00 ; 0 17592: 0e 94 94 55 call 0xab28 ; 0xab28 memset((void*)adc_values, 0, sizeof(adc_values)); 17596: e4 e0 ldi r30, 0x04 ; 4 17598: f3 e0 ldi r31, 0x03 ; 3 1759a: 80 e1 ldi r24, 0x10 ; 16 1759c: df 01 movw r26, r30 1759e: 1d 92 st X+, r1 175a0: 8a 95 dec r24 175a2: e9 f7 brne .-6 ; 0x1759e ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 175a4: 88 81 ld r24, Y 175a6: 80 64 ori r24, 0x40 ; 64 175a8: 88 83 st Y, r24 } 175aa: df 91 pop r29 175ac: cf 91 pop r28 175ae: 08 95 ret 000175b0 : uint8_t check_pinda_0() { return _PINDA?0:1; } 175b0: 81 50 subi r24, 0x01 ; 1 175b2: 82 31 cpi r24, 0x12 ; 18 175b4: 08 f0 brcs .+2 ; 0x175b8 175b6: 5a c0 rjmp .+180 ; 0x1766c 175b8: e8 2f mov r30, r24 175ba: f0 e0 ldi r31, 0x00 ; 0 175bc: 88 27 eor r24, r24 175be: ec 51 subi r30, 0x1C ; 28 175c0: f5 44 sbci r31, 0x45 ; 69 175c2: 8f 4f sbci r24, 0xFF ; 255 175c4: 0d 94 4e a5 jmp 0x34a9c ; 0x34a9c <__tablejump2__> 175c8: 04 bb out 0x14, r16 ; 20 175ca: 08 bb out 0x18, r16 ; 24 175cc: f6 ba out 0x16, r15 ; 22 175ce: fc ba out 0x1c, r15 ; 28 175d0: 00 bb out 0x10, r16 ; 16 175d2: 36 bb out 0x16, r19 ; 22 175d4: 0b bb out 0x1b, r16 ; 27 175d6: 11 bb out 0x11, r17 ; 17 175d8: 15 bb out 0x15, r17 ; 21 175da: 1b bb out 0x1b, r17 ; 27 175dc: 1f bb out 0x1f, r17 ; 31 175de: 23 bb out 0x13, r18 ; 19 175e0: 29 bb out 0x19, r18 ; 25 175e2: 2d bb out 0x1d, r18 ; 29 175e4: 36 bb out 0x16, r19 ; 22 175e6: 31 bb out 0x11, r19 ; 17 175e8: 37 bb out 0x17, r19 ; 23 175ea: 3b bb out 0x1b, r19 ; 27 175ec: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 175f0: 8f 77 andi r24, 0x7F ; 127 175f2: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 175f6: 08 95 ret 175f8: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 175fc: 8f 7d andi r24, 0xDF ; 223 175fe: f9 cf rjmp .-14 ; 0x175f2 17600: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 17604: 87 7f andi r24, 0xF7 ; 247 17606: f5 cf rjmp .-22 ; 0x175f2 17608: 84 b5 in r24, 0x24 ; 36 1760a: 8f 77 andi r24, 0x7F ; 127 1760c: 84 bd out 0x24, r24 ; 36 1760e: 08 95 ret 17610: 84 b5 in r24, 0x24 ; 36 17612: 8f 7d andi r24, 0xDF ; 223 17614: fb cf rjmp .-10 ; 0x1760c 17616: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1761a: 8f 77 andi r24, 0x7F ; 127 1761c: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 17620: 08 95 ret 17622: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 17626: 8f 7d andi r24, 0xDF ; 223 17628: f9 cf rjmp .-14 ; 0x1761c 1762a: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1762e: 8f 77 andi r24, 0x7F ; 127 17630: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 17634: 08 95 ret 17636: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1763a: 8f 7d andi r24, 0xDF ; 223 1763c: f9 cf rjmp .-14 ; 0x17630 1763e: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 17642: 87 7f andi r24, 0xF7 ; 247 17644: f5 cf rjmp .-22 ; 0x17630 17646: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1764a: 8f 77 andi r24, 0x7F ; 127 1764c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 17650: 08 95 ret 17652: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 17656: 8f 7d andi r24, 0xDF ; 223 17658: f9 cf rjmp .-14 ; 0x1764c 1765a: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1765e: 87 7f andi r24, 0xF7 ; 247 17660: f5 cf rjmp .-22 ; 0x1764c 17662: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 17666: 8f 77 andi r24, 0x7F ; 127 17668: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1766c: 08 95 ret 1766e: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 17672: 8f 7d andi r24, 0xDF ; 223 17674: f9 cf rjmp .-14 ; 0x17668 17676: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1767a: 87 7f andi r24, 0xF7 ; 247 1767c: f5 cf rjmp .-22 ; 0x17668 0001767e : 1767e: 83 b1 in r24, 0x03 ; 3 17680: 82 95 swap r24 17682: 81 70 andi r24, 0x01 ; 1 17684: 08 95 ret 00017686 : } #else //SM4_ACCEL_TEST uint16_t xyzcal_calc_delay(uint16_t, uint16_t) { return xyzcal_sm4_delay; } 17686: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef 1768a: 90 91 f0 03 lds r25, 0x03F0 ; 0x8003f0 1768e: 08 95 ret 00017690 : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 17690: cf 92 push r12 17692: df 92 push r13 17694: ef 92 push r14 17696: 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; 17698: 20 91 f1 03 lds r18, 0x03F1 ; 0x8003f1 1769c: b0 e0 ldi r27, 0x00 ; 0 1769e: a0 e0 ldi r26, 0x00 ; 0 176a0: c0 90 4c 06 lds r12, 0x064C ; 0x80064c 176a4: d0 90 4d 06 lds r13, 0x064D ; 0x80064d 176a8: e0 90 4e 06 lds r14, 0x064E ; 0x80064e 176ac: f0 90 4f 06 lds r15, 0x064F ; 0x80064f 176b0: 20 ff sbrs r18, 0 176b2: 42 c0 rjmp .+132 ; 0x17738 176b4: c8 1a sub r12, r24 176b6: d9 0a sbc r13, r25 176b8: ea 0a sbc r14, r26 176ba: fb 0a sbc r15, r27 176bc: c0 92 4c 06 sts 0x064C, r12 ; 0x80064c 176c0: d0 92 4d 06 sts 0x064D, r13 ; 0x80064d 176c4: e0 92 4e 06 sts 0x064E, r14 ; 0x80064e 176c8: f0 92 4f 06 sts 0x064F, r15 ; 0x80064f 176cc: cb 01 movw r24, r22 176ce: b0 e0 ldi r27, 0x00 ; 0 176d0: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 176d2: c0 90 50 06 lds r12, 0x0650 ; 0x800650 176d6: d0 90 51 06 lds r13, 0x0651 ; 0x800651 176da: e0 90 52 06 lds r14, 0x0652 ; 0x800652 176de: f0 90 53 06 lds r15, 0x0653 ; 0x800653 176e2: 21 ff sbrs r18, 1 176e4: 36 c0 rjmp .+108 ; 0x17752 176e6: c8 1a sub r12, r24 176e8: d9 0a sbc r13, r25 176ea: ea 0a sbc r14, r26 176ec: fb 0a sbc r15, r27 176ee: c0 92 50 06 sts 0x0650, r12 ; 0x800650 176f2: d0 92 51 06 sts 0x0651, r13 ; 0x800651 176f6: e0 92 52 06 sts 0x0652, r14 ; 0x800652 176fa: f0 92 53 06 sts 0x0653, r15 ; 0x800653 176fe: 70 e0 ldi r23, 0x00 ; 0 17700: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 17702: 80 91 54 06 lds r24, 0x0654 ; 0x800654 17706: 90 91 55 06 lds r25, 0x0655 ; 0x800655 1770a: a0 91 56 06 lds r26, 0x0656 ; 0x800656 1770e: b0 91 57 06 lds r27, 0x0657 ; 0x800657 17712: 22 ff sbrs r18, 2 17714: 2b c0 rjmp .+86 ; 0x1776c 17716: 84 1b sub r24, r20 17718: 95 0b sbc r25, r21 1771a: a6 0b sbc r26, r22 1771c: b7 0b sbc r27, r23 1771e: 80 93 54 06 sts 0x0654, r24 ; 0x800654 17722: 90 93 55 06 sts 0x0655, r25 ; 0x800655 17726: a0 93 56 06 sts 0x0656, r26 ; 0x800656 1772a: 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]); } 1772e: ff 90 pop r15 17730: ef 90 pop r14 17732: df 90 pop r13 17734: cf 90 pop r12 17736: 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; 17738: 8c 0d add r24, r12 1773a: 9d 1d adc r25, r13 1773c: ae 1d adc r26, r14 1773e: bf 1d adc r27, r15 17740: 80 93 4c 06 sts 0x064C, r24 ; 0x80064c 17744: 90 93 4d 06 sts 0x064D, r25 ; 0x80064d 17748: a0 93 4e 06 sts 0x064E, r26 ; 0x80064e 1774c: b0 93 4f 06 sts 0x064F, r27 ; 0x80064f 17750: bd cf rjmp .-134 ; 0x176cc if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 17752: 8c 0d add r24, r12 17754: 9d 1d adc r25, r13 17756: ae 1d adc r26, r14 17758: bf 1d adc r27, r15 1775a: 80 93 50 06 sts 0x0650, r24 ; 0x800650 1775e: 90 93 51 06 sts 0x0651, r25 ; 0x800651 17762: a0 93 52 06 sts 0x0652, r26 ; 0x800652 17766: b0 93 53 06 sts 0x0653, r27 ; 0x800653 1776a: c9 cf rjmp .-110 ; 0x176fe if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 1776c: 84 0f add r24, r20 1776e: 95 1f adc r25, r21 17770: a6 1f adc r26, r22 17772: b7 1f adc r27, r23 17774: d4 cf rjmp .-88 ; 0x1771e 00017776 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 17776: fb 01 movw r30, r22 *v = 0; 17778: 11 82 std Z+1, r1 ; 0x01 1777a: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 1777c: 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'; 1777e: dc 01 movw r26, r24 17780: 2c 91 ld r18, X 17782: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 17784: 2a 30 cpi r18, 0x0A ; 10 17786: a0 f4 brcc .+40 ; 0x177b0 *v *= 10; 17788: 40 81 ld r20, Z 1778a: 51 81 ldd r21, Z+1 ; 0x01 1778c: 64 9f mul r22, r20 1778e: 90 01 movw r18, r0 17790: 65 9f mul r22, r21 17792: 30 0d add r19, r0 17794: 11 24 eor r1, r1 17796: 31 83 std Z+1, r19 ; 0x01 17798: 20 83 st Z, r18 *v += *str - '0'; 1779a: 4d 91 ld r20, X+ 1779c: cd 01 movw r24, r26 1779e: 20 53 subi r18, 0x30 ; 48 177a0: 31 09 sbc r19, r1 177a2: 24 0f add r18, r20 177a4: 31 1d adc r19, r1 177a6: 47 fd sbrc r20, 7 177a8: 3a 95 dec r19 177aa: 31 83 std Z+1, r19 ; 0x01 177ac: 20 83 st Z, r18 177ae: e7 cf rjmp .-50 ; 0x1777e ++str; } return str; } 177b0: 08 95 ret 000177b2 : 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) { 177b2: fc 01 movw r30, r24 switch(*oCheckSetting) { 177b4: 80 81 ld r24, Z 177b6: 88 23 and r24, r24 177b8: 21 f0 breq .+8 ; 0x177c2 177ba: 81 30 cpi r24, 0x01 ; 1 177bc: 29 f4 brne .+10 ; 0x177c8 case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 177be: 82 e0 ldi r24, 0x02 ; 2 177c0: 01 c0 rjmp .+2 ; 0x177c4 while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 177c2: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 177c4: 80 83 st Z, r24 177c6: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 177c8: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 177ca: 08 95 ret 000177cc : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 177cc: fc 01 movw r30, r24 177ce: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 177d0: 90 32 cpi r25, 0x20 ; 32 177d2: 49 f0 breq .+18 ; 0x177e6 177d4: 87 ef ldi r24, 0xF7 ; 247 177d6: 89 0f add r24, r25 177d8: 82 30 cpi r24, 0x02 ; 2 177da: 28 f0 brcs .+10 ; 0x177e6 177dc: 81 e0 ldi r24, 0x01 ; 1 177de: 9d 30 cpi r25, 0x0D ; 13 177e0: 19 f0 breq .+6 ; 0x177e8 177e2: 80 e0 ldi r24, 0x00 ; 0 177e4: 08 95 ret 177e6: 81 e0 ldi r24, 0x01 ; 1 } 177e8: 08 95 ret 000177ea : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 177ea: cf 93 push r28 177ec: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 177ee: 0f 94 5b 18 call 0x230b6 ; 0x230b6 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 177f2: c1 e6 ldi r28, 0x61 ; 97 177f4: 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)); 177f6: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 177fa: 70 e0 ldi r23, 0x00 ; 0 177fc: 90 e0 ldi r25, 0x00 ; 0 177fe: 80 e0 ldi r24, 0x00 ; 0 17800: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 17804: 20 e0 ldi r18, 0x00 ; 0 17806: 30 e0 ldi r19, 0x00 ; 0 17808: 40 e8 ldi r20, 0x80 ; 128 1780a: 51 e4 ldi r21, 0x41 ; 65 1780c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 17810: 9b 01 movw r18, r22 17812: ac 01 movw r20, r24 17814: 6c 85 ldd r22, Y+12 ; 0x0c 17816: 7d 85 ldd r23, Y+13 ; 0x0d 17818: 8e 85 ldd r24, Y+14 ; 0x0e 1781a: 9f 85 ldd r25, Y+15 ; 0x0f 1781c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 17820: 6c 87 std Y+12, r22 ; 0x0c 17822: 7d 87 std Y+13, r23 ; 0x0d 17824: 8e 87 std Y+14, r24 ; 0x0e 17826: 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])); 17828: 62 e0 ldi r22, 0x02 ; 2 1782a: 81 e7 ldi r24, 0x71 ; 113 1782c: 98 e8 ldi r25, 0x88 ; 136 } 1782e: df 91 pop r29 17830: 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])); 17832: 0d 94 db 79 jmp 0x2f3b6 ; 0x2f3b6 00017836 : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 17836: df 92 push r13 17838: ef 92 push r14 1783a: ff 92 push r15 1783c: 0f 93 push r16 1783e: 1f 93 push r17 17840: cf 93 push r28 17842: df 93 push r29 17844: cd b7 in r28, 0x3d ; 61 17846: de b7 in r29, 0x3e ; 62 17848: 63 97 sbiw r28, 0x13 ; 19 1784a: 0f b6 in r0, 0x3f ; 63 1784c: f8 94 cli 1784e: de bf out 0x3e, r29 ; 62 17850: 0f be out 0x3f, r0 ; 63 17852: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 17854: 30 91 63 04 lds r19, 0x0463 ; 0x800463 17858: 20 91 62 04 lds r18, 0x0462 ; 0x800462 1785c: 32 13 cpse r19, r18 1785e: 73 c0 rjmp .+230 ; 0x17946 17860: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 17862: 80 91 59 02 lds r24, 0x0259 ; 0x800259 17866: 88 23 and r24, r24 17868: 09 f4 brne .+2 ; 0x1786c 1786a: 45 c0 rjmp .+138 ; 0x178f6 //! //! @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)); 1786c: 87 ee ldi r24, 0xE7 ; 231 1786e: 9e e4 ldi r25, 0x4E ; 78 17870: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17874: 9f 93 push r25 17876: 8f 93 push r24 17878: 83 e6 ldi r24, 0x63 ; 99 1787a: 98 e8 ldi r25, 0x88 ; 136 1787c: 9f 93 push r25 1787e: 8f 93 push r24 17880: 8e 01 movw r16, r28 17882: 0f 5f subi r16, 0xFF ; 255 17884: 1f 4f sbci r17, 0xFF ; 255 17886: 1f 93 push r17 17888: 0f 93 push r16 1788a: 0f 94 55 a3 call 0x346aa ; 0x346aa 1788e: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 17890: 47 e0 ldi r20, 0x07 ; 7 17892: 50 e0 ldi r21, 0x00 ; 0 17894: b7 01 movw r22, r14 17896: 80 0f add r24, r16 17898: 91 2f mov r25, r17 1789a: 91 1d adc r25, r1 1789c: 0f 94 2e a4 call 0x3485c ; 0x3485c 178a0: 0f 90 pop r0 178a2: 0f 90 pop r0 178a4: 0f 90 pop r0 178a6: 0f 90 pop r0 178a8: 0f 90 pop r0 178aa: 0f 90 pop r0 178ac: 20 e0 ldi r18, 0x00 ; 0 178ae: 82 2f mov r24, r18 178b0: 8d 0d add r24, r13 178b2: 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) 178b4: 27 30 cpi r18, 0x07 ; 7 178b6: 39 f0 breq .+14 ; 0x178c6 178b8: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 178ba: f8 01 movw r30, r16 178bc: e8 0f add r30, r24 178be: f9 1f adc r31, r25 178c0: 30 81 ld r19, Z 178c2: 31 11 cpse r19, r1 178c4: f4 cf rjmp .-24 ; 0x178ae } buffer.c[index] = ']'; 178c6: f8 01 movw r30, r16 178c8: e8 0f add r30, r24 178ca: f9 1f adc r31, r25 178cc: 2d e5 ldi r18, 0x5D ; 93 178ce: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 178d0: 8c 0f add r24, r28 178d2: 9d 1f adc r25, r29 178d4: fc 01 movw r30, r24 178d6: 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()); 178d8: 0e 94 c1 62 call 0xc582 ; 0xc582 178dc: 48 2f mov r20, r24 178de: 60 91 60 04 lds r22, 0x0460 ; 0x800460 178e2: 80 e0 ldi r24, 0x00 ; 0 178e4: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_print_pad(buffer.c, LCD_WIDTH - 2); 178e8: 62 e1 ldi r22, 0x12 ; 18 178ea: c8 01 movw r24, r16 178ec: 0e 94 a2 73 call 0xe744 ; 0xe744 lcd_putc(type_char); 178f0: 80 e2 ldi r24, 0x20 ; 32 178f2: 0e 94 7c 6f call 0xdef8 ; 0xdef8 void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) { if (menu_item == menu_line) { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); if (menu_clicked && (lcd_encoder == menu_item)) 178f6: 80 91 61 04 lds r24, 0x0461 ; 0x800461 178fa: 88 23 and r24, r24 178fc: 21 f1 breq .+72 ; 0x17946 178fe: 20 91 63 04 lds r18, 0x0463 ; 0x800463 17902: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 17906: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1790a: 28 17 cp r18, r24 1790c: 19 06 cpc r1, r25 1790e: d9 f4 brne .+54 ; 0x17946 { lcd_update_enabled = 0; 17910: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(); 17914: 85 e0 ldi r24, 0x05 ; 5 17916: 99 e7 ldi r25, 0x79 ; 121 17918: 89 2b or r24, r25 1791a: 11 f0 breq .+4 ; 0x17920 1791c: 0e 94 05 79 call 0xf20a ; 0xf20a lcd_update_enabled = 1; 17920: 81 e0 ldi r24, 0x01 ; 1 17922: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a menu_item_ret(); 17926: 0e 94 ce 62 call 0xc59c ; 0xc59c return; } } menu_item++; } 1792a: 63 96 adiw r28, 0x13 ; 19 1792c: 0f b6 in r0, 0x3f ; 63 1792e: f8 94 cli 17930: de bf out 0x3e, r29 ; 62 17932: 0f be out 0x3f, r0 ; 63 17934: cd bf out 0x3d, r28 ; 61 17936: df 91 pop r29 17938: cf 91 pop r28 1793a: 1f 91 pop r17 1793c: 0f 91 pop r16 1793e: ff 90 pop r15 17940: ef 90 pop r14 17942: df 90 pop r13 17944: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 17946: 80 91 63 04 lds r24, 0x0463 ; 0x800463 1794a: 8f 5f subi r24, 0xFF ; 255 1794c: 80 93 63 04 sts 0x0463, r24 ; 0x800463 17950: ec cf rjmp .-40 ; 0x1792a 00017952 : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 17952: 89 e5 ldi r24, 0x59 ; 89 17954: 99 e6 ldi r25, 0x69 ; 105 17956: 0e 94 18 7d call 0xfa30 ; 0xfa30 lcd_return_to_status(); 1795a: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 0001795e : //! 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) { 1795e: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.385> 17962: 81 30 cpi r24, 0x01 ; 1 17964: 21 f4 brne .+8 ; 0x1796e SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 17966: 8f e0 ldi r24, 0x0F ; 15 17968: 99 e6 ldi r25, 0x69 ; 105 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 1796a: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 1796e: 80 e0 ldi r24, 0x00 ; 0 17970: 99 e6 ldi r25, 0x69 ; 105 17972: fb cf rjmp .-10 ; 0x1796a 00017974 : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 17974: 0d 94 24 6d jmp 0x2da48 ; 0x2da48 00017978 : 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) { 17978: 0f 93 push r16 1797a: 1f 93 push r17 1797c: cf 93 push r28 1797e: df 93 push r29 17980: 98 2f mov r25, r24 17982: 86 2f mov r24, r22 17984: 14 2f mov r17, r20 17986: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 17988: 69 2f mov r22, r25 1798a: 0e 94 b5 6f call 0xdf6a ; 0xdf6a switch (_state) 1798e: 11 30 cpi r17, 0x01 ; 1 17990: 21 f0 breq .+8 ; 0x1799a 17992: 12 30 cpi r17, 0x02 ; 2 17994: 79 f0 breq .+30 ; 0x179b4 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 17996: ce 01 movw r24, r28 17998: 15 c0 rjmp .+42 ; 0x179c4 { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 1799a: ce 01 movw r24, r28 1799c: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_putc(':'); 179a0: 8a e3 ldi r24, 0x3A ; 58 179a2: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_putc(_indicator); 179a6: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 179a8: df 91 pop r29 179aa: cf 91 pop r28 179ac: 1f 91 pop r17 179ae: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 179b0: 0c 94 7c 6f jmp 0xdef8 ; 0xdef8 break; case 2: lcd_puts_P(_name_PROGMEM); 179b4: ce 01 movw r24, r28 179b6: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_putc(':'); 179ba: 8a e3 ldi r24, 0x3A ; 58 179bc: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_puts_P(MSG_OK_CAPS); 179c0: 82 e3 ldi r24, 0x32 ; 50 179c2: 99 e6 ldi r25, 0x69 ; 105 break; default: lcd_puts_P(_name_PROGMEM); } } 179c4: df 91 pop r29 179c6: cf 91 pop r28 179c8: 1f 91 pop r17 179ca: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 179cc: 0c 94 78 6f jmp 0xdef0 ; 0xdef0 000179d0 : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 179d0: 81 30 cpi r24, 0x01 ; 1 179d2: 21 f4 brne .+8 ; 0x179dc case STATE_ON: lcd_puts_P(_N(" 1")); 179d4: 8c e4 ldi r24, 0x4C ; 76 179d6: 98 e6 ldi r25, 0x68 ; 104 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 179d8: 0c 94 78 6f jmp 0xdef0 ; 0xdef0 179dc: 88 e4 ldi r24, 0x48 ; 72 179de: 98 e6 ldi r25, 0x68 ; 104 179e0: fb cf rjmp .-10 ; 0x179d8 000179e2 : } #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); 179e2: 87 ea ldi r24, 0xA7 ; 167 179e4: 9c e0 ldi r25, 0x0C ; 12 179e6: 0f 94 3e a4 call 0x3487c ; 0x3487c if (value > 1) value = 1; 179ea: 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) 179ec: 82 30 cpi r24, 0x02 ; 2 179ee: 08 f4 brcc .+2 ; 0x179f2 179f0: 68 27 eor r22, r24 179f2: 87 ea ldi r24, 0xA7 ; 167 179f4: 9c e0 ldi r25, 0x0C ; 12 179f6: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 000179fa : 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); 179fa: 8a ea ldi r24, 0xAA ; 170 179fc: 9d e0 ldi r25, 0x0D ; 13 179fe: 0f 94 3e a4 call 0x3487c ; 0x3487c switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 17a02: 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) { 17a04: 83 30 cpi r24, 0x03 ; 3 17a06: 21 f0 breq .+8 ; 0x17a10 case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 17a08: 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) { 17a0a: 85 30 cpi r24, 0x05 ; 5 17a0c: 09 f0 breq .+2 ; 0x17a10 case 1: mbl_z_probe_nr = 3; break; 17a0e: 63 e0 ldi r22, 0x03 ; 3 17a10: 8a ea ldi r24, 0xAA ; 170 17a12: 9d e0 ldi r25, 0x0D ; 13 17a14: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017a18 : 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); 17a18: 8b ea ldi r24, 0xAB ; 171 17a1a: 9d e0 ldi r25, 0x0D ; 13 17a1c: 0f 94 3e a4 call 0x3487c ; 0x3487c if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 17a20: 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; 17a22: 83 30 cpi r24, 0x03 ; 3 17a24: 09 f4 brne .+2 ; 0x17a28 17a26: 67 e0 ldi r22, 0x07 ; 7 17a28: 8b ea ldi r24, 0xAB ; 171 17a2a: 9d e0 ldi r25, 0x0D ; 13 17a2c: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017a30 : #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); 17a30: 8c ea ldi r24, 0xAC ; 172 17a32: 9d e0 ldi r25, 0x0D ; 13 17a34: 0f 94 3e a4 call 0x3487c ; 0x3487c magnet_elimination = !magnet_elimination; 17a38: 61 e0 ldi r22, 0x01 ; 1 17a3a: 81 11 cpse r24, r1 17a3c: 60 e0 ldi r22, 0x00 ; 0 17a3e: 8c ea ldi r24, 0xAC ; 172 17a40: 9d e0 ldi r25, 0x0D ; 13 17a42: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017a46 : 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); 17a46: 8e ee ldi r24, 0xEE ; 238 17a48: 93 e0 ldi r25, 0x03 ; 3 17a4a: 0e 94 d9 bb call 0x177b2 ; 0x177b2 17a4e: 60 91 ee 03 lds r22, 0x03EE ; 0x8003ee 17a52: 80 e2 ldi r24, 0x20 ; 32 17a54: 9c e0 ldi r25, 0x0C ; 12 17a56: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017a5a : 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); 17a5a: 89 ee ldi r24, 0xE9 ; 233 17a5c: 93 e0 ldi r25, 0x03 ; 3 17a5e: 0e 94 d9 bb call 0x177b2 ; 0x177b2 17a62: 60 91 e9 03 lds r22, 0x03E9 ; 0x8003e9 17a66: 83 ea ldi r24, 0xA3 ; 163 17a68: 9d e0 ldi r25, 0x0D ; 13 17a6a: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017a6e : 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); 17a6e: 8a ee ldi r24, 0xEA ; 234 17a70: 93 e0 ldi r25, 0x03 ; 3 17a72: 0e 94 d9 bb call 0x177b2 ; 0x177b2 17a76: 60 91 ea 03 lds r22, 0x03EA ; 0x8003ea 17a7a: 84 ea ldi r24, 0xA4 ; 164 17a7c: 9d e0 ldi r25, 0x0D ; 13 17a7e: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017a82 : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 17a82: 8d ee ldi r24, 0xED ; 237 17a84: 93 e0 ldi r25, 0x03 ; 3 17a86: 0e 94 d9 bb call 0x177b2 ; 0x177b2 17a8a: 60 91 ed 03 lds r22, 0x03ED ; 0x8003ed 17a8e: 88 ea ldi r24, 0xA8 ; 168 17a90: 9d e0 ldi r25, 0x0D ; 13 17a92: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017a96 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 17a96: 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; 17a9a: 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) { 17a9c: 81 11 cpse r24, r1 17a9e: 01 c0 rjmp .+2 ; 0x17aa2 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 17aa0: 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; 17aa2: 60 93 f9 16 sts 0x16F9, r22 ; 0x8016f9 17aa6: 87 e4 ldi r24, 0x47 ; 71 17aa8: 9d e0 ldi r25, 0x0D ; 13 17aaa: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017aae : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 17aae: e1 ef ldi r30, 0xF1 ; 241 17ab0: f6 e1 ldi r31, 0x16 ; 22 17ab2: 61 81 ldd r22, Z+1 ; 0x01 17ab4: 81 e0 ldi r24, 0x01 ; 1 17ab6: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 17ab8: 61 83 std Z+1, r22 ; 0x01 17aba: 87 e0 ldi r24, 0x07 ; 7 17abc: 9f e0 ldi r25, 0x0F ; 15 17abe: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017ac2 : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 17ac2: e1 ef ldi r30, 0xF1 ; 241 17ac4: f6 e1 ldi r31, 0x16 ; 22 17ac6: 62 81 ldd r22, Z+2 ; 0x02 17ac8: 81 e0 ldi r24, 0x01 ; 1 17aca: 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; 17acc: 62 83 std Z+2, r22 ; 0x02 17ace: 85 ed ldi r24, 0xD5 ; 213 17ad0: 9e e0 ldi r25, 0x0E ; 14 17ad2: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017ad6 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 17ad6: e8 e4 ldi r30, 0x48 ; 72 17ad8: f6 e1 ldi r31, 0x16 ; 22 17ada: 60 81 ld r22, Z 17adc: 81 e0 ldi r24, 0x01 ; 1 17ade: 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; } 17ae0: 60 83 st Z, r22 17ae2: 8b eb ldi r24, 0xBB ; 187 17ae4: 9f e0 ldi r25, 0x0F ; 15 17ae6: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017aea : 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); 17aea: 8f ea ldi r24, 0xAF ; 175 17aec: 9f e0 ldi r25, 0x0F ; 15 17aee: 0f 94 3e a4 call 0x3487c ; 0x3487c temp_cal_active = !temp_cal_active; 17af2: 61 e0 ldi r22, 0x01 ; 1 17af4: 81 11 cpse r24, r1 17af6: 60 e0 ldi r22, 0x00 ; 0 17af8: 8f ea ldi r24, 0xAF ; 175 17afa: 9f e0 ldi r25, 0x0F ; 15 17afc: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017b00 : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 17b00: 80 91 47 04 lds r24, 0x0447 ; 0x800447 17b04: 81 30 cpi r24, 0x01 ; 1 17b06: 71 f0 breq .+28 ; 0x17b24 17b08: 20 f0 brcs .+8 ; 0x17b12 17b0a: 82 30 cpi r24, 0x02 ; 2 17b0c: 69 f4 brne .+26 ; 0x17b28 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 17b0e: 83 e0 ldi r24, 0x03 ; 3 17b10: 01 c0 rjmp .+2 ; 0x17b14 void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 17b12: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 17b14: 80 93 47 04 sts 0x0447, r24 ; 0x800447 17b18: 60 91 47 04 lds r22, 0x0447 ; 0x800447 17b1c: 87 ed ldi r24, 0xD7 ; 215 17b1e: 9e e0 ldi r25, 0x0E ; 14 17b20: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 17b24: 82 e0 ldi r24, 0x02 ; 2 17b26: f6 cf rjmp .-20 ; 0x17b14 break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 17b28: 10 92 47 04 sts 0x0447, r1 ; 0x800447 17b2c: f5 cf rjmp .-22 ; 0x17b18 00017b2e : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 17b2e: 89 e0 ldi r24, 0x09 ; 9 17b30: 9f e0 ldi r25, 0x0F ; 15 17b32: 0f 94 3e a4 call 0x3487c ; 0x3487c switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 17b36: 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) { 17b38: 88 23 and r24, r24 17b3a: 21 f0 breq .+8 ; 0x17b44 case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 17b3c: 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) { 17b3e: 81 30 cpi r24, 0x01 ; 1 17b40: 09 f0 breq .+2 ; 0x17b44 case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 17b42: 60 e0 ldi r22, 0x00 ; 0 17b44: 89 e0 ldi r24, 0x09 ; 9 17b46: 9f e0 ldi r25, 0x0F ; 15 17b48: 0f 94 62 a4 call 0x348c4 ; 0x348c4 } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 17b4c: 81 e0 ldi r24, 0x01 ; 1 17b4e: 80 93 26 14 sts 0x1426, r24 ; 0x801426 } 17b52: 08 95 ret 00017b54 : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 17b54: cf 93 push r28 17b56: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 17b58: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb 17b5c: 8c 33 cpi r24, 0x3C ; 60 17b5e: e1 f0 breq .+56 ; 0x17b98 17b60: 80 35 cpi r24, 0x50 ; 80 17b62: 01 f1 breq .+64 ; 0x17ba4 17b64: 88 32 cpi r24, 0x28 ; 40 17b66: 91 f0 breq .+36 ; 0x17b8c case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 17b68: 88 e2 ldi r24, 0x28 ; 40 17b6a: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=400; 17b6e: c0 e9 ldi r28, 0x90 ; 144 17b70: d1 e0 ldi r29, 0x01 ; 1 17b72: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb 17b76: 87 ea ldi r24, 0xA7 ; 167 17b78: 9d e0 ldi r25, 0x0D ; 13 17b7a: 0f 94 62 a4 call 0x348c4 ; 0x348c4 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 17b7e: be 01 movw r22, r28 17b80: 85 ea ldi r24, 0xA5 ; 165 17b82: 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); } 17b84: df 91 pop r29 17b86: cf 91 pop r28 17b88: 0d 94 80 a4 jmp 0x34900 ; 0x34900 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 17b8c: 8c e3 ldi r24, 0x3C ; 60 17b8e: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=600; 17b92: c8 e5 ldi r28, 0x58 ; 88 17b94: d2 e0 ldi r29, 0x02 ; 2 17b96: ed cf rjmp .-38 ; 0x17b72 break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 17b98: 80 e5 ldi r24, 0x50 ; 80 17b9a: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=800; 17b9e: c0 e2 ldi r28, 0x20 ; 32 17ba0: d3 e0 ldi r29, 0x03 ; 3 17ba2: e7 cf rjmp .-50 ; 0x17b72 break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 17ba4: 89 e1 ldi r24, 0x19 ; 25 17ba6: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=250; 17baa: ca ef ldi r28, 0xFA ; 250 17bac: d0 e0 ldi r29, 0x00 ; 0 17bae: e1 cf rjmp .-62 ; 0x17b72 00017bb0 : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 17bb0: 0f 93 push r16 17bb2: 1f 93 push r17 17bb4: cf 93 push r28 17bb6: df 93 push r29 17bb8: 00 d0 rcall .+0 ; 0x17bba 17bba: 00 d0 rcall .+0 ; 0x17bbc 17bbc: 1f 92 push r1 17bbe: 1f 92 push r1 17bc0: cd b7 in r28, 0x3d ; 61 17bc2: de b7 in r29, 0x3e ; 62 17bc4: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 17bc6: 8a e0 ldi r24, 0x0A ; 10 17bc8: 90 e0 ldi r25, 0x00 ; 0 17bca: 0f 94 4c a4 call 0x34898 ; 0x34898 17bce: 9a 83 std Y+2, r25 ; 0x02 17bd0: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 17bd2: 8c e0 ldi r24, 0x0C ; 12 17bd4: 90 e0 ldi r25, 0x00 ; 0 17bd6: 0f 94 4c a4 call 0x34898 ; 0x34898 17bda: 9c 83 std Y+4, r25 ; 0x04 17bdc: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 17bde: 8e e0 ldi r24, 0x0E ; 14 17be0: 90 e0 ldi r25, 0x00 ; 0 17be2: 0f 94 4c a4 call 0x34898 ; 0x34898 17be6: 9e 83 std Y+6, r25 ; 0x06 17be8: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 17bea: 80 e1 ldi r24, 0x10 ; 16 17bec: 90 e0 ldi r25, 0x00 ; 0 17bee: 0f 94 4c a4 call 0x34898 ; 0x34898 17bf2: 98 87 std Y+8, r25 ; 0x08 17bf4: 8f 83 std Y+7, r24 ; 0x07 17bf6: c8 01 movw r24, r16 17bf8: de 01 movw r26, r28 17bfa: 11 96 adiw r26, 0x01 ; 1 17bfc: be 01 movw r22, r28 17bfe: 67 5f subi r22, 0xF7 ; 247 17c00: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 17c02: fc 01 movw r30, r24 17c04: 25 91 lpm r18, Z+ 17c06: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 17c08: 4d 91 ld r20, X+ 17c0a: 5d 91 ld r21, X+ 17c0c: 42 17 cp r20, r18 17c0e: 53 07 cpc r21, r19 17c10: 48 f0 brcs .+18 ; 0x17c24 return true; else if (v < ver_eeprom[i]) 17c12: 24 17 cp r18, r20 17c14: 35 07 cpc r19, r21 17c16: 20 f0 brcs .+8 ; 0x17c20 17c18: 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) { 17c1a: a6 17 cp r26, r22 17c1c: b7 07 cpc r27, r23 17c1e: 89 f7 brne .-30 ; 0x17c02 return true; else if (v < ver_eeprom[i]) break; } return false; 17c20: 80 e0 ldi r24, 0x00 ; 0 17c22: 01 c0 rjmp .+2 ; 0x17c26 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; 17c24: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 17c26: 28 96 adiw r28, 0x08 ; 8 17c28: 0f b6 in r0, 0x3f ; 63 17c2a: f8 94 cli 17c2c: de bf out 0x3e, r29 ; 62 17c2e: 0f be out 0x3f, r0 ; 63 17c30: cd bf out 0x3d, r28 ; 61 17c32: df 91 pop r29 17c34: cf 91 pop r28 17c36: 1f 91 pop r17 17c38: 0f 91 pop r16 17c3a: 08 95 ret 00017c3c : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 17c3c: 8c ea ldi r24, 0xAC ; 172 17c3e: 9c e0 ldi r25, 0x0C ; 12 17c40: 0f 94 3e a4 call 0x3487c ; 0x3487c if (current_state) 17c44: 88 23 and r24, r24 17c46: 99 f0 breq .+38 ; 0x17c6e StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 17c48: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 17c4c: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 17c50: 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)); 17c54: 8c ea ldi r24, 0xAC ; 172 17c56: 9c e0 ldi r25, 0x0C ; 12 17c58: 0f 94 3e a4 call 0x3487c ; 0x3487c 17c5c: 61 e0 ldi r22, 0x01 ; 1 17c5e: 81 11 cpse r24, r1 17c60: 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); 17c62: 8c ea ldi r24, 0xAC ; 172 17c64: 9c e0 ldi r25, 0x0C ; 12 17c66: 0f 94 86 a4 call 0x3490c ; 0x3490c { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); 17c6a: 0d 94 23 65 jmp 0x2ca46 ; 0x2ca46 { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 17c6e: 0f 94 de 95 call 0x32bbc ; 0x32bbc 17c72: f0 cf rjmp .-32 ; 0x17c54 00017c74 : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 17c74: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb 17c78: 88 23 and r24, r24 17c7a: 21 f0 breq .+8 ; 0x17c84 17c7c: 81 30 cpi r24, 0x01 ; 1 17c7e: 69 f4 brne .+26 ; 0x17c9a 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; 17c80: 82 e0 ldi r24, 0x02 ; 2 17c82: 01 c0 rjmp .+2 ; 0x17c86 #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; 17c84: 81 e0 ldi r24, 0x01 ; 1 case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break; 17c86: 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); 17c8a: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 17c8e: 8f ef ldi r24, 0xFF ; 255 17c90: 9f e0 ldi r25, 0x0F ; 15 17c92: 0f 94 62 a4 call 0x348c4 ; 0x348c4 // 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(); 17c96: 0d 94 e4 17 jmp 0x22fc8 ; 0x22fc8 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; 17c9a: 10 92 bb 03 sts 0x03BB, r1 ; 0x8003bb 17c9e: f5 cf rjmp .-22 ; 0x17c8a 00017ca0 : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 17ca0: 81 e0 ldi r24, 0x01 ; 1 17ca2: 90 91 f1 16 lds r25, 0x16F1 ; 0x8016f1 17ca6: 91 11 cpse r25, r1 17ca8: 80 e0 ldi r24, 0x00 ; 0 17caa: 0c 94 eb 77 jmp 0xefd6 ; 0xefd6 00017cae : static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); } #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_jam_detection_set() { 17cae: 0f 93 push r16 17cb0: 1f 93 push r17 17cb2: cf 93 push r28 fsensor.setJamDetectionEnabled(!fsensor.getJamDetectionEnabled(), true); 17cb4: 01 ef ldi r16, 0xF1 ; 241 17cb6: 16 e1 ldi r17, 0x16 ; 22 17cb8: f8 01 movw r30, r16 17cba: c6 85 ldd r28, Z+14 ; 0x0e 17cbc: 81 e0 ldi r24, 0x01 ; 1 17cbe: c8 27 eor r28, r24 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 17cc0: c6 87 std Z+14, r28 ; 0x0e oldPos = pat9125_y; 17cc2: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 17cc6: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 17cca: 90 8b std Z+16, r25 ; 0x10 17ccc: 87 87 std Z+15, r24 ; 0x0f resetStepCount(); 17cce: 0f 94 d5 6c call 0x2d9aa ; 0x2d9aa jamErrCnt = 0; 17cd2: f8 01 movw r30, r16 17cd4: 15 8a std Z+21, r1 ; 0x15 17cd6: 6c 2f mov r22, r28 17cd8: 8d ea ldi r24, 0xAD ; 173 17cda: 9c e0 ldi r25, 0x0C ; 12 } 17cdc: cf 91 pop r28 17cde: 1f 91 pop r17 17ce0: 0f 91 pop r16 17ce2: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 00017ce6 : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 17ce6: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 17cea: 86 e2 ldi r24, 0x26 ; 38 17cec: 9b e3 ldi r25, 0x3B ; 59 17cee: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17cf2: ac 01 movw r20, r24 17cf4: 60 e0 ldi r22, 0x00 ; 0 17cf6: 80 e0 ldi r24, 0x00 ; 0 17cf8: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 pid_temp += lcd_encoder; 17cfc: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 17d00: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 17d04: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 17d08: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 17d0c: 82 0f add r24, r18 17d0e: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 17d10: 82 33 cpi r24, 0x32 ; 50 17d12: 21 e0 ldi r18, 0x01 ; 1 17d14: 92 07 cpc r25, r18 17d16: 50 f1 brcs .+84 ; 0x17d6c 17d18: 81 e3 ldi r24, 0x31 ; 49 17d1a: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 17d1c: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f 17d20: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e lcd_encoder = 0; 17d24: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 17d28: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e lcd_set_cursor(1, 2); 17d2c: 62 e0 ldi r22, 0x02 ; 2 17d2e: 81 e0 ldi r24, 0x01 ; 1 17d30: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%3u"), pid_temp); 17d34: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 17d38: 8f 93 push r24 17d3a: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 17d3e: 8f 93 push r24 17d40: 8b e5 ldi r24, 0x5B ; 91 17d42: 93 e8 ldi r25, 0x83 ; 131 17d44: 9f 93 push r25 17d46: 8f 93 push r24 17d48: 0e 94 66 6f call 0xdecc ; 0xdecc if (lcd_clicked()) { 17d4c: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 17d50: 0f 90 pop r0 17d52: 0f 90 pop r0 17d54: 0f 90 pop r0 17d56: 0f 90 pop r0 17d58: 88 23 and r24, r24 17d5a: 71 f0 breq .+28 ; 0x17d78 lcd_commands_type = LcdCommands::PidExtruder; 17d5c: 83 e0 ldi r24, 0x03 ; 3 17d5e: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e lcd_return_to_status(); 17d62: 0f 94 18 05 call 0x20a30 ; 0x20a30 lcd_update(2); 17d66: 82 e0 ldi r24, 0x02 ; 2 17d68: 0c 94 54 6f jmp 0xdea8 ; 0xdea8 { lcd_clear(); lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); pid_temp += lcd_encoder; if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 17d6c: 8e 31 cpi r24, 0x1E ; 30 17d6e: 91 05 cpc r25, r1 17d70: a8 f6 brcc .-86 ; 0x17d1c 17d72: 8e e1 ldi r24, 0x1E ; 30 17d74: 90 e0 ldi r25, 0x00 ; 0 17d76: d2 cf rjmp .-92 ; 0x17d1c lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 17d78: 08 95 ret 00017d7a : 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)) { 17d7a: 0f 93 push r16 17d7c: 1f 93 push r17 17d7e: cf 93 push r28 17d80: df 93 push r29 17d82: eb 01 movw r28, r22 17d84: 8a 01 movw r16, r20 switch(*oCheckSetting) { 17d86: 81 30 cpi r24, 0x01 ; 1 17d88: 81 f0 breq .+32 ; 0x17daa 17d8a: 82 30 cpi r24, 0x02 ; 2 17d8c: 89 f0 breq .+34 ; 0x17db0 case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 17d8e: 83 e4 ldi r24, 0x43 ; 67 17d90: 9b e4 ldi r25, 0x4B ; 75 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); 17d92: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17d96: 22 e0 ldi r18, 0x02 ; 2 17d98: a8 01 movw r20, r16 17d9a: bc 01 movw r22, r24 17d9c: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 17d9e: df 91 pop r29 17da0: cf 91 pop r28 17da2: 1f 91 pop r17 17da4: 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); 17da6: 0c 94 b9 75 jmp 0xeb72 ; 0xeb72 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); 17daa: 8c e3 ldi r24, 0x3C ; 60 17dac: 9b e4 ldi r25, 0x4B ; 75 17dae: f1 cf rjmp .-30 ; 0x17d92 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 17db0: 83 e3 ldi r24, 0x33 ; 51 17db2: 9b e4 ldi r25, 0x4B ; 75 17db4: ee cf rjmp .-36 ; 0x17d92 00017db6 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() 17db6: cf 93 push r28 17db8: 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)) 17dba: 8f ef ldi r24, 0xFF ; 255 17dbc: 9f e0 ldi r25, 0x0F ; 15 17dbe: 0f 94 3e a4 call 0x3487c ; 0x3487c 17dc2: 81 30 cpi r24, 0x01 ; 1 17dc4: 99 f0 breq .+38 ; 0x17dec 17dc6: 82 30 cpi r24, 0x02 ; 2 17dc8: a1 f0 breq .+40 ; 0x17df2 { case SILENT_MODE_POWER: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); 17dca: 86 e2 ldi r24, 0x26 ; 38 17dcc: 9b e4 ldi r25, 0x4B ; 75 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); 17dce: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17dd2: ec 01 movw r28, r24 17dd4: 8f e1 ldi r24, 0x1F ; 31 17dd6: 9b e4 ldi r25, 0x4B ; 75 17dd8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17ddc: 22 e0 ldi r18, 0x02 ; 2 17dde: 4a e3 ldi r20, 0x3A ; 58 17de0: 5e eb ldi r21, 0xBE ; 190 17de2: 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 } } 17de4: df 91 pop r29 17de6: 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); 17de8: 0c 94 b9 75 jmp 0xeb72 ; 0xeb72 { 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); 17dec: 86 e1 ldi r24, 0x16 ; 22 17dee: 9b e4 ldi r25, 0x4B ; 75 17df0: ee cf rjmp .-36 ; 0x17dce break; case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); 17df2: 89 e0 ldi r24, 0x09 ; 9 17df4: 9b e4 ldi r25, 0x4B ; 75 17df6: eb cf rjmp .-42 ; 0x17dce 00017df8 : 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() { 17df8: cf 93 push r28 17dfa: 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); 17dfc: 80 91 40 02 lds r24, 0x0240 ; 0x800240 17e00: 88 23 and r24, r24 17e02: 89 f0 breq .+34 ; 0x17e26 17e04: 8c e5 ldi r24, 0x5C ; 92 17e06: 93 e6 ldi r25, 0x63 ; 99 17e08: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17e0c: ec 01 movw r28, r24 17e0e: 80 ed ldi r24, 0xD0 ; 208 17e10: 94 e4 ldi r25, 0x44 ; 68 17e12: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17e16: 22 e0 ldi r18, 0x02 ; 2 17e18: 42 eb ldi r20, 0xB2 ; 178 17e1a: 57 e3 ldi r21, 0x37 ; 55 17e1c: be 01 movw r22, r28 } 17e1e: df 91 pop r29 17e20: 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); 17e22: 0c 94 b9 75 jmp 0xeb72 ; 0xeb72 17e26: 86 e5 ldi r24, 0x56 ; 86 17e28: 93 e6 ldi r25, 0x63 ; 99 17e2a: ee cf rjmp .-36 ; 0x17e08 00017e2c : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 17e2c: cf 93 push r28 17e2e: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 17e30: 86 ed ldi r24, 0xD6 ; 214 17e32: 9e e0 ldi r25, 0x0E ; 14 17e34: 0f 94 3e a4 call 0x3487c ; 0x3487c 17e38: 81 30 cpi r24, 0x01 ; 1 17e3a: 19 f5 brne .+70 ; 0x17e82 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 17e3c: 8c e5 ldi r24, 0x5C ; 92 17e3e: 93 e6 ldi r25, 0x63 ; 99 17e40: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17e44: 22 e0 ldi r18, 0x02 ; 2 17e46: 40 eb ldi r20, 0xB0 ; 176 17e48: 58 e3 ldi r21, 0x38 ; 56 17e4a: bc 01 movw r22, r24 17e4c: 86 e9 ldi r24, 0x96 ; 150 17e4e: 98 e6 ldi r25, 0x68 ; 104 17e50: 0e 94 b9 75 call 0xeb72 ; 0xeb72 #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 17e54: 8e ec ldi r24, 0xCE ; 206 17e56: 9e e0 ldi r25, 0x0E ; 14 17e58: 0f 94 3e a4 call 0x3487c ; 0x3487c 17e5c: 81 30 cpi r24, 0x01 ; 1 17e5e: a1 f4 brne .+40 ; 0x17e88 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 17e60: 8c e5 ldi r24, 0x5C ; 92 17e62: 93 e6 ldi r25, 0x63 ; 99 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); 17e64: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17e68: ec 01 movw r28, r24 17e6a: 85 eb ldi r24, 0xB5 ; 181 17e6c: 94 e4 ldi r25, 0x44 ; 68 17e6e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17e72: 22 e0 ldi r18, 0x02 ; 2 17e74: 46 ec ldi r20, 0xC6 ; 198 17e76: 58 e3 ldi r21, 0x38 ; 56 17e78: 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 } 17e7a: df 91 pop r29 17e7c: 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); 17e7e: 0c 94 b9 75 jmp 0xeb72 ; 0xeb72 #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); 17e82: 86 e5 ldi r24, 0x56 ; 86 17e84: 93 e6 ldi r25, 0x63 ; 99 17e86: dc cf rjmp .-72 ; 0x17e40 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: 86 e5 ldi r24, 0x56 ; 86 17e8a: 93 e6 ldi r25, 0x63 ; 99 17e8c: eb cf rjmp .-42 ; 0x17e64 00017e8e : 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) 17e8e: 80 91 96 03 lds r24, 0x0396 ; 0x800396 17e92: 88 23 and r24, r24 17e94: 21 f0 breq .+8 ; 0x17e9e 17e96: 80 91 59 02 lds r24, 0x0259 ; 0x800259 17e9a: 88 23 and r24, r24 17e9c: 51 f0 breq .+20 ; 0x17eb2 { _md->status = 1; 17e9e: 81 e0 ldi r24, 0x01 ; 1 17ea0: 80 93 96 03 sts 0x0396, r24 ; 0x800396 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 17ea4: 60 e0 ldi r22, 0x00 ; 0 17ea6: 8a e2 ldi r24, 0x2A ; 42 17ea8: 9d e0 ldi r25, 0x0D ; 13 17eaa: 0e 94 b8 78 call 0xf170 ; 0xf170 17eae: 80 93 97 03 sts 0x0397, r24 ; 0x800397 } MENU_BEGIN(); 17eb2: 0e 94 67 74 call 0xe8ce ; 0xe8ce 17eb6: 10 92 60 04 sts 0x0460, r1 ; 0x800460 17eba: 80 91 60 04 lds r24, 0x0460 ; 0x800460 17ebe: 84 30 cpi r24, 0x04 ; 4 17ec0: 08 f0 brcs .+2 ; 0x17ec4 17ec2: 90 c0 rjmp .+288 ; 0x17fe4 17ec4: 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 17ec8: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec 17ecc: 81 11 cpse r24, r1 17ece: 55 c0 rjmp .+170 ; 0x17f7a 17ed0: 82 e0 ldi r24, 0x02 ; 2 17ed2: 9b e4 ldi r25, 0x4B ; 75 17ed4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17ed8: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 17edc: 85 ee ldi r24, 0xE5 ; 229 17ede: 96 e4 ldi r25, 0x46 ; 70 17ee0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17ee4: 65 e8 ldi r22, 0x85 ; 133 17ee6: 7e ec ldi r23, 0xCE ; 206 17ee8: 0e 94 4e 73 call 0xe69c ; 0xe69c SETTINGS_NOZZLE; 17eec: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb 17ef0: 8c 33 cpi r24, 0x3C ; 60 17ef2: 09 f4 brne .+2 ; 0x17ef6 17ef4: 60 c0 rjmp .+192 ; 0x17fb6 17ef6: 08 f0 brcs .+2 ; 0x17efa 17ef8: 43 c0 rjmp .+134 ; 0x17f80 17efa: 89 31 cpi r24, 0x19 ; 25 17efc: 09 f4 brne .+2 ; 0x17f00 17efe: 4f c0 rjmp .+158 ; 0x17f9e 17f00: 88 32 cpi r24, 0x28 ; 40 17f02: 09 f4 brne .+2 ; 0x17f06 17f04: 42 c0 rjmp .+132 ; 0x17f8a MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 17f06: 8e e7 ldi r24, 0x7E ; 126 17f08: 95 e4 ldi r25, 0x45 ; 69 17f0a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17f0e: 60 e1 ldi r22, 0x10 ; 16 17f10: 79 ee ldi r23, 0xE9 ; 233 17f12: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 17f16: 8b e2 ldi r24, 0x2B ; 43 17f18: 95 e4 ldi r25, 0x45 ; 69 17f1a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17f1e: 67 ec ldi r22, 0xC7 ; 199 17f20: 71 ec ldi r23, 0xC1 ; 193 17f22: 0e 94 4e 73 call 0xe69c ; 0xe69c //! 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) 17f26: 80 91 97 03 lds r24, 0x0397 ; 0x800397 17f2a: 88 23 and r24, r24 17f2c: 31 f0 breq .+12 ; 0x17f3a { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 17f2e: 63 ef ldi r22, 0xF3 ; 243 17f30: 7f eb ldi r23, 0xBF ; 191 17f32: 80 e2 ldi r24, 0x20 ; 32 17f34: 94 e8 ldi r25, 0x84 ; 132 17f36: 0e 94 4e 73 call 0xe69c ; 0xe69c //! 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); 17f3a: 89 e2 ldi r24, 0x29 ; 41 17f3c: 9d e0 ldi r25, 0x0D ; 13 17f3e: 0f 94 3e a4 call 0x3487c ; 0x3487c 17f42: 88 23 and r24, r24 17f44: 09 f4 brne .+2 ; 0x17f48 17f46: 4b c0 rjmp .+150 ; 0x17fde 17f48: 82 ea ldi r24, 0xA2 ; 162 17f4a: 98 e4 ldi r25, 0x48 ; 72 17f4c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17f50: 22 e0 ldi r18, 0x02 ; 2 17f52: 43 e2 ldi r20, 0x23 ; 35 17f54: 56 ec ldi r21, 0xC6 ; 198 17f56: bc 01 movw r22, r24 17f58: 89 ea ldi r24, 0xA9 ; 169 17f5a: 98 e6 ldi r25, 0x68 ; 104 17f5c: 0e 94 b9 75 call 0xeb72 ; 0xeb72 #endif //PINDA_TEMP_COMP MENU_END(); 17f60: 0e 94 de 62 call 0xc5bc ; 0xc5bc _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 17f64: 80 91 60 04 lds r24, 0x0460 ; 0x800460 17f68: 8f 5f subi r24, 0xFF ; 255 17f6a: 80 93 60 04 sts 0x0460, r24 ; 0x800460 17f6e: 80 91 62 04 lds r24, 0x0462 ; 0x800462 17f72: 8f 5f subi r24, 0xFF ; 255 17f74: 80 93 62 04 sts 0x0462, r24 ; 0x800462 17f78: a0 cf rjmp .-192 ; 0x17eba MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 17f7a: 87 e9 ldi r24, 0x97 ; 151 17f7c: 98 e4 ldi r25, 0x48 ; 72 17f7e: aa cf rjmp .-172 ; 0x17ed4 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 17f80: 80 35 cpi r24, 0x50 ; 80 17f82: 19 f1 breq .+70 ; 0x17fca 17f84: 8f 3f cpi r24, 0xFF ; 255 17f86: 09 f0 breq .+2 ; 0x17f8a 17f88: be cf rjmp .-132 ; 0x17f06 17f8a: 84 e3 ldi r24, 0x34 ; 52 17f8c: 95 e4 ldi r25, 0x45 ; 69 17f8e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17f92: 22 e0 ldi r18, 0x02 ; 2 17f94: 4a ea ldi r20, 0xAA ; 170 17f96: 5d eb ldi r21, 0xBD ; 189 17f98: 67 e3 ldi r22, 0x37 ; 55 17f9a: 74 e8 ldi r23, 0x84 ; 132 17f9c: 09 c0 rjmp .+18 ; 0x17fb0 17f9e: 84 e3 ldi r24, 0x34 ; 52 17fa0: 95 e4 ldi r25, 0x45 ; 69 17fa2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17fa6: 22 e0 ldi r18, 0x02 ; 2 17fa8: 4a ea ldi r20, 0xAA ; 170 17faa: 5d eb ldi r21, 0xBD ; 189 17fac: 6c e3 ldi r22, 0x3C ; 60 17fae: 74 e8 ldi r23, 0x84 ; 132 17fb0: 0e 94 b9 75 call 0xeb72 ; 0xeb72 17fb4: a8 cf rjmp .-176 ; 0x17f06 17fb6: 84 e3 ldi r24, 0x34 ; 52 17fb8: 95 e4 ldi r25, 0x45 ; 69 17fba: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17fbe: 22 e0 ldi r18, 0x02 ; 2 17fc0: 4a ea ldi r20, 0xAA ; 170 17fc2: 5d eb ldi r21, 0xBD ; 189 17fc4: 62 e3 ldi r22, 0x32 ; 50 17fc6: 74 e8 ldi r23, 0x84 ; 132 17fc8: f3 cf rjmp .-26 ; 0x17fb0 17fca: 84 e3 ldi r24, 0x34 ; 52 17fcc: 95 e4 ldi r25, 0x45 ; 69 17fce: 0e 94 95 75 call 0xeb2a ; 0xeb2a 17fd2: 22 e0 ldi r18, 0x02 ; 2 17fd4: 4a ea ldi r20, 0xAA ; 170 17fd6: 5d eb ldi r21, 0xBD ; 189 17fd8: 6d e2 ldi r22, 0x2D ; 45 17fda: 74 e8 ldi r23, 0x84 ; 132 17fdc: e9 cf rjmp .-46 ; 0x17fb0 //! 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); 17fde: 88 ea ldi r24, 0xA8 ; 168 17fe0: 98 e4 ldi r25, 0x48 ; 72 17fe2: b4 cf rjmp .-152 ; 0x17f4c #endif //PINDA_TEMP_COMP MENU_END(); } 17fe4: 08 95 ret 00017fe6 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 17fe6: 0e 94 67 74 call 0xe8ce ; 0xe8ce 17fea: 10 92 60 04 sts 0x0460, r1 ; 0x800460 17fee: 80 91 60 04 lds r24, 0x0460 ; 0x800460 17ff2: 84 30 cpi r24, 0x04 ; 4 17ff4: a8 f4 brcc .+42 ; 0x18020 17ff6: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_BACK)); 17ffa: 82 e0 ldi r24, 0x02 ; 2 17ffc: 9b e4 ldi r25, 0x4B ; 75 17ffe: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18002: 0e 94 29 73 call 0xe652 ; 0xe652 #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(); 18006: 0e 94 de 62 call 0xc5bc ; 0xc5bc } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 1800a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1800e: 8f 5f subi r24, 0xFF ; 255 18010: 80 93 60 04 sts 0x0460, r24 ; 0x800460 18014: 80 91 62 04 lds r24, 0x0462 ; 0x800462 18018: 8f 5f subi r24, 0xFF ; 255 1801a: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1801e: e7 cf rjmp .-50 ; 0x17fee #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(); } 18020: 08 95 ret 00018022 : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 18022: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 18024: 8d ea ldi r24, 0xAD ; 173 18026: 98 e4 ldi r25, 0x48 ; 72 18028: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1802c: ac 01 movw r20, r24 1802e: 60 e0 ldi r22, 0x00 ; 0 18030: 80 e0 ldi r24, 0x00 ; 0 18032: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_putc_at(0, 1, '\n'); 18036: 4a e0 ldi r20, 0x0A ; 10 18038: 61 e0 ldi r22, 0x01 ; 1 1803a: 80 e0 ldi r24, 0x00 ; 0 1803c: 0e 94 6e 70 call 0xe0dc ; 0xe0dc MENU_BEGIN(); 18040: 0e 94 67 74 call 0xe8ce ; 0xe8ce 18044: 10 92 60 04 sts 0x0460, r1 ; 0x800460 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 18048: 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(); 1804a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1804e: 84 30 cpi r24, 0x04 ; 4 18050: 18 f5 brcc .+70 ; 0x18098 18052: 10 92 63 04 sts 0x0463, r1 ; 0x800463 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 18056: 81 11 cpse r24, r1 18058: 02 c0 rjmp .+4 ; 0x1805e 1805a: 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); 1805e: 88 ea ldi r24, 0xA8 ; 168 18060: 98 e4 ldi r25, 0x48 ; 72 18062: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18066: 6c e7 ldi r22, 0x7C ; 124 18068: 77 e3 ldi r23, 0x37 ; 55 1806a: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1806e: 82 ea ldi r24, 0xA2 ; 162 18070: 98 e4 ldi r25, 0x48 ; 72 18072: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18076: 6d e2 ldi r22, 0x2D ; 45 18078: 7d ed ldi r23, 0xDD ; 221 1807a: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 MENU_END(); 1807e: 0e 94 de 62 call 0xc5bc ; 0xc5bc { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 18082: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18086: 8f 5f subi r24, 0xFF ; 255 18088: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1808c: 80 91 62 04 lds r24, 0x0462 ; 0x800462 18090: 8f 5f subi r24, 0xFF ; 255 18092: 80 93 62 04 sts 0x0462, r24 ; 0x800462 18096: d9 cf rjmp .-78 ; 0x1804a // 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(); } 18098: cf 91 pop r28 1809a: 08 95 ret 0001809c : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 1809c: cf 93 push r28 1809e: df 93 push r29 MENU_BEGIN(); 180a0: 0e 94 67 74 call 0xe8ce ; 0xe8ce 180a4: 10 92 60 04 sts 0x0460, r1 ; 0x800460 180a8: 80 91 60 04 lds r24, 0x0460 ; 0x800460 180ac: 84 30 cpi r24, 0x04 ; 4 180ae: 08 f0 brcs .+2 ; 0x180b2 180b0: bd c0 rjmp .+378 ; 0x1822c 180b2: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_BACK)); 180b6: 82 e0 ldi r24, 0x02 ; 2 180b8: 9b e4 ldi r25, 0x4B ; 75 180ba: 0e 94 95 75 call 0xeb2a ; 0xeb2a 180be: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 180c2: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 180c6: 88 23 and r24, r24 180c8: 09 f4 brne .+2 ; 0x180cc 180ca: 4e c0 rjmp .+156 ; 0x18168 180cc: 8c e5 ldi r24, 0x5C ; 92 180ce: 93 e6 ldi r25, 0x63 ; 99 180d0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 180d4: ec 01 movw r28, r24 180d6: 8d e3 ldi r24, 0x3D ; 61 180d8: 98 e4 ldi r25, 0x48 ; 72 180da: 0e 94 95 75 call 0xeb2a ; 0xeb2a 180de: 22 e0 ldi r18, 0x02 ; 2 180e0: 40 e5 ldi r20, 0x50 ; 80 180e2: 5e eb ldi r21, 0xBE ; 190 180e4: be 01 movw r22, r28 180e6: 0e 94 b9 75 call 0xeb72 ; 0xeb72 180ea: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 if (fsensor.isEnabled()) { 180ee: 88 23 and r24, r24 180f0: 09 f4 brne .+2 ; 0x180f4 180f2: 8c c0 rjmp .+280 ; 0x1820c if (fsensor.isError()) { 180f4: 83 30 cpi r24, 0x03 ; 3 180f6: d9 f5 brne .+118 ; 0x1816e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 180f8: 8c e7 ldi r24, 0x7C ; 124 180fa: 98 e4 ldi r25, 0x48 ; 72 180fc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18100: ec 01 movw r28, r24 18102: 89 ea ldi r24, 0xA9 ; 169 18104: 94 e4 ldi r25, 0x44 ; 68 18106: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1810a: 22 e0 ldi r18, 0x02 ; 2 1810c: 4a eb ldi r20, 0xBA ; 186 1810e: 5c eb ldi r21, 0xBC ; 188 18110: be 01 movw r22, r28 18112: 0e 94 b9 75 call 0xeb72 ; 0xeb72 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 18116: 8c e7 ldi r24, 0x7C ; 124 18118: 98 e4 ldi r25, 0x48 ; 72 1811a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1811e: ec 01 movw r28, r24 18120: 8b e9 ldi r24, 0x9B ; 155 18122: 94 e4 ldi r25, 0x44 ; 68 18124: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18128: 22 e0 ldi r18, 0x02 ; 2 1812a: 4a eb ldi r20, 0xBA ; 186 1812c: 5c eb ldi r21, 0xBC ; 188 1812e: be 01 movw r22, r28 18130: 0e 94 b9 75 call 0xeb72 ; 0xeb72 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); 18134: 8c e7 ldi r24, 0x7C ; 124 18136: 98 e4 ldi r25, 0x48 ; 72 18138: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1813c: ec 01 movw r28, r24 1813e: 8b e8 ldi r24, 0x8B ; 139 18140: 94 e4 ldi r25, 0x44 ; 68 18142: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18146: 22 e0 ldi r18, 0x02 ; 2 18148: 4a eb ldi r20, 0xBA ; 186 1814a: 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); 1814c: be 01 movw r22, r28 1814e: 0e 94 b9 75 call 0xeb72 ; 0xeb72 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } switch(fsensor.getActionOnError()) { 18152: 80 91 f9 16 lds r24, 0x16F9 ; 0x8016f9 18156: 88 23 and r24, r24 18158: 09 f4 brne .+2 ; 0x1815c 1815a: 49 c0 rjmp .+146 ; 0x181ee 1815c: 81 30 cpi r24, 0x01 ; 1 1815e: 09 f4 brne .+2 ; 0x18162 18160: 62 c0 rjmp .+196 ; 0x18226 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(); 18162: 0e 94 4b bd call 0x17a96 ; 0x17a96 18166: 52 c0 rjmp .+164 ; 0x1820c 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); 18168: 86 e5 ldi r24, 0x56 ; 86 1816a: 93 e6 ldi r25, 0x63 ; 99 1816c: b1 cf rjmp .-158 ; 0x180d0 #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); 1816e: 80 91 f3 16 lds r24, 0x16F3 ; 0x8016f3 18172: 88 23 and r24, r24 18174: 99 f1 breq .+102 ; 0x181dc 18176: 8c e5 ldi r24, 0x5C ; 92 18178: 93 e6 ldi r25, 0x63 ; 99 1817a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1817e: ec 01 movw r28, r24 18180: 89 ea ldi r24, 0xA9 ; 169 18182: 94 e4 ldi r25, 0x44 ; 68 18184: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18188: 22 e0 ldi r18, 0x02 ; 2 1818a: 41 e6 ldi r20, 0x61 ; 97 1818c: 5d eb ldi r21, 0xBD ; 189 1818e: be 01 movw r22, r28 18190: 0e 94 b9 75 call 0xeb72 ; 0xeb72 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 18194: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 18198: 88 23 and r24, r24 1819a: 19 f1 breq .+70 ; 0x181e2 1819c: 8c e5 ldi r24, 0x5C ; 92 1819e: 93 e6 ldi r25, 0x63 ; 99 181a0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 181a4: ec 01 movw r28, r24 181a6: 8b e9 ldi r24, 0x9B ; 155 181a8: 94 e4 ldi r25, 0x44 ; 68 181aa: 0e 94 95 75 call 0xeb2a ; 0xeb2a 181ae: 22 e0 ldi r18, 0x02 ; 2 181b0: 47 e5 ldi r20, 0x57 ; 87 181b2: 5d eb ldi r21, 0xBD ; 189 181b4: be 01 movw r22, r28 181b6: 0e 94 b9 75 call 0xeb72 ; 0xeb72 #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); 181ba: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 181be: 88 23 and r24, r24 181c0: 99 f0 breq .+38 ; 0x181e8 181c2: 8c e5 ldi r24, 0x5C ; 92 181c4: 93 e6 ldi r25, 0x63 ; 99 181c6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 181ca: ec 01 movw r28, r24 181cc: 8b e8 ldi r24, 0x8B ; 139 181ce: 94 e4 ldi r25, 0x44 ; 68 181d0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 181d4: 22 e0 ldi r18, 0x02 ; 2 181d6: 47 e5 ldi r20, 0x57 ; 87 181d8: 5e eb ldi r21, 0xBE ; 190 181da: b8 cf rjmp .-144 ; 0x1814c #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); 181dc: 86 e5 ldi r24, 0x56 ; 86 181de: 93 e6 ldi r25, 0x63 ; 99 181e0: cc cf rjmp .-104 ; 0x1817a MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 181e2: 86 e5 ldi r24, 0x56 ; 86 181e4: 93 e6 ldi r25, 0x63 ; 99 181e6: dc cf rjmp .-72 ; 0x181a0 #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); 181e8: 86 e5 ldi r24, 0x56 ; 86 181ea: 93 e6 ldi r25, 0x63 ; 99 181ec: ec cf rjmp .-40 ; 0x181c6 #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); 181ee: 83 e8 ldi r24, 0x83 ; 131 181f0: 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); 181f2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 181f6: ec 01 movw r28, r24 181f8: 87 e7 ldi r24, 0x77 ; 119 181fa: 94 e4 ldi r25, 0x44 ; 68 181fc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18200: 22 e0 ldi r18, 0x02 ; 2 18202: 4b e4 ldi r20, 0x4B ; 75 18204: 5d eb ldi r21, 0xBD ; 189 18206: be 01 movw r22, r28 18208: 0e 94 b9 75 call 0xeb72 ; 0xeb72 default: lcd_fsensor_actionNA_set(); } } MENU_END(); 1820c: 0e 94 de 62 call 0xc5bc ; 0xc5bc } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 18210: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18214: 8f 5f subi r24, 0xFF ; 255 18216: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1821a: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1821e: 8f 5f subi r24, 0xFF ; 255 18220: 80 93 62 04 sts 0x0462, r24 ; 0x800462 18224: 41 cf rjmp .-382 ; 0x180a8 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); 18226: 8f e6 ldi r24, 0x6F ; 111 18228: 94 e4 ldi r25, 0x44 ; 68 1822a: e3 cf rjmp .-58 ; 0x181f2 lcd_fsensor_actionNA_set(); } } MENU_END(); } 1822c: df 91 pop r29 1822e: cf 91 pop r28 18230: 08 95 ret 00018232 : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 18232: 0e 94 67 74 call 0xe8ce ; 0xe8ce 18236: 10 92 60 04 sts 0x0460, r1 ; 0x800460 1823a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1823e: 84 30 cpi r24, 0x04 ; 4 18240: 08 f0 brcs .+2 ; 0x18244 18242: 3f c0 rjmp .+126 ; 0x182c2 18244: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 18248: 85 ee ldi r24, 0xE5 ; 229 1824a: 96 e4 ldi r25, 0x46 ; 70 1824c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18250: 0e 94 29 73 call 0xe652 ; 0xe652 if(eeprom_is_sheet_initialized(selected_sheet)){ 18254: 80 91 ca 03 lds r24, 0x03CA ; 0x8003ca 18258: 0e 94 e3 78 call 0xf1c6 ; 0xf1c6 1825c: 88 23 and r24, r24 1825e: 41 f0 breq .+16 ; 0x18270 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 18260: 8c ed ldi r24, 0xDC ; 220 18262: 96 e4 ldi r25, 0x46 ; 70 18264: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18268: 63 ec ldi r22, 0xC3 ; 195 1826a: 7d ec ldi r23, 0xCD ; 205 1826c: 0e 94 4e 73 call 0xe69c ; 0xe69c } if (lcd_commands_type == LcdCommands::Idle) 18270: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 18274: 81 11 cpse r24, r1 18276: 08 c0 rjmp .+16 ; 0x18288 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 18278: 89 ec ldi r24, 0xC9 ; 201 1827a: 96 e4 ldi r25, 0x46 ; 70 1827c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18280: 61 e4 ldi r22, 0x41 ; 65 18282: 77 ed ldi r23, 0xD7 ; 215 18284: 0e 94 4e 73 call 0xe69c ; 0xe69c } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 18288: 80 ec ldi r24, 0xC0 ; 192 1828a: 96 e4 ldi r25, 0x46 ; 70 1828c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18290: 68 ef ldi r22, 0xF8 ; 248 18292: 73 ec ldi r23, 0xC3 ; 195 18294: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 18298: 88 eb ldi r24, 0xB8 ; 184 1829a: 96 e4 ldi r25, 0x46 ; 70 1829c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 182a0: 62 ef ldi r22, 0xF2 ; 242 182a2: 74 ed ldi r23, 0xD4 ; 212 182a4: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 MENU_END(); 182a8: 0e 94 de 62 call 0xc5bc ; 0xc5bc lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 182ac: 80 91 60 04 lds r24, 0x0460 ; 0x800460 182b0: 8f 5f subi r24, 0xFF ; 255 182b2: 80 93 60 04 sts 0x0460, r24 ; 0x800460 182b6: 80 91 62 04 lds r24, 0x0462 ; 0x800462 182ba: 8f 5f subi r24, 0xFF ; 255 182bc: 80 93 62 04 sts 0x0462, r24 ; 0x800462 182c0: bc cf rjmp .-136 ; 0x1823a } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 182c2: 08 95 ret 000182c4 ()>: } template static void select_sheet_menu() { selected_sheet = number; 182c4: 87 e0 ldi r24, 0x07 ; 7 182c6: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182ca: 0c 94 19 c1 jmp 0x18232 ; 0x18232 000182ce ()>: } template static void select_sheet_menu() { selected_sheet = number; 182ce: 86 e0 ldi r24, 0x06 ; 6 182d0: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182d4: 0c 94 19 c1 jmp 0x18232 ; 0x18232 000182d8 ()>: } template static void select_sheet_menu() { selected_sheet = number; 182d8: 85 e0 ldi r24, 0x05 ; 5 182da: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182de: 0c 94 19 c1 jmp 0x18232 ; 0x18232 000182e2 ()>: } template static void select_sheet_menu() { selected_sheet = number; 182e2: 84 e0 ldi r24, 0x04 ; 4 182e4: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182e8: 0c 94 19 c1 jmp 0x18232 ; 0x18232 000182ec ()>: } template static void select_sheet_menu() { selected_sheet = number; 182ec: 83 e0 ldi r24, 0x03 ; 3 182ee: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182f2: 0c 94 19 c1 jmp 0x18232 ; 0x18232 000182f6 ()>: } template static void select_sheet_menu() { selected_sheet = number; 182f6: 82 e0 ldi r24, 0x02 ; 2 182f8: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182fc: 0c 94 19 c1 jmp 0x18232 ; 0x18232 00018300 ()>: } template static void select_sheet_menu() { selected_sheet = number; 18300: 81 e0 ldi r24, 0x01 ; 1 18302: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 18306: 0c 94 19 c1 jmp 0x18232 ; 0x18232 0001830a ()>: } template static void select_sheet_menu() { selected_sheet = number; 1830a: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca lcd_sheet_menu(); 1830e: 0c 94 19 c1 jmp 0x18232 ; 0x18232 00018312 : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 18312: 0e 94 67 74 call 0xe8ce ; 0xe8ce 18316: 10 92 60 04 sts 0x0460, r1 ; 0x800460 1831a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1831e: 84 30 cpi r24, 0x04 ; 4 18320: a8 f5 brcc .+106 ; 0x1838c 18322: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 18326: 87 e9 ldi r24, 0x97 ; 151 18328: 98 e4 ldi r25, 0x48 ; 72 1832a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1832e: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 18332: 8a eb ldi r24, 0xBA ; 186 18334: 9c e3 ldi r25, 0x3C ; 60 18336: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1833a: 65 e4 ldi r22, 0x45 ; 69 1833c: 76 ec ldi r23, 0xC6 ; 198 1833e: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 18342: 81 eb ldi r24, 0xB1 ; 177 18344: 9c e3 ldi r25, 0x3C ; 60 18346: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1834a: 6e e4 ldi r22, 0x4E ; 78 1834c: 76 ec ldi r23, 0xC6 ; 198 1834e: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 18352: 88 ea ldi r24, 0xA8 ; 168 18354: 9c e3 ldi r25, 0x3C ; 60 18356: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1835a: 6c e3 ldi r22, 0x3C ; 60 1835c: 76 ec ldi r23, 0xC6 ; 198 1835e: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 18362: 8d e9 ldi r24, 0x9D ; 157 18364: 9c e3 ldi r25, 0x3C ; 60 18366: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1836a: 63 eb ldi r22, 0xB3 ; 179 1836c: 7c ec ldi r23, 0xCC ; 204 1836e: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_END(); 18372: 0e 94 de 62 call 0xc5bc ; 0xc5bc menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 18376: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1837a: 8f 5f subi r24, 0xFF ; 255 1837c: 80 93 60 04 sts 0x0460, r24 ; 0x800460 18380: 80 91 62 04 lds r24, 0x0462 ; 0x800462 18384: 8f 5f subi r24, 0xFF ; 255 18386: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1838a: c7 cf rjmp .-114 ; 0x1831a 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(); } 1838c: 08 95 ret 0001838e : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1838e: 0e 94 67 74 call 0xe8ce ; 0xe8ce 18392: 10 92 60 04 sts 0x0460, r1 ; 0x800460 18396: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1839a: 84 30 cpi r24, 0x04 ; 4 1839c: d8 f5 brcc .+118 ; 0x18414 1839e: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 183a2: 8e e8 ldi r24, 0x8E ; 142 183a4: 95 e4 ldi r25, 0x45 ; 69 183a6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 183aa: 0e 94 29 73 call 0xe652 ; 0xe652 settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 183ae: 85 ee ldi r24, 0xE5 ; 229 183b0: 94 e4 ldi r25, 0x44 ; 68 183b2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 183b6: 41 e4 ldi r20, 0x41 ; 65 183b8: 5d eb ldi r21, 0xBD ; 189 183ba: bc 01 movw r22, r24 183bc: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed 183c0: 0e 94 bd be call 0x17d7a ; 0x17d7a settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 183c4: 8d ed ldi r24, 0xDD ; 221 183c6: 94 e4 ldi r25, 0x44 ; 68 183c8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 183cc: 47 e3 ldi r20, 0x37 ; 55 183ce: 5d eb ldi r21, 0xBD ; 189 183d0: bc 01 movw r22, r24 183d2: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea 183d6: 0e 94 bd be call 0x17d7a ; 0x17d7a settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 183da: 4d e2 ldi r20, 0x2D ; 45 183dc: 5d eb ldi r21, 0xBD ; 189 183de: 60 ea ldi r22, 0xA0 ; 160 183e0: 78 e6 ldi r23, 0x68 ; 104 183e2: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 183e6: 0e 94 bd be call 0x17d7a ; 0x17d7a settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 183ea: 43 e2 ldi r20, 0x23 ; 35 183ec: 5d eb ldi r21, 0xBD ; 189 183ee: 63 e9 ldi r22, 0x93 ; 147 183f0: 7a e6 ldi r23, 0x6A ; 106 183f2: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee 183f6: 0e 94 bd be call 0x17d7a ; 0x17d7a MENU_END(); 183fa: 0e 94 de 62 call 0xc5bc ; 0xc5bc } } static void lcd_checking_menu(void) { MENU_BEGIN(); 183fe: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18402: 8f 5f subi r24, 0xFF ; 255 18404: 80 93 60 04 sts 0x0460, r24 ; 0x800460 18408: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1840c: 8f 5f subi r24, 0xFF ; 255 1840e: 80 93 62 04 sts 0x0462, r24 ; 0x800462 18412: c1 cf rjmp .-126 ; 0x18396 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(); } 18414: 08 95 ret 00018416 : ++str; } return str; } bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 18416: cf 92 push r12 18418: df 92 push r13 1841a: ef 92 push r14 1841c: ff 92 push r15 1841e: 0f 93 push r16 18420: 1f 93 push r17 18422: cf 93 push r28 18424: df 93 push r29 18426: 6c 01 movw r12, r24 18428: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 1842a: c4 2f mov r28, r20 1842c: d0 e0 ldi r29, 0x00 ; 0 1842e: ae 01 movw r20, r28 18430: 0f 94 1d a2 call 0x3443a ; 0x3443a 18434: 89 2b or r24, r25 18436: b9 f4 brne .+46 ; 0x18466 Number(str + tagSize, v); 18438: b8 01 movw r22, r16 1843a: c6 01 movw r24, r12 1843c: 8c 0f add r24, r28 1843e: 9d 1f adc r25, r29 18440: 0e 94 bb bb call 0x17776 ; 0x17776 *v |= tagMask; 18444: f8 01 movw r30, r16 18446: 20 81 ld r18, Z 18448: 31 81 ldd r19, Z+1 ; 0x01 1844a: 2e 29 or r18, r14 1844c: 3f 29 or r19, r15 1844e: 31 83 std Z+1, r19 ; 0x01 18450: 20 83 st Z, r18 return true; 18452: 81 e0 ldi r24, 0x01 ; 1 } return false; } 18454: df 91 pop r29 18456: cf 91 pop r28 18458: 1f 91 pop r17 1845a: 0f 91 pop r16 1845c: ff 90 pop r15 1845e: ef 90 pop r14 18460: df 90 pop r13 18462: cf 90 pop r12 18464: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 18466: 80 e0 ldi r24, 0x00 ; 0 18468: f5 cf rjmp .-22 ; 0x18454 0001846a : } } #if (LANG_MODE != 0) void lcd_language() { 1846a: cf 93 push r28 1846c: df 93 push r29 lcd_update_enable(true); 1846e: 81 e0 ldi r24, 0x01 ; 1 18470: 0e 94 93 70 call 0xe126 ; 0xe126 menu_goto(lcd_language_menu, 0, true, true); 18474: 21 e0 ldi r18, 0x01 ; 1 18476: 41 e0 ldi r20, 0x01 ; 1 18478: 70 e0 ldi r23, 0x00 ; 0 1847a: 60 e0 ldi r22, 0x00 ; 0 1847c: 86 ec ldi r24, 0xC6 ; 198 1847e: 93 ee ldi r25, 0xE3 ; 227 18480: 0e 94 12 63 call 0xc624 ; 0xc624 18484: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 18488: c0 91 02 04 lds r28, 0x0402 ; 0x800402 1848c: d0 91 03 04 lds r29, 0x0403 ; 0x800403 18490: 0e 94 89 74 call 0xe912 ; 0xe912 18494: ce 59 subi r28, 0x9E ; 158 18496: d7 43 sbci r29, 0x37 ; 55 18498: 39 f0 breq .+14 ; 0x184a8 1849a: 81 11 cpse r24, r1 1849c: 07 c0 rjmp .+14 ; 0x184ac { delay_keep_alive(50); 1849e: 82 e3 ldi r24, 0x32 ; 50 184a0: 90 e0 ldi r25, 0x00 ; 0 184a2: 0e 94 0a 8d call 0x11a14 ; 0x11a14 184a6: f0 cf rjmp .-32 ; 0x18488 } if (lang_is_selected()) 184a8: 88 23 and r24, r24 184aa: 21 f0 breq .+8 ; 0x184b4 lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 184ac: df 91 pop r29 184ae: 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(); 184b0: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 else lang_select(LANG_ID_PRI); 184b4: 80 e0 ldi r24, 0x00 ; 0 } 184b6: df 91 pop r29 184b8: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 184ba: 0c 94 29 75 jmp 0xea52 ; 0xea52 000184be : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 184be: 61 e0 ldi r22, 0x01 ; 1 184c0: 88 ef ldi r24, 0xF8 ; 248 184c2: 93 e8 ldi r25, 0x83 ; 131 184c4: 0e 94 65 8d call 0x11aca ; 0x11aca lcd_return_to_status(); 184c8: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 000184cc : } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 184cc: 61 e0 ldi r22, 0x01 ; 1 184ce: 8c ef ldi r24, 0xFC ; 252 184d0: 93 e8 ldi r25, 0x83 ; 131 184d2: 0e 94 65 8d call 0x11aca ; 0x11aca lcd_return_to_status(); 184d6: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 000184da : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 184da: 61 e0 ldi r22, 0x01 ; 1 184dc: 84 ef ldi r24, 0xF4 ; 244 184de: 93 e8 ldi r25, 0x83 ; 131 184e0: 0e 94 65 8d call 0x11aca ; 0x11aca lcd_return_to_status(); 184e4: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 000184e8 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 184e8: 61 e0 ldi r22, 0x01 ; 1 184ea: 82 e0 ldi r24, 0x02 ; 2 184ec: 94 e8 ldi r25, 0x84 ; 132 184ee: 0e 94 65 8d call 0x11aca ; 0x11aca lcd_return_to_status(); 184f2: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 000184f6 : 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()") { 184f6: cf 93 push r28 184f8: 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); 184fc: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 184fe: 4a e7 ldi r20, 0x7A ; 122 18500: 58 e6 ldi r21, 0x68 ; 104 18502: 60 e0 ldi r22, 0x00 ; 0 18504: 80 e0 ldi r24, 0x00 ; 0 18506: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(LCD_WIDTH - 14, 0); 1850a: 60 e0 ldi r22, 0x00 ; 0 1850c: 86 e0 ldi r24, 0x06 ; 6 1850e: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print_state(pinda_state); 18512: c4 fb bst r28, 4 18514: 88 27 eor r24, r24 18516: 80 f9 bld r24, 0 18518: 0e 94 e8 bc call 0x179d0 ; 0x179d0 if (MMU2::mmu2.Enabled()) { 1851c: 80 91 01 13 lds r24, 0x1301 ; 0x801301 18520: 81 30 cpi r24, 0x01 ; 1 18522: 99 f4 brne .+38 ; 0x1854a inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 18524: c1 e0 ldi r28, 0x01 ; 1 18526: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 1852a: 81 11 cpse r24, r1 1852c: 01 c0 rjmp .+2 ; 0x18530 1852e: 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 18530: 44 e7 ldi r20, 0x74 ; 116 18532: 58 e6 ldi r21, 0x68 ; 104 18534: 60 e0 ldi r22, 0x00 ; 0 18536: 8a e0 ldi r24, 0x0A ; 10 18538: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(LCD_WIDTH - 3, 0); 1853c: 60 e0 ldi r22, 0x00 ; 0 1853e: 81 e1 ldi r24, 0x11 ; 17 18540: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print_state(finda_state); 18544: 8c 2f mov r24, r28 18546: 0e 94 e8 bc call 0x179d0 ; 0x179d0 1854a: c1 e0 ldi r28, 0x01 ; 1 1854c: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 18550: 81 11 cpse r24, r1 18552: 01 c0 rjmp .+2 ; 0x18556 18554: c0 e0 ldi r28, 0x00 ; 0 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 18556: 8d e3 ldi r24, 0x3D ; 61 18558: 98 e4 ldi r25, 0x48 ; 72 1855a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1855e: ac 01 movw r20, r24 18560: 61 e0 ldi r22, 0x01 ; 1 18562: 80 e0 ldi r24, 0x00 ; 0 18564: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(LCD_WIDTH - 3, 1); 18568: 61 e0 ldi r22, 0x01 ; 1 1856a: 81 e1 ldi r24, 0x11 ; 17 1856c: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print_state(idler_state); 18570: 8c 2f mov r24, r28 18572: 0e 94 e8 bc call 0x179d0 ; 0x179d0 // 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); 18576: 62 e0 ldi r22, 0x02 ; 2 18578: 80 e0 ldi r24, 0x00 ; 0 1857a: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(_N("B: %3d Xd:%6d\n" 1857e: 80 91 39 0e lds r24, 0x0E39 ; 0x800e39 18582: 8f 93 push r24 18584: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 18588: 8f 93 push r24 1858a: 80 91 64 0d lds r24, 0x0D64 ; 0x800d64 1858e: 1f 92 push r1 18590: 8f 93 push r24 18592: 80 91 8a 03 lds r24, 0x038A ; 0x80038a 18596: 8f 93 push r24 18598: 80 91 89 03 lds r24, 0x0389 ; 0x800389 1859c: 8f 93 push r24 1859e: 80 91 63 0d lds r24, 0x0D63 ; 0x800d63 185a2: 1f 92 push r1 185a4: 8f 93 push r24 185a6: 80 e5 ldi r24, 0x50 ; 80 185a8: 98 e6 ldi r25, 0x68 ; 104 185aa: 9f 93 push r25 185ac: 8f 93 push r24 185ae: 0e 94 66 6f call 0xdecc ; 0xdecc 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(); 185b2: 8d b7 in r24, 0x3d ; 61 185b4: 9e b7 in r25, 0x3e ; 62 185b6: 0a 96 adiw r24, 0x0a ; 10 185b8: 0f b6 in r0, 0x3f ; 63 185ba: f8 94 cli 185bc: 9e bf out 0x3e, r25 ; 62 185be: 0f be out 0x3f, r0 ; 63 185c0: 8d bf out 0x3d, r24 ; 61 } 185c2: 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(); 185c4: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 000185c8 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 185c8: bf 92 push r11 185ca: cf 92 push r12 185cc: df 92 push r13 185ce: ef 92 push r14 185d0: ff 92 push r15 185d2: 0f 93 push r16 185d4: 1f 93 push r17 185d6: cf 93 push r28 185d8: df 93 push r29 185da: c8 2f mov r28, r24 185dc: f6 2e mov r15, r22 185de: e4 2e mov r14, r20 185e0: b2 2e mov r11, r18 185e2: 68 01 movw r12, r16 lcd_update_enable(false); 185e4: 80 e0 ldi r24, 0x00 ; 0 185e6: 0e 94 93 70 call 0xe126 ; 0xe126 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 185ea: dc e7 ldi r29, 0x7C ; 124 185ec: fe 14 cp r15, r14 185ee: 08 f0 brcs .+2 ; 0x185f2 185f0: dd e2 ldi r29, 0x2D ; 45 if (_clear) 185f2: bb 20 and r11, r11 185f4: 09 f1 breq .+66 ; 0x18638 lcd_clear(); 185f6: 0e 94 81 70 call 0xe102 ; 0xe102 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 185fa: c1 11 cpse r28, r1 185fc: 20 c0 rjmp .+64 ; 0x1863e if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 185fe: 8f e2 ldi r24, 0x2F ; 47 18600: 9e e5 ldi r25, 0x5E ; 94 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)); 18602: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18606: 0e 94 78 6f call 0xdef0 ; 0xdef0 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1860a: 88 ef ldi r24, 0xF8 ; 248 1860c: 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 1860e: 82 30 cpi r24, 0x02 ; 2 18610: 78 f5 brcc .+94 ; 0x18670 || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 18612: 88 e8 ldi r24, 0x88 ; 136 18614: 9a e4 ldi r25, 0x4A ; 74 18616: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1861a: 0e 94 78 6f call 0xdef0 ; 0xdef0 if (screen == TestScreen::Fsensor) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); if (screen == TestScreen::AllCorrect) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ALLCORRECT)); 1861e: 87 e6 ldi r24, 0x67 ; 103 18620: 9a e4 ldi r25, 0x4A ; 74 18622: cc 30 cpi r28, 0x0C ; 12 18624: 49 f1 breq .+82 ; 0x18678 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 18626: 85 e5 ldi r24, 0x55 ; 85 18628: 9a e4 ldi r25, 0x4A ; 74 1862a: cd 30 cpi r28, 0x0D ; 13 1862c: 29 f1 breq .+74 ; 0x18678 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 1862e: ce 30 cpi r28, 0x0E ; 14 18630: 39 f5 brne .+78 ; 0x18680 18632: 82 e4 ldi r24, 0x42 ; 66 18634: 9a e4 ldi r25, 0x4A ; 74 18636: 20 c0 rjmp .+64 ; 0x18678 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 18638: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 1863c: de cf rjmp .-68 ; 0x185fa if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1863e: c1 30 cpi r28, 0x01 ; 1 18640: f1 f2 breq .-68 ; 0x185fe if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 18642: c2 30 cpi r28, 0x02 ; 2 18644: e1 f2 breq .-72 ; 0x185fe if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 18646: 8f ed ldi r24, 0xDF ; 223 18648: 9a e4 ldi r25, 0x4A ; 74 1864a: c3 30 cpi r28, 0x03 ; 3 1864c: d1 f2 breq .-76 ; 0x18602 if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 1864e: 8d ec ldi r24, 0xCD ; 205 18650: 9a e4 ldi r25, 0x4A ; 74 18652: c4 30 cpi r28, 0x04 ; 4 18654: b1 f2 breq .-84 ; 0x18602 if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 18656: 8b eb ldi r24, 0xBB ; 187 18658: 9a e4 ldi r25, 0x4A ; 74 1865a: c5 30 cpi r28, 0x05 ; 5 1865c: 91 f2 breq .-92 ; 0x18602 if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 1865e: 89 ea ldi r24, 0xA9 ; 169 18660: 9a e4 ldi r25, 0x4A ; 74 18662: c6 30 cpi r28, 0x06 ; 6 18664: 71 f2 breq .-100 ; 0x18602 if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 18666: c7 30 cpi r28, 0x07 ; 7 18668: 81 f6 brne .-96 ; 0x1860a 1866a: 8a e9 ldi r24, 0x9A ; 154 1866c: 9a e4 ldi r25, 0x4A ; 74 1866e: c9 cf rjmp .-110 ; 0x18602 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)); 18670: ca 30 cpi r28, 0x0A ; 10 18672: 99 f5 brne .+102 ; 0x186da if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 18674: 85 e7 ldi r24, 0x75 ; 117 18676: 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)); 18678: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1867c: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_puts_at_P(0, 1, STR_SEPARATOR); 18680: 44 ec ldi r20, 0xC4 ; 196 18682: 54 e8 ldi r21, 0x84 ; 132 18684: 61 e0 ldi r22, 0x01 ; 1 18686: 80 e0 ldi r24, 0x00 ; 0 18688: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1868c: c3 30 cpi r28, 0x03 ; 3 1868e: 70 f5 brcc .+92 ; 0x186ec { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 18690: 84 e3 ldi r24, 0x34 ; 52 18692: 9a e4 ldi r25, 0x4A ; 74 18694: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18698: ac 01 movw r20, r24 1869a: 62 e0 ldi r22, 0x02 ; 2 1869c: 80 e0 ldi r24, 0x00 ; 0 1869e: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(18, 2); 186a2: 62 e0 ldi r22, 0x02 ; 2 186a4: 82 e1 ldi r24, 0x12 ; 18 186a6: 0e 94 b5 6f call 0xdf6a ; 0xdf6a (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 186aa: c1 11 cpse r28, r1 186ac: 1a c0 rjmp .+52 ; 0x186e2 186ae: 8d 2f mov r24, r29 186b0: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 186b4: 87 e2 ldi r24, 0x27 ; 39 186b6: 9a e4 ldi r25, 0x4A ; 74 186b8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 186bc: ac 01 movw r20, r24 186be: 63 e0 ldi r22, 0x03 ; 3 186c0: 80 e0 ldi r24, 0x00 ; 0 186c2: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(18, 3); 186c6: 63 e0 ldi r22, 0x03 ; 3 186c8: 82 e1 ldi r24, 0x12 ; 18 186ca: 0e 94 b5 6f call 0xdf6a ; 0xdf6a (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 186ce: c2 30 cpi r28, 0x02 ; 2 186d0: 19 f1 breq .+70 ; 0x18718 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); 186d2: 8d 2f mov r24, r29 186d4: 0e 94 7c 6f call 0xdef8 ; 0xdef8 186d8: 23 c0 rjmp .+70 ; 0x18720 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)); 186da: cb 30 cpi r28, 0x0B ; 11 186dc: 09 f0 breq .+2 ; 0x186e0 186de: 9f cf rjmp .-194 ; 0x1861e 186e0: c9 cf rjmp .-110 ; 0x18674 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); 186e2: 82 e3 ldi r24, 0x32 ; 50 186e4: 99 e6 ldi r25, 0x69 ; 105 186e6: 0e 94 78 6f call 0xdef0 ; 0xdef0 186ea: e4 cf rjmp .-56 ; 0x186b4 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) 186ec: 86 ef ldi r24, 0xF6 ; 246 186ee: 8c 0f add r24, r28 186f0: 82 30 cpi r24, 0x02 ; 2 186f2: a8 f5 brcc .+106 ; 0x1875e { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 186f4: 85 e1 ldi r24, 0x15 ; 21 186f6: 9a e4 ldi r25, 0x4A ; 74 186f8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 186fc: ac 01 movw r20, r24 186fe: 62 e0 ldi r22, 0x02 ; 2 18700: 80 e0 ldi r24, 0x00 ; 0 18702: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_putc(':'); 18706: 8a e3 ldi r24, 0x3A ; 58 18708: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_set_cursor(18, 2); 1870c: 62 e0 ldi r22, 0x02 ; 2 1870e: 82 e1 ldi r24, 0x12 ; 18 18710: 0e 94 b5 6f call 0xdf6a ; 0xdf6a (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 18714: ca 30 cpi r28, 0x0A ; 10 18716: e9 f2 breq .-70 ; 0x186d2 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); 18718: 82 e3 ldi r24, 0x32 ; 50 1871a: 99 e6 ldi r25, 0x69 ; 105 1871c: 0e 94 78 6f call 0xdef0 ; 0xdef0 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); } if (_delay > 0) delay_keep_alive(_delay); 18720: c1 14 cp r12, r1 18722: d1 04 cpc r13, r1 18724: 19 f0 breq .+6 ; 0x1872c 18726: c6 01 movw r24, r12 18728: 0e 94 0a 8d call 0x11a14 ; 0x11a14 _progress++; 1872c: 81 e0 ldi r24, 0x01 ; 1 1872e: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 18730: 48 2f mov r20, r24 18732: 50 e0 ldi r21, 0x00 ; 0 18734: 92 e0 ldi r25, 0x02 ; 2 18736: 24 e0 ldi r18, 0x04 ; 4 18738: 30 e0 ldi r19, 0x00 ; 0 1873a: e9 16 cp r14, r25 1873c: 11 f0 breq .+4 ; 0x18742 1873e: 26 e0 ldi r18, 0x06 ; 6 18740: 30 e0 ldi r19, 0x00 ; 0 18742: 42 17 cp r20, r18 18744: 53 07 cpc r21, r19 18746: 0c f0 brlt .+2 ; 0x1874a 18748: 80 e0 ldi r24, 0x00 ; 0 } 1874a: df 91 pop r29 1874c: cf 91 pop r28 1874e: 1f 91 pop r17 18750: 0f 91 pop r16 18752: ff 90 pop r15 18754: ef 90 pop r14 18756: df 90 pop r13 18758: cf 90 pop r12 1875a: bf 90 pop r11 1875c: 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) 1875e: ca 30 cpi r28, 0x0A ; 10 18760: f8 f6 brcc .-66 ; 0x18720 { //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); 18762: 41 e0 ldi r20, 0x01 ; 1 18764: c4 30 cpi r28, 0x04 ; 4 18766: 21 f0 breq .+8 ; 0x18770 18768: 42 e0 ldi r20, 0x02 ; 2 1876a: c3 30 cpi r28, 0x03 ; 3 1876c: 09 f4 brne .+2 ; 0x18770 1876e: 40 e0 ldi r20, 0x00 ; 0 18770: 0d 2f mov r16, r29 18772: 22 ec ldi r18, 0xC2 ; 194 18774: 34 e8 ldi r19, 0x84 ; 132 18776: 62 e0 ldi r22, 0x02 ; 2 18778: 82 e0 ldi r24, 0x02 ; 2 1877a: 0e 94 bc bc call 0x17978 ; 0x17978 _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1877e: 41 e0 ldi r20, 0x01 ; 1 18780: c5 30 cpi r28, 0x05 ; 5 18782: 21 f0 breq .+8 ; 0x1878c 18784: 42 e0 ldi r20, 0x02 ; 2 18786: c5 30 cpi r28, 0x05 ; 5 18788: 08 f4 brcc .+2 ; 0x1878c 1878a: 40 e0 ldi r20, 0x00 ; 0 1878c: 0d 2f mov r16, r29 1878e: 20 ec ldi r18, 0xC0 ; 192 18790: 34 e8 ldi r19, 0x84 ; 132 18792: 68 e0 ldi r22, 0x08 ; 8 18794: 82 e0 ldi r24, 0x02 ; 2 18796: 0e 94 bc bc call 0x17978 ; 0x17978 _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 1879a: 41 e0 ldi r20, 0x01 ; 1 1879c: c6 30 cpi r28, 0x06 ; 6 1879e: 21 f0 breq .+8 ; 0x187a8 187a0: 42 e0 ldi r20, 0x02 ; 2 187a2: c6 30 cpi r28, 0x06 ; 6 187a4: 08 f4 brcc .+2 ; 0x187a8 187a6: 40 e0 ldi r20, 0x00 ; 0 187a8: 0d 2f mov r16, r29 187aa: 2e eb ldi r18, 0xBE ; 190 187ac: 34 e8 ldi r19, 0x84 ; 132 187ae: 6e e0 ldi r22, 0x0E ; 14 187b0: 82 e0 ldi r24, 0x02 ; 2 187b2: 0e 94 bc bc call 0x17978 ; 0x17978 _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 187b6: 41 e0 ldi r20, 0x01 ; 1 187b8: c7 30 cpi r28, 0x07 ; 7 187ba: 21 f0 breq .+8 ; 0x187c4 187bc: 42 e0 ldi r20, 0x02 ; 2 187be: c7 30 cpi r28, 0x07 ; 7 187c0: 08 f4 brcc .+2 ; 0x187c4 187c2: 40 e0 ldi r20, 0x00 ; 0 187c4: 0d 2f mov r16, r29 187c6: 2a eb ldi r18, 0xBA ; 186 187c8: 34 e8 ldi r19, 0x84 ; 132 187ca: 60 e0 ldi r22, 0x00 ; 0 187cc: 83 e0 ldi r24, 0x03 ; 3 187ce: 0e 94 bc bc call 0x17978 ; 0x17978 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 187d2: 41 e0 ldi r20, 0x01 ; 1 187d4: c8 30 cpi r28, 0x08 ; 8 187d6: 21 f0 breq .+8 ; 0x187e0 187d8: 42 e0 ldi r20, 0x02 ; 2 187da: c8 30 cpi r28, 0x08 ; 8 187dc: 08 f4 brcc .+2 ; 0x187e0 187de: 40 e0 ldi r20, 0x00 ; 0 187e0: 0d 2f mov r16, r29 187e2: 23 eb ldi r18, 0xB3 ; 179 187e4: 34 e8 ldi r19, 0x84 ; 132 187e6: 69 e0 ldi r22, 0x09 ; 9 187e8: 83 e0 ldi r24, 0x03 ; 3 187ea: 0e 94 bc bc call 0x17978 ; 0x17978 187ee: 98 cf rjmp .-208 ; 0x18720 000187f0 : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 187f0: cf 93 push r28 187f2: 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) 187f4: 80 91 96 03 lds r24, 0x0396 ; 0x800396 187f8: 81 11 cpse r24, r1 187fa: 18 c0 rjmp .+48 ; 0x1882c { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 187fc: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 18800: 8b e0 ldi r24, 0x0B ; 11 18802: 68 9f mul r22, r24 18804: b0 01 movw r22, r0 18806: 11 24 eor r1, r1 18808: 67 5b subi r22, 0xB7 ; 183 1880a: 72 4f sbci r23, 0xF2 ; 242 1880c: 47 e0 ldi r20, 0x07 ; 7 1880e: 50 e0 ldi r21, 0x00 ; 0 18810: 88 e9 ldi r24, 0x98 ; 152 18812: 93 e0 ldi r25, 0x03 ; 3 18814: 0f 94 2e a4 call 0x3485c ; 0x3485c lcd_encoder = menuData->name[0]; 18818: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1881c: 90 e0 ldi r25, 0x00 ; 0 1881e: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 18822: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e menuData->initialized = true; 18826: 81 e0 ldi r24, 0x01 ; 1 18828: 80 93 96 03 sts 0x0396, r24 ; 0x800396 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 1882c: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 18830: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 18834: 80 97 sbiw r24, 0x20 ; 32 18836: 34 f4 brge .+12 ; 0x18844 18838: 80 e2 ldi r24, 0x20 ; 32 1883a: 90 e0 ldi r25, 0x00 ; 0 1883c: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 18840: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 18844: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 18848: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1884c: 8f 3f cpi r24, 0xFF ; 255 1884e: 91 05 cpc r25, r1 18850: 39 f0 breq .+14 ; 0x18860 18852: 34 f0 brlt .+12 ; 0x18860 18854: 8f ef ldi r24, 0xFF ; 255 18856: 90 e0 ldi r25, 0x00 ; 0 18858: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 1885c: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e menuData->name[menuData->selected] = lcd_encoder; 18860: e0 91 97 03 lds r30, 0x0397 ; 0x800397 18864: f0 e0 ldi r31, 0x00 ; 0 18866: ea 56 subi r30, 0x6A ; 106 18868: fc 4f sbci r31, 0xFC ; 252 1886a: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1886e: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 18870: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 18874: c8 e9 ldi r28, 0x98 ; 152 18876: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 18878: 89 91 ld r24, Y+ 1887a: 0e 94 7c 6f call 0xdef8 ; 0xdef8 if (lcd_encoder < 0x20) lcd_encoder = 0x20; if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; menuData->name[menuData->selected] = lcd_encoder; lcd_home(); for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) 1887e: 83 e0 ldi r24, 0x03 ; 3 18880: cf 39 cpi r28, 0x9F ; 159 18882: d8 07 cpc r29, r24 18884: c9 f7 brne .-14 ; 0x18878 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 18886: 4e e5 ldi r20, 0x5E ; 94 18888: 61 e0 ldi r22, 0x01 ; 1 1888a: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1888e: 0e 94 6e 70 call 0xe0dc ; 0xe0dc if (menuData->selected > 0) 18892: 80 91 97 03 lds r24, 0x0397 ; 0x800397 18896: 88 23 and r24, r24 18898: 29 f0 breq .+10 ; 0x188a4 { lcd_putc_at(menuData->selected-1, 1, ' '); 1889a: 40 e2 ldi r20, 0x20 ; 32 1889c: 61 e0 ldi r22, 0x01 ; 1 1889e: 81 50 subi r24, 0x01 ; 1 188a0: 0e 94 6e 70 call 0xe0dc ; 0xe0dc } if (lcd_clicked()) 188a4: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 188a8: 88 23 and r24, r24 188aa: 99 f0 breq .+38 ; 0x188d2 { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 188ac: e0 91 97 03 lds r30, 0x0397 ; 0x800397 188b0: 8e 2f mov r24, r30 188b2: 90 e0 ldi r25, 0x00 ; 0 188b4: 01 96 adiw r24, 0x01 ; 1 188b6: 07 97 sbiw r24, 0x07 ; 7 188b8: 78 f4 brcc .+30 ; 0x188d8 { lcd_encoder = menuData->name[++(menuData->selected)]; 188ba: ef 5f subi r30, 0xFF ; 255 188bc: e0 93 97 03 sts 0x0397, r30 ; 0x800397 188c0: f0 e0 ldi r31, 0x00 ; 0 188c2: ea 56 subi r30, 0x6A ; 106 188c4: fc 4f sbci r31, 0xFC ; 252 188c6: 82 81 ldd r24, Z+2 ; 0x02 188c8: 90 e0 ldi r25, 0x00 ; 0 188ca: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 188ce: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 188d2: df 91 pop r29 188d4: cf 91 pop r28 188d6: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 188d8: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 188dc: 8b e0 ldi r24, 0x0B ; 11 188de: 68 9f mul r22, r24 188e0: b0 01 movw r22, r0 188e2: 11 24 eor r1, r1 188e4: 67 5b subi r22, 0xB7 ; 183 188e6: 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); 188e8: 47 e0 ldi r20, 0x07 ; 7 188ea: 50 e0 ldi r21, 0x00 ; 0 188ec: 88 e9 ldi r24, 0x98 ; 152 188ee: 93 e0 ldi r25, 0x03 ; 3 188f0: 0f 94 52 a4 call 0x348a4 ; 0x348a4 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 188f4: df 91 pop r29 188f6: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 188f8: 0c 94 76 63 jmp 0xc6ec ; 0xc6ec 000188fc : //! |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() { 188fc: 2f 92 push r2 188fe: 3f 92 push r3 18900: 4f 92 push r4 18902: 5f 92 push r5 18904: 6f 92 push r6 18906: 7f 92 push r7 18908: 8f 92 push r8 1890a: 9f 92 push r9 1890c: af 92 push r10 1890e: bf 92 push r11 18910: cf 92 push r12 18912: df 92 push r13 18914: ef 92 push r14 18916: ff 92 push r15 18918: 0f 93 push r16 1891a: 1f 93 push r17 1891c: cf 93 push r28 1891e: df 93 push r29 18920: cd b7 in r28, 0x3d ; 61 18922: de b7 in r29, 0x3e ; 62 18924: a8 97 sbiw r28, 0x28 ; 40 18926: 0f b6 in r0, 0x3f ; 63 18928: f8 94 cli 1892a: de bf out 0x3e, r29 ; 62 1892c: 0f be out 0x3f, r0 ; 63 1892e: 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); 18930: 48 e0 ldi r20, 0x08 ; 8 18932: 50 e0 ldi r21, 0x00 ; 0 18934: 65 ee ldi r22, 0xE5 ; 229 18936: 7f e0 ldi r23, 0x0F ; 15 18938: ce 01 movw r24, r28 1893a: 41 96 adiw r24, 0x11 ; 17 1893c: 0f 94 2e a4 call 0x3485c ; 0x3485c eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 18940: 48 e0 ldi r20, 0x08 ; 8 18942: 50 e0 ldi r21, 0x00 ; 0 18944: 6d ed ldi r22, 0xDD ; 221 18946: 7f e0 ldi r23, 0x0F ; 15 18948: ce 01 movw r24, r28 1894a: 09 96 adiw r24, 0x09 ; 9 1894c: 0f 94 2e a4 call 0x3485c ; 0x3485c eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 18950: 48 e0 ldi r20, 0x08 ; 8 18952: 50 e0 ldi r21, 0x00 ; 0 18954: 65 ed ldi r22, 0xD5 ; 213 18956: 7f e0 ldi r23, 0x0F ; 15 18958: ce 01 movw r24, r28 1895a: 01 96 adiw r24, 0x01 ; 1 1895c: 0f 94 2e a4 call 0x3485c ; 0x3485c 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]; 18960: 8d 84 ldd r8, Y+13 ; 0x0d 18962: 9e 84 ldd r9, Y+14 ; 0x0e 18964: af 84 ldd r10, Y+15 ; 0x0f 18966: b8 88 ldd r11, Y+16 ; 0x10 18968: e1 e0 ldi r30, 0x01 ; 1 1896a: fd e9 ldi r31, 0x9D ; 157 1896c: 25 91 lpm r18, Z+ 1896e: 35 91 lpm r19, Z+ 18970: 45 91 lpm r20, Z+ 18972: 54 91 lpm r21, Z 18974: cd 80 ldd r12, Y+5 ; 0x05 18976: de 80 ldd r13, Y+6 ; 0x06 18978: ef 80 ldd r14, Y+7 ; 0x07 1897a: f8 84 ldd r15, Y+8 ; 0x08 1897c: e5 e0 ldi r30, 0x05 ; 5 1897e: fd e9 ldi r31, 0x9D ; 157 18980: 85 91 lpm r24, Z+ 18982: 95 91 lpm r25, Z+ 18984: a5 91 lpm r26, Z+ 18986: b4 91 lpm r27, Z 18988: 8d a3 std Y+37, r24 ; 0x25 1898a: 9e a3 std Y+38, r25 ; 0x26 1898c: af a3 std Y+39, r26 ; 0x27 1898e: b8 a7 std Y+40, r27 ; 0x28 18990: 8d 89 ldd r24, Y+21 ; 0x15 18992: 9e 89 ldd r25, Y+22 ; 0x16 18994: af 89 ldd r26, Y+23 ; 0x17 18996: b8 8d ldd r27, Y+24 ; 0x18 18998: 89 a3 std Y+33, r24 ; 0x21 1899a: 9a a3 std Y+34, r25 ; 0x22 1899c: ab a3 std Y+35, r26 ; 0x23 1899e: bc a3 std Y+36, r27 ; 0x24 189a0: c5 01 movw r24, r10 189a2: b4 01 movw r22, r8 189a4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 189a8: 2b 01 movw r4, r22 189aa: 3c 01 movw r6, r24 189ac: 2d a1 ldd r18, Y+37 ; 0x25 189ae: 3e a1 ldd r19, Y+38 ; 0x26 189b0: 4f a1 ldd r20, Y+39 ; 0x27 189b2: 58 a5 ldd r21, Y+40 ; 0x28 189b4: c7 01 movw r24, r14 189b6: b6 01 movw r22, r12 189b8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 189bc: 9b 01 movw r18, r22 189be: ac 01 movw r20, r24 189c0: c3 01 movw r24, r6 189c2: b2 01 movw r22, r4 189c4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 189c8: 29 a1 ldd r18, Y+33 ; 0x21 189ca: 3a a1 ldd r19, Y+34 ; 0x22 189cc: 4b a1 ldd r20, Y+35 ; 0x23 189ce: 5c a1 ldd r21, Y+36 ; 0x24 189d0: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 189d4: 20 e0 ldi r18, 0x00 ; 0 189d6: 30 e0 ldi r19, 0x00 ; 0 189d8: 40 e9 ldi r20, 0x90 ; 144 189da: 50 e4 ldi r21, 0x40 ; 64 189dc: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 189e0: 1b 01 movw r2, r22 189e2: 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]; 189e4: e9 e0 ldi r30, 0x09 ; 9 189e6: fd e9 ldi r31, 0x9D ; 157 189e8: 25 91 lpm r18, Z+ 189ea: 35 91 lpm r19, Z+ 189ec: 45 91 lpm r20, Z+ 189ee: 54 91 lpm r21, Z 189f0: ed e0 ldi r30, 0x0D ; 13 189f2: fd e9 ldi r31, 0x9D ; 157 189f4: 45 90 lpm r4, Z+ 189f6: 55 90 lpm r5, Z+ 189f8: 65 90 lpm r6, Z+ 189fa: 74 90 lpm r7, Z 189fc: c5 01 movw r24, r10 189fe: b4 01 movw r22, r8 18a00: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 18a04: 4b 01 movw r8, r22 18a06: 5c 01 movw r10, r24 18a08: a3 01 movw r20, r6 18a0a: 92 01 movw r18, r4 18a0c: c7 01 movw r24, r14 18a0e: b6 01 movw r22, r12 18a10: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 18a14: 9b 01 movw r18, r22 18a16: ac 01 movw r20, r24 18a18: c5 01 movw r24, r10 18a1a: b4 01 movw r22, r8 18a1c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 18a20: 29 a1 ldd r18, Y+33 ; 0x21 18a22: 3a a1 ldd r19, Y+34 ; 0x22 18a24: 4b a1 ldd r20, Y+35 ; 0x23 18a26: 5c a1 ldd r21, Y+36 ; 0x24 18a28: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 18a2c: 20 e0 ldi r18, 0x00 ; 0 18a2e: 30 e0 ldi r19, 0x00 ; 0 18a30: 40 e9 ldi r20, 0x90 ; 144 18a32: 50 e4 ldi r21, 0x40 ; 64 18a34: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 18a38: 6d 8f std Y+29, r22 ; 0x1d 18a3a: 7e 8f std Y+30, r23 ; 0x1e 18a3c: 8f 8f std Y+31, r24 ; 0x1f 18a3e: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 18a40: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 lcd_printf_P(_N( 18a44: 8b e8 ldi r24, 0x8B ; 139 18a46: 9a e3 ldi r25, 0x3A ; 58 18a48: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18a4c: d8 2e mov r13, r24 18a4e: c9 2e mov r12, r25 18a50: 84 e8 ldi r24, 0x84 ; 132 18a52: 9a e3 ldi r25, 0x3A ; 58 18a54: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18a58: f8 2e mov r15, r24 18a5a: e9 2e mov r14, r25 18a5c: 8e e6 ldi r24, 0x6E ; 110 18a5e: 9a e3 ldi r25, 0x3A ; 58 18a60: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18a64: cf 92 push r12 18a66: df 92 push r13 18a68: ef 92 push r14 18a6a: ff 92 push r15 18a6c: 24 ec ldi r18, 0xC4 ; 196 18a6e: 34 e8 ldi r19, 0x84 ; 132 18a70: 3f 93 push r19 18a72: 2f 93 push r18 18a74: 9f 93 push r25 18a76: 8f 93 push r24 18a78: 86 e0 ldi r24, 0x06 ; 6 18a7a: 98 e6 ldi r25, 0x68 ; 104 18a7c: 9f 93 push r25 18a7e: 8f 93 push r24 18a80: 0e 94 66 6f call 0xdecc ; 0xdecc _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 18a84: 62 e0 ldi r22, 0x02 ; 2 18a86: 8b e0 ldi r24, 0x0B ; 11 18a88: 0e 94 b5 6f call 0xdf6a ; 0xdf6a if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 18a8c: 0f b6 in r0, 0x3f ; 63 18a8e: f8 94 cli 18a90: de bf out 0x3e, r29 ; 62 18a92: 0f be out 0x3f, r0 ; 63 18a94: cd bf out 0x3d, r28 ; 61 18a96: 20 e0 ldi r18, 0x00 ; 0 18a98: 30 e0 ldi r19, 0x00 ; 0 18a9a: 48 e4 ldi r20, 0x48 ; 72 18a9c: 53 e4 ldi r21, 0x43 ; 67 18a9e: 62 2d mov r22, r2 18aa0: 73 2d mov r23, r3 18aa2: 80 2f mov r24, r16 18aa4: 91 2f mov r25, r17 18aa6: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 18aaa: 87 ff sbrs r24, 7 18aac: 51 c0 rjmp .+162 ; 0x18b50 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 18aae: 1f 93 push r17 18ab0: 0f 93 push r16 18ab2: 3f 92 push r3 18ab4: 2f 92 push r2 18ab6: 8e ef ldi r24, 0xFE ; 254 18ab8: 97 e6 ldi r25, 0x67 ; 103 18aba: 9f 93 push r25 18abc: 8f 93 push r24 18abe: 0e 94 66 6f call 0xdecc ; 0xdecc 18ac2: 0f 90 pop r0 18ac4: 0f 90 pop r0 18ac6: 0f 90 pop r0 18ac8: 0f 90 pop r0 18aca: 0f 90 pop r0 18acc: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 18ace: 63 e0 ldi r22, 0x03 ; 3 18ad0: 8b e0 ldi r24, 0x0B ; 11 18ad2: 0e 94 b5 6f call 0xdf6a ; 0xdf6a if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 18ad6: 1d 8d ldd r17, Y+29 ; 0x1d 18ad8: 0e 8d ldd r16, Y+30 ; 0x1e 18ada: ff 8c ldd r15, Y+31 ; 0x1f 18adc: e8 a0 ldd r14, Y+32 ; 0x20 18ade: 20 e0 ldi r18, 0x00 ; 0 18ae0: 30 e0 ldi r19, 0x00 ; 0 18ae2: 48 e4 ldi r20, 0x48 ; 72 18ae4: 53 e4 ldi r21, 0x43 ; 67 18ae6: d8 01 movw r26, r16 18ae8: f7 01 movw r30, r14 18aea: 6b 2f mov r22, r27 18aec: 7a 2f mov r23, r26 18aee: 8f 2f mov r24, r31 18af0: 9e 2f mov r25, r30 18af2: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 18af6: 87 fd sbrc r24, 7 18af8: 32 c0 rjmp .+100 ; 0x18b5e 18afa: 8c e7 ldi r24, 0x7C ; 124 18afc: 98 e4 ldi r25, 0x48 ; 72 18afe: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18b02: 0e 94 78 6f call 0xdef0 ; 0xdef0 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 18b06: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 18b0a: 88 23 and r24, r24 18b0c: 41 f0 breq .+16 ; 0x18b1e menu_goto(lcd_menu_xyz_skew, 0, true); 18b0e: 20 e0 ldi r18, 0x00 ; 0 18b10: 41 e0 ldi r20, 0x01 ; 1 18b12: 70 e0 ldi r23, 0x00 ; 0 18b14: 60 e0 ldi r22, 0x00 ; 0 18b16: 8e e1 ldi r24, 0x1E ; 30 18b18: 9f ec ldi r25, 0xCF ; 207 18b1a: 0e 94 12 63 call 0xc624 ; 0xc624 } 18b1e: a8 96 adiw r28, 0x28 ; 40 18b20: 0f b6 in r0, 0x3f ; 63 18b22: f8 94 cli 18b24: de bf out 0x3e, r29 ; 62 18b26: 0f be out 0x3f, r0 ; 63 18b28: cd bf out 0x3d, r28 ; 61 18b2a: df 91 pop r29 18b2c: cf 91 pop r28 18b2e: 1f 91 pop r17 18b30: 0f 91 pop r16 18b32: ff 90 pop r15 18b34: ef 90 pop r14 18b36: df 90 pop r13 18b38: cf 90 pop r12 18b3a: bf 90 pop r11 18b3c: af 90 pop r10 18b3e: 9f 90 pop r9 18b40: 8f 90 pop r8 18b42: 7f 90 pop r7 18b44: 6f 90 pop r6 18b46: 5f 90 pop r5 18b48: 4f 90 pop r4 18b4a: 3f 90 pop r3 18b4c: 2f 90 pop r2 18b4e: 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)); 18b50: 8c e7 ldi r24, 0x7C ; 124 18b52: 98 e4 ldi r25, 0x48 ; 72 18b54: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18b58: 0e 94 78 6f call 0xdef0 ; 0xdef0 18b5c: b8 cf rjmp .-144 ; 0x18ace else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 18b5e: ef 92 push r14 18b60: ff 92 push r15 18b62: 0f 93 push r16 18b64: 1f 93 push r17 18b66: 8e ef ldi r24, 0xFE ; 254 18b68: 97 e6 ldi r25, 0x67 ; 103 18b6a: 9f 93 push r25 18b6c: 8f 93 push r24 18b6e: 0e 94 66 6f call 0xdecc ; 0xdecc 18b72: 0f 90 pop r0 18b74: 0f 90 pop r0 18b76: 0f 90 pop r0 18b78: 0f 90 pop r0 18b7a: 0f 90 pop r0 18b7c: 0f 90 pop r0 18b7e: c3 cf rjmp .-122 ; 0x18b06 00018b80 : else value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { 18b80: ef 92 push r14 18b82: ff 92 push r15 18b84: 0f 93 push r16 18b86: 1f 93 push r17 18b88: cf 93 push r28 18b8a: df 93 push r29 18b8c: cd b7 in r28, 0x3d ; 61 18b8e: de b7 in r29, 0x3e ; 62 18b90: 6b 97 sbiw r28, 0x1b ; 27 18b92: 0f b6 in r0, 0x3f ; 63 18b94: f8 94 cli 18b96: de bf out 0x3e, r29 ; 62 18b98: 0f be out 0x3f, r0 ; 63 18b9a: 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); 18b9c: 8a e5 ldi r24, 0x5A ; 90 18b9e: 9f e0 ldi r25, 0x0F ; 15 18ba0: 0f 94 3e a4 call 0x3487c ; 0x3487c 18ba4: e8 2e mov r14, r24 18ba6: 0a e0 ldi r16, 0x0A ; 10 18ba8: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 18baa: 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); 18bac: 48 e0 ldi r20, 0x08 ; 8 18bae: 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++) { 18bb0: ef 14 cp r14, r15 18bb2: 79 f0 breq .+30 ; 0x18bd2 eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 18bb4: b8 01 movw r22, r16 18bb6: ce 01 movw r24, r28 18bb8: 0e 96 adiw r24, 0x0e ; 14 18bba: 0f 94 2e a4 call 0x3485c ; 0x3485c dir_name[8] = '\0'; 18bbe: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 18bc0: 60 e0 ldi r22, 0x00 ; 0 18bc2: ce 01 movw r24, r28 18bc4: 0e 96 adiw r24, 0x0e ; 14 18bc6: 0f 94 17 70 call 0x2e02e ; 0x2e02e 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++) { 18bca: f3 94 inc r15 18bcc: 08 5f subi r16, 0xF8 ; 248 18bce: 1f 4f sbci r17, 0xFF ; 255 18bd0: ed cf rjmp .-38 ; 0x18bac 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); 18bd2: 65 e9 ldi r22, 0x95 ; 149 18bd4: 7f e0 ldi r23, 0x0F ; 15 18bd6: 8e 01 movw r16, r28 18bd8: 0f 5f subi r16, 0xFF ; 255 18bda: 1f 4f sbci r17, 0xFF ; 255 18bdc: c8 01 movw r24, r16 18bde: 0f 94 2e a4 call 0x3485c ; 0x3485c // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 18be2: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 18be4: 8e e2 ldi r24, 0x2E ; 46 18be6: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 18be8: 43 e0 ldi r20, 0x03 ; 3 18bea: 50 e0 ldi r21, 0x00 ; 0 18bec: 61 e9 ldi r22, 0x91 ; 145 18bee: 7c e0 ldi r23, 0x0C ; 12 18bf0: ce 01 movw r24, r28 18bf2: 48 96 adiw r24, 0x18 ; 24 18bf4: 0f 94 2e a4 call 0x3485c ; 0x3485c extension_ptr[4] = '\0'; 18bf8: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 18bfa: be 01 movw r22, r28 18bfc: 69 5e subi r22, 0xE9 ; 233 18bfe: 7f 4f sbci r23, 0xFF ; 255 18c00: c8 01 movw r24, r16 18c02: 0f 94 8a aa call 0x35514 ; 0x35514 enquecommandf_P(MSG_M23, filename); 18c06: 1f 93 push r17 18c08: 0f 93 push r16 18c0a: 8b e0 ldi r24, 0x0B ; 11 18c0c: 9d e6 ldi r25, 0x6D ; 109 18c0e: 9f 93 push r25 18c10: 8f 93 push r24 18c12: 0e 94 2b 8e call 0x11c56 ; 0x11c56 restore_file_from_sd(); // M24: Start/resume SD print enquecommand_P(MSG_M24); 18c16: 61 e0 ldi r22, 0x01 ; 1 18c18: 87 e0 ldi r24, 0x07 ; 7 18c1a: 9d e6 ldi r25, 0x6D ; 109 18c1c: 0e 94 65 8d call 0x11aca ; 0x11aca lcd_return_to_status(); 18c20: 0f 94 18 05 call 0x20a30 ; 0x20a30 18c24: 0f 90 pop r0 18c26: 0f 90 pop r0 18c28: 0f 90 pop r0 18c2a: 0f 90 pop r0 } 18c2c: 6b 96 adiw r28, 0x1b ; 27 18c2e: 0f b6 in r0, 0x3f ; 63 18c30: f8 94 cli 18c32: de bf out 0x3e, r29 ; 62 18c34: 0f be out 0x3f, r0 ; 63 18c36: cd bf out 0x3d, r28 ; 61 18c38: df 91 pop r29 18c3a: cf 91 pop r28 18c3c: 1f 91 pop r17 18c3e: 0f 91 pop r16 18c40: ff 90 pop r15 18c42: ef 90 pop r14 18c44: 08 95 ret 00018c46 : MENU_END(); } #ifdef PINDA_TEMP_COMP void lcd_pinda_temp_compensation_toggle() { 18c46: cf 93 push r28 uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION); 18c48: 89 e2 ldi r24, 0x29 ; 41 18c4a: 9d e0 ldi r25, 0x0D ; 13 18c4c: 0f 94 3e a4 call 0x3487c ; 0x3487c 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; 18c50: 81 50 subi r24, 0x01 ; 1 18c52: c1 e0 ldi r28, 0x01 ; 1 18c54: 8e 3f cpi r24, 0xFE ; 254 18c56: 08 f4 brcc .+2 ; 0x18c5a 18c58: 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); 18c5a: 6c 2f mov r22, r28 18c5c: 89 e2 ldi r24, 0x29 ; 41 18c5e: 9d e0 ldi r25, 0x0D ; 13 18c60: 0f 94 62 a4 call 0x348c4 ; 0x348c4 eeprom_update_byte_notify((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, pinda_temp_compensation); SERIAL_ECHOLNPGM("SuperPINDA:"); 18c64: 89 ed ldi r24, 0xD9 ; 217 18c66: 94 e8 ldi r25, 0x84 ; 132 18c68: 0e 94 18 7d call 0xfa30 ; 0xfa30 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 18c6c: 8c 2f mov r24, r28 18c6e: 0e 94 0c 7a call 0xf418 ; 0xf418 SERIAL_ECHOLN(pinda_temp_compensation); } 18c72: cf 91 pop r28 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 18c74: 0c 94 17 7b jmp 0xf62e ; 0xf62e 00018c78 : } 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); 18c78: 22 ed ldi r18, 0xD2 ; 210 18c7a: 30 e0 ldi r19, 0x00 ; 0 18c7c: 50 e0 ldi r21, 0x00 ; 0 18c7e: 40 e0 ldi r20, 0x00 ; 0 18c80: 62 e0 ldi r22, 0x02 ; 2 18c82: 87 e4 ldi r24, 0x47 ; 71 18c84: 93 e8 ldi r25, 0x83 ; 131 18c86: 0d 94 db 49 jmp 0x293b6 ; 0x293b6 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]> 00018c8a : } // 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); 18c8a: 2a ef ldi r18, 0xFA ; 250 18c8c: 30 e0 ldi r19, 0x00 ; 0 18c8e: 50 e0 ldi r21, 0x00 ; 0 18c90: 40 e0 ldi r20, 0x00 ; 0 18c92: 60 e0 ldi r22, 0x00 ; 0 18c94: 81 e4 ldi r24, 0x41 ; 65 18c96: 93 e8 ldi r25, 0x83 ; 131 18c98: 0d 94 db 49 jmp 0x293b6 ; 0x293b6 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]> 00018c9c : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 18c9c: 22 ed ldi r18, 0xD2 ; 210 18c9e: 30 e0 ldi r19, 0x00 ; 0 18ca0: 4c ef ldi r20, 0xFC ; 252 18ca2: 5f ef ldi r21, 0xFF ; 255 18ca4: 61 e0 ldi r22, 0x01 ; 1 18ca6: 84 e4 ldi r24, 0x44 ; 68 18ca8: 93 e8 ldi r25, 0x83 ; 131 18caa: 0d 94 db 49 jmp 0x293b6 ; 0x293b6 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]> 00018cae : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 18cae: cf 93 push r28 18cb0: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 18cb2: 83 ee ldi r24, 0xE3 ; 227 18cb4: 93 e0 ldi r25, 0x03 ; 3 18cb6: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 18cba: 80 91 71 12 lds r24, 0x1271 ; 0x801271 18cbe: 81 11 cpse r24, r1 18cc0: 18 c0 rjmp .+48 ; 0x18cf2 18cc2: 80 91 72 12 lds r24, 0x1272 ; 0x801272 18cc6: 81 11 cpse r24, r1 18cc8: 14 c0 rjmp .+40 ; 0x18cf2 18cca: c0 91 02 04 lds r28, 0x0402 ; 0x800402 18cce: d0 91 03 04 lds r29, 0x0403 ; 0x800403 18cd2: 85 ed ldi r24, 0xD5 ; 213 18cd4: c3 35 cpi r28, 0x53 ; 83 18cd6: d8 07 cpc r29, r24 18cd8: 61 f0 breq .+24 ; 0x18cf2 18cda: 86 ec ldi r24, 0xC6 ; 198 18cdc: cc 33 cpi r28, 0x3C ; 60 18cde: d8 07 cpc r29, r24 18ce0: 41 f0 breq .+16 ; 0x18cf2 18ce2: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 18ce6: 81 11 cpse r24, r1 18ce8: 04 c0 rjmp .+8 ; 0x18cf2 18cea: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 18cee: 88 23 and r24, r24 18cf0: 31 f0 breq .+12 ; 0x18cfe { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 18cf2: 82 e0 ldi r24, 0x02 ; 2 18cf4: 80 93 59 02 sts 0x0259, r24 ; 0x800259 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18cf8: df 91 pop r29 18cfa: cf 91 pop r28 18cfc: 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) 18cfe: 8f eb ldi r24, 0xBF ; 191 18d00: c7 34 cpi r28, 0x47 ; 71 18d02: d8 07 cpc r29, r24 18d04: 81 f4 brne .+32 ; 0x18d26 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 18d06: 82 e0 ldi r24, 0x02 ; 2 18d08: 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)); 18d0c: 8a e2 ldi r24, 0x2A ; 42 18d0e: 9d e0 ldi r25, 0x0D ; 13 18d10: 0f 94 3e a4 call 0x3487c ; 0x3487c 18d14: 61 e0 ldi r22, 0x01 ; 1 18d16: 81 11 cpse r24, r1 18d18: 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); 18d1a: 8a e2 ldi r24, 0x2A ; 42 18d1c: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18d1e: df 91 pop r29 18d20: cf 91 pop r28 18d22: 0d 94 86 a4 jmp 0x3490c ; 0x3490c 18d26: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 18d2a: 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 18d2e: 98 13 cpse r25, r24 18d30: 04 c0 rjmp .+8 ; 0x18d3a 18d32: 0e 94 9b 66 call 0xcd36 ; 0xcd36 18d36: 88 23 and r24, r24 18d38: 61 f0 breq .+24 ; 0x18d52 if ( babystep_allowed_strict() 18d3a: 0e 94 d6 66 call 0xcdac ; 0xcdac && (menu_menu == lcd_status_screen // and in listed menus... 18d3e: 81 11 cpse r24, r1 18d40: 10 c0 rjmp .+32 ; 0x18d62 Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 18d42: 82 e0 ldi r24, 0x02 ; 2 18d44: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 18d48: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18d4a: df 91 pop r29 18d4c: cf 91 pop r28 18d4e: 0d 94 06 23 jmp 0x2460c ; 0x2460c menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 18d52: 87 e3 ldi r24, 0x37 ; 55 18d54: ce 39 cpi r28, 0x9E ; 158 18d56: d8 07 cpc r29, r24 18d58: e1 f4 brne .+56 ; 0x18d92 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 18d5a: 60 e0 ldi r22, 0x00 ; 0 18d5c: 8c e3 ldi r24, 0x3C ; 60 18d5e: 96 ec ldi r25, 0xC6 ; 198 18d60: 14 c0 rjmp .+40 ; 0x18d8a // 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... 18d62: 87 e3 ldi r24, 0x37 ; 55 18d64: ce 39 cpi r28, 0x9E ; 158 18d66: d8 07 cpc r29, r24 18d68: 59 f0 breq .+22 ; 0x18d80 || menu_menu == lcd_main_menu 18d6a: 86 ec ldi r24, 0xC6 ; 198 18d6c: c6 3e cpi r28, 0xE6 ; 230 18d6e: d8 07 cpc r29, r24 18d70: 39 f0 breq .+14 ; 0x18d80 || menu_menu == lcd_tune_menu 18d72: 8a ec ldi r24, 0xCA ; 202 18d74: c2 31 cpi r28, 0x12 ; 18 18d76: d8 07 cpc r29, r24 18d78: 19 f0 breq .+6 ; 0x18d80 || menu_menu == lcd_support_menu 18d7a: c0 50 subi r28, 0x00 ; 0 18d7c: d9 43 sbci r29, 0x39 ; 57 18d7e: 09 f7 brne .-62 ; 0x18d42 ) ){ lcd_clear(); 18d80: 0e 94 81 70 call 0xe102 ; 0xe102 menu_submenu(lcd_babystep_z); 18d84: 60 e0 ldi r22, 0x00 ; 0 18d86: 83 e5 ldi r24, 0x53 ; 83 18d88: 95 ed ldi r25, 0xD5 ; 213 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18d8a: df 91 pop r29 18d8c: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 18d8e: 0c 94 38 63 jmp 0xc670 ; 0xc670 } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 18d92: 86 ec ldi r24, 0xC6 ; 198 18d94: c6 3e cpi r28, 0xE6 ; 230 18d96: d8 07 cpc r29, r24 18d98: 01 f3 breq .-64 ; 0x18d5a || menu_menu == lcd_preheat_menu 18d9a: 88 e3 ldi r24, 0x38 ; 56 18d9c: ca 35 cpi r28, 0x5A ; 90 18d9e: d8 07 cpc r29, r24 18da0: e1 f2 breq .-72 ; 0x18d5a || menu_menu == lcd_sdcard_menu 18da2: 84 ee ldi r24, 0xE4 ; 228 18da4: c0 33 cpi r28, 0x30 ; 48 18da6: d8 07 cpc r29, r24 18da8: c1 f2 breq .-80 ; 0x18d5a || menu_menu == lcd_settings_menu 18daa: 8a ec ldi r24, 0xCA ; 202 18dac: c0 3d cpi r28, 0xD0 ; 208 18dae: d8 07 cpc r29, r24 18db0: a1 f2 breq .-88 ; 0x18d5a || menu_menu == lcd_control_temperature_menu 18db2: 89 ec ldi r24, 0xC9 ; 201 18db4: c9 33 cpi r28, 0x39 ; 57 18db6: d8 07 cpc r29, r24 18db8: 81 f2 breq .-96 ; 0x18d5a #if (LANG_MODE != 0) || menu_menu == lcd_language 18dba: 82 ec ldi r24, 0xC2 ; 194 18dbc: c5 33 cpi r28, 0x35 ; 53 18dbe: d8 07 cpc r29, r24 18dc0: 61 f2 breq .-104 ; 0x18d5a #endif || menu_menu == lcd_support_menu 18dc2: c0 50 subi r28, 0x00 ; 0 18dc4: d9 43 sbci r29, 0x39 ; 57 18dc6: 09 f0 breq .+2 ; 0x18dca 18dc8: bc cf rjmp .-136 ; 0x18d42 18dca: c7 cf rjmp .-114 ; 0x18d5a 00018dcc : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 18dcc: 1f 93 push r17 18dce: cf 93 push r28 18dd0: df 93 push r29 MENU_BEGIN(); 18dd2: 0e 94 67 74 call 0xe8ce ; 0xe8ce 18dd6: 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); 18dda: 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 18ddc: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 18dde: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18de2: 84 30 cpi r24, 0x04 ; 4 18de4: 08 f0 brcs .+2 ; 0x18de8 18de6: 08 c2 rjmp .+1040 ; 0x191f8 18de8: 10 92 63 04 sts 0x0463, r1 ; 0x800463 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 18dec: 80 e1 ldi r24, 0x10 ; 16 18dee: 98 e4 ldi r25, 0x48 ; 72 18df0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18df4: 0e 94 29 73 call 0xe652 ; 0xe652 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)) { 18df8: 0e 94 ec 66 call 0xcdd8 ; 0xcdd8 18dfc: 81 11 cpse r24, r1 18dfe: 19 c0 rjmp .+50 ; 0x18e32 18e00: 0e 94 86 66 call 0xcd0c ; 0xcd0c 18e04: 81 11 cpse r24, r1 18e06: 15 c0 rjmp .+42 ; 0x18e32 18e08: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 18e0c: 81 11 cpse r24, r1 18e0e: 11 c0 rjmp .+34 ; 0x18e32 #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 18e10: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.385> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 18e14: 83 30 cpi r24, 0x03 ; 3 18e16: 09 f0 breq .+2 ; 0x18e1a 18e18: 5d c0 rjmp .+186 ; 0x18ed4 18e1a: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 18e1e: 88 23 and r24, r24 18e20: 41 f0 breq .+16 ; 0x18e32 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 18e22: 86 e0 ldi r24, 0x06 ; 6 18e24: 98 e4 ldi r25, 0x48 ; 72 18e26: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18e2a: 60 ec ldi r22, 0xC0 ; 192 18e2c: 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); 18e2e: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 18e32: 0e 94 d6 66 call 0xcdac ; 0xcdac 18e36: 88 23 and r24, r24 18e38: 81 f0 breq .+32 ; 0x18e5a 18e3a: 0e 94 9b 66 call 0xcd36 ; 0xcd36 18e3e: 81 11 cpse r24, r1 18e40: 04 c0 rjmp .+8 ; 0x18e4a 18e42: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 18e46: 84 30 cpi r24, 0x04 ; 4 18e48: 41 f4 brne .+16 ; 0x18e5a MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 18e4a: 86 ef ldi r24, 0xF6 ; 246 18e4c: 97 e4 ldi r25, 0x47 ; 71 18e4e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18e52: 63 e5 ldi r22, 0x53 ; 83 18e54: 75 ed ldi r23, 0xD5 ; 213 18e56: 0e 94 4e 73 call 0xe69c ; 0xe69c if (farm_mode) 18e5a: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 18e5e: 88 23 and r24, r24 18e60: 41 f0 breq .+16 ; 0x18e72 MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 18e62: 8b e4 ldi r24, 0x4B ; 75 18e64: 98 e4 ldi r25, 0x48 ; 72 18e66: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18e6a: 60 e9 ldi r22, 0x90 ; 144 18e6c: 7c ed ldi r23, 0xDC ; 220 18e6e: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 if (!printer_recovering()) { 18e72: 0e 94 86 66 call 0xcd0c ; 0xcd0c 18e76: 81 11 cpse r24, r1 18e78: 61 c0 rjmp .+194 ; 0x18f3c } //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); 18e7a: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 18e7e: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 18e82: 89 1b sub r24, r25 18e84: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 18e86: a9 f5 brne .+106 ; 0x18ef2 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 18e88: 0e 94 ec 66 call 0xcdd8 ; 0xcdd8 18e8c: 81 11 cpse r24, r1 18e8e: 31 c0 rjmp .+98 ; 0x18ef2 #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 18e90: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 18e94: 82 30 cpi r24, 0x02 ; 2 18e96: 69 f1 breq .+90 ; 0x18ef2 #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 18e98: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 18e9c: 81 11 cpse r24, r1 18e9e: 31 c0 rjmp .+98 ; 0x18f02 MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 18ea0: 85 ee ldi r24, 0xE5 ; 229 18ea2: 97 e4 ldi r25, 0x47 ; 71 18ea4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18ea8: 6a e5 ldi r22, 0x5A ; 90 18eaa: 78 e3 ldi r23, 0x38 ; 56 18eac: 0e 94 4e 73 call 0xe69c ; 0xe69c if (M79_timer_get_status()) { 18eb0: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.420> 18eb4: 88 23 and r24, r24 18eb6: 29 f1 breq .+74 ; 0x18f02 #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 18eb8: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.385> 18ebc: 81 30 cpi r24, 0x01 ; 1 18ebe: 09 f0 breq .+2 ; 0x18ec2 18ec0: 45 c1 rjmp .+650 ; 0x1914c MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 18ec2: 85 ed ldi r24, 0xD5 ; 213 18ec4: 97 e4 ldi r25, 0x47 ; 71 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 18ec6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18eca: 6f ea ldi r22, 0xAF ; 175 18ecc: 7c eb ldi r23, 0xBC ; 188 18ece: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 18ed2: 17 c0 rjmp .+46 ; 0x18f02 // 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()) { 18ed4: 84 30 cpi r24, 0x04 ; 4 18ed6: 09 f0 breq .+2 ; 0x18eda 18ed8: ac cf rjmp .-168 ; 0x18e32 18eda: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.420> 18ede: 88 23 and r24, r24 18ee0: 09 f4 brne .+2 ; 0x18ee4 18ee2: a7 cf rjmp .-178 ; 0x18e32 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 18ee4: 86 e0 ldi r24, 0x06 ; 6 18ee6: 98 e4 ldi r25, 0x48 ; 72 18ee8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18eec: 69 ea ldi r22, 0xA9 ; 169 18eee: 7c eb ldi r23, 0xBC ; 188 18ef0: 9e cf rjmp .-196 ; 0x18e2e 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); 18ef2: 8f ee ldi r24, 0xEF ; 239 18ef4: 97 e4 ldi r25, 0x47 ; 71 18ef6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18efa: 62 e1 ldi r22, 0x12 ; 18 18efc: 7a ec ldi r23, 0xCA ; 202 18efe: 0e 94 4e 73 call 0xe69c ; 0xe69c #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) { 18f02: c0 91 72 12 lds r28, 0x1272 ; 0x801272 18f06: 0e 94 90 66 call 0xcd20 ; 0xcd20 18f0a: c1 11 cpse r28, r1 18f0c: 17 c0 rjmp .+46 ; 0x18f3c 18f0e: 90 91 71 12 lds r25, 0x1271 ; 0x801271 18f12: 91 11 cpse r25, r1 18f14: 13 c0 rjmp .+38 ; 0x18f3c 18f16: 81 11 cpse r24, r1 18f18: 15 c0 rjmp .+42 ; 0x18f44 18f1a: 80 91 91 03 lds r24, 0x0391 ; 0x800391 18f1e: 81 11 cpse r24, r1 18f20: 0d c0 rjmp .+26 ; 0x18f3c if (usb_timer.running()) { 18f22: 80 91 42 12 lds r24, 0x1242 ; 0x801242 18f26: 88 23 and r24, r24 18f28: 09 f4 brne .+2 ; 0x18f2c 18f2a: 13 c1 rjmp .+550 ; 0x19152 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 18f2c: 8b eb ldi r24, 0xBB ; 187 18f2e: 97 e4 ldi r25, 0x47 ; 71 18f30: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18f34: 62 e6 ldi r22, 0x62 ; 98 18f36: 77 e3 ldi r23, 0x37 ; 55 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 18f38: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 } } } if (printingIsPaused() 18f3c: 0e 94 90 66 call 0xcd20 ; 0xcd20 && !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) { 18f40: 88 23 and r24, r24 18f42: f1 f0 breq .+60 ; 0x18f80 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 18f44: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 18f48: 81 11 cpse r24, r1 18f4a: 1a c0 rjmp .+52 ; 0x18f80 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18f4c: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 18f50: 82 30 cpi r24, 0x02 ; 2 18f52: b1 f0 breq .+44 ; 0x18f80 #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 18f54: 80 91 79 02 lds r24, 0x0279 ; 0x800279 18f58: 82 30 cpi r24, 0x02 ; 2 18f5a: 21 f4 brne .+8 ; 0x18f64 18f5c: 90 91 73 12 lds r25, 0x1273 ; 0x801273 18f60: 99 23 and r25, r25 18f62: 71 f0 breq .+28 ; 0x18f80 && custom_message_type != CustomMsg::Resuming) { 18f64: 90 91 5d 06 lds r25, 0x065D ; 0x80065d 18f68: 98 30 cpi r25, 0x08 ; 8 18f6a: 51 f0 breq .+20 ; 0x18f80 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 18f6c: 81 11 cpse r24, r1 18f6e: fd c0 rjmp .+506 ; 0x1916a MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 18f70: 8c ea ldi r24, 0xAC ; 172 18f72: 97 e4 ldi r25, 0x47 ; 71 18f74: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18f78: 64 ea ldi r22, 0xA4 ; 164 18f7a: 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); 18f7c: 0e 94 4e 73 call 0xe69c ; 0xe69c } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 18f80: 0e 94 9b 66 call 0xcd36 ; 0xcd36 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 18f84: 81 11 cpse r24, r1 18f86: 08 c0 rjmp .+16 ; 0x18f98 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())) 18f88: 0e 94 90 66 call 0xcd20 ; 0xcd20 18f8c: 81 11 cpse r24, r1 18f8e: 04 c0 rjmp .+8 ; 0x18f98 18f90: 0e 94 86 66 call 0xcd0c ; 0xcd0c 18f94: 88 23 and r24, r24 18f96: 81 f0 breq .+32 ; 0x18fb8 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 18f98: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 18f9c: 81 30 cpi r24, 0x01 ; 1 18f9e: 61 f0 breq .+24 ; 0x18fb8 18fa0: 80 91 91 03 lds r24, 0x0391 ; 0x800391 18fa4: 81 11 cpse r24, r1 18fa6: 08 c0 rjmp .+16 ; 0x18fb8 MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 18fa8: 8d ea ldi r24, 0xAD ; 173 18faa: 98 e4 ldi r25, 0x48 ; 72 18fac: 0e 94 95 75 call 0xeb2a ; 0xeb2a 18fb0: 61 e1 ldi r22, 0x11 ; 17 18fb2: 70 ec ldi r23, 0xC0 ; 192 18fb4: 0e 94 4e 73 call 0xe69c ; 0xe69c 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() 18fb8: 0e 94 86 66 call 0xcd0c ; 0xcd0c #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18fbc: 81 11 cpse r24, r1 18fbe: 95 c0 rjmp .+298 ; 0x190ea 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() 18fc0: 0e 94 ec 66 call 0xcdd8 ; 0xcdd8 18fc4: 81 11 cpse r24, r1 18fc6: 91 c0 rjmp .+290 ; 0x190ea 18fc8: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 18fcc: 81 11 cpse r24, r1 18fce: 8d c0 rjmp .+282 ; 0x190ea #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18fd0: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 18fd4: 82 30 cpi r24, 0x02 ; 2 18fd6: 09 f4 brne .+2 ; 0x18fda 18fd8: 88 c0 rjmp .+272 ; 0x190ea #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 18fda: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 18fde: 81 11 cpse r24, r1 18fe0: 05 c0 rjmp .+10 ; 0x18fec || lcd_commands_type != LcdCommands::Idle) { 18fe2: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 18fe6: 88 23 and r24, r24 18fe8: 09 f4 brne .+2 ; 0x18fec 18fea: ce c0 rjmp .+412 ; 0x19188 if (!card.isFileOpen()) { 18fec: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 18ff0: 81 11 cpse r24, r1 18ff2: 12 c0 rjmp .+36 ; 0x19018 if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 18ff4: 80 91 42 12 lds r24, 0x1242 ; 0x801242 18ff8: 81 11 cpse r24, r1 18ffa: 0e c0 rjmp .+28 ; 0x19018 18ffc: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 19000: 81 11 cpse r24, r1 19002: 0a c0 rjmp .+20 ; 0x19018 bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 19004: d0 93 c9 03 sts 0x03C9, r29 ; 0x8003c9 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 19008: 8c e9 ldi r24, 0x9C ; 156 1900a: 97 e4 ldi r25, 0x47 ; 71 1900c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19010: 60 e3 ldi r22, 0x30 ; 48 19012: 74 ee ldi r23, 0xE4 ; 228 19014: 0e 94 4e 73 call 0xe69c ; 0xe69c #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) { 19018: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1901c: 81 11 cpse r24, r1 1901e: 12 c0 rjmp .+36 ; 0x19044 const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 19020: 81 ea ldi r24, 0xA1 ; 161 19022: 9d e0 ldi r25, 0x0D ; 13 19024: 0f 94 3e a4 call 0x3487c ; 0x3487c 19028: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 1902a: 0e 94 f1 78 call 0xf1e2 ; 0xf1e2 if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 1902e: 87 fd sbrc r24, 7 19030: 09 c0 rjmp .+18 ; 0x19044 19032: c8 17 cp r28, r24 19034: 39 f0 breq .+14 ; 0x19044 MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 19036: c1 02 muls r28, r17 19038: c0 01 movw r24, r0 1903a: 11 24 eor r1, r1 1903c: 87 5b subi r24, 0xB7 ; 183 1903e: 92 4f sbci r25, 0xF2 ; 242 19040: 0e 94 1b bc call 0x17836 ; 0x17836 SETTINGS_NOZZLE; #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 19044: 80 91 94 03 lds r24, 0x0394 ; 0x800394 19048: 81 11 cpse r24, r1 1904a: 4f c0 rjmp .+158 ; 0x190ea 1904c: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 19050: 81 11 cpse r24, r1 19052: 4b c0 rjmp .+150 ; 0x190ea if (MMU2::mmu2.Enabled()) { 19054: 80 91 01 13 lds r24, 0x1301 ; 0x801301 19058: 81 30 cpi r24, 0x01 ; 1 1905a: 09 f0 breq .+2 ; 0x1905e 1905c: 9e c0 rjmp .+316 ; 0x1919a if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 1905e: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 19062: 81 11 cpse r24, r1 19064: 0c c0 rjmp .+24 ; 0x1907e 19066: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1906a: 81 11 cpse r24, r1 1906c: 08 c0 rjmp .+16 ; 0x1907e // 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); 1906e: 8e e7 ldi r24, 0x7E ; 126 19070: 97 e4 ldi r25, 0x47 ; 71 19072: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19076: 6d e7 ldi r22, 0x7D ; 125 19078: 7d ec ldi r23, 0xCD ; 205 1907a: 0e 94 4e 73 call 0xe69c ; 0xe69c } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 1907e: 8d e6 ldi r24, 0x6D ; 109 19080: 97 e4 ldi r25, 0x47 ; 71 19082: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19086: 64 eb ldi r22, 0xB4 ; 180 19088: 7d ec ldi r23, 0xCD ; 205 1908a: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 1908e: 8b e5 ldi r24, 0x5B ; 91 19090: 97 e4 ldi r25, 0x47 ; 71 19092: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19096: 67 eb ldi r22, 0xB7 ; 183 19098: 7d ec ldi r23, 0xCD ; 205 1909a: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 1909e: 8e e9 ldi r24, 0x9E ; 158 190a0: 92 e6 ldi r25, 0x62 ; 98 190a2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 190a6: 6a eb ldi r22, 0xBA ; 186 190a8: 7d ec ldi r23, 0xCD ; 205 190aa: 0e 94 4e 73 call 0xe69c ; 0xe69c #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 190ae: 8e ec ldi r24, 0xCE ; 206 190b0: 9e e0 ldi r25, 0x0E ; 14 190b2: 0f 94 3e a4 call 0x3487c ; 0x3487c 190b6: 88 23 and r24, r24 190b8: 41 f0 breq .+16 ; 0x190ca MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 190ba: 8f e8 ldi r24, 0x8F ; 143 190bc: 92 e6 ldi r25, 0x62 ; 98 190be: 0e 94 95 75 call 0xeb2a ; 0xeb2a 190c2: 6d eb ldi r22, 0xBD ; 189 190c4: 7d ec ldi r23, 0xCD ; 205 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 190c6: 0e 94 4e 73 call 0xe69c ; 0xe69c #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 190ca: 87 e9 ldi r24, 0x97 ; 151 190cc: 98 e4 ldi r25, 0x48 ; 72 190ce: 0e 94 95 75 call 0xeb2a ; 0xeb2a 190d2: 60 ed ldi r22, 0xD0 ; 208 190d4: 7a ec ldi r23, 0xCA ; 202 190d6: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 190da: 89 e2 ldi r24, 0x29 ; 41 190dc: 97 e4 ldi r25, 0x47 ; 71 190de: 0e 94 95 75 call 0xeb2a ; 0xeb2a 190e2: 6c e2 ldi r22, 0x2C ; 44 190e4: 7c ec ldi r23, 0xCC ; 204 190e6: 0e 94 4e 73 call 0xe69c ; 0xe69c } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 190ea: 8c e1 ldi r24, 0x1C ; 28 190ec: 97 e4 ldi r25, 0x47 ; 71 190ee: 0e 94 95 75 call 0xeb2a ; 0xeb2a 190f2: 62 e4 ldi r22, 0x42 ; 66 190f4: 77 e3 ldi r23, 0x37 ; 55 190f6: 0e 94 4e 73 call 0xe69c ; 0xe69c #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 190fa: 8f e0 ldi r24, 0x0F ; 15 190fc: 97 e4 ldi r25, 0x47 ; 71 190fe: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19102: 68 e1 ldi r22, 0x18 ; 24 19104: 77 e3 ldi r23, 0x37 ; 55 19106: 0e 94 4e 73 call 0xe69c ; 0xe69c #endif if (MMU2::mmu2.Enabled()) { 1910a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1910e: 81 30 cpi r24, 0x01 ; 1 19110: 41 f4 brne .+16 ; 0x19122 MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 19112: 8e ef ldi r24, 0xFE ; 254 19114: 96 e4 ldi r25, 0x46 ; 70 19116: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1911a: 62 eb ldi r22, 0xB2 ; 178 1911c: 78 e3 ldi r23, 0x38 ; 56 1911e: 0e 94 4e 73 call 0xe69c ; 0xe69c 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); 19122: 84 ef ldi r24, 0xF4 ; 244 19124: 96 e4 ldi r25, 0x46 ; 70 19126: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1912a: 60 e0 ldi r22, 0x00 ; 0 1912c: 79 e3 ldi r23, 0x39 ; 57 1912e: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_END(); 19132: 0e 94 de 62 call 0xc5bc ; 0xc5bc //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 19136: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1913a: 8f 5f subi r24, 0xFF ; 255 1913c: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19140: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19144: 8f 5f subi r24, 0xFF ; 255 19146: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1914a: 49 ce rjmp .-878 ; 0x18dde 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); 1914c: 89 ec ldi r24, 0xC9 ; 201 1914e: 97 e4 ldi r25, 0x47 ; 71 19150: ba ce rjmp .-652 ; 0x18ec6 } } 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) { 19152: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 19156: 88 23 and r24, r24 19158: 09 f4 brne .+2 ; 0x1915c 1915a: f0 ce rjmp .-544 ; 0x18f3c MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1915c: 8b eb ldi r24, 0xBB ; 187 1915e: 97 e4 ldi r25, 0x47 ; 71 19160: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19164: 6c e4 ldi r22, 0x4C ; 76 19166: 77 e3 ldi r23, 0x37 ; 55 19168: e7 ce rjmp .-562 ; 0x18f38 #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())) { 1916a: 81 30 cpi r24, 0x01 ; 1 1916c: 09 f0 breq .+2 ; 0x19170 1916e: 08 cf rjmp .-496 ; 0x18f80 19170: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.420> 19174: 88 23 and r24, r24 19176: 09 f4 brne .+2 ; 0x1917a 19178: 03 cf rjmp .-506 ; 0x18f80 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 1917a: 8c ea ldi r24, 0xAC ; 172 1917c: 97 e4 ldi r25, 0x47 ; 71 1917e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19182: 66 e7 ldi r22, 0x76 ; 118 19184: 7c ed ldi r23, 0xDC ; 220 19186: fa ce rjmp .-524 ; 0x18f7c #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 19188: d0 93 c9 03 sts 0x03C9, r29 ; 0x8003c9 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 1918c: 8f e8 ldi r24, 0x8F ; 143 1918e: 97 e4 ldi r25, 0x47 ; 71 19190: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19194: 0e 94 29 73 call 0xe652 ; 0xe652 19198: 3f cf rjmp .-386 ; 0x19018 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 1919a: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1919e: 88 23 and r24, r24 191a0: e1 f0 breq .+56 ; 0x191da if (!fsensor.getAutoLoadEnabled()) { 191a2: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 191a6: 81 11 cpse r24, r1 191a8: 08 c0 rjmp .+16 ; 0x191ba MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 191aa: 8b e4 ldi r24, 0x4B ; 75 191ac: 97 e4 ldi r25, 0x47 ; 71 191ae: 0e 94 95 75 call 0xeb2a ; 0xeb2a 191b2: 6e e4 ldi r22, 0x4E ; 78 191b4: 78 e3 ldi r23, 0x38 ; 56 191b6: 0e 94 4e 73 call 0xe69c ; 0xe69c } if (!fsensor.getFilamentPresent()) { 191ba: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 191be: 81 11 cpse r24, r1 191c0: 14 c0 rjmp .+40 ; 0x191ea if (fsensor.getAutoLoadEnabled()) { 191c2: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 191c6: 88 23 and r24, r24 191c8: 09 f4 brne .+2 ; 0x191cc 191ca: 7f cf rjmp .-258 ; 0x190ca MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 191cc: 87 e3 ldi r24, 0x37 ; 55 191ce: 97 e4 ldi r25, 0x47 ; 71 191d0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 191d4: 66 e5 ldi r22, 0x56 ; 86 191d6: 77 e3 ldi r23, 0x37 ; 55 191d8: 76 cf rjmp .-276 ; 0x190c6 } else { MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 191da: 8b e4 ldi r24, 0x4B ; 75 191dc: 97 e4 ldi r25, 0x47 ; 71 191de: 0e 94 95 75 call 0xeb2a ; 0xeb2a 191e2: 6e e4 ldi r22, 0x4E ; 78 191e4: 78 e3 ldi r23, 0x38 ; 56 191e6: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 191ea: 8b e5 ldi r24, 0x5B ; 91 191ec: 97 e4 ldi r25, 0x47 ; 71 191ee: 0e 94 95 75 call 0xeb2a ; 0xeb2a 191f2: 6e ed ldi r22, 0xDE ; 222 191f4: 78 e3 ldi r23, 0x38 ; 56 191f6: 67 cf rjmp .-306 ; 0x190c6 #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 191f8: df 91 pop r29 191fa: cf 91 pop r28 191fc: 1f 91 pop r17 191fe: 08 95 ret 00019200 : } #endif // TMC2130 } } static void menuitems_temperature_common() { 19200: ef 92 push r14 19202: ff 92 push r15 19204: 0f 93 push r16 19206: 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); 19208: 85 ee ldi r24, 0xE5 ; 229 1920a: 94 e4 ldi r25, 0x44 ; 68 1920c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19210: 28 ec ldi r18, 0xC8 ; 200 19212: e2 2e mov r14, r18 19214: f1 2c mov r15, r1 19216: 07 e2 ldi r16, 0x27 ; 39 19218: 11 e0 ldi r17, 0x01 ; 1 1921a: 30 e0 ldi r19, 0x00 ; 0 1921c: 20 e0 ldi r18, 0x00 ; 0 1921e: 40 e1 ldi r20, 0x10 ; 16 19220: 6d e5 ldi r22, 0x5D ; 93 19222: 72 e1 ldi r23, 0x12 ; 18 19224: 0e 94 c9 6f call 0xdf92 ; 0xdf92 #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); 19228: 8a ec ldi r24, 0xCA ; 202 1922a: 94 e4 ldi r25, 0x44 ; 68 1922c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19230: 32 e3 ldi r19, 0x32 ; 50 19232: e3 2e mov r14, r19 19234: f1 2c mov r15, r1 19236: 08 e7 ldi r16, 0x78 ; 120 19238: 10 e0 ldi r17, 0x00 ; 0 1923a: 30 e0 ldi r19, 0x00 ; 0 1923c: 20 e0 ldi r18, 0x00 ; 0 1923e: 40 e1 ldi r20, 0x10 ; 16 19240: 69 e5 ldi r22, 0x59 ; 89 19242: 72 e1 ldi r23, 0x12 ; 18 19244: 0e 94 c9 6f call 0xdf92 ; 0xdf92 #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 19248: 8e eb ldi r24, 0xBE ; 190 1924a: 94 e4 ldi r25, 0x44 ; 68 1924c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19250: 4f e7 ldi r20, 0x7F ; 127 19252: e4 2e mov r14, r20 19254: f1 2c mov r15, r1 19256: 0f ef ldi r16, 0xFF ; 255 19258: 10 e0 ldi r17, 0x00 ; 0 1925a: 30 e0 ldi r19, 0x00 ; 0 1925c: 20 e0 ldi r18, 0x00 ; 0 1925e: 48 e0 ldi r20, 0x08 ; 8 19260: 65 e5 ldi r22, 0x55 ; 85 19262: 72 e1 ldi r23, 0x12 ; 18 19264: 0e 94 c9 6f call 0xdf92 ; 0xdf92 } 19268: 1f 91 pop r17 1926a: 0f 91 pop r16 1926c: ff 90 pop r15 1926e: ef 90 pop r14 19270: 08 95 ret 00019272 : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 19272: 0e 94 67 74 call 0xe8ce ; 0xe8ce 19276: 10 92 60 04 sts 0x0460, r1 ; 0x800460 1927a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1927e: 84 30 cpi r24, 0x04 ; 4 19280: b8 f4 brcc .+46 ; 0x192b0 19282: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 19286: 87 e9 ldi r24, 0x97 ; 151 19288: 98 e4 ldi r25, 0x48 ; 72 1928a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1928e: 0e 94 29 73 call 0xe652 ; 0xe652 menuitems_temperature_common(); 19292: 0e 94 00 c9 call 0x19200 ; 0x19200 MENU_END(); 19296: 0e 94 de 62 call 0xc5bc ; 0xc5bc } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1929a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1929e: 8f 5f subi r24, 0xFF ; 255 192a0: 80 93 60 04 sts 0x0460, r24 ; 0x800460 192a4: 80 91 62 04 lds r24, 0x0462 ; 0x800462 192a8: 8f 5f subi r24, 0xFF ; 255 192aa: 80 93 62 04 sts 0x0462, r24 ; 0x800462 192ae: e5 cf rjmp .-54 ; 0x1927a MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 192b0: 08 95 ret 000192b2 : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 192b2: ef 92 push r14 192b4: ff 92 push r15 192b6: 0f 93 push r16 192b8: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 192ba: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 192be: 81 11 cpse r24, r1 192c0: 35 c0 rjmp .+106 ; 0x1932c { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 192c2: 80 ec ldi r24, 0xC0 ; 192 192c4: 9f e0 ldi r25, 0x0F ; 15 192c6: 0f 94 3e a4 call 0x3487c ; 0x3487c 192ca: 81 30 cpi r24, 0x01 ; 1 192cc: 61 f5 brne .+88 ; 0x19326 { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 192ce: 8f eb ldi r24, 0xBF ; 191 192d0: 9f e0 ldi r25, 0x0F ; 15 192d2: 0f 94 3e a4 call 0x3487c ; 0x3487c 192d6: 08 2e mov r0, r24 192d8: 00 0c add r0, r0 192da: 99 0b sbc r25, r25 192dc: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 192e0: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 192e4: 8e eb ldi r24, 0xBE ; 190 192e6: 9f e0 ldi r25, 0x0F ; 15 192e8: 0f 94 3e a4 call 0x3487c ; 0x3487c 192ec: 08 2e mov r0, r24 192ee: 00 0c add r0, r0 192f0: 99 0b sbc r25, r25 192f2: 90 93 a7 03 sts 0x03A7, r25 ; 0x8003a7 192f6: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 192fa: 8d eb ldi r24, 0xBD ; 189 192fc: 9f e0 ldi r25, 0x0F ; 15 192fe: 0f 94 3e a4 call 0x3487c ; 0x3487c 19302: 08 2e mov r0, r24 19304: 00 0c add r0, r0 19306: 99 0b sbc r25, r25 19308: 90 93 a9 03 sts 0x03A9, r25 ; 0x8003a9 1930c: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 19310: 8c eb ldi r24, 0xBC ; 188 19312: 9f e0 ldi r25, 0x0F ; 15 19314: 0f 94 3e a4 call 0x3487c ; 0x3487c 19318: 08 2e mov r0, r24 1931a: 00 0c add r0, r0 1931c: 99 0b sbc r25, r25 1931e: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 19322: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } _md->status = 1; 19326: 81 e0 ldi r24, 0x01 ; 1 19328: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 } MENU_BEGIN(); 1932c: 0e 94 67 74 call 0xe8ce ; 0xe8ce 19330: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19334: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19338: 84 30 cpi r24, 0x04 ; 4 1933a: 08 f0 brcs .+2 ; 0x1933e 1933c: 6e c0 rjmp .+220 ; 0x1941a 1933e: 10 92 63 04 sts 0x0463, r1 ; 0x800463 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 19342: 0e 94 a7 62 call 0xc54e ; 0xc54e 19346: 88 23 and r24, r24 19348: e9 f0 breq .+58 ; 0x19384 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1934a: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 1934e: 8f eb ldi r24, 0xBF ; 191 19350: 9f e0 ldi r25, 0x0F ; 15 19352: 0f 94 62 a4 call 0x348c4 ; 0x348c4 19356: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 1935a: 8d eb ldi r24, 0xBD ; 189 1935c: 9f e0 ldi r25, 0x0F ; 15 1935e: 0f 94 62 a4 call 0x348c4 ; 0x348c4 19362: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 19366: 8c eb ldi r24, 0xBC ; 188 19368: 9f e0 ldi r25, 0x0F ; 15 1936a: 0f 94 62 a4 call 0x348c4 ; 0x348c4 1936e: 60 91 a6 03 lds r22, 0x03A6 ; 0x8003a6 19372: 8e eb ldi r24, 0xBE ; 190 19374: 9f e0 ldi r25, 0x0F ; 15 19376: 0f 94 62 a4 call 0x348c4 ; 0x348c4 1937a: 61 e0 ldi r22, 0x01 ; 1 1937c: 80 ec ldi r24, 0xC0 ; 192 1937e: 9f e0 ldi r25, 0x0F ; 15 19380: 0f 94 62 a4 call 0x348c4 ; 0x348c4 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)); 19384: 82 e0 ldi r24, 0x02 ; 2 19386: 9b e4 ldi r25, 0x4B ; 75 19388: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1938c: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 19390: 85 e1 ldi r24, 0x15 ; 21 19392: 9b e3 ldi r25, 0x3B ; 59 19394: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19398: f1 2c mov r15, r1 1939a: e1 2c mov r14, r1 1939c: 04 e6 ldi r16, 0x64 ; 100 1939e: 10 e0 ldi r17, 0x00 ; 0 193a0: 2c e9 ldi r18, 0x9C ; 156 193a2: 3f ef ldi r19, 0xFF ; 255 193a4: 40 e1 ldi r20, 0x10 ; 16 193a6: 64 ea ldi r22, 0xA4 ; 164 193a8: 73 e0 ldi r23, 0x03 ; 3 193aa: 0e 94 c9 6f call 0xdf92 ; 0xdf92 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 193ae: 84 e0 ldi r24, 0x04 ; 4 193b0: 9b e3 ldi r25, 0x3B ; 59 193b2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 193b6: 2c e9 ldi r18, 0x9C ; 156 193b8: 3f ef ldi r19, 0xFF ; 255 193ba: 40 e1 ldi r20, 0x10 ; 16 193bc: 66 ea ldi r22, 0xA6 ; 166 193be: 73 e0 ldi r23, 0x03 ; 3 193c0: 0e 94 c9 6f call 0xdf92 ; 0xdf92 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 193c4: 83 ef ldi r24, 0xF3 ; 243 193c6: 9a e3 ldi r25, 0x3A ; 58 193c8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 193cc: 2c e9 ldi r18, 0x9C ; 156 193ce: 3f ef ldi r19, 0xFF ; 255 193d0: 40 e1 ldi r20, 0x10 ; 16 193d2: 68 ea ldi r22, 0xA8 ; 168 193d4: 73 e0 ldi r23, 0x03 ; 3 193d6: 0e 94 c9 6f call 0xdf92 ; 0xdf92 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 193da: 82 ee ldi r24, 0xE2 ; 226 193dc: 9a e3 ldi r25, 0x3A ; 58 193de: 0e 94 95 75 call 0xeb2a ; 0xeb2a 193e2: 2c e9 ldi r18, 0x9C ; 156 193e4: 3f ef ldi r19, 0xFF ; 255 193e6: 40 e1 ldi r20, 0x10 ; 16 193e8: 6a ea ldi r22, 0xAA ; 170 193ea: 73 e0 ldi r23, 0x03 ; 3 193ec: 0e 94 c9 6f call 0xdf92 ; 0xdf92 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 193f0: 88 eb ldi r24, 0xB8 ; 184 193f2: 96 e4 ldi r25, 0x46 ; 70 193f4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 193f8: 64 ed ldi r22, 0xD4 ; 212 193fa: 7e ec ldi r23, 0xCE ; 206 193fc: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 MENU_END(); 19400: 0e 94 de 62 call 0xc5bc ; 0xc5bc _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(); 19404: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19408: 8f 5f subi r24, 0xFF ; 255 1940a: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1940e: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19412: 8f 5f subi r24, 0xFF ; 255 19414: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19418: 8d cf rjmp .-230 ; 0x19334 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(); } 1941a: 1f 91 pop r17 1941c: 0f 91 pop r16 1941e: ff 90 pop r15 19420: ef 90 pop r14 19422: 08 95 ret 00019424 : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 19424: ef 92 push r14 19426: ff 92 push r15 19428: 0f 93 push r16 1942a: 1f 93 push r17 1942c: cf 93 push r28 1942e: df 93 push r29 19430: 80 91 75 02 lds r24, 0x0275 ; 0x800275 19434: 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) 19438: 20 91 a3 03 lds r18, 0x03A3 ; 0x8003a3 1943c: 21 11 cpse r18, r1 1943e: 91 c0 rjmp .+290 ; 0x19562 { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 19440: 21 e0 ldi r18, 0x01 ; 1 19442: 20 93 a3 03 sts 0x03A3, r18 ; 0x8003a3 _md->extrudemultiply = extrudemultiply; 19446: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 1944a: 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); 1944e: 8f ef ldi r24, 0xFF ; 255 19450: 9f e0 ldi r25, 0x0F ; 15 19452: 0f 94 3e a4 call 0x3487c ; 0x3487c 19456: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb MENU_BEGIN(); 1945a: 0e 94 67 74 call 0xe8ce ; 0xe8ce 1945e: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19462: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19466: 84 30 cpi r24, 0x04 ; 4 19468: 08 f0 brcs .+2 ; 0x1946c 1946a: 93 c0 rjmp .+294 ; 0x19592 1946c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 19470: 0e 94 a7 62 call 0xc54e ; 0xc54e 19474: 81 11 cpse r24, r1 19476: 0e 94 98 64 call 0xc930 ; 0xc930 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1947a: 89 ef ldi r24, 0xF9 ; 249 1947c: 98 e4 ldi r25, 0x48 ; 72 1947e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19482: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 19486: 84 e6 ldi r24, 0x64 ; 100 19488: 98 e4 ldi r25, 0x48 ; 72 1948a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1948e: f1 2c mov r15, r1 19490: e1 2c mov r14, r1 19492: 07 ee ldi r16, 0xE7 ; 231 19494: 13 e0 ldi r17, 0x03 ; 3 19496: 2a e0 ldi r18, 0x0A ; 10 19498: 30 e0 ldi r19, 0x00 ; 0 1949a: 40 e1 ldi r20, 0x10 ; 16 1949c: 6e e8 ldi r22, 0x8E ; 142 1949e: 72 e0 ldi r23, 0x02 ; 2 194a0: 0e 94 c9 6f call 0xdf92 ; 0xdf92 menuitems_temperature_common(); 194a4: 0e 94 00 c9 call 0x19200 ; 0x19200 MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 194a8: 8d e5 ldi r24, 0x5D ; 93 194aa: 98 e4 ldi r25, 0x48 ; 72 194ac: 0e 94 95 75 call 0xeb2a ; 0xeb2a 194b0: 2a e0 ldi r18, 0x0A ; 10 194b2: 30 e0 ldi r19, 0x00 ; 0 194b4: 40 e1 ldi r20, 0x10 ; 16 194b6: 65 e7 ldi r22, 0x75 ; 117 194b8: 72 e0 ldi r23, 0x02 ; 2 194ba: 0e 94 c9 6f call 0xdf92 ; 0xdf92 #ifdef LA_LIVE_K MENU_ITEM_EDIT_advance_K(); #endif #ifdef FILAMENTCHANGEENABLE if (!farm_mode) 194be: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 194c2: 81 11 cpse r24, r1 194c4: 08 c0 rjmp .+16 ; 0x194d6 MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change); 194c6: 8b e4 ldi r24, 0x4B ; 75 194c8: 98 e4 ldi r25, 0x48 ; 72 194ca: 0e 94 95 75 call 0xeb2a ; 0xeb2a 194ce: 60 e9 ldi r22, 0x90 ; 144 194d0: 7c ed ldi r23, 0xDC ; 220 194d2: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 194d6: 0e 94 90 66 call 0xcd20 ; 0xcd20 194da: 88 23 and r24, r24 194dc: 41 f0 breq .+16 ; 0x194ee MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 194de: 83 e8 ldi r24, 0x83 ; 131 194e0: 92 e6 ldi r25, 0x62 ; 98 194e2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 194e6: 6c e7 ldi r22, 0x7C ; 124 194e8: 74 e8 ldi r23, 0x84 ; 132 194ea: 0e 94 e4 8d call 0x11bc8 ; 0x11bc8 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 194ee: 8d e3 ldi r24, 0x3D ; 61 194f0: 98 e4 ldi r25, 0x48 ; 72 194f2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 194f6: 6e e4 ldi r22, 0x4E ; 78 194f8: 70 ec ldi r23, 0xC0 ; 192 194fa: 0e 94 4e 73 call 0xe69c ; 0xe69c #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 194fe: 80 91 01 13 lds r24, 0x1301 ; 0x801301 19502: 81 30 cpi r24, 0x01 ; 1 19504: 11 f4 brne .+4 ; 0x1950a { menuitems_MMU_settings_common(); 19506: 0e 94 16 bf call 0x17e2c ; 0x17e2c } SETTINGS_FANS_CHECK(); 1950a: 0e 94 fc be call 0x17df8 ; 0x17df8 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 1950e: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19512: 81 11 cpse r24, r1 19514: 02 c0 rjmp .+4 ; 0x1951a 19516: 0e 94 db be call 0x17db6 ; 0x17db6 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1951a: 80 91 47 04 lds r24, 0x0447 ; 0x800447 1951e: 82 30 cpi r24, 0x02 ; 2 19520: 91 f1 breq .+100 ; 0x19586 19522: 83 30 cpi r24, 0x03 ; 3 19524: 99 f1 breq .+102 ; 0x1958c 19526: 81 30 cpi r24, 0x01 ; 1 19528: 59 f1 breq .+86 ; 0x19580 1952a: 86 e3 ldi r24, 0x36 ; 54 1952c: 98 e4 ldi r25, 0x48 ; 72 1952e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19532: ec 01 movw r28, r24 19534: 8e e2 ldi r24, 0x2E ; 46 19536: 98 e4 ldi r25, 0x48 ; 72 19538: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1953c: 22 e0 ldi r18, 0x02 ; 2 1953e: 40 e8 ldi r20, 0x80 ; 128 19540: 5d eb ldi r21, 0xBD ; 189 19542: be 01 movw r22, r28 19544: 0e 94 b9 75 call 0xeb72 ; 0xeb72 if (backlightSupport) { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); 19548: 0e 94 de 62 call 0xc5bc ; 0xc5bc calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1954c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19550: 8f 5f subi r24, 0xFF ; 255 19552: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19556: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1955a: 8f 5f subi r24, 0xFF ; 255 1955c: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19560: 80 cf rjmp .-256 ; 0x19462 { // 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) 19562: 20 91 a4 03 lds r18, 0x03A4 ; 0x8003a4 19566: 30 91 a5 03 lds r19, 0x03A5 ; 0x8003a5 1956a: 28 17 cp r18, r24 1956c: 39 07 cpc r19, r25 1956e: 09 f4 brne .+2 ; 0x19572 19570: 6e cf rjmp .-292 ; 0x1944e { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 19572: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 19576: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 calculate_extruder_multipliers(); 1957a: 0e 94 a5 64 call 0xc94a ; 0xc94a 1957e: 67 cf rjmp .-306 ; 0x1944e menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 19580: 87 e2 ldi r24, 0x27 ; 39 19582: 98 e4 ldi r25, 0x48 ; 72 19584: d4 cf rjmp .-88 ; 0x1952e 19586: 86 e1 ldi r24, 0x16 ; 22 19588: 9b e4 ldi r25, 0x4B ; 75 1958a: d1 cf rjmp .-94 ; 0x1952e 1958c: 8e e1 ldi r24, 0x1E ; 30 1958e: 98 e4 ldi r25, 0x48 ; 72 19590: ce cf rjmp .-100 ; 0x1952e { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 19592: df 91 pop r29 19594: cf 91 pop r28 19596: 1f 91 pop r17 19598: 0f 91 pop r16 1959a: ff 90 pop r15 1959c: ef 90 pop r14 1959e: 08 95 ret 000195a0 : MENU_END(); } static void lcd_settings_menu() { 195a0: 1f 93 push r17 195a2: cf 93 push r28 195a4: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 195a6: 8f ef ldi r24, 0xFF ; 255 195a8: 9f e0 ldi r25, 0x0F ; 15 195aa: 0f 94 3e a4 call 0x3487c ; 0x3487c 195ae: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb MENU_BEGIN(); 195b2: 0e 94 67 74 call 0xe8ce ; 0xe8ce 195b6: 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 195ba: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 195bc: 80 91 60 04 lds r24, 0x0460 ; 0x800460 195c0: 84 30 cpi r24, 0x04 ; 4 195c2: 08 f0 brcs .+2 ; 0x195c6 195c4: 45 c1 rjmp .+650 ; 0x19850 195c6: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 195ca: 89 ef ldi r24, 0xF9 ; 249 195cc: 98 e4 ldi r25, 0x48 ; 72 195ce: 0e 94 95 75 call 0xeb2a ; 0xeb2a 195d2: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 195d6: 87 ec ldi r24, 0xC7 ; 199 195d8: 95 e4 ldi r25, 0x45 ; 69 195da: 0e 94 95 75 call 0xeb2a ; 0xeb2a 195de: 69 e3 ldi r22, 0x39 ; 57 195e0: 79 ec ldi r23, 0xC9 ; 201 195e2: 0e 94 4e 73 call 0xe69c ; 0xe69c if (!printer_active() || printingIsPaused()) 195e6: 0e 94 ec 66 call 0xcdd8 ; 0xcdd8 195ea: 88 23 and r24, r24 195ec: 21 f0 breq .+8 ; 0x195f6 195ee: 0e 94 90 66 call 0xcd20 ; 0xcd20 195f2: 88 23 and r24, r24 195f4: 81 f0 breq .+32 ; 0x19616 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 195f6: 8b eb ldi r24, 0xBB ; 187 195f8: 95 e4 ldi r25, 0x45 ; 69 195fa: 0e 94 95 75 call 0xeb2a ; 0xeb2a 195fe: 69 e8 ldi r22, 0x89 ; 137 19600: 71 ec ldi r23, 0xC1 ; 193 19602: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 19606: 88 ea ldi r24, 0xA8 ; 168 19608: 95 e4 ldi r25, 0x45 ; 69 1960a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1960e: 68 e6 ldi r22, 0x68 ; 104 19610: 79 e6 ldi r23, 0x69 ; 105 19612: 0e 94 e4 8d call 0x11bc8 ; 0x11bc8 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 19616: 8d e3 ldi r24, 0x3D ; 61 19618: 98 e4 ldi r25, 0x48 ; 72 1961a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1961e: 6e e4 ldi r22, 0x4E ; 78 19620: 70 ec ldi r23, 0xC0 ; 192 19622: 0e 94 4e 73 call 0xe69c ; 0xe69c #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); 19626: 8c ea ldi r24, 0xAC ; 172 19628: 9c e0 ldi r25, 0x0C ; 12 1962a: 0f 94 3e a4 call 0x3487c ; 0x3487c 1962e: 88 23 and r24, r24 19630: 09 f4 brne .+2 ; 0x19634 19632: 91 c0 rjmp .+290 ; 0x19756 19634: 8c e5 ldi r24, 0x5C ; 92 19636: 93 e6 ldi r25, 0x63 ; 99 19638: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1963c: 22 e0 ldi r18, 0x02 ; 2 1963e: 4e e1 ldi r20, 0x1E ; 30 19640: 5e eb ldi r21, 0xBE ; 190 19642: bc 01 movw r22, r24 19644: 8d e5 ldi r24, 0x5D ; 93 19646: 94 e8 ldi r25, 0x84 ; 132 19648: 0e 94 b9 75 call 0xeb72 ; 0xeb72 if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 1964c: 8c ea ldi r24, 0xAC ; 172 1964e: 9c e0 ldi r25, 0x0C ; 12 19650: 0f 94 3e a4 call 0x3487c ; 0x3487c 19654: 88 23 and r24, r24 19656: 31 f0 breq .+12 ; 0x19664 { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 19658: 62 e8 ldi r22, 0x82 ; 130 1965a: 7e ec ldi r23, 0xCE ; 206 1965c: 83 e5 ldi r24, 0x53 ; 83 1965e: 94 e8 ldi r25, 0x84 ; 132 19660: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 } if (MMU2::mmu2.Enabled()) 19664: 80 91 01 13 lds r24, 0x1301 ; 0x801301 19668: 81 30 cpi r24, 0x01 ; 1 1966a: 51 f4 brne .+20 ; 0x19680 { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 1966c: 0e 94 16 bf call 0x17e2c ; 0x17e2c MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 19670: 89 e9 ldi r24, 0x99 ; 153 19672: 95 e4 ldi r25, 0x45 ; 69 19674: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19678: 60 ec ldi r22, 0xC0 ; 192 1967a: 7d ec ldi r23, 0xCD ; 205 1967c: 0e 94 4e 73 call 0xe69c ; 0xe69c } SETTINGS_FANS_CHECK(); 19680: 0e 94 fc be call 0x17df8 ; 0x17df8 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 19684: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19688: 81 11 cpse r24, r1 1968a: 02 c0 rjmp .+4 ; 0x19690 1968c: 0e 94 db be call 0x17db6 ; 0x17db6 } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) 19690: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19694: 81 11 cpse r24, r1 19696: 62 c0 rjmp .+196 ; 0x1975c { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 19698: 10 93 ec 03 sts 0x03EC, r17 ; 0x8003ec MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 1969c: 8e e8 ldi r24, 0x8E ; 142 1969e: 95 e4 ldi r25, 0x45 ; 69 196a0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 196a4: 67 e4 ldi r22, 0x47 ; 71 196a6: 7f eb ldi r23, 0xBF ; 191 196a8: 0e 94 4e 73 call 0xe69c ; 0xe69c } 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); 196ac: 8d e2 ldi r24, 0x2D ; 45 196ae: 96 e4 ldi r25, 0x46 ; 70 196b0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 196b4: 67 ec ldi r22, 0xC7 ; 199 196b6: 77 ee ldi r23, 0xE7 ; 231 196b8: 0e 94 4e 73 call 0xe69c ; 0xe69c #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()) 196bc: 0f 94 3b 10 call 0x22076 ; 0x22076 196c0: 88 23 and r24, r24 196c2: b1 f0 breq .+44 ; 0x196f0 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); 196c4: 8f ea ldi r24, 0xAF ; 175 196c6: 9f e0 ldi r25, 0x0F ; 15 196c8: 0f 94 3e a4 call 0x3487c ; 0x3487c 196cc: 88 23 and r24, r24 196ce: 09 f4 brne .+2 ; 0x196d2 196d0: 4e c0 rjmp .+156 ; 0x1976e 196d2: 8c e5 ldi r24, 0x5C ; 92 196d4: 93 e6 ldi r25, 0x63 ; 99 196d6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 196da: ec 01 movw r28, r24 196dc: 85 ed ldi r24, 0xD5 ; 213 196de: 95 e4 ldi r25, 0x45 ; 69 196e0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 196e4: 22 e0 ldi r18, 0x02 ; 2 196e6: 45 e7 ldi r20, 0x75 ; 117 196e8: 5d eb ldi r21, 0xBD ; 189 196ea: be 01 movw r22, r28 196ec: 0e 94 b9 75 call 0xeb72 ; 0xeb72 #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); 196f0: 0e 94 90 66 call 0xcd20 ; 0xcd20 196f4: 81 11 cpse r24, r1 196f6: 08 c0 rjmp .+16 ; 0x19708 196f8: 86 ef ldi r24, 0xF6 ; 246 196fa: 97 e4 ldi r25, 0x47 ; 71 196fc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19700: 63 e5 ldi r22, 0x53 ; 83 19702: 75 ed ldi r23, 0xD5 ; 213 19704: 0e 94 4e 73 call 0xe69c ; 0xe69c #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 19708: 8c e6 ldi r24, 0x6C ; 108 1970a: 95 e4 ldi r25, 0x45 ; 69 1970c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19710: 66 ec ldi r22, 0xC6 ; 198 19712: 73 ee ldi r23, 0xE3 ; 227 19714: 0e 94 4e 73 call 0xe69c ; 0xe69c #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode 19718: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1971c: 81 11 cpse r24, r1 1971e: 47 c0 rjmp .+142 ; 0x197ae if (card.ToshibaFlashAir_isEnabled()) 19720: 80 91 48 16 lds r24, 0x1648 ; 0x801648 19724: 88 23 and r24, r24 19726: 31 f1 breq .+76 ; 0x19774 MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 19728: 82 e6 ldi r24, 0x62 ; 98 1972a: 95 e4 ldi r25, 0x45 ; 69 1972c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19730: 22 e0 ldi r18, 0x02 ; 2 19732: 4b e6 ldi r20, 0x6B ; 107 19734: 5d eb ldi r21, 0xBD ; 189 19736: 61 ec ldi r22, 0xC1 ; 193 19738: 78 e6 ldi r23, 0x68 ; 104 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 1973a: 0e 94 b9 75 call 0xeb72 ; 0xeb72 #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 1973e: 89 e0 ldi r24, 0x09 ; 9 19740: 9f e0 ldi r25, 0x0F ; 15 19742: 0f 94 3e a4 call 0x3487c ; 0x3487c 19746: 88 23 and r24, r24 19748: 19 f1 breq .+70 ; 0x19790 1974a: 81 30 cpi r24, 0x01 ; 1 1974c: 09 f4 brne .+2 ; 0x19750 1974e: 71 c0 rjmp .+226 ; 0x19832 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); 19750: 83 e4 ldi r24, 0x43 ; 67 19752: 9b e4 ldi r25, 0x4B ; 75 19754: 1f c0 rjmp .+62 ; 0x19794 #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); 19756: 86 e5 ldi r24, 0x56 ; 86 19758: 93 e6 ldi r25, 0x63 ; 99 1975a: 6e cf rjmp .-292 ; 0x19638 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); 1975c: 8e e7 ldi r24, 0x7E ; 126 1975e: 95 e4 ldi r25, 0x45 ; 69 19760: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19764: 60 e1 ldi r22, 0x10 ; 16 19766: 79 ee ldi r23, 0xE9 ; 233 19768: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 1976c: 9f cf rjmp .-194 ; 0x196ac #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); 1976e: 86 e5 ldi r24, 0x56 ; 86 19770: 93 e6 ldi r25, 0x63 ; 99 19772: b1 cf rjmp .-158 ; 0x196d6 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); 19774: 89 e5 ldi r24, 0x59 ; 89 19776: 95 e4 ldi r25, 0x45 ; 69 19778: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1977c: ec 01 movw r28, r24 1977e: 82 e6 ldi r24, 0x62 ; 98 19780: 95 e4 ldi r25, 0x45 ; 69 19782: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19786: 22 e0 ldi r18, 0x02 ; 2 19788: 4b e6 ldi r20, 0x6B ; 107 1978a: 5d eb ldi r21, 0xBD ; 189 1978c: be 01 movw r22, r28 1978e: d5 cf rjmp .-86 ; 0x1973a #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; 19790: 82 e5 ldi r24, 0x52 ; 82 19792: 95 e4 ldi r25, 0x45 ; 69 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); 19794: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19798: ec 01 movw r28, r24 1979a: 8b e4 ldi r24, 0x4B ; 75 1979c: 95 e4 ldi r25, 0x45 ; 69 1979e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 197a2: 22 e0 ldi r18, 0x02 ; 2 197a4: 47 e9 ldi r20, 0x97 ; 151 197a6: 5d eb ldi r21, 0xBD ; 189 197a8: be 01 movw r22, r28 197aa: 0e 94 b9 75 call 0xeb72 ; 0xeb72 } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 197ae: 80 91 47 04 lds r24, 0x0447 ; 0x800447 197b2: 82 30 cpi r24, 0x02 ; 2 197b4: 09 f4 brne .+2 ; 0x197b8 197b6: 43 c0 rjmp .+134 ; 0x1983e 197b8: 83 30 cpi r24, 0x03 ; 3 197ba: 09 f4 brne .+2 ; 0x197be 197bc: 43 c0 rjmp .+134 ; 0x19844 197be: 81 30 cpi r24, 0x01 ; 1 197c0: d9 f1 breq .+118 ; 0x19838 197c2: 86 e3 ldi r24, 0x36 ; 54 197c4: 98 e4 ldi r25, 0x48 ; 72 197c6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 197ca: ec 01 movw r28, r24 197cc: 8e e2 ldi r24, 0x2E ; 46 197ce: 98 e4 ldi r25, 0x48 ; 72 197d0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 197d4: 22 e0 ldi r18, 0x02 ; 2 197d6: 40 e8 ldi r20, 0x80 ; 128 197d8: 5d eb ldi r21, 0xBD ; 189 197da: be 01 movw r22, r28 197dc: 0e 94 b9 75 call 0xeb72 ; 0xeb72 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 197e0: 87 ea ldi r24, 0xA7 ; 167 197e2: 9c e0 ldi r25, 0x0C ; 12 197e4: 0f 94 3e a4 call 0x3487c ; 0x3487c 197e8: 88 23 and r24, r24 197ea: 79 f1 breq .+94 ; 0x1984a 197ec: 82 ea ldi r24, 0xA2 ; 162 197ee: 98 e4 ldi r25, 0x48 ; 72 197f0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 197f4: 22 e0 ldi r18, 0x02 ; 2 197f6: 41 ef ldi r20, 0xF1 ; 241 197f8: 5c eb ldi r21, 0xBC ; 188 197fa: bc 01 movw r22, r24 197fc: 84 eb ldi r24, 0xB4 ; 180 197fe: 98 e6 ldi r25, 0x68 ; 104 19800: 0e 94 b9 75 call 0xeb72 ; 0xeb72 if (farm_mode) 19804: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19808: 88 23 and r24, r24 1980a: 31 f0 breq .+12 ; 0x19818 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); 1980c: 62 e4 ldi r22, 0x42 ; 66 1980e: 77 ee ldi r23, 0xE7 ; 231 19810: 81 e4 ldi r24, 0x41 ; 65 19812: 94 e8 ldi r25, 0x84 ; 132 19814: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 } MENU_END(); 19818: 0e 94 de 62 call 0xc5bc ; 0xc5bc } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1981c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19820: 8f 5f subi r24, 0xFF ; 255 19822: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19826: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1982a: 8f 5f subi r24, 0xFF ; 255 1982c: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19830: c5 ce rjmp .-630 ; 0x195bc 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; 19832: 80 e4 ldi r24, 0x40 ; 64 19834: 95 e4 ldi r25, 0x45 ; 69 19836: ae cf rjmp .-164 ; 0x19794 default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 19838: 87 e2 ldi r24, 0x27 ; 39 1983a: 98 e4 ldi r25, 0x48 ; 72 1983c: c4 cf rjmp .-120 ; 0x197c6 1983e: 86 e1 ldi r24, 0x16 ; 22 19840: 9b e4 ldi r25, 0x4B ; 75 19842: c1 cf rjmp .-126 ; 0x197c6 19844: 8e e1 ldi r24, 0x1E ; 30 19846: 98 e4 ldi r25, 0x48 ; 72 19848: be cf rjmp .-132 ; 0x197c6 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 1984a: 88 ea ldi r24, 0xA8 ; 168 1984c: 98 e4 ldi r25, 0x48 ; 72 1984e: d0 cf rjmp .-96 ; 0x197f0 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 19850: df 91 pop r29 19852: cf 91 pop r28 19854: 1f 91 pop r17 19856: 08 95 ret 00019858 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 19858: 0e 94 67 74 call 0xe8ce ; 0xe8ce 1985c: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19860: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19864: 84 30 cpi r24, 0x04 ; 4 19866: 08 f0 brcs .+2 ; 0x1986a 19868: 7d c0 rjmp .+250 ; 0x19964 1986a: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1986e: 89 ef ldi r24, 0xF9 ; 249 19870: 98 e4 ldi r25, 0x48 ; 72 19872: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19876: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1987a: 8a e6 ldi r24, 0x6A ; 106 1987c: 96 e4 ldi r25, 0x46 ; 70 1987e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19882: 60 e2 ldi r22, 0x20 ; 32 19884: 79 ef ldi r23, 0xF9 ; 249 19886: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 if (lcd_commands_type == LcdCommands::Idle) 1988a: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1988e: 81 11 cpse r24, r1 19890: 08 c0 rjmp .+16 ; 0x198a2 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 19892: 89 ec ldi r24, 0xC9 ; 201 19894: 96 e4 ldi r25, 0x46 ; 70 19896: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1989a: 64 e8 ldi r22, 0x84 ; 132 1989c: 76 ed ldi r23, 0xD6 ; 214 1989e: 0e 94 4e 73 call 0xe69c ; 0xe69c } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 198a2: 83 e8 ldi r24, 0x83 ; 131 198a4: 92 e6 ldi r25, 0x62 ; 98 198a6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 198aa: 61 e7 ldi r22, 0x71 ; 113 198ac: 79 e6 ldi r23, 0x69 ; 105 198ae: 0e 94 e4 8d call 0x11bc8 ; 0x11bc8 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 198b2: 8f e5 ldi r24, 0x5F ; 95 198b4: 96 e4 ldi r25, 0x46 ; 70 198b6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 198ba: 67 e6 ldi r22, 0x67 ; 103 198bc: 71 ee ldi r23, 0xE1 ; 225 198be: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 198c2: 8f e4 ldi r24, 0x4F ; 79 198c4: 96 e4 ldi r25, 0x46 ; 70 198c6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 198ca: 6f e5 ldi r22, 0x5F ; 95 198cc: 72 ec ldi r23, 0xC2 ; 194 198ce: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 198d2: 81 e4 ldi r24, 0x41 ; 65 198d4: 96 e4 ldi r25, 0x46 ; 70 198d6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 198da: 66 e6 ldi r22, 0x66 ; 102 198dc: 72 ec ldi r23, 0xC2 ; 194 198de: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 198e2: 8d e2 ldi r24, 0x2D ; 45 198e4: 96 e4 ldi r25, 0x46 ; 70 198e6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 198ea: 6d e6 ldi r22, 0x6D ; 109 198ec: 72 ec ldi r23, 0xC2 ; 194 198ee: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 198f2: 89 e1 ldi r24, 0x19 ; 25 198f4: 96 e4 ldi r25, 0x46 ; 70 198f6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 198fa: 69 e5 ldi r22, 0x59 ; 89 198fc: 79 ec ldi r23, 0xC9 ; 201 198fe: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 19902: 87 e0 ldi r24, 0x07 ; 7 19904: 96 e4 ldi r25, 0x46 ; 70 19906: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1990a: 63 e7 ldi r22, 0x73 ; 115 1990c: 7e eb ldi r23, 0xBE ; 190 1990e: 0e 94 4e 73 call 0xe69c ; 0xe69c #ifndef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_SHOW_END_STOPS), menu_show_end_stops); 19912: 86 ef ldi r24, 0xF6 ; 246 19914: 95 e4 ldi r25, 0x45 ; 69 19916: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1991a: 68 e5 ldi r22, 0x58 ; 88 1991c: 7d ed ldi r23, 0xDD ; 221 1991e: 0e 94 4e 73 call 0xe69c ; 0xe69c #endif MENU_ITEM_GCODE_P(_T(MSG_CALIBRATE_BED_RESET), PSTR("M44")); 19922: 82 ee ldi r24, 0xE2 ; 226 19924: 95 e4 ldi r25, 0x45 ; 69 19926: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1992a: 61 e6 ldi r22, 0x61 ; 97 1992c: 74 e8 ldi r23, 0x84 ; 132 1992e: 0e 94 e4 8d call 0x11bc8 ; 0x11bc8 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 19932: 0f 94 3b 10 call 0x22076 ; 0x22076 19936: 88 23 and r24, r24 19938: 41 f0 breq .+16 ; 0x1994a MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1993a: 85 ed ldi r24, 0xD5 ; 213 1993c: 95 e4 ldi r25, 0x45 ; 69 1993e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19942: 64 e7 ldi r22, 0x74 ; 116 19944: 72 ec ldi r23, 0xC2 ; 194 19946: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); 1994a: 0e 94 de 62 call 0xc5bc ; 0xc5bc } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1994e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19952: 8f 5f subi r24, 0xFF ; 255 19954: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19958: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1995c: 8f 5f subi r24, 0xFF ; 255 1995e: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19962: 7e cf rjmp .-260 ; 0x19860 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 19964: 08 95 ret 00019966 : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 19966: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1996a: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1996e: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 19972: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 19976: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1997a: 20 91 57 02 lds r18, 0x0257 ; 0x800257 1997e: 30 91 58 02 lds r19, 0x0258 ; 0x800258 19982: 26 17 cp r18, r22 19984: 37 07 cpc r19, r23 19986: 0c f0 brlt .+2 ; 0x1998a 19988: 65 c0 rjmp .+202 ; 0x19a54 { if (lcd_encoder != 0) 1998a: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1998e: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 19992: 89 2b or r24, r25 19994: b9 f1 breq .+110 ; 0x19a04 { refresh_cmd_timeout(); 19996: 0e 94 9c 65 call 0xcb38 ; 0xcb38 } FORCE_INLINE bool planner_queue_full() { uint8_t next_block_index = block_buffer_head; 1999a: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e if (++ next_block_index == BLOCK_BUFFER_SIZE) 1999e: 8f 5f subi r24, 0xFF ; 255 199a0: 80 31 cpi r24, 0x10 ; 16 199a2: 09 f4 brne .+2 ; 0x199a6 next_block_index = 0; 199a4: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 199a6: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f if (! planner_queue_full()) 199aa: 98 17 cp r25, r24 199ac: 59 f1 breq .+86 ; 0x19a04 { current_position[E_AXIS] += lcd_encoder; 199ae: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 199b2: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 199b6: 07 2e mov r0, r23 199b8: 00 0c add r0, r0 199ba: 88 0b sbc r24, r24 199bc: 99 0b sbc r25, r25 199be: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 199c2: 9b 01 movw r18, r22 199c4: ac 01 movw r20, r24 199c6: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 199ca: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 199ce: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 199d2: 90 91 70 12 lds r25, 0x1270 ; 0x801270 199d6: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 199da: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 199de: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 199e2: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 199e6: 90 93 70 12 sts 0x1270, r25 ; 0x801270 lcd_encoder = 0; 199ea: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 199ee: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 199f2: 65 e5 ldi r22, 0x55 ; 85 199f4: 75 e5 ldi r23, 0x55 ; 85 199f6: 85 ed ldi r24, 0xD5 ; 213 199f8: 9f e3 ldi r25, 0x3F ; 63 199fa: 0f 94 a8 49 call 0x29350 ; 0x29350 lcd_draw_update = 1; 199fe: 81 e0 ldi r24, 0x01 ; 1 19a00: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } } if (lcd_draw_update) 19a04: 80 91 59 02 lds r24, 0x0259 ; 0x800259 19a08: 88 23 and r24, r24 19a0a: 11 f1 breq .+68 ; 0x19a50 { lcd_set_cursor(0, 1); 19a0c: 61 e0 ldi r22, 0x01 ; 1 19a0e: 80 e0 ldi r24, 0x00 ; 0 19a10: 0e 94 b5 6f call 0xdf6a ; 0xdf6a //! 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); 19a14: 80 91 70 12 lds r24, 0x1270 ; 0x801270 19a18: 8f 93 push r24 19a1a: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 19a1e: 8f 93 push r24 19a20: 80 91 6e 12 lds r24, 0x126E ; 0x80126e 19a24: 8f 93 push r24 19a26: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 19a2a: 8f 93 push r24 19a2c: 8c e2 ldi r24, 0x2C ; 44 19a2e: 93 e8 ldi r25, 0x83 ; 131 19a30: 9f 93 push r25 19a32: 8f 93 push r24 19a34: 8d e1 ldi r24, 0x1D ; 29 19a36: 93 e8 ldi r25, 0x83 ; 131 19a38: 9f 93 push r25 19a3a: 8f 93 push r24 19a3c: 0e 94 66 6f call 0xdecc ; 0xdecc 19a40: 8d b7 in r24, 0x3d ; 61 19a42: 9e b7 in r25, 0x3e ; 62 19a44: 08 96 adiw r24, 0x08 ; 8 19a46: 0f b6 in r0, 0x3f ; 63 19a48: f8 94 cli 19a4a: 9e bf out 0x3e, r25 ; 62 19a4c: 0f be out 0x3f, r0 ; 63 19a4e: 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(); 19a50: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 }; } void show_preheat_nozzle_warning() { lcd_clear(); 19a54: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 19a58: 85 e6 ldi r24, 0x65 ; 101 19a5a: 9a e3 ldi r25, 0x3A ; 58 19a5c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19a60: ac 01 movw r20, r24 19a62: 60 e0 ldi r22, 0x00 ; 0 19a64: 80 e0 ldi r24, 0x00 ; 0 19a66: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 19a6a: 8f e4 ldi r24, 0x4F ; 79 19a6c: 9a e3 ldi r25, 0x3A ; 58 19a6e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19a72: ac 01 movw r20, r24 19a74: 62 e0 ldi r22, 0x02 ; 2 19a76: 80 e0 ldi r24, 0x00 ; 0 19a78: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 _delay(2000); 19a7c: 60 ed ldi r22, 0xD0 ; 208 19a7e: 77 e0 ldi r23, 0x07 ; 7 19a80: 80 e0 ldi r24, 0x00 ; 0 19a82: 90 e0 ldi r25, 0x00 ; 0 19a84: 0f 94 ce 0a call 0x2159c ; 0x2159c lcd_clear(); 19a88: 0e 94 81 70 call 0xe102 ; 0xe102 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 19a8c: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 00019a90 : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 19a90: 0f 94 8d 6e call 0x2dd1a ; 0x2dd1a #endif menu_top = 0; 19a94: 10 92 92 03 sts 0x0392, r1 ; 0x800392 lcd_encoder = 0; 19a98: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 19a9c: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e menu_data_reset(); //Forces reloading of cached variables. 19aa0: 0c 94 0a 63 jmp 0xc614 ; 0xc614 00019aa4 : } } void CardReader::updir() { if(workDirDepth > 0) 19aa4: 80 91 77 15 lds r24, 0x1577 ; 0x801577 19aa8: 88 23 and r24, r24 19aaa: f9 f0 breq .+62 ; 0x19aea { --workDirDepth; 19aac: 81 50 subi r24, 0x01 ; 1 19aae: 80 93 77 15 sts 0x1577, r24 ; 0x801577 workDir = workDirParents[0]; 19ab2: 93 e2 ldi r25, 0x23 ; 35 19ab4: e5 ea ldi r30, 0xA5 ; 165 19ab6: f4 e1 ldi r31, 0x14 ; 20 19ab8: a2 e8 ldi r26, 0x82 ; 130 19aba: b4 e1 ldi r27, 0x14 ; 20 19abc: 01 90 ld r0, Z+ 19abe: 0d 92 st X+, r0 19ac0: 9a 95 dec r25 19ac2: e1 f7 brne .-8 ; 0x19abc 19ac4: 25 ea ldi r18, 0xA5 ; 165 19ac6: 34 e1 ldi r19, 0x14 ; 20 for (uint8_t d = 0; d < workDirDepth; d++) 19ac8: 90 e0 ldi r25, 0x00 ; 0 19aca: 98 17 cp r25, r24 19acc: 60 f4 brcc .+24 ; 0x19ae6 { workDirParents[d] = workDirParents[d+1]; 19ace: 43 e2 ldi r20, 0x23 ; 35 19ad0: f9 01 movw r30, r18 19ad2: b3 96 adiw r30, 0x23 ; 35 19ad4: d9 01 movw r26, r18 19ad6: 01 90 ld r0, Z+ 19ad8: 0d 92 st X+, r0 19ada: 4a 95 dec r20 19adc: e1 f7 brne .-8 ; 0x19ad6 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 19ade: 9f 5f subi r25, 0xFF ; 255 19ae0: 2d 5d subi r18, 0xDD ; 221 19ae2: 3f 4f sbci r19, 0xFF ; 255 19ae4: f2 cf rjmp .-28 ; 0x19aca { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 19ae6: 0f 94 8d 6e call 0x2dd1a ; 0x2dd1a } static void lcd_sd_updir() { card.updir(); menu_top = 0; 19aea: 10 92 92 03 sts 0x0392, r1 ; 0x800392 lcd_encoder = 0; 19aee: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 19af2: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e menu_data_reset(); //Forces reloading of cached variables. 19af6: 0c 94 0a 63 jmp 0xc614 ; 0xc614 00019afa : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 19afa: cf 93 push r28 MENU_BEGIN(); 19afc: 0e 94 67 74 call 0xe8ce ; 0xe8ce 19b00: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19b04: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19b08: 84 30 cpi r24, 0x04 ; 4 19b0a: 60 f5 brcc .+88 ; 0x19b64 19b0c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19b10: 89 ef ldi r24, 0xF9 ; 249 19b12: 98 e4 ldi r25, 0x48 ; 72 19b14: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19b18: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 19b1c: 86 e8 ldi r24, 0x86 ; 134 19b1e: 96 e4 ldi r25, 0x46 ; 70 19b20: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19b24: 61 e7 ldi r22, 0x71 ; 113 19b26: 7e ec ldi r23, 0xCE ; 206 19b28: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19b2c: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 19b2e: 8b e4 ldi r24, 0x4B ; 75 19b30: 97 e4 ldi r25, 0x47 ; 71 19b32: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19b36: 61 e3 ldi r22, 0x31 ; 49 19b38: 6c 0f add r22, r28 19b3a: 2c 2f mov r18, r28 19b3c: 40 e8 ldi r20, 0x80 ; 128 19b3e: 5e ec ldi r21, 0xCE ; 206 19b40: 0e 94 8a 72 call 0xe514 ; 0xe514 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++) 19b44: cf 5f subi r28, 0xFF ; 255 19b46: c5 30 cpi r28, 0x05 ; 5 19b48: 91 f7 brne .-28 ; 0x19b2e MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 19b4a: 0e 94 de 62 call 0xc5bc ; 0xc5bc static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 19b4e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19b52: 8f 5f subi r24, 0xFF ; 255 19b54: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19b58: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19b5c: 8f 5f subi r24, 0xFF ; 255 19b5e: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19b62: d0 cf rjmp .-96 ; 0x19b04 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(); } 19b64: cf 91 pop r28 19b66: 08 95 ret 00019b68 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 19b68: 84 e0 ldi r24, 0x04 ; 4 19b6a: 0d 94 5f 24 jmp 0x248be ; 0x248be 00019b6e : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 19b6e: 85 e0 ldi r24, 0x05 ; 5 19b70: 0d 94 5f 24 jmp 0x248be ; 0x248be 00019b74 : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 19b74: 86 e0 ldi r24, 0x06 ; 6 19b76: 0d 94 5f 24 jmp 0x248be ; 0x248be 00019b7a : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 19b7a: 87 e0 ldi r24, 0x07 ; 7 19b7c: 0d 94 5f 24 jmp 0x248be ; 0x248be 00019b80 : 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); 19b80: 88 e0 ldi r24, 0x08 ; 8 19b82: 0d 94 5f 24 jmp 0x248be ; 0x248be 00019b86 : 19b86: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 19b8a: 81 ea ldi r24, 0xA1 ; 161 19b8c: 9d e0 ldi r25, 0x0D ; 13 19b8e: 0f 94 62 a4 call 0x348c4 ; 0x348c4 } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 19b92: 83 e0 ldi r24, 0x03 ; 3 19b94: 0c 94 5a 63 jmp 0xc6b4 ; 0xc6b4 00019b98 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 19b98: cf 93 push r28 MENU_BEGIN(); 19b9a: 0e 94 67 74 call 0xe8ce ; 0xe8ce 19b9e: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19ba2: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19ba6: 84 30 cpi r24, 0x04 ; 4 19ba8: 88 f5 brcc .+98 ; 0x19c0c 19baa: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 19bae: 0e 94 a7 62 call 0xc54e ; 0xc54e 19bb2: 81 11 cpse r24, r1 19bb4: 0f 94 0d 09 call 0x2121a ; 0x2121a clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19bb8: 89 ef ldi r24, 0xF9 ; 249 19bba: 98 e4 ldi r25, 0x48 ; 72 19bbc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19bc0: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 19bc4: 86 e8 ldi r24, 0x86 ; 134 19bc6: 96 e4 ldi r25, 0x46 ; 70 19bc8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19bcc: 6a e4 ldi r22, 0x4A ; 74 19bce: 7c ef ldi r23, 0xFC ; 252 19bd0: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19bd4: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 19bd6: 8b e4 ldi r24, 0x4B ; 75 19bd8: 97 e4 ldi r25, 0x47 ; 71 19bda: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19bde: 61 e3 ldi r22, 0x31 ; 49 19be0: 6c 0f add r22, r28 19be2: 2c 2f mov r18, r28 19be4: 45 e3 ldi r20, 0x35 ; 53 19be6: 5c ef ldi r21, 0xFC ; 252 19be8: 0e 94 8a 72 call 0xe514 ; 0xe514 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++) 19bec: cf 5f subi r28, 0xFF ; 255 19bee: c5 30 cpi r28, 0x05 ; 5 19bf0: 91 f7 brne .-28 ; 0x19bd6 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 19bf2: 0e 94 de 62 call 0xc5bc ; 0xc5bc // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 19bf6: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19bfa: 8f 5f subi r24, 0xFF ; 255 19bfc: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19c00: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19c04: 8f 5f subi r24, 0xFF ; 255 19c06: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19c0a: cb cf rjmp .-106 ; 0x19ba2 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(); } 19c0c: cf 91 pop r28 19c0e: 08 95 ret 00019c10 : } // 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)) { 19c10: ef 92 push r14 19c12: ff 92 push r15 19c14: 0f 93 push r16 19c16: 1f 93 push r17 19c18: cf 93 push r28 19c1a: 8c 01 movw r16, r24 19c1c: 7b 01 movw r14, r22 MENU_BEGIN(); 19c1e: 0e 94 67 74 call 0xe8ce ; 0xe8ce 19c22: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19c26: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19c2a: 84 30 cpi r24, 0x04 ; 4 19c2c: 28 f5 brcc .+74 ; 0x19c78 19c2e: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 19c32: 0e 94 a7 62 call 0xc54e ; 0xc54e 19c36: 81 11 cpse r24, r1 19c38: 0f 94 0d 09 call 0x2121a ; 0x2121a clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19c3c: 89 ef ldi r24, 0xF9 ; 249 19c3e: 98 e4 ldi r25, 0x48 ; 72 19c40: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19c44: 0e 94 29 73 call 0xe652 ; 0xe652 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19c48: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 19c4a: 61 e3 ldi r22, 0x31 ; 49 19c4c: 6c 0f add r22, r28 19c4e: 2c 2f mov r18, r28 19c50: a7 01 movw r20, r14 19c52: c8 01 movw r24, r16 19c54: 0e 94 8a 72 call 0xe514 ; 0xe514 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19c58: cf 5f subi r28, 0xFF ; 255 19c5a: c5 30 cpi r28, 0x05 ; 5 19c5c: b1 f7 brne .-20 ; 0x19c4a MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 19c5e: 0e 94 de 62 call 0xc5bc ; 0xc5bc // 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(); 19c62: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19c66: 8f 5f subi r24, 0xFF ; 255 19c68: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19c6c: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19c70: 8f 5f subi r24, 0xFF ; 255 19c72: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19c76: d7 cf rjmp .-82 ; 0x19c26 ); 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(); } 19c78: cf 91 pop r28 19c7a: 1f 91 pop r17 19c7c: 0f 91 pop r16 19c7e: ff 90 pop r15 19c80: ef 90 pop r14 19c82: 08 95 ret 00019c84 : 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); 19c84: 8f e8 ldi r24, 0x8F ; 143 19c86: 92 e6 ldi r25, 0x62 ; 98 19c88: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19c8c: 6a e5 ldi r22, 0x5A ; 90 19c8e: 7e ec ldi r23, 0xCE ; 206 19c90: 0c 94 08 ce jmp 0x19c10 ; 0x19c10 00019c94 : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 19c94: 8e e9 ldi r24, 0x9E ; 158 19c96: 92 e6 ldi r25, 0x62 ; 98 19c98: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19c9c: 66 e6 ldi r22, 0x66 ; 102 19c9e: 7e ec ldi r23, 0xCE ; 206 19ca0: 0c 94 08 ce jmp 0x19c10 ; 0x19c10 00019ca4 : 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); 19ca4: 8b e4 ldi r24, 0x4B ; 75 19ca6: 97 e4 ldi r25, 0x47 ; 71 19ca8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19cac: 6b ec ldi r22, 0xCB ; 203 19cae: 7b ef ldi r23, 0xFB ; 251 19cb0: 0c 94 08 ce jmp 0x19c10 ; 0x19c10 00019cb4 : 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){ 19cb4: cf 93 push r28 19cb6: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 19cb8: 0f 94 04 7a call 0x2f408 ; 0x2f408 19cbc: 88 23 and r24, r24 19cbe: 21 f0 breq .+8 ; 0x19cc8 19cc0: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 19cc2: cf 91 pop r28 19cc4: 0d 94 a7 9e jmp 0x33d4e ; 0x33d4e 19cc8: cf 91 pop r28 19cca: 08 95 ret 00019ccc : 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) { 19ccc: cf 93 push r28 19cce: c8 2f mov r28, r24 menu_back(); 19cd0: 0e 94 76 63 call 0xc6ec ; 0xc6ec MMU2::mmu2.eject_filament(filament, true); 19cd4: 61 e0 ldi r22, 0x01 ; 1 19cd6: 8c 2f mov r24, r28 19cd8: 0f 94 2a 9e call 0x33c54 ; 0x33c54 // Clear the filament action clearFilamentAction(); } 19cdc: 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(); 19cde: 0d 94 0d 09 jmp 0x2121a ; 0x2121a 00019ce2 : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.load_filament(i); 19ce2: 80 e0 ldi r24, 0x00 ; 0 19ce4: 0f 94 e7 9d call 0x33bce ; 0x33bce 19ce8: 81 e0 ldi r24, 0x01 ; 1 19cea: 0f 94 e7 9d call 0x33bce ; 0x33bce 19cee: 82 e0 ldi r24, 0x02 ; 2 19cf0: 0f 94 e7 9d call 0x33bce ; 0x33bce 19cf4: 83 e0 ldi r24, 0x03 ; 3 19cf6: 0f 94 e7 9d call 0x33bce ; 0x33bce 19cfa: 84 e0 ldi r24, 0x04 ; 4 19cfc: 0d 94 e7 9d jmp 0x33bce ; 0x33bce 00019d00 : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 19d00: 0d 94 e7 9d jmp 0x33bce ; 0x33bce 00019d04 : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 19d04: 80 e0 ldi r24, 0x00 ; 0 19d06: 0d 94 a1 95 jmp 0x32b42 ; 0x32b42 00019d0a : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 19d0a: 0e 94 67 74 call 0xe8ce ; 0xe8ce 19d0e: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19d12: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19d16: 84 30 cpi r24, 0x04 ; 4 19d18: 08 f0 brcs .+2 ; 0x19d1c 19d1a: 45 c0 rjmp .+138 ; 0x19da6 19d1c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 19d20: 8e e8 ldi r24, 0x8E ; 142 19d22: 95 e4 ldi r25, 0x45 ; 69 19d24: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19d28: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 19d2c: 65 e8 ldi r22, 0x85 ; 133 19d2e: 71 ec ldi r23, 0xC1 ; 193 19d30: 89 e4 ldi r24, 0x49 ; 73 19d32: 9d e0 ldi r25, 0x0D ; 13 19d34: 0e 94 80 76 call 0xed00 ; 0xed00 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 19d38: 60 e8 ldi r22, 0x80 ; 128 19d3a: 71 ec ldi r23, 0xC1 ; 193 19d3c: 84 e5 ldi r24, 0x54 ; 84 19d3e: 9d e0 ldi r25, 0x0D ; 13 19d40: 0e 94 80 76 call 0xed00 ; 0xed00 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 19d44: 6b e7 ldi r22, 0x7B ; 123 19d46: 71 ec ldi r23, 0xC1 ; 193 19d48: 8f e5 ldi r24, 0x5F ; 95 19d4a: 9d e0 ldi r25, 0x0D ; 13 19d4c: 0e 94 80 76 call 0xed00 ; 0xed00 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 19d50: 66 e7 ldi r22, 0x76 ; 118 19d52: 71 ec ldi r23, 0xC1 ; 193 19d54: 8a e6 ldi r24, 0x6A ; 106 19d56: 9d e0 ldi r25, 0x0D ; 13 19d58: 0e 94 80 76 call 0xed00 ; 0xed00 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 19d5c: 61 e7 ldi r22, 0x71 ; 113 19d5e: 71 ec ldi r23, 0xC1 ; 193 19d60: 85 e7 ldi r24, 0x75 ; 117 19d62: 9d e0 ldi r25, 0x0D ; 13 19d64: 0e 94 80 76 call 0xed00 ; 0xed00 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 19d68: 6c e6 ldi r22, 0x6C ; 108 19d6a: 71 ec ldi r23, 0xC1 ; 193 19d6c: 80 e8 ldi r24, 0x80 ; 128 19d6e: 9d e0 ldi r25, 0x0D ; 13 19d70: 0e 94 80 76 call 0xed00 ; 0xed00 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 19d74: 67 e6 ldi r22, 0x67 ; 103 19d76: 71 ec ldi r23, 0xC1 ; 193 19d78: 8b e8 ldi r24, 0x8B ; 139 19d7a: 9d e0 ldi r25, 0x0D ; 13 19d7c: 0e 94 80 76 call 0xed00 ; 0xed00 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 19d80: 62 e6 ldi r22, 0x62 ; 98 19d82: 71 ec ldi r23, 0xC1 ; 193 19d84: 86 e9 ldi r24, 0x96 ; 150 19d86: 9d e0 ldi r25, 0x0D ; 13 19d88: 0e 94 80 76 call 0xed00 ; 0xed00 MENU_END(); 19d8c: 0e 94 de 62 call 0xc5bc ; 0xc5bc lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 19d90: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19d94: 8f 5f subi r24, 0xFF ; 255 19d96: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19d9a: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19d9e: 8f 5f subi r24, 0xFF ; 255 19da0: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19da4: b6 cf rjmp .-148 ; 0x19d12 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(); } 19da6: 08 95 ret 00019da8 : } _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(); 19da8: 0e 94 3a 79 call 0xf274 ; 0xf274 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 19dac: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 } 19db0: 08 95 ret 00019db2 : //! |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() { 19db2: cf 93 push r28 19db4: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 19db6: 8f eb ldi r24, 0xBF ; 191 19db8: 9a e3 ldi r25, 0x3A ; 58 19dba: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19dbe: ac 01 movw r20, r24 19dc0: 60 e0 ldi r22, 0x00 ; 0 19dc2: 80 e0 ldi r24, 0x00 ; 0 19dc4: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 1, STR_SEPARATOR); 19dc8: 44 ec ldi r20, 0xC4 ; 196 19dca: 54 e8 ldi r21, 0x84 ; 132 19dcc: 61 e0 ldi r22, 0x01 ; 1 19dce: 80 e0 ldi r24, 0x00 ; 0 19dd0: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 19dd4: 62 e0 ldi r22, 0x02 ; 2 19dd6: 80 e0 ldi r24, 0x00 ; 0 19dd8: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 19ddc: 85 ee ldi r24, 0xE5 ; 229 19dde: 9f e0 ldi r25, 0x0F ; 15 19de0: 0f 94 46 a4 call 0x3488c ; 0x3488c 19de4: 9f 93 push r25 19de6: 8f 93 push r24 19de8: 7f 93 push r23 19dea: 6f 93 push r22 19dec: 1f 92 push r1 19dee: 88 e5 ldi r24, 0x58 ; 88 19df0: 8f 93 push r24 19df2: c6 e3 ldi r28, 0x36 ; 54 19df4: d3 e8 ldi r29, 0x83 ; 131 19df6: df 93 push r29 19df8: cf 93 push r28 19dfa: 0e 94 66 6f call 0xdecc ; 0xdecc { lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); lcd_puts_at_P(0, 1, STR_SEPARATOR); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 19dfe: 63 e0 ldi r22, 0x03 ; 3 19e00: 80 e0 ldi r24, 0x00 ; 0 19e02: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 19e06: 89 ee ldi r24, 0xE9 ; 233 19e08: 9f e0 ldi r25, 0x0F ; 15 19e0a: 0f 94 46 a4 call 0x3488c ; 0x3488c 19e0e: 9f 93 push r25 19e10: 8f 93 push r24 19e12: 7f 93 push r23 19e14: 6f 93 push r22 19e16: 1f 92 push r1 19e18: 89 e5 ldi r24, 0x59 ; 89 19e1a: 8f 93 push r24 19e1c: df 93 push r29 19e1e: cf 93 push r28 19e20: 0e 94 66 6f call 0xdecc ; 0xdecc } menu_back_if_clicked(); 19e24: 8d b7 in r24, 0x3d ; 61 19e26: 9e b7 in r25, 0x3e ; 62 19e28: 40 96 adiw r24, 0x10 ; 16 19e2a: 0f b6 in r0, 0x3f ; 63 19e2c: f8 94 cli 19e2e: 9e bf out 0x3e, r25 ; 62 19e30: 0f be out 0x3f, r0 ; 63 19e32: 8d bf out 0x3d, r24 ; 61 } 19e34: df 91 pop r29 19e36: 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(); 19e38: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 00019e3c : //! ---------------------- //! 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() { 19e3c: cf 92 push r12 19e3e: df 92 push r13 19e40: ef 92 push r14 19e42: ff 92 push r15 19e44: 0f 93 push r16 19e46: 1f 93 push r17 19e48: cf 93 push r28 19e4a: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 19e4c: 80 e6 ldi r24, 0x60 ; 96 19e4e: 9f e0 ldi r25, 0x0F ; 15 19e50: 0f 94 46 a4 call 0x3488c ; 0x3488c 19e54: 6b 01 movw r12, r22 19e56: 7c 01 movw r14, r24 lcd_home(); 19e58: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 lcd_printf_P(_N( 19e5c: 81 eb ldi r24, 0xB1 ; 177 19e5e: 9a e3 ldi r25, 0x3A ; 58 19e60: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19e64: 18 2f mov r17, r24 19e66: 09 2f mov r16, r25 19e68: 83 ea ldi r24, 0xA3 ; 163 19e6a: 9a e3 ldi r25, 0x3A ; 58 19e6c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19e70: ec 01 movw r28, r24 19e72: 83 e9 ldi r24, 0x93 ; 147 19e74: 9a e3 ldi r25, 0x3A ; 58 19e76: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19e7a: 2e e3 ldi r18, 0x3E ; 62 19e7c: 2f 93 push r18 19e7e: 20 e8 ldi r18, 0x80 ; 128 19e80: 2f 93 push r18 19e82: 1f 92 push r1 19e84: 1f 92 push r1 19e86: 0f 93 push r16 19e88: 1f 93 push r17 19e8a: 2d e3 ldi r18, 0x3D ; 61 19e8c: 2f 93 push r18 19e8e: 25 ef ldi r18, 0xF5 ; 245 19e90: 2f 93 push r18 19e92: 22 ec ldi r18, 0xC2 ; 194 19e94: 2f 93 push r18 19e96: 20 e9 ldi r18, 0x90 ; 144 19e98: 2f 93 push r18 19e9a: df 93 push r29 19e9c: cf 93 push r28 19e9e: 24 ec ldi r18, 0xC4 ; 196 19ea0: 34 e8 ldi r19, 0x84 ; 132 19ea2: 3f 93 push r19 19ea4: 2f 93 push r18 19ea6: 9f 93 push r25 19ea8: 8f 93 push r24 19eaa: 8b e1 ldi r24, 0x1B ; 27 19eac: 98 e6 ldi r25, 0x68 ; 104 19eae: 9f 93 push r25 19eb0: 8f 93 push r24 19eb2: 0e 94 66 6f call 0xdecc ; 0xdecc _T(MSG_MEASURED_SKEW), STR_SEPARATOR, _T(MSG_SLIGHT_SKEW), _deg(bed_skew_angle_mild), _T(MSG_SEVERE_SKEW), _deg(bed_skew_angle_extreme) ); lcd_set_cursor(15, 0); 19eb6: 60 e0 ldi r22, 0x00 ; 0 19eb8: 8f e0 ldi r24, 0x0F ; 15 19eba: 0e 94 b5 6f call 0xdf6a ; 0xdf6a if (angleDiff < 100){ 19ebe: 8d b7 in r24, 0x3d ; 61 19ec0: 9e b7 in r25, 0x3e ; 62 19ec2: 42 96 adiw r24, 0x12 ; 18 19ec4: 0f b6 in r0, 0x3f ; 63 19ec6: f8 94 cli 19ec8: 9e bf out 0x3e, r25 ; 62 19eca: 0f be out 0x3f, r0 ; 63 19ecc: 8d bf out 0x3d, r24 ; 61 19ece: 20 e0 ldi r18, 0x00 ; 0 19ed0: 30 e0 ldi r19, 0x00 ; 0 19ed2: 48 ec ldi r20, 0xC8 ; 200 19ed4: 52 e4 ldi r21, 0x42 ; 66 19ed6: c7 01 movw r24, r14 19ed8: b6 01 movw r22, r12 19eda: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 19ede: 87 ff sbrs r24, 7 19ee0: 32 c0 rjmp .+100 ; 0x19f46 } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 19ee2: 20 e0 ldi r18, 0x00 ; 0 19ee4: 30 e0 ldi r19, 0x00 ; 0 19ee6: 44 e3 ldi r20, 0x34 ; 52 19ee8: 53 e4 ldi r21, 0x43 ; 67 19eea: c7 01 movw r24, r14 19eec: b6 01 movw r22, r12 19eee: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 19ef2: 2b ed ldi r18, 0xDB ; 219 19ef4: 3f e0 ldi r19, 0x0F ; 15 19ef6: 49 e4 ldi r20, 0x49 ; 73 19ef8: 50 e4 ldi r21, 0x40 ; 64 19efa: 0f 94 65 a6 call 0x34cca ; 0x34cca <__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)); 19efe: 9f 93 push r25 19f00: 8f 93 push r24 19f02: 7f 93 push r23 19f04: 6f 93 push r22 19f06: 84 e1 ldi r24, 0x14 ; 20 19f08: 98 e6 ldi r25, 0x68 ; 104 19f0a: 9f 93 push r25 19f0c: 8f 93 push r24 19f0e: 0e 94 66 6f call 0xdecc ; 0xdecc 19f12: 0f 90 pop r0 19f14: 0f 90 pop r0 19f16: 0f 90 pop r0 19f18: 0f 90 pop r0 19f1a: 0f 90 pop r0 19f1c: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 19f1e: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 19f22: 88 23 and r24, r24 19f24: b9 f0 breq .+46 ; 0x19f54 menu_goto(lcd_menu_xyz_offset, 0, true); 19f26: 20 e0 ldi r18, 0x00 ; 0 19f28: 41 e0 ldi r20, 0x01 ; 1 19f2a: 70 e0 ldi r23, 0x00 ; 0 19f2c: 60 e0 ldi r22, 0x00 ; 0 19f2e: 89 ed ldi r24, 0xD9 ; 217 19f30: 9e ec ldi r25, 0xCE ; 206 } 19f32: df 91 pop r29 19f34: cf 91 pop r28 19f36: 1f 91 pop r17 19f38: 0f 91 pop r16 19f3a: ff 90 pop r15 19f3c: ef 90 pop r14 19f3e: df 90 pop r13 19f40: 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); 19f42: 0c 94 12 63 jmp 0xc624 ; 0xc624 ); 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)); 19f46: 8c e7 ldi r24, 0x7C ; 124 19f48: 98 e4 ldi r25, 0x48 ; 72 19f4a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 19f4e: 0e 94 78 6f call 0xdef0 ; 0xdef0 19f52: e5 cf rjmp .-54 ; 0x19f1e } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 19f54: df 91 pop r29 19f56: cf 91 pop r28 19f58: 1f 91 pop r17 19f5a: 0f 91 pop r16 19f5c: ff 90 pop r15 19f5e: ef 90 pop r14 19f60: df 90 pop r13 19f62: cf 90 pop r12 19f64: 08 95 ret 00019f66 : //! //! @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) 19f66: 4f 92 push r4 19f68: 5f 92 push r5 19f6a: 6f 92 push r6 19f6c: 7f 92 push r7 19f6e: 8f 92 push r8 19f70: 9f 92 push r9 19f72: af 92 push r10 19f74: bf 92 push r11 19f76: cf 92 push r12 19f78: df 92 push r13 19f7a: ef 92 push r14 19f7c: ff 92 push r15 19f7e: 0f 93 push r16 19f80: 1f 93 push r17 19f82: cf 93 push r28 19f84: df 93 push r29 19f86: 6c 01 movw r12, r24 19f88: 7b 01 movw r14, r22 19f8a: 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); 19f8e: 67 2b or r22, r23 19f90: 29 f0 breq .+10 ; 0x19f9c 19f92: 06 e0 ldi r16, 0x06 ; 6 19f94: 81 30 cpi r24, 0x01 ; 1 19f96: 29 f0 breq .+10 ; 0x19fa2 19f98: 05 e0 ldi r16, 0x05 ; 5 19f9a: 03 c0 rjmp .+6 ; 0x19fa2 19f9c: 04 e0 ldi r16, 0x04 ; 4 19f9e: 81 30 cpi r24, 0x01 ; 1 19fa0: d9 f3 breq .-10 ; 0x19f98 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 19fa2: 0e 94 81 70 call 0xe102 ; 0xe102 KEEPALIVE_STATE(PAUSED_FOR_USER); 19fa6: 84 e0 ldi r24, 0x04 ; 4 19fa8: 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; 19fac: 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; 19fae: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 19fb0: 03 50 subi r16, 0x03 ; 3 19fb2: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 19fb4: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 19fb8: 81 e0 ldi r24, 0x01 ; 1 19fba: 0e 94 b0 8a call 0x11560 ; 0x11560 if (lcd_encoder) 19fbe: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 19fc2: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 19fc6: 00 97 sbiw r24, 0x00 ; 0 19fc8: 09 f4 brne .+2 ; 0x19fcc 19fca: 9d c0 rjmp .+314 ; 0x1a106 { if (lcd_encoder < 0) 19fcc: 97 ff sbrs r25, 7 19fce: 88 c0 rjmp .+272 ; 0x1a0e0 { cursor_pos--; 19fd0: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 19fd2: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 19fd6: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } if (cursor_pos > 3) 19fda: c4 30 cpi r28, 0x04 ; 4 19fdc: 0c f4 brge .+2 ; 0x19fe0 19fde: 86 c0 rjmp .+268 ; 0x1a0ec { cursor_pos = 3; if (first < items_no - 3) 19fe0: 88 2d mov r24, r8 19fe2: 08 2c mov r0, r8 19fe4: 00 0c add r0, r0 19fe6: 99 0b sbc r25, r25 19fe8: 80 17 cp r24, r16 19fea: 91 07 cpc r25, r17 19fec: 0c f0 brlt .+2 ; 0x19ff0 19fee: 7a c0 rjmp .+244 ; 0x1a0e4 { first++; 19ff0: 83 94 inc r8 lcd_clear(); 19ff2: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 19ff6: 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); 19ff8: c1 14 cp r12, r1 19ffa: d1 04 cpc r13, r1 19ffc: 29 f0 breq .+10 ; 0x1a008 19ffe: a6 01 movw r20, r12 1a000: 60 e0 ldi r22, 0x00 ; 0 1a002: 80 e0 ldi r24, 0x00 ; 0 1a004: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 const bool last_visible = (first == items_no - 3); 1a008: a8 2c mov r10, r8 1a00a: 08 2c mov r0, r8 1a00c: 00 0c add r0, r0 1a00e: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1a010: e1 14 cp r14, r1 1a012: f1 04 cpc r15, r1 1a014: 29 f0 breq .+10 ; 0x1a020 1a016: 82 e0 ldi r24, 0x02 ; 2 1a018: 98 2e mov r9, r24 1a01a: a0 16 cp r10, r16 1a01c: b1 06 cpc r11, r17 1a01e: 11 f0 breq .+4 ; 0x1a024 1a020: 93 e0 ldi r25, 0x03 ; 3 1a022: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1a024: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1a026: df 5f subi r29, 0xFF ; 255 1a028: 43 e9 ldi r20, 0x93 ; 147 1a02a: 5a e6 ldi r21, 0x6A ; 106 1a02c: 6d 2f mov r22, r29 1a02e: 81 e0 ldi r24, 0x01 ; 1 1a030: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 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++) 1a034: 9d 12 cpse r9, r29 1a036: f7 cf rjmp .-18 ; 0x1a026 1a038: 48 2c mov r4, r8 1a03a: 08 2c mov r0, r8 1a03c: 00 0c add r0, r0 1a03e: 55 08 sbc r5, r5 1a040: 66 08 sbc r6, r6 1a042: 77 08 sbc r7, r7 1a044: 8f ef ldi r24, 0xFF ; 255 1a046: 48 1a sub r4, r24 1a048: 58 0a sbc r5, r24 1a04a: 68 0a sbc r6, r24 1a04c: 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++) 1a04e: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1a050: 93 94 inc r9 1a052: 69 2d mov r22, r9 1a054: 8a e0 ldi r24, 0x0A ; 10 1a056: 0e 94 b5 6f call 0xdf6a ; 0xdf6a 1a05a: c3 01 movw r24, r6 1a05c: b2 01 movw r22, r4 1a05e: 0e 94 36 72 call 0xe46c ; 0xe46c 1a062: 8f ef ldi r24, 0xFF ; 255 1a064: 48 1a sub r4, r24 1a066: 58 0a sbc r5, r24 1a068: 68 0a sbc r6, r24 1a06a: 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++) 1a06c: d9 11 cpse r29, r9 1a06e: f0 cf rjmp .-32 ; 0x1a050 { 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); 1a070: e1 14 cp r14, r1 1a072: f1 04 cpc r15, r1 1a074: 41 f0 breq .+16 ; 0x1a086 1a076: a0 16 cp r10, r16 1a078: b1 06 cpc r11, r17 1a07a: 29 f4 brne .+10 ; 0x1a086 1a07c: a7 01 movw r20, r14 1a07e: 63 e0 ldi r22, 0x03 ; 3 1a080: 81 e0 ldi r24, 0x01 ; 1 1a082: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1a086: 4b e6 ldi r20, 0x6B ; 107 1a088: 58 e8 ldi r21, 0x88 ; 136 1a08a: 61 e0 ldi r22, 0x01 ; 1 1a08c: 80 e0 ldi r24, 0x00 ; 0 1a08e: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_putc_at(0, cursor_pos, '>'); 1a092: 4e e3 ldi r20, 0x3E ; 62 1a094: 6c 2f mov r22, r28 1a096: 80 e0 ldi r24, 0x00 ; 0 1a098: 0e 94 6e 70 call 0xe0dc ; 0xe0dc _delay(100); 1a09c: 64 e6 ldi r22, 0x64 ; 100 1a09e: 70 e0 ldi r23, 0x00 ; 0 1a0a0: 80 e0 ldi r24, 0x00 ; 0 1a0a2: 90 e0 ldi r25, 0x00 ; 0 1a0a4: 0f 94 ce 0a call 0x2159c ; 0x2159c if (lcd_clicked()) 1a0a8: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1a0ac: 88 23 and r24, r24 1a0ae: 09 f4 brne .+2 ; 0x1a0b2 1a0b0: 81 cf rjmp .-254 ; 0x19fb4 { KEEPALIVE_STATE(IN_HANDLER); 1a0b2: 82 e0 ldi r24, 0x02 ; 2 1a0b4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(cursor_pos + first - 1); 1a0b8: 8f ef ldi r24, 0xFF ; 255 1a0ba: 8c 0f add r24, r28 1a0bc: 88 0d add r24, r8 } } } 1a0be: df 91 pop r29 1a0c0: cf 91 pop r28 1a0c2: 1f 91 pop r17 1a0c4: 0f 91 pop r16 1a0c6: ff 90 pop r15 1a0c8: ef 90 pop r14 1a0ca: df 90 pop r13 1a0cc: cf 90 pop r12 1a0ce: bf 90 pop r11 1a0d0: af 90 pop r10 1a0d2: 9f 90 pop r9 1a0d4: 8f 90 pop r8 1a0d6: 7f 90 pop r7 1a0d8: 6f 90 pop r6 1a0da: 5f 90 pop r5 1a0dc: 4f 90 pop r4 1a0de: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1a0e0: cf 5f subi r28, 0xFF ; 255 1a0e2: 77 cf rjmp .-274 ; 0x19fd2 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); 1a0e4: 87 e0 ldi r24, 0x07 ; 7 1a0e6: 0f 94 06 23 call 0x2460c ; 0x2460c 1a0ea: 85 cf rjmp .-246 ; 0x19ff6 } } if (cursor_pos < 1) 1a0ec: c1 11 cpse r28, r1 1a0ee: 84 cf rjmp .-248 ; 0x19ff8 { cursor_pos = 1; if (first > 0) 1a0f0: 18 14 cp r1, r8 1a0f2: 2c f4 brge .+10 ; 0x1a0fe { first--; 1a0f4: 8a 94 dec r8 lcd_clear(); 1a0f6: 0e 94 81 70 call 0xe102 ; 0xe102 } } if (cursor_pos < 1) { cursor_pos = 1; 1a0fa: c1 e0 ldi r28, 0x01 ; 1 1a0fc: 7d cf rjmp .-262 ; 0x19ff8 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1a0fe: 87 e0 ldi r24, 0x07 ; 7 1a100: 0f 94 06 23 call 0x2460c ; 0x2460c 1a104: fa cf rjmp .-12 ; 0x1a0fa cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1a106: c4 30 cpi r28, 0x04 ; 4 1a108: 0c f0 brlt .+2 ; 0x1a10c 1a10a: 6a cf rjmp .-300 ; 0x19fe0 1a10c: 75 cf rjmp .-278 ; 0x19ff8 0001a10e : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1a10e: ef 92 push r14 1a110: ff 92 push r15 1a112: 0f 93 push r16 1a114: 1f 93 push r17 1a116: cf 93 push r28 1a118: df 93 push r29 1a11a: 00 d0 rcall .+0 ; 0x1a11c 1a11c: 1f 92 push r1 1a11e: 1f 92 push r1 1a120: cd b7 in r28, 0x3d ; 61 1a122: de b7 in r29, 0x3e ; 62 1a124: 08 2f mov r16, r24 1a126: 16 2f mov r17, r22 1a128: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1a12a: 0f 94 04 7a call 0x2f408 ; 0x2f408 1a12e: 88 23 and r24, r24 1a130: d9 f0 breq .+54 ; 0x1a168 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) { 1a132: 0b 30 cpi r16, 0x0B ; 11 1a134: 29 f1 breq .+74 ; 0x1a180 1a136: 04 31 cpi r16, 0x14 ; 20 1a138: 31 f1 breq .+76 ; 0x1a186 /// @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()) { 1a13a: 87 e5 ldi r24, 0x57 ; 87 1a13c: e8 2e mov r14, r24 1a13e: e9 82 std Y+1, r14 ; 0x01 1a140: 0a 83 std Y+2, r16 ; 0x02 1a142: 1b 83 std Y+3, r17 ; 0x03 1a144: fc 82 std Y+4, r15 ; 0x04 1a146: ce 01 movw r24, r28 1a148: 01 96 adiw r24, 0x01 ; 1 1a14a: 0f 94 07 4e call 0x29c0e ; 0x29c0e 1a14e: 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)); 1a150: 47 e5 ldi r20, 0x57 ; 87 1a152: 50 2f mov r21, r16 1a154: 61 2f mov r22, r17 1a156: 7f 2d mov r23, r15 1a158: 0f 94 77 95 call 0x32aee ; 0x32aee 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)); 1a15c: 60 e0 ldi r22, 0x00 ; 0 1a15e: 80 e0 ldi r24, 0x00 ; 0 1a160: 0f 94 08 9d call 0x33a10 ; 0x33a10 1a164: 88 23 and r24, r24 1a166: 59 f3 breq .-42 ; 0x1a13e return true; } 1a168: 0f 90 pop r0 1a16a: 0f 90 pop r0 1a16c: 0f 90 pop r0 1a16e: 0f 90 pop r0 1a170: 0f 90 pop r0 1a172: df 91 pop r29 1a174: cf 91 pop r28 1a176: 1f 91 pop r17 1a178: 0f 91 pop r16 1a17a: ff 90 pop r15 1a17c: ef 90 pop r14 1a17e: 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); 1a180: 10 93 de 12 sts 0x12DE, r17 ; 0x8012de 1a184: da cf rjmp .-76 ; 0x1a13a break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1a186: 10 93 df 12 sts 0x12DF, r17 ; 0x8012df 1a18a: d7 cf rjmp .-82 ; 0x1a13a 0001a18c : #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) 1a18c: 82 30 cpi r24, 0x02 ; 2 1a18e: 91 05 cpc r25, r1 1a190: 38 f0 brcs .+14 ; 0x1a1a0 // 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 1a192: 88 0f add r24, r24 1a194: 99 1f adc r25, r25 1a196: 88 0f add r24, r24 1a198: 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, 1a19a: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1a19c: 01 97 sbiw r24, 0x01 ; 1 1a19e: f1 f7 brne .-4 ; 0x1a19c "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1a1a0: 08 95 ret 0001a1a2 : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1a1a2: cf 93 push r28 1a1a4: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1a1a6: 28 2f mov r18, r24 1a1a8: 30 e0 ldi r19, 0x00 ; 0 1a1aa: f9 01 movw r30, r18 1a1ac: e5 5f subi r30, 0xF5 ; 245 1a1ae: f8 47 sbci r31, 0x78 ; 120 1a1b0: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1a1b2: f9 01 movw r30, r18 1a1b4: eb 54 subi r30, 0x4B ; 75 1a1b6: f9 47 sbci r31, 0x79 ; 121 1a1b8: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1a1ba: f9 01 movw r30, r18 1a1bc: e1 5a subi r30, 0xA1 ; 161 1a1be: f9 47 sbci r31, 0x79 ; 121 1a1c0: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1a1c2: cc 23 and r28, r28 1a1c4: a1 f0 breq .+40 ; 0x1a1ee // 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); 1a1c6: 81 11 cpse r24, r1 1a1c8: 0e 94 d8 ba call 0x175b0 ; 0x175b0 if (*portInputRegister(port) & bit) return HIGH; 1a1cc: ec 2f mov r30, r28 1a1ce: f0 e0 ldi r31, 0x00 ; 0 1a1d0: ee 0f add r30, r30 1a1d2: ff 1f adc r31, r31 1a1d4: eb 5b subi r30, 0xBB ; 187 1a1d6: f9 47 sbci r31, 0x79 ; 121 1a1d8: a5 91 lpm r26, Z+ 1a1da: b4 91 lpm r27, Z 1a1dc: ec 91 ld r30, X 1a1de: ed 23 and r30, r29 1a1e0: 81 e0 ldi r24, 0x01 ; 1 1a1e2: 90 e0 ldi r25, 0x00 ; 0 1a1e4: 09 f4 brne .+2 ; 0x1a1e8 1a1e6: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1a1e8: df 91 pop r29 1a1ea: cf 91 pop r28 1a1ec: 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; 1a1ee: 80 e0 ldi r24, 0x00 ; 0 1a1f0: 90 e0 ldi r25, 0x00 ; 0 1a1f2: fa cf rjmp .-12 ; 0x1a1e8 0001a1f4 : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1a1f4: 1f 93 push r17 1a1f6: cf 93 push r28 1a1f8: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1a1fa: 28 2f mov r18, r24 1a1fc: 30 e0 ldi r19, 0x00 ; 0 1a1fe: f9 01 movw r30, r18 1a200: e5 5f subi r30, 0xF5 ; 245 1a202: f8 47 sbci r31, 0x78 ; 120 1a204: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1a206: f9 01 movw r30, r18 1a208: eb 54 subi r30, 0x4B ; 75 1a20a: f9 47 sbci r31, 0x79 ; 121 1a20c: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1a20e: f9 01 movw r30, r18 1a210: e1 5a subi r30, 0xA1 ; 161 1a212: f9 47 sbci r31, 0x79 ; 121 1a214: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1a216: cc 23 and r28, r28 1a218: a9 f0 breq .+42 ; 0x1a244 1a21a: 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); 1a21c: 81 11 cpse r24, r1 1a21e: 0e 94 d8 ba call 0x175b0 ; 0x175b0 out = portOutputRegister(port); 1a222: ec 2f mov r30, r28 1a224: f0 e0 ldi r31, 0x00 ; 0 1a226: ee 0f add r30, r30 1a228: ff 1f adc r31, r31 1a22a: e5 5d subi r30, 0xD5 ; 213 1a22c: f9 47 sbci r31, 0x79 ; 121 1a22e: a5 91 lpm r26, Z+ 1a230: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1a232: 8f b7 in r24, 0x3f ; 63 cli(); 1a234: f8 94 cli if (val == LOW) { *out &= ~bit; 1a236: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1a238: 11 11 cpse r17, r1 1a23a: 08 c0 rjmp .+16 ; 0x1a24c *out &= ~bit; 1a23c: d0 95 com r29 1a23e: de 23 and r29, r30 } else { *out |= bit; 1a240: dc 93 st X, r29 } SREG = oldSREG; 1a242: 8f bf out 0x3f, r24 ; 63 } 1a244: df 91 pop r29 1a246: cf 91 pop r28 1a248: 1f 91 pop r17 1a24a: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1a24c: de 2b or r29, r30 1a24e: f8 cf rjmp .-16 ; 0x1a240 0001a250 : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1a250: cf 93 push r28 1a252: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1a254: 90 e0 ldi r25, 0x00 ; 0 1a256: fc 01 movw r30, r24 1a258: eb 54 subi r30, 0x4B ; 75 1a25a: f9 47 sbci r31, 0x79 ; 121 1a25c: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1a25e: 81 5a subi r24, 0xA1 ; 161 1a260: 99 47 sbci r25, 0x79 ; 121 1a262: fc 01 movw r30, r24 1a264: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1a266: 88 23 and r24, r24 1a268: d1 f0 breq .+52 ; 0x1a29e // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1a26a: 90 e0 ldi r25, 0x00 ; 0 1a26c: 88 0f add r24, r24 1a26e: 99 1f adc r25, r25 1a270: fc 01 movw r30, r24 1a272: ef 5e subi r30, 0xEF ; 239 1a274: f9 47 sbci r31, 0x79 ; 121 1a276: a5 91 lpm r26, Z+ 1a278: b4 91 lpm r27, Z out = portOutputRegister(port); 1a27a: fc 01 movw r30, r24 1a27c: e5 5d subi r30, 0xD5 ; 213 1a27e: f9 47 sbci r31, 0x79 ; 121 1a280: c5 91 lpm r28, Z+ 1a282: d4 91 lpm r29, Z if (mode == INPUT) { 1a284: 61 11 cpse r22, r1 1a286: 0e c0 rjmp .+28 ; 0x1a2a4 uint8_t oldSREG = SREG; 1a288: 9f b7 in r25, 0x3f ; 63 cli(); 1a28a: f8 94 cli *reg &= ~bit; 1a28c: 8c 91 ld r24, X 1a28e: e2 2f mov r30, r18 1a290: e0 95 com r30 1a292: 8e 23 and r24, r30 1a294: 8c 93 st X, r24 *out &= ~bit; 1a296: 28 81 ld r18, Y 1a298: e2 23 and r30, r18 1a29a: e8 83 st Y, r30 SREG = oldSREG; 1a29c: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1a29e: df 91 pop r29 1a2a0: cf 91 pop r28 1a2a2: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1a2a4: 8f b7 in r24, 0x3f ; 63 cli(); 1a2a6: f8 94 cli *reg |= bit; 1a2a8: ec 91 ld r30, X 1a2aa: e2 2b or r30, r18 1a2ac: ec 93 st X, r30 SREG = oldSREG; 1a2ae: 8f bf out 0x3f, r24 ; 63 1a2b0: f6 cf rjmp .-20 ; 0x1a29e 0001a2b2 : // 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) { 1a2b2: 1f 93 push r17 1a2b4: cf 93 push r28 1a2b6: df 93 push r29 1a2b8: 18 2f mov r17, r24 1a2ba: 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); 1a2bc: 61 e0 ldi r22, 0x01 ; 1 1a2be: 0e 94 28 d1 call 0x1a250 ; 0x1a250 if (val == 0) 1a2c2: 20 97 sbiw r28, 0x00 ; 0 1a2c4: 39 f4 brne .+14 ; 0x1a2d4 { digitalWrite(pin, LOW); 1a2c6: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1a2c8: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1a2ca: df 91 pop r29 1a2cc: cf 91 pop r28 1a2ce: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1a2d0: 0c 94 fa d0 jmp 0x1a1f4 ; 0x1a1f4 pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1a2d4: cf 3f cpi r28, 0xFF ; 255 1a2d6: d1 05 cpc r29, r1 1a2d8: 11 f4 brne .+4 ; 0x1a2de { digitalWrite(pin, HIGH); 1a2da: 61 e0 ldi r22, 0x01 ; 1 1a2dc: f5 cf rjmp .-22 ; 0x1a2c8 } else { switch(digitalPinToTimer(pin)) 1a2de: e1 2f mov r30, r17 1a2e0: f0 e0 ldi r31, 0x00 ; 0 1a2e2: e5 5f subi r30, 0xF5 ; 245 1a2e4: f8 47 sbci r31, 0x78 ; 120 1a2e6: e4 91 lpm r30, Z 1a2e8: e1 50 subi r30, 0x01 ; 1 1a2ea: e2 31 cpi r30, 0x12 ; 18 1a2ec: 08 f0 brcs .+2 ; 0x1a2f0 1a2ee: b3 c0 rjmp .+358 ; 0x1a456 1a2f0: f0 e0 ldi r31, 0x00 ; 0 1a2f2: 88 27 eor r24, r24 1a2f4: e1 58 subi r30, 0x81 ; 129 1a2f6: fe 42 sbci r31, 0x2E ; 46 1a2f8: 8f 4f sbci r24, 0xFF ; 255 1a2fa: 0d 94 4e a5 jmp 0x34a9c ; 0x34a9c <__tablejump2__> 1a2fe: 91 d1 rcall .+802 ; 0x1a622 1a300: 99 d1 rcall .+818 ; 0x1a634 1a302: 9e d1 rcall .+828 ; 0x1a640 1a304: a8 d1 rcall .+848 ; 0x1a656 1a306: b2 d1 rcall .+868 ; 0x1a66c 1a308: 2b d2 rcall .+1110 ; 0x1a760 1a30a: bc d1 rcall .+888 ; 0x1a684 1a30c: c4 d1 rcall .+904 ; 0x1a696 1a30e: cc d1 rcall .+920 ; 0x1a6a8 1a310: d6 d1 rcall .+940 ; 0x1a6be 1a312: e0 d1 rcall .+960 ; 0x1a6d4 1a314: ea d1 rcall .+980 ; 0x1a6ea 1a316: f9 d1 rcall .+1010 ; 0x1a70a 1a318: 03 d2 rcall .+1030 ; 0x1a720 1a31a: 2b d2 rcall .+1110 ; 0x1a772 1a31c: 0d d2 rcall .+1050 ; 0x1a738 1a31e: 17 d2 rcall .+1070 ; 0x1a74e 1a320: 21 d2 rcall .+1090 ; 0x1a764 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1a322: 84 b5 in r24, 0x24 ; 36 1a324: 80 68 ori r24, 0x80 ; 128 1a326: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1a328: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1a32a: df 91 pop r29 1a32c: cf 91 pop r28 1a32e: 1f 91 pop r17 1a330: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1a332: 84 b5 in r24, 0x24 ; 36 1a334: 80 62 ori r24, 0x20 ; 32 1a336: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1a338: c8 bd out 0x28, r28 ; 40 1a33a: f7 cf rjmp .-18 ; 0x1a32a #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1a33c: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1a340: 80 68 ori r24, 0x80 ; 128 1a342: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1a346: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1a34a: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1a34e: ed cf rjmp .-38 ; 0x1a32a #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1a350: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1a354: 80 62 ori r24, 0x20 ; 32 1a356: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1a35a: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1a35e: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1a362: e3 cf rjmp .-58 ; 0x1a32a #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1a364: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1a368: 88 60 ori r24, 0x08 ; 8 1a36a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1a36e: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1a372: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1a376: d9 cf rjmp .-78 ; 0x1a32a #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1a378: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1a37c: 80 68 ori r24, 0x80 ; 128 1a37e: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1a382: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1a386: d1 cf rjmp .-94 ; 0x1a32a #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1a388: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1a38c: 80 62 ori r24, 0x20 ; 32 1a38e: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1a392: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1a396: c9 cf rjmp .-110 ; 0x1a32a #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1a398: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1a39c: 80 68 ori r24, 0x80 ; 128 1a39e: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1a3a2: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1a3a6: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1a3aa: bf cf rjmp .-130 ; 0x1a32a #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1a3ac: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1a3b0: 80 62 ori r24, 0x20 ; 32 1a3b2: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1a3b6: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1a3ba: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1a3be: b5 cf rjmp .-150 ; 0x1a32a #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1a3c0: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1a3c4: 88 60 ori r24, 0x08 ; 8 1a3c6: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1a3ca: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1a3ce: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1a3d2: ab cf rjmp .-170 ; 0x1a32a #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1a3d4: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a3d8: 80 68 ori r24, 0x80 ; 128 1a3da: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1a3de: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a3e2: 8f 7b andi r24, 0xBF ; 191 1a3e4: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1a3e8: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1a3ec: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1a3f0: 9c cf rjmp .-200 ; 0x1a32a #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1a3f2: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a3f6: 80 62 ori r24, 0x20 ; 32 1a3f8: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1a3fc: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1a400: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1a404: 92 cf rjmp .-220 ; 0x1a32a #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1a406: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a40a: 88 60 ori r24, 0x08 ; 8 1a40c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1a410: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1a414: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1a418: 88 cf rjmp .-240 ; 0x1a32a #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1a41a: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1a41e: 80 68 ori r24, 0x80 ; 128 1a420: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1a424: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1a428: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1a42c: 7e cf rjmp .-260 ; 0x1a32a #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1a42e: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1a432: 80 62 ori r24, 0x20 ; 32 1a434: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1a438: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1a43c: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1a440: 74 cf rjmp .-280 ; 0x1a32a #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1a442: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1a446: 88 60 ori r24, 0x08 ; 8 1a448: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1a44c: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1a450: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1a454: 6a cf rjmp .-300 ; 0x1a32a break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1a456: c0 38 cpi r28, 0x80 ; 128 1a458: d1 05 cpc r29, r1 1a45a: 0c f0 brlt .+2 ; 0x1a45e 1a45c: 3e cf rjmp .-388 ; 0x1a2da 1a45e: 33 cf rjmp .-410 ; 0x1a2c6 0001a460 : } } /// 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){ 1a460: 4f 92 push r4 1a462: 5f 92 push r5 1a464: 6f 92 push r6 1a466: 7f 92 push r7 1a468: 8f 92 push r8 1a46a: 9f 92 push r9 1a46c: af 92 push r10 1a46e: bf 92 push r11 1a470: cf 92 push r12 1a472: df 92 push r13 1a474: ef 92 push r14 1a476: ff 92 push r15 1a478: 0f 93 push r16 1a47a: 1f 93 push r17 1a47c: cf 93 push r28 1a47e: df 93 push r29 1a480: eb 01 movw r28, r22 1a482: 6a 01 movw r12, r20 1a484: 79 01 movw r14, r18 sm4_do_step(axes); 1a486: 0f 94 bb 25 call 0x24b76 ; 0x24b76 1a48a: f6 01 movw r30, r12 1a48c: 00 81 ld r16, Z 1a48e: 11 81 ldd r17, Z+1 ; 0x01 /// keep max speed (avoid extra computation) if (acc > 0 && delay_us == min_delay_us){ 1a490: 1c 16 cp r1, r28 1a492: 1d 06 cpc r1, r29 1a494: b4 f4 brge .+44 ; 0x1a4c2 1a496: 0e 15 cp r16, r14 1a498: 1f 05 cpc r17, r15 1a49a: 99 f4 brne .+38 ; 0x1a4c2 delayMicroseconds(delay_us); 1a49c: c8 01 movw r24, r16 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1a49e: df 91 pop r29 1a4a0: cf 91 pop r28 1a4a2: 1f 91 pop r17 1a4a4: 0f 91 pop r16 1a4a6: ff 90 pop r15 1a4a8: ef 90 pop r14 1a4aa: df 90 pop r13 1a4ac: cf 90 pop r12 1a4ae: bf 90 pop r11 1a4b0: af 90 pop r10 1a4b2: 9f 90 pop r9 1a4b4: 8f 90 pop r8 1a4b6: 7f 90 pop r7 1a4b8: 6f 90 pop r6 1a4ba: 5f 90 pop r5 1a4bc: 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); 1a4be: 0c 94 c6 d0 jmp 0x1a18c ; 0x1a18c return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1a4c2: b8 01 movw r22, r16 1a4c4: 90 e0 ldi r25, 0x00 ; 0 1a4c6: 80 e0 ldi r24, 0x00 ; 0 1a4c8: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 1a4cc: 2d eb ldi r18, 0xBD ; 189 1a4ce: 37 e3 ldi r19, 0x37 ; 55 1a4d0: 46 e8 ldi r20, 0x86 ; 134 1a4d2: 55 e3 ldi r21, 0x35 ; 53 1a4d4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1a4d8: 4b 01 movw r8, r22 1a4da: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1a4dc: be 01 movw r22, r28 1a4de: 0d 2e mov r0, r29 1a4e0: 00 0c add r0, r0 1a4e2: 88 0b sbc r24, r24 1a4e4: 99 0b sbc r25, r25 1a4e6: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1a4ea: a5 01 movw r20, r10 1a4ec: 94 01 movw r18, r8 1a4ee: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1a4f2: 2b 01 movw r4, r22 1a4f4: 3c 01 movw r6, r24 1a4f6: a5 01 movw r20, r10 1a4f8: 94 01 movw r18, r8 1a4fa: 6a e0 ldi r22, 0x0A ; 10 1a4fc: 77 ed ldi r23, 0xD7 ; 215 1a4fe: 83 e2 ldi r24, 0x23 ; 35 1a500: 9c e3 ldi r25, 0x3C ; 60 1a502: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1a506: 9b 01 movw r18, r22 1a508: ac 01 movw r20, r24 1a50a: c3 01 movw r24, r6 1a50c: b2 01 movw r22, r4 1a50e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1a512: 4b 01 movw r8, r22 1a514: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1a516: 2a e0 ldi r18, 0x0A ; 10 1a518: 37 ed ldi r19, 0xD7 ; 215 1a51a: 43 e2 ldi r20, 0x23 ; 35 1a51c: 5e e3 ldi r21, 0x3E ; 62 1a51e: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1a522: 18 16 cp r1, r24 1a524: dc f5 brge .+118 ; 0x1a59c 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)); 1a526: a5 01 movw r20, r10 1a528: 94 01 movw r18, r8 1a52a: 6a e0 ldi r22, 0x0A ; 10 1a52c: 77 ed ldi r23, 0xD7 ; 215 1a52e: 83 e2 ldi r24, 0x23 ; 35 1a530: 9c e3 ldi r25, 0x3C ; 60 1a532: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1a536: 20 e0 ldi r18, 0x00 ; 0 1a538: 34 e2 ldi r19, 0x24 ; 36 1a53a: 44 e7 ldi r20, 0x74 ; 116 1a53c: 59 e4 ldi r21, 0x49 ; 73 1a53e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__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); 1a542: 20 e0 ldi r18, 0x00 ; 0 1a544: 30 e0 ldi r19, 0x00 ; 0 1a546: 40 e0 ldi r20, 0x00 ; 0 1a548: 5f e3 ldi r21, 0x3F ; 63 1a54a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1a54e: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 1a552: 5b 01 movw r10, r22 1a554: 6e 15 cp r22, r14 1a556: 7f 05 cpc r23, r15 1a558: 08 f4 brcc .+2 ; 0x1a55c 1a55a: 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){ 1a55c: 0a 15 cp r16, r10 1a55e: 1b 05 cpc r17, r11 1a560: 31 f4 brne .+12 ; 0x1a56e 1a562: 20 97 sbiw r28, 0x00 ; 0 1a564: 21 f0 breq .+8 ; 0x1a56e if (acc > 0) 1a566: fc f0 brlt .+62 ; 0x1a5a6 t1--; 1a568: f1 e0 ldi r31, 0x01 ; 1 1a56a: af 1a sub r10, r31 1a56c: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1a56e: c5 01 movw r24, r10 1a570: 0e 94 c6 d0 call 0x1a18c ; 0x1a18c delay_us = t1; 1a574: f6 01 movw r30, r12 1a576: b1 82 std Z+1, r11 ; 0x01 1a578: a0 82 st Z, r10 } 1a57a: df 91 pop r29 1a57c: cf 91 pop r28 1a57e: 1f 91 pop r17 1a580: 0f 91 pop r16 1a582: ff 90 pop r15 1a584: ef 90 pop r14 1a586: df 90 pop r13 1a588: cf 90 pop r12 1a58a: bf 90 pop r11 1a58c: af 90 pop r10 1a58e: 9f 90 pop r9 1a590: 8f 90 pop r8 1a592: 7f 90 pop r7 1a594: 6f 90 pop r6 1a596: 5f 90 pop r5 1a598: 4f 90 pop r4 1a59a: 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 1a59c: 80 e1 ldi r24, 0x10 ; 16 1a59e: a8 2e mov r10, r24 1a5a0: 87 e2 ldi r24, 0x27 ; 39 1a5a2: b8 2e mov r11, r24 1a5a4: db cf rjmp .-74 ; 0x1a55c /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1a5a6: 8f ef ldi r24, 0xFF ; 255 1a5a8: a8 1a sub r10, r24 1a5aa: b8 0a sbc r11, r24 1a5ac: e0 cf rjmp .-64 ; 0x1a56e 0001a5ae : /// 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){ 1a5ae: 2f 92 push r2 1a5b0: 3f 92 push r3 1a5b2: 4f 92 push r4 1a5b4: 5f 92 push r5 1a5b6: 6f 92 push r6 1a5b8: 7f 92 push r7 1a5ba: 8f 92 push r8 1a5bc: 9f 92 push r9 1a5be: af 92 push r10 1a5c0: bf 92 push r11 1a5c2: cf 92 push r12 1a5c4: df 92 push r13 1a5c6: ef 92 push r14 1a5c8: ff 92 push r15 1a5ca: 0f 93 push r16 1a5cc: 1f 93 push r17 1a5ce: cf 93 push r28 1a5d0: df 93 push r29 1a5d2: 00 d0 rcall .+0 ; 0x1a5d4 1a5d4: cd b7 in r28, 0x3d ; 61 1a5d6: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1a5d8: f9 01 movw r30, r18 1a5da: e0 80 ld r14, Z 1a5dc: f1 80 ldd r15, Z+1 ; 0x01 1a5de: e1 14 cp r14, r1 1a5e0: f1 04 cpc r15, r1 1a5e2: 09 f4 brne .+2 ; 0x1a5e6 1a5e4: 6c c0 rjmp .+216 ; 0x1a6be 1a5e6: 16 16 cp r1, r22 1a5e8: 17 06 cpc r1, r23 1a5ea: 0c f0 brlt .+2 ; 0x1a5ee 1a5ec: 68 c0 rjmp .+208 ; 0x1a6be 1a5ee: 19 01 movw r2, r18 1a5f0: 5b 83 std Y+3, r21 ; 0x03 1a5f2: 4a 83 std Y+2, r20 ; 0x02 1a5f4: 6b 01 movw r12, r22 1a5f6: 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)); 1a5f8: fa 01 movw r30, r20 1a5fa: 00 81 ld r16, Z 1a5fc: 11 81 ldd r17, Z+1 ; 0x01 1a5fe: b8 01 movw r22, r16 1a600: 90 e0 ldi r25, 0x00 ; 0 1a602: 80 e0 ldi r24, 0x00 ; 0 1a604: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 1a608: 4b 01 movw r8, r22 1a60a: 5c 01 movw r10, r24 1a60c: b6 01 movw r22, r12 1a60e: 0d 2c mov r0, r13 1a610: 00 0c add r0, r0 1a612: 88 0b sbc r24, r24 1a614: 99 0b sbc r25, r25 1a616: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1a61a: 2b 01 movw r4, r22 1a61c: 3c 01 movw r6, r24 1a61e: a5 01 movw r20, r10 1a620: 94 01 movw r18, r8 1a622: c5 01 movw r24, r10 1a624: b4 01 movw r22, r8 1a626: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1a62a: 9b 01 movw r18, r22 1a62c: ac 01 movw r20, r24 1a62e: c3 01 movw r24, r6 1a630: b2 01 movw r22, r4 1a632: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1a636: 9b 01 movw r18, r22 1a638: ac 01 movw r20, r24 1a63a: 6a e0 ldi r22, 0x0A ; 10 1a63c: 77 ed ldi r23, 0xD7 ; 215 1a63e: 83 ea ldi r24, 0xA3 ; 163 1a640: 9b e3 ldi r25, 0x3B ; 59 1a642: 0f 94 65 a6 call 0x34cca ; 0x34cca <__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); 1a646: 20 e0 ldi r18, 0x00 ; 0 1a648: 30 e0 ldi r19, 0x00 ; 0 1a64a: 40 e0 ldi r20, 0x00 ; 0 1a64c: 5f e3 ldi r21, 0x3F ; 63 1a64e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1a652: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__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){ 1a656: 6e 15 cp r22, r14 1a658: 7f 05 cpc r23, r15 1a65a: 30 f5 brcc .+76 ; 0x1a6a8 /// go steady sm4_do_step(axes); 1a65c: 89 81 ldd r24, Y+1 ; 0x01 1a65e: 0f 94 bb 25 call 0x24b76 ; 0x24b76 delayMicroseconds(delay_us); 1a662: ea 81 ldd r30, Y+2 ; 0x02 1a664: fb 81 ldd r31, Y+3 ; 0x03 1a666: 80 81 ld r24, Z 1a668: 91 81 ldd r25, Z+1 ; 0x01 1a66a: 0e 94 c6 d0 call 0x1a18c ; 0x1a18c } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1a66e: f1 01 movw r30, r2 1a670: 80 81 ld r24, Z 1a672: 91 81 ldd r25, Z+1 ; 0x01 1a674: 01 97 sbiw r24, 0x01 ; 1 1a676: 91 83 std Z+1, r25 ; 0x01 1a678: 80 83 st Z, r24 return true; 1a67a: 81 e0 ldi r24, 0x01 ; 1 } 1a67c: 0f 90 pop r0 1a67e: 0f 90 pop r0 1a680: 0f 90 pop r0 1a682: df 91 pop r29 1a684: cf 91 pop r28 1a686: 1f 91 pop r17 1a688: 0f 91 pop r16 1a68a: ff 90 pop r15 1a68c: ef 90 pop r14 1a68e: df 90 pop r13 1a690: cf 90 pop r12 1a692: bf 90 pop r11 1a694: af 90 pop r10 1a696: 9f 90 pop r9 1a698: 8f 90 pop r8 1a69a: 7f 90 pop r7 1a69c: 6f 90 pop r6 1a69e: 5f 90 pop r5 1a6a0: 4f 90 pop r4 1a6a2: 3f 90 pop r3 1a6a4: 2f 90 pop r2 1a6a6: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1a6a8: 66 27 eor r22, r22 1a6aa: 77 27 eor r23, r23 1a6ac: 6c 19 sub r22, r12 1a6ae: 7d 09 sbc r23, r13 1a6b0: 98 01 movw r18, r16 1a6b2: 4a 81 ldd r20, Y+2 ; 0x02 1a6b4: 5b 81 ldd r21, Y+3 ; 0x03 1a6b6: 89 81 ldd r24, Y+1 ; 0x01 1a6b8: 0e 94 30 d2 call 0x1a460 ; 0x1a460 1a6bc: d8 cf rjmp .-80 ; 0x1a66e /// 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; 1a6be: 80 e0 ldi r24, 0x00 ; 0 1a6c0: dd cf rjmp .-70 ; 0x1a67c 0001a6c2 : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1a6c2: 0f 93 push r16 1a6c4: 1f 93 push r17 1a6c6: cf 93 push r28 1a6c8: df 93 push r29 1a6ca: 18 2f mov r17, r24 1a6cc: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1a6ce: d1 e0 ldi r29, 0x01 ; 1 1a6d0: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1a6d2: 81 2f mov r24, r17 1a6d4: 8d 23 and r24, r29 1a6d6: 29 f0 breq .+10 ; 0x1a6e2 sm4_set_dir(i, dir & mask); 1a6d8: 60 2f mov r22, r16 1a6da: 6d 23 and r22, r29 1a6dc: 8c 2f mov r24, r28 1a6de: 0f 94 c3 25 call 0x24b86 ; 0x24b86 } } } 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) { 1a6e2: cf 5f subi r28, 0xFF ; 255 1a6e4: dd 0f add r29, r29 1a6e6: c3 30 cpi r28, 0x03 ; 3 1a6e8: a1 f7 brne .-24 ; 0x1a6d2 if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1a6ea: df 91 pop r29 1a6ec: cf 91 pop r28 1a6ee: 1f 91 pop r17 1a6f0: 0f 91 pop r16 1a6f2: 08 95 ret 0001a6f4 : //@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) { 1a6f4: 8f 92 push r8 1a6f6: 9f 92 push r9 1a6f8: af 92 push r10 1a6fa: bf 92 push r11 1a6fc: cf 92 push r12 1a6fe: df 92 push r13 1a700: ef 92 push r14 1a702: ff 92 push r15 1a704: 30 e0 ldi r19, 0x00 ; 0 1a706: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1a708: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1a70a: 48 2f mov r20, r24 1a70c: 49 23 and r20, r25 1a70e: 19 f1 breq .+70 ; 0x1a756 count_position[i] += dir & mask ? -1L : 1L; 1a710: a9 01 movw r20, r18 1a712: 44 0f add r20, r20 1a714: 55 1f adc r21, r21 1a716: 44 0f add r20, r20 1a718: 55 1f adc r21, r21 1a71a: fa 01 movw r30, r20 1a71c: e4 5b subi r30, 0xB4 ; 180 1a71e: f9 4f sbci r31, 0xF9 ; 249 1a720: c0 80 ld r12, Z 1a722: d1 80 ldd r13, Z+1 ; 0x01 1a724: e2 80 ldd r14, Z+2 ; 0x02 1a726: f3 80 ldd r15, Z+3 ; 0x03 1a728: 76 2f mov r23, r22 1a72a: 79 23 and r23, r25 1a72c: 81 2c mov r8, r1 1a72e: 91 2c mov r9, r1 1a730: 54 01 movw r10, r8 1a732: 83 94 inc r8 1a734: 77 23 and r23, r23 1a736: 21 f0 breq .+8 ; 0x1a740 1a738: 88 24 eor r8, r8 1a73a: 8a 94 dec r8 1a73c: 98 2c mov r9, r8 1a73e: 54 01 movw r10, r8 1a740: c8 0c add r12, r8 1a742: d9 1c adc r13, r9 1a744: ea 1c adc r14, r10 1a746: fb 1c adc r15, r11 1a748: 44 5b subi r20, 0xB4 ; 180 1a74a: 59 4f sbci r21, 0xF9 ; 249 1a74c: fa 01 movw r30, r20 1a74e: c0 82 st Z, r12 1a750: d1 82 std Z+1, r13 ; 0x01 1a752: e2 82 std Z+2, r14 ; 0x02 1a754: 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) { 1a756: 99 0f add r25, r25 1a758: 2f 5f subi r18, 0xFF ; 255 1a75a: 3f 4f sbci r19, 0xFF ; 255 1a75c: 23 30 cpi r18, 0x03 ; 3 1a75e: 31 05 cpc r19, r1 1a760: a1 f6 brne .-88 ; 0x1a70a if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1a762: ff 90 pop r15 1a764: ef 90 pop r14 1a766: df 90 pop r13 1a768: cf 90 pop r12 1a76a: bf 90 pop r11 1a76c: af 90 pop r10 1a76e: 9f 90 pop r9 1a770: 8f 90 pop r8 1a772: 08 95 ret 0001a774 : /// 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) { 1a774: 2f 92 push r2 1a776: 3f 92 push r3 1a778: 4f 92 push r4 1a77a: 5f 92 push r5 1a77c: 6f 92 push r6 1a77e: 7f 92 push r7 1a780: 8f 92 push r8 1a782: 9f 92 push r9 1a784: af 92 push r10 1a786: bf 92 push r11 1a788: cf 92 push r12 1a78a: df 92 push r13 1a78c: ef 92 push r14 1a78e: ff 92 push r15 1a790: 0f 93 push r16 1a792: 1f 93 push r17 1a794: cf 93 push r28 1a796: df 93 push r29 1a798: 00 d0 rcall .+0 ; 0x1a79a 1a79a: 00 d0 rcall .+0 ; 0x1a79c 1a79c: cd b7 in r28, 0x3d ; 61 1a79e: 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]; 1a7a0: c0 90 4c 06 lds r12, 0x064C ; 0x80064c 1a7a4: d0 90 4d 06 lds r13, 0x064D ; 0x80064d 1a7a8: e0 90 4e 06 lds r14, 0x064E ; 0x80064e 1a7ac: f0 90 4f 06 lds r15, 0x064F ; 0x80064f 1a7b0: 7c 01 movw r14, r24 1a7b2: ec 18 sub r14, r12 1a7b4: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1a7b6: 80 91 50 06 lds r24, 0x0650 ; 0x800650 1a7ba: 90 91 51 06 lds r25, 0x0651 ; 0x800651 1a7be: a0 91 52 06 lds r26, 0x0652 ; 0x800652 1a7c2: b0 91 53 06 lds r27, 0x0653 ; 0x800653 1a7c6: 68 1b sub r22, r24 1a7c8: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1a7ca: 80 91 54 06 lds r24, 0x0654 ; 0x800654 1a7ce: 90 91 55 06 lds r25, 0x0655 ; 0x800655 1a7d2: a0 91 56 06 lds r26, 0x0656 ; 0x800656 1a7d6: b0 91 57 06 lds r27, 0x0657 ; 0x800657 1a7da: fa 01 movw r30, r20 1a7dc: e8 1b sub r30, r24 1a7de: f9 0b sbc r31, r25 1a7e0: fa 83 std Y+2, r31 ; 0x02 1a7e2: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1a7e4: fb 01 movw r30, r22 1a7e6: ff 0f add r31, r31 1a7e8: ee 0b sbc r30, r30 1a7ea: ff 0f add r31, r31 1a7ec: fe 2f mov r31, r30 1a7ee: ee 1f adc r30, r30 1a7f0: e2 70 andi r30, 0x02 ; 2 1a7f2: 89 81 ldd r24, Y+1 ; 0x01 1a7f4: 9a 81 ldd r25, Y+2 ; 0x02 1a7f6: 88 e0 ldi r24, 0x08 ; 8 1a7f8: 98 02 muls r25, r24 1a7fa: 81 2d mov r24, r1 1a7fc: 99 0b sbc r25, r25 1a7fe: 11 24 eor r1, r1 1a800: 84 70 andi r24, 0x04 ; 4 1a802: e8 2b or r30, r24 1a804: 8f 2d mov r24, r15 1a806: 88 1f adc r24, r24 1a808: 88 27 eor r24, r24 1a80a: 88 1f adc r24, r24 1a80c: e8 2b or r30, r24 1a80e: e0 93 f1 03 sts 0x03F1, r30 ; 0x8003f1 asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1a812: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1a816: 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; 1a818: 87 e0 ldi r24, 0x07 ; 7 1a81a: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 2; //set X direction bit 1a81c: e0 fd sbrc r30, 0 1a81e: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 2) portL |= 1; //set Y direction bit 1a820: e1 fd sbrc r30, 1 1a822: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 4) portL |= 4; //set Z direction bit 1a824: e4 70 andi r30, 0x04 ; 4 1a826: 09 f0 breq .+2 ; 0x1a82a 1a828: 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; 1a82a: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1a82e: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1a830: 8f e3 ldi r24, 0x3F ; 63 1a832: 9b eb ldi r25, 0xBB ; 187 1a834: 01 11 cpse r16, r1 1a836: 02 c0 rjmp .+4 ; 0x1a83c 1a838: 90 e0 ldi r25, 0x00 ; 0 1a83a: 80 e0 ldi r24, 0x00 ; 0 1a83c: 90 93 25 06 sts 0x0625, r25 ; 0x800625 1a840: 80 93 24 06 sts 0x0624, r24 ; 0x800624 xyzcal_sm4_delay = delay_us; 1a844: 30 93 f0 03 sts 0x03F0, r19 ; 0x8003f0 1a848: 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; 1a84c: 29 81 ldd r18, Y+1 ; 0x01 1a84e: 3a 81 ldd r19, Y+2 ; 0x02 1a850: 3e 83 std Y+6, r19 ; 0x06 1a852: 2d 83 std Y+5, r18 ; 0x05 1a854: 37 ff sbrs r19, 7 1a856: 05 c0 rjmp .+10 ; 0x1a862 1a858: 31 95 neg r19 1a85a: 21 95 neg r18 1a85c: 31 09 sbc r19, r1 1a85e: 3e 83 std Y+6, r19 ; 0x06 1a860: 2d 83 std Y+5, r18 ; 0x05 1a862: 8b 01 movw r16, r22 1a864: 77 ff sbrs r23, 7 1a866: 03 c0 rjmp .+6 ; 0x1a86e 1a868: 11 95 neg r17 1a86a: 01 95 neg r16 1a86c: 11 09 sbc r17, r1 1a86e: f7 fe sbrs r15, 7 1a870: 03 c0 rjmp .+6 ; 0x1a878 1a872: f1 94 neg r15 1a874: e1 94 neg r14 1a876: 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); 1a878: 98 01 movw r18, r16 1a87a: d8 01 movw r26, r16 1a87c: 0f 94 56 a5 call 0x34aac ; 0x34aac <__mulhisi3> 1a880: 4b 01 movw r8, r22 1a882: 5c 01 movw r10, r24 1a884: 2d 81 ldd r18, Y+5 ; 0x05 1a886: 3e 81 ldd r19, Y+6 ; 0x06 1a888: d9 01 movw r26, r18 1a88a: 0f 94 56 a5 call 0x34aac ; 0x34aac <__mulhisi3> 1a88e: 86 0e add r8, r22 1a890: 97 1e adc r9, r23 1a892: a8 1e adc r10, r24 1a894: b9 1e adc r11, r25 1a896: 97 01 movw r18, r14 1a898: d7 01 movw r26, r14 1a89a: 0f 94 56 a5 call 0x34aac ; 0x34aac <__mulhisi3> 1a89e: 68 0d add r22, r8 1a8a0: 79 1d adc r23, r9 1a8a2: 8a 1d adc r24, r10 1a8a4: 9b 1d adc r25, r11 1a8a6: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 1a8aa: 0f 94 34 a9 call 0x35268 ; 0x35268 1a8ae: 20 e0 ldi r18, 0x00 ; 0 1a8b0: 30 e0 ldi r19, 0x00 ; 0 1a8b2: 40 e0 ldi r20, 0x00 ; 0 1a8b4: 5f e3 ldi r21, 0x3F ; 63 1a8b6: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1a8ba: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 1a8be: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1a8c0: 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; 1a8c2: 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; 1a8c4: 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; 1a8c6: 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; 1a8c8: 1c 82 std Y+4, r1 ; 0x04 1a8ca: 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; 1a8cc: 31 2c mov r3, r1 1a8ce: 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; 1a8d0: 1a 82 std Y+2, r1 ; 0x02 1a8d2: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1a8d4: 61 14 cp r6, r1 1a8d6: 71 04 cpc r7, r1 1a8d8: 09 f4 brne .+2 ; 0x1a8dc 1a8da: 48 c0 rjmp .+144 ; 0x1a96c if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1a8dc: e0 91 24 06 lds r30, 0x0624 ; 0x800624 1a8e0: f0 91 25 06 lds r31, 0x0625 ; 0x800625 1a8e4: 30 97 sbiw r30, 0x00 ; 0 1a8e6: f1 f5 brne .+124 ; 0x1a964 uint8_t sm = 0; //step mask 1a8e8: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1a8ea: ec 14 cp r14, r12 1a8ec: fd 04 cpc r15, r13 1a8ee: 40 f0 brcs .+16 ; 0x1a900 sm |= 1; cx += dd; 1a8f0: c4 0c add r12, r4 1a8f2: d5 1c adc r13, r5 x++; 1a8f4: 89 81 ldd r24, Y+1 ; 0x01 1a8f6: 9a 81 ldd r25, Y+2 ; 0x02 1a8f8: 01 96 adiw r24, 0x01 ; 1 1a8fa: 9a 83 std Y+2, r25 ; 0x02 1a8fc: 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; 1a8fe: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1a900: 0a 15 cp r16, r10 1a902: 1b 05 cpc r17, r11 1a904: 30 f0 brcs .+12 ; 0x1a912 sm |= 2; 1a906: 82 60 ori r24, 0x02 ; 2 cy += dd; 1a908: a4 0c add r10, r4 1a90a: b5 1c adc r11, r5 y++; 1a90c: 9f ef ldi r25, 0xFF ; 255 1a90e: 29 1a sub r2, r25 1a910: 39 0a sbc r3, r25 } if (cz <= dz){ 1a912: ed 81 ldd r30, Y+5 ; 0x05 1a914: fe 81 ldd r31, Y+6 ; 0x06 1a916: e8 15 cp r30, r8 1a918: f9 05 cpc r31, r9 1a91a: 48 f0 brcs .+18 ; 0x1a92e sm |= 4; 1a91c: 84 60 ori r24, 0x04 ; 4 cz += dd; 1a91e: 84 0c add r8, r4 1a920: 95 1c adc r9, r5 z++; 1a922: 2b 81 ldd r18, Y+3 ; 0x03 1a924: 3c 81 ldd r19, Y+4 ; 0x04 1a926: 2f 5f subi r18, 0xFF ; 255 1a928: 3f 4f sbci r19, 0xFF ; 255 1a92a: 3c 83 std Y+4, r19 ; 0x04 1a92c: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1a92e: ce 18 sub r12, r14 1a930: df 08 sbc r13, r15 cy -= dy; 1a932: a0 1a sub r10, r16 1a934: b1 0a sbc r11, r17 cz -= dz; 1a936: ed 81 ldd r30, Y+5 ; 0x05 1a938: fe 81 ldd r31, Y+6 ; 0x06 1a93a: 8e 1a sub r8, r30 1a93c: 9f 0a sbc r9, r31 sm4_do_step(sm); 1a93e: 0f 94 bb 25 call 0x24b76 ; 0x24b76 uint16_t delay = SM4_DEFDELAY; if (sm4_calc_delay_cb) delay = (*sm4_calc_delay_cb)(nd, dd); 1a942: e0 91 20 06 lds r30, 0x0620 ; 0x800620 1a946: f0 91 21 06 lds r31, 0x0621 ; 0x800621 1a94a: 30 97 sbiw r30, 0x00 ; 0 1a94c: d1 f1 breq .+116 ; 0x1a9c2 1a94e: b2 01 movw r22, r4 1a950: c3 01 movw r24, r6 1a952: 19 95 eicall if (delay) delayMicroseconds(delay); 1a954: 00 97 sbiw r24, 0x00 ; 0 1a956: 11 f0 breq .+4 ; 0x1a95c 1a958: 0e 94 c6 d0 call 0x1a18c ; 0x1a18c nd--; 1a95c: f1 e0 ldi r31, 0x01 ; 1 1a95e: 6f 1a sub r6, r31 1a960: 71 08 sbc r7, r1 1a962: b8 cf rjmp .-144 ; 0x1a8d4 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; 1a964: 19 95 eicall 1a966: 88 23 and r24, r24 1a968: 09 f4 brne .+2 ; 0x1a96c 1a96a: be cf rjmp .-132 ; 0x1a8e8 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) 1a96c: e0 91 22 06 lds r30, 0x0622 ; 0x800622 1a970: f0 91 23 06 lds r31, 0x0623 ; 0x800623 1a974: 30 97 sbiw r30, 0x00 ; 0 1a976: 41 f0 breq .+16 ; 0x1a988 (*sm4_update_pos_cb)(x, y, z, 0); 1a978: 30 e0 ldi r19, 0x00 ; 0 1a97a: 20 e0 ldi r18, 0x00 ; 0 1a97c: 4b 81 ldd r20, Y+3 ; 0x03 1a97e: 5c 81 ldd r21, Y+4 ; 0x04 1a980: b1 01 movw r22, r2 1a982: 89 81 ldd r24, Y+1 ; 0x01 1a984: 9a 81 ldd r25, Y+2 ; 0x02 1a986: 19 95 eicall 1a988: 81 e0 ldi r24, 0x01 ; 1 1a98a: 67 28 or r6, r7 1a98c: 09 f4 brne .+2 ; 0x1a990 1a98e: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1a990: 26 96 adiw r28, 0x06 ; 6 1a992: 0f b6 in r0, 0x3f ; 63 1a994: f8 94 cli 1a996: de bf out 0x3e, r29 ; 62 1a998: 0f be out 0x3f, r0 ; 63 1a99a: cd bf out 0x3d, r28 ; 61 1a99c: df 91 pop r29 1a99e: cf 91 pop r28 1a9a0: 1f 91 pop r17 1a9a2: 0f 91 pop r16 1a9a4: ff 90 pop r15 1a9a6: ef 90 pop r14 1a9a8: df 90 pop r13 1a9aa: cf 90 pop r12 1a9ac: bf 90 pop r11 1a9ae: af 90 pop r10 1a9b0: 9f 90 pop r9 1a9b2: 8f 90 pop r8 1a9b4: 7f 90 pop r7 1a9b6: 6f 90 pop r6 1a9b8: 5f 90 pop r5 1a9ba: 4f 90 pop r4 1a9bc: 3f 90 pop r3 1a9be: 2f 90 pop r2 1a9c0: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1a9c2: 84 ef ldi r24, 0xF4 ; 244 1a9c4: 91 e0 ldi r25, 0x01 ; 1 1a9c6: c8 cf rjmp .-112 ; 0x1a958 0001a9c8 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1a9c8: cf 93 push r28 1a9ca: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1a9cc: 86 ea ldi r24, 0xA6 ; 166 1a9ce: 9c e0 ldi r25, 0x0C ; 12 1a9d0: 0f 94 3e a4 call 0x3487c ; 0x3487c status &= ~components; 1a9d4: c0 95 com r28 1a9d6: 6c 2f mov r22, r28 1a9d8: 68 23 and r22, r24 1a9da: 86 ea ldi r24, 0xA6 ; 166 1a9dc: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1a9de: cf 91 pop r28 1a9e0: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 0001a9e4 : } } } static void lcd_reset_sheet() { 1a9e4: 1f 93 push r17 1a9e6: cf 93 push r28 1a9e8: df 93 push r29 1a9ea: 00 d0 rcall .+0 ; 0x1a9ec 1a9ec: 00 d0 rcall .+0 ; 0x1a9ee 1a9ee: 1f 92 push r1 1a9f0: 1f 92 push r1 1a9f2: cd b7 in r28, 0x3d ; 61 1a9f4: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1a9f6: be 01 movw r22, r28 1a9f8: 6f 5f subi r22, 0xFF ; 255 1a9fa: 7f 4f sbci r23, 0xFF ; 255 1a9fc: 80 91 ca 03 lds r24, 0x03CA ; 0x8003ca 1aa00: 0e 94 13 79 call 0xf226 ; 0xf226 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1aa04: 80 91 ca 03 lds r24, 0x03CA ; 0x8003ca 1aa08: 1b e0 ldi r17, 0x0B ; 11 1aa0a: 81 9f mul r24, r17 1aa0c: c0 01 movw r24, r0 1aa0e: 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); 1aa10: 6f ef ldi r22, 0xFF ; 255 1aa12: 7f ef ldi r23, 0xFF ; 255 1aa14: 80 5b subi r24, 0xB0 ; 176 1aa16: 92 4f sbci r25, 0xF2 ; 242 1aa18: 0f 94 80 a4 call 0x34900 ; 0x34900 eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1aa1c: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 1aa20: 61 9f mul r22, r17 1aa22: b0 01 movw r22, r0 1aa24: 11 24 eor r1, r1 1aa26: 67 5b subi r22, 0xB7 ; 183 1aa28: 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); 1aa2a: 47 e0 ldi r20, 0x07 ; 7 1aa2c: 50 e0 ldi r21, 0x00 ; 0 1aa2e: ce 01 movw r24, r28 1aa30: 01 96 adiw r24, 0x01 ; 1 1aa32: 0f 94 52 a4 call 0x348a4 ; 0x348a4 if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1aa36: 81 ea ldi r24, 0xA1 ; 161 1aa38: 9d e0 ldi r25, 0x0D ; 13 1aa3a: 0f 94 3e a4 call 0x3487c ; 0x3487c 1aa3e: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca 1aa42: 89 13 cpse r24, r25 1aa44: 0a c0 rjmp .+20 ; 0x1aa5a { eeprom_switch_to_next_sheet(); 1aa46: 0e 94 05 79 call 0xf20a ; 0xf20a if (-1 == eeprom_next_initialized_sheet(0)) 1aa4a: 80 e0 ldi r24, 0x00 ; 0 1aa4c: 0e 94 f1 78 call 0xf1e2 ; 0xf1e2 1aa50: 8f 3f cpi r24, 0xFF ; 255 1aa52: 19 f4 brne .+6 ; 0x1aa5a calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1aa54: 80 e1 ldi r24, 0x10 ; 16 1aa56: 0e 94 e4 d4 call 0x1a9c8 ; 0x1a9c8 } menu_back(); 1aa5a: 0e 94 76 63 call 0xc6ec ; 0xc6ec } 1aa5e: 28 96 adiw r28, 0x08 ; 8 1aa60: 0f b6 in r0, 0x3f ; 63 1aa62: f8 94 cli 1aa64: de bf out 0x3e, r29 ; 62 1aa66: 0f be out 0x3f, r0 ; 63 1aa68: cd bf out 0x3d, r28 ; 61 1aa6a: df 91 pop r29 1aa6c: cf 91 pop r28 1aa6e: 1f 91 pop r17 1aa70: 08 95 ret 0001aa72 : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1aa72: cf 93 push r28 1aa74: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1aa76: 86 ea ldi r24, 0xA6 ; 166 1aa78: 9c e0 ldi r25, 0x0C ; 12 1aa7a: 0f 94 3e a4 call 0x3487c ; 0x3487c status |= components; 1aa7e: 68 2f mov r22, r24 1aa80: 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); 1aa82: 86 ea ldi r24, 0xA6 ; 166 1aa84: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1aa86: cf 91 pop r28 1aa88: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 0001aa8c : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1aa8c: cf 93 push r28 1aa8e: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1aa90: 86 ea ldi r24, 0xA6 ; 166 1aa92: 9c e0 ldi r25, 0x0C ; 12 1aa94: 0f 94 3e a4 call 0x3487c ; 0x3487c return ((status & components) == components); 1aa98: 98 2f mov r25, r24 1aa9a: 9c 23 and r25, r28 1aa9c: 81 e0 ldi r24, 0x01 ; 1 1aa9e: 9c 13 cpse r25, r28 1aaa0: 80 e0 ldi r24, 0x00 ; 0 } 1aaa2: cf 91 pop r28 1aaa4: 08 95 ret 0001aaa6 : * @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() { 1aaa6: ef 92 push r14 1aaa8: ff 92 push r15 1aaaa: 0f 93 push r16 1aaac: 1f 93 push r17 1aaae: cf 93 push r28 1aab0: df 93 push r29 1aab2: cd b7 in r28, 0x3d ; 61 1aab4: de b7 in r29, 0x3e ; 62 1aab6: 63 97 sbiw r28, 0x13 ; 19 1aab8: 0f b6 in r0, 0x3f ; 63 1aaba: f8 94 cli 1aabc: de bf out 0x3e, r29 ; 62 1aabe: 0f be out 0x3f, r0 ; 63 1aac0: 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) 1aac2: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1aac6: 81 11 cpse r24, r1 1aac8: 3a c0 rjmp .+116 ; 0x1ab3e { // Menu was entered. // Initialize its status. _md->status = 1; 1aaca: 81 e0 ldi r24, 0x01 ; 1 1aacc: 80 93 96 03 sts 0x0396, r24 ; 0x800396 check_babystep(); 1aad0: 0e 94 77 7d call 0xfaee ; 0xfaee if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 1aad4: 81 ea ldi r24, 0xA1 ; 161 1aad6: 9d e0 ldi r25, 0x0D ; 13 1aad8: 0f 94 3e a4 call 0x3487c ; 0x3487c 1aadc: 18 2f mov r17, r24 1aade: 0e 94 e3 78 call 0xf1c6 ; 0xf1c6 1aae2: 81 11 cpse r24, r1 1aae4: ee c0 rjmp .+476 ; 0x1acc2 _md->babystepMemZ = 0; 1aae6: 10 92 98 03 sts 0x0398, r1 ; 0x800398 1aaea: 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)) 1aaee: 80 e1 ldi r24, 0x10 ; 16 1aaf0: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c 1aaf4: 81 11 cpse r24, r1 1aaf6: 04 c0 rjmp .+8 ; 0x1ab00 _md->babystepMemZ = 0; 1aaf8: 10 92 98 03 sts 0x0398, r1 ; 0x800398 1aafc: 10 92 97 03 sts 0x0397, r1 ; 0x800397 _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 1ab00: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1ab04: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1ab08: 07 2e mov r0, r23 1ab0a: 00 0c add r0, r0 1ab0c: 88 0b sbc r24, r24 1ab0e: 99 0b sbc r25, r25 1ab10: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1ab14: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 1ab18: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1ab1c: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1ab20: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1ab24: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1ab28: 60 93 99 03 sts 0x0399, r22 ; 0x800399 1ab2c: 70 93 9a 03 sts 0x039A, r23 ; 0x80039a 1ab30: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b 1ab34: 90 93 9c 03 sts 0x039C, r25 ; 0x80039c lcd_draw_update = 1; 1ab38: 81 e0 ldi r24, 0x01 ; 1 1ab3a: 80 93 59 02 sts 0x0259, r24 ; 0x800259 //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 1ab3e: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1ab42: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1ab46: 00 97 sbiw r24, 0x00 ; 0 1ab48: f1 f1 breq .+124 ; 0x1abc6 { _md->babystepMemZ += lcd_encoder; 1ab4a: 20 91 97 03 lds r18, 0x0397 ; 0x800397 1ab4e: 30 91 98 03 lds r19, 0x0398 ; 0x800398 1ab52: 28 0f add r18, r24 1ab54: 39 1f adc r19, r25 1ab56: 30 93 98 03 sts 0x0398, r19 ; 0x800398 1ab5a: 20 93 97 03 sts 0x0397, r18 ; 0x800397 if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 1ab5e: 21 36 cpi r18, 0x61 ; 97 1ab60: 40 ef ldi r20, 0xF0 ; 240 1ab62: 34 07 cpc r19, r20 1ab64: 0c f0 brlt .+2 ; 0x1ab68 1ab66: ba c0 rjmp .+372 ; 0x1acdc 1ab68: 81 e6 ldi r24, 0x61 ; 97 1ab6a: 90 ef ldi r25, 0xF0 ; 240 1ab6c: 90 93 98 03 sts 0x0398, r25 ; 0x800398 1ab70: 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]; 1ab74: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1ab78: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1ab7c: 07 2e mov r0, r23 1ab7e: 00 0c add r0, r0 1ab80: 88 0b sbc r24, r24 1ab82: 99 0b sbc r25, r25 1ab84: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1ab88: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 1ab8c: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1ab90: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1ab94: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1ab98: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1ab9c: 60 93 99 03 sts 0x0399, r22 ; 0x800399 1aba0: 70 93 9a 03 sts 0x039A, r23 ; 0x80039a 1aba4: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b 1aba8: 90 93 9c 03 sts 0x039C, r25 ; 0x80039c _delay(50); 1abac: 62 e3 ldi r22, 0x32 ; 50 1abae: 70 e0 ldi r23, 0x00 ; 0 1abb0: 80 e0 ldi r24, 0x00 ; 0 1abb2: 90 e0 ldi r25, 0x00 ; 0 1abb4: 0f 94 ce 0a call 0x2159c ; 0x2159c lcd_encoder = 0; 1abb8: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1abbc: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e lcd_draw_update = 1; 1abc0: 81 e0 ldi r24, 0x01 ; 1 1abc2: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } if (lcd_draw_update) 1abc6: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1abca: 88 23 and r24, r24 1abcc: c9 f1 breq .+114 ; 0x1ac40 { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 1abce: 81 ea ldi r24, 0xA1 ; 161 1abd0: 9d e0 ldi r25, 0x0D ; 13 1abd2: 0f 94 3e a4 call 0x3487c ; 0x3487c 1abd6: 2b e0 ldi r18, 0x0B ; 11 1abd8: 82 9f mul r24, r18 1abda: c0 01 movw r24, r0 1abdc: 11 24 eor r1, r1 1abde: be 01 movw r22, r28 1abe0: 6f 5f subi r22, 0xFF ; 255 1abe2: 7f 4f sbci r23, 0xFF ; 255 1abe4: 87 5b subi r24, 0xB7 ; 183 1abe6: 92 4f sbci r25, 0xF2 ; 242 1abe8: 0e 94 58 76 call 0xecb0 ; 0xecb0 lcd_home(); 1abec: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 lcd_print(buffer.c); 1abf0: ce 01 movw r24, r28 1abf2: 01 96 adiw r24, 0x01 ; 1 1abf4: 0e 94 ba 73 call 0xe774 ; 0xe774 lcd_set_cursor(0, 1); 1abf8: 61 e0 ldi r22, 0x01 ; 1 1abfa: 80 e0 ldi r24, 0x00 ; 0 1abfc: 0e 94 b5 6f call 0xdf6a ; 0xdf6a menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 1ac00: 10 91 99 03 lds r17, 0x0399 ; 0x800399 1ac04: 00 91 9a 03 lds r16, 0x039A ; 0x80039a 1ac08: f0 90 9b 03 lds r15, 0x039B ; 0x80039b 1ac0c: e0 90 9c 03 lds r14, 0x039C ; 0x80039c 1ac10: 84 ed ldi r24, 0xD4 ; 212 1ac12: 9a e3 ldi r25, 0x3A ; 58 1ac14: 0e 94 95 75 call 0xeb2a ; 0xeb2a //! (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); 1ac18: ef 92 push r14 1ac1a: ff 92 push r15 1ac1c: 0f 93 push r16 1ac1e: 1f 93 push r17 1ac20: 9f 93 push r25 1ac22: 8f 93 push r24 1ac24: 1f 92 push r1 1ac26: 80 e2 ldi r24, 0x20 ; 32 1ac28: 8f 93 push r24 1ac2a: 8a e4 ldi r24, 0x4A ; 74 1ac2c: 93 e8 ldi r25, 0x83 ; 131 1ac2e: 9f 93 push r25 1ac30: 8f 93 push r24 1ac32: 0e 94 66 6f call 0xdecc ; 0xdecc 1ac36: 0f b6 in r0, 0x3f ; 63 1ac38: f8 94 cli 1ac3a: de bf out 0x3e, r29 ; 62 1ac3c: 0f be out 0x3f, r0 ; 63 1ac3e: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 1ac40: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1ac44: 81 11 cpse r24, r1 1ac46: 04 c0 rjmp .+8 ; 0x1ac50 1ac48: 80 91 c4 03 lds r24, 0x03C4 ; 0x8003c4 1ac4c: 88 23 and r24, r24 1ac4e: 51 f1 breq .+84 ; 0x1aca4 { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 1ac50: 81 ea ldi r24, 0xA1 ; 161 1ac52: 9d e0 ldi r25, 0x0D ; 13 1ac54: 0f 94 3e a4 call 0x3487c ; 0x3487c 1ac58: 9b e0 ldi r25, 0x0B ; 11 1ac5a: 89 9f mul r24, r25 1ac5c: 80 01 movw r16, r0 1ac5e: 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); 1ac60: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1ac64: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1ac68: c8 01 movw r24, r16 1ac6a: 80 5b subi r24, 0xB0 ; 176 1ac6c: 92 4f sbci r25, 0xF2 ; 242 1ac6e: 0f 94 80 a4 call 0x34900 ; 0x34900 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1ac72: 60 91 59 12 lds r22, 0x1259 ; 0x801259 1ac76: c8 01 movw r24, r16 1ac78: 8e 5a subi r24, 0xAE ; 174 1ac7a: 92 4f sbci r25, 0xF2 ; 242 1ac7c: 0f 94 62 a4 call 0x348c4 ; 0x348c4 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); 1ac80: 60 91 85 03 lds r22, 0x0385 ; 0x800385 1ac84: 70 91 86 03 lds r23, 0x0386 ; 0x800386 1ac88: 80 91 87 03 lds r24, 0x0387 ; 0x800387 1ac8c: 90 91 88 03 lds r25, 0x0388 ; 0x800388 1ac90: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 1ac94: c8 01 movw r24, r16 1ac96: 8d 5a subi r24, 0xAD ; 173 1ac98: 92 4f sbci r25, 0xF2 ; 242 1ac9a: 0f 94 62 a4 call 0x348c4 ; 0x348c4 #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 1ac9e: 80 e1 ldi r24, 0x10 ; 16 1aca0: 0e 94 39 d5 call 0x1aa72 ; 0x1aa72 } menu_back_if_clicked(); 1aca4: 0e 94 61 74 call 0xe8c2 ; 0xe8c2 } 1aca8: 63 96 adiw r28, 0x13 ; 19 1acaa: 0f b6 in r0, 0x3f ; 63 1acac: f8 94 cli 1acae: de bf out 0x3e, r29 ; 62 1acb0: 0f be out 0x3f, r0 ; 63 1acb2: cd bf out 0x3d, r28 ; 61 1acb4: df 91 pop r29 1acb6: cf 91 pop r28 1acb8: 1f 91 pop r17 1acba: 0f 91 pop r16 1acbc: ff 90 pop r15 1acbe: ef 90 pop r14 1acc0: 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-> 1acc2: 2b e0 ldi r18, 0x0B ; 11 1acc4: 12 9f mul r17, r18 1acc6: c0 01 movw r24, r0 1acc8: 11 24 eor r1, r1 1acca: 80 5b subi r24, 0xB0 ; 176 1accc: 92 4f sbci r25, 0xF2 ; 242 1acce: 0f 94 4c a4 call 0x34898 ; 0x34898 1acd2: 90 93 98 03 sts 0x0398, r25 ; 0x800398 1acd6: 80 93 97 03 sts 0x0397, r24 ; 0x800397 1acda: 09 cf rjmp .-494 ; 0x1aaee 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 1acdc: 12 16 cp r1, r18 1acde: 13 06 cpc r1, r19 1ace0: 2c f4 brge .+10 ; 0x1acec 1ace2: 10 92 98 03 sts 0x0398, r1 ; 0x800398 1ace6: 10 92 97 03 sts 0x0397, r1 ; 0x800397 1acea: 44 cf rjmp .-376 ; 0x1ab74 extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 1acec: 2f b7 in r18, 0x3f ; 63 1acee: f8 94 cli babystepsTodo[Z_AXIS] += n; 1acf0: 40 91 83 03 lds r20, 0x0383 ; 0x800383 1acf4: 50 91 84 03 lds r21, 0x0384 ; 0x800384 1acf8: 84 0f add r24, r20 1acfa: 95 1f adc r25, r21 1acfc: 90 93 84 03 sts 0x0384, r25 ; 0x800384 1ad00: 80 93 83 03 sts 0x0383, r24 ; 0x800383 CRITICAL_SECTION_END 1ad04: 2f bf out 0x3f, r18 ; 63 1ad06: 36 cf rjmp .-404 ; 0x1ab74 0001ad08 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 1ad08: af 92 push r10 1ad0a: bf 92 push r11 1ad0c: cf 92 push r12 1ad0e: df 92 push r13 1ad10: ef 92 push r14 1ad12: ff 92 push r15 1ad14: 0f 93 push r16 1ad16: 1f 93 push r17 1ad18: cf 93 push r28 1ad1a: df 93 push r29 1ad1c: 00 d0 rcall .+0 ; 0x1ad1e 1ad1e: 00 d0 rcall .+0 ; 0x1ad20 1ad20: 1f 92 push r1 1ad22: cd b7 in r28, 0x3d ; 61 1ad24: 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)) || 1ad26: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1ad2a: 81 11 cpse r24, r1 1ad2c: 18 c0 rjmp .+48 ; 0x1ad5e 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))) || 1ad2e: 81 ea ldi r24, 0xA1 ; 161 1ad30: 9d e0 ldi r25, 0x0D ; 13 1ad32: 0f 94 3e a4 call 0x3487c ; 0x3487c 1ad36: 18 2f mov r17, r24 1ad38: 0e 94 e3 78 call 0xf1c6 ; 0xf1c6 1ad3c: 88 23 and r24, r24 1ad3e: 79 f0 breq .+30 ; 0x1ad5e (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 1ad40: 80 e1 ldi r24, 0x10 ; 16 1ad42: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c 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))) || 1ad46: 88 23 and r24, r24 1ad48: 51 f0 breq .+20 ; 0x1ad5e (!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))))) 1ad4a: 2b e0 ldi r18, 0x0B ; 11 1ad4c: 12 9f mul r17, r18 1ad4e: c0 01 movw r24, r0 1ad50: 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 1ad52: 80 5b subi r24, 0xB0 ; 176 1ad54: 92 4f sbci r25, 0xF2 ; 242 1ad56: 0f 94 4c a4 call 0x34898 ; 0x34898 } 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)) || 1ad5a: 89 2b or r24, r25 1ad5c: f1 f4 brne .+60 ; 0x1ad9a (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) 1ad5e: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1ad62: 88 23 and r24, r24 1ad64: 71 f0 breq .+28 ; 0x1ad82 { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 1ad66: 81 ea ldi r24, 0xA1 ; 161 1ad68: 9d e0 ldi r25, 0x0D ; 13 1ad6a: 0f 94 3e a4 call 0x3487c ; 0x3487c 1ad6e: 2b e0 ldi r18, 0x0B ; 11 1ad70: 82 9f mul r24, r18 1ad72: c0 01 movw r24, r0 1ad74: 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); 1ad76: 6f ef ldi r22, 0xFF ; 255 1ad78: 7f ef ldi r23, 0xFF ; 255 1ad7a: 80 5b subi r24, 0xB0 ; 176 1ad7c: 92 4f sbci r25, 0xF2 ; 242 1ad7e: 0f 94 80 a4 call 0x34900 ; 0x34900 } // 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()); 1ad82: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1ad86: 21 e0 ldi r18, 0x01 ; 1 1ad88: 81 11 cpse r24, r1 1ad8a: 20 e0 ldi r18, 0x00 ; 0 1ad8c: 41 e0 ldi r20, 0x01 ; 1 1ad8e: 70 e0 ldi r23, 0x00 ; 0 1ad90: 60 e0 ldi r22, 0x00 ; 0 1ad92: 88 e5 ldi r24, 0x58 ; 88 1ad94: 97 ee ldi r25, 0xE7 ; 231 1ad96: 0e 94 12 63 call 0xc624 ; 0xc624 } if (lcd_encoder) { 1ad9a: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1ad9e: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1ada2: 21 15 cp r18, r1 1ada4: 31 05 cpc r19, r1 1ada6: 59 f0 breq .+22 ; 0x1adbe menuData->reset = lcd_encoder > 0; 1ada8: 81 e0 ldi r24, 0x01 ; 1 1adaa: 12 16 cp r1, r18 1adac: 13 06 cpc r1, r19 1adae: 0c f0 brlt .+2 ; 0x1adb2 1adb0: 80 e0 ldi r24, 0x00 ; 0 1adb2: 80 93 96 03 sts 0x0396, r24 ; 0x800396 lcd_encoder = 0; // Reset 1adb6: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1adba: 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)); 1adbe: 81 ea ldi r24, 0xA1 ; 161 1adc0: 9d e0 ldi r25, 0x0D ; 13 1adc2: 0f 94 3e a4 call 0x3487c ; 0x3487c 1adc6: 1b e0 ldi r17, 0x0B ; 11 1adc8: 81 9f mul r24, r17 1adca: b0 01 movw r22, r0 1adcc: 11 24 eor r1, r1 1adce: 67 5b subi r22, 0xB7 ; 183 1add0: 72 4f sbci r23, 0xF2 ; 242 1add2: 47 e0 ldi r20, 0x07 ; 7 1add4: 50 e0 ldi r21, 0x00 ; 0 1add6: ce 01 movw r24, r28 1add8: 01 96 adiw r24, 0x01 ; 1 1adda: 7c 01 movw r14, r24 1addc: 0f 94 2e a4 call 0x3485c ; 0x3485c lcd_home(); 1ade0: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 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]; 1ade4: 81 ea ldi r24, 0xA1 ; 161 1ade6: 9d e0 ldi r25, 0x0D ; 13 1ade8: 0f 94 3e a4 call 0x3487c ; 0x3487c 1adec: 81 9f mul r24, r17 1adee: c0 01 movw r24, r0 1adf0: 11 24 eor r1, r1 1adf2: 80 5b subi r24, 0xB0 ; 176 1adf4: 92 4f sbci r25, 0xF2 ; 242 1adf6: 0f 94 4c a4 call 0x34898 ; 0x34898 1adfa: bc 01 movw r22, r24 1adfc: 99 0f add r25, r25 1adfe: 88 0b sbc r24, r24 1ae00: 99 0b sbc r25, r25 1ae02: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1ae06: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 1ae0a: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1ae0e: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1ae12: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1ae16: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1ae1a: d6 2e mov r13, r22 1ae1c: c7 2e mov r12, r23 1ae1e: b8 2e mov r11, r24 1ae20: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 1ae22: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1ae26: 0e e3 ldi r16, 0x3E ; 62 1ae28: 10 e2 ldi r17, 0x20 ; 32 1ae2a: 81 11 cpse r24, r1 1ae2c: 02 c0 rjmp .+4 ; 0x1ae32 1ae2e: 00 e2 ldi r16, 0x20 ; 32 1ae30: 1e e3 ldi r17, 0x3E ; 62 1ae32: 83 ec ldi r24, 0xC3 ; 195 1ae34: 9c e3 ldi r25, 0x3C ; 60 1ae36: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1ae3a: 1f 92 push r1 1ae3c: 0f 93 push r16 1ae3e: 1f 92 push r1 1ae40: 1f 93 push r17 1ae42: af 92 push r10 1ae44: bf 92 push r11 1ae46: cf 92 push r12 1ae48: df 92 push r13 1ae4a: ff 92 push r15 1ae4c: ef 92 push r14 1ae4e: 9f 93 push r25 1ae50: 8f 93 push r24 1ae52: 0e 94 66 6f call 0xdecc ; 0xdecc 1ae56: 0f b6 in r0, 0x3f ; 63 1ae58: f8 94 cli 1ae5a: de bf out 0x3e, r29 ; 62 1ae5c: 0f be out 0x3f, r0 ; 63 1ae5e: 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. } 1ae60: 27 96 adiw r28, 0x07 ; 7 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 1ae6c: df 91 pop r29 1ae6e: cf 91 pop r28 1ae70: 1f 91 pop r17 1ae72: 0f 91 pop r16 1ae74: ff 90 pop r15 1ae76: ef 90 pop r14 1ae78: df 90 pop r13 1ae7a: cf 90 pop r12 1ae7c: bf 90 pop r11 1ae7e: af 90 pop r10 1ae80: 08 95 ret 0001ae82 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1ae82: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 1ae86: 81 ea ldi r24, 0xA1 ; 161 1ae88: 9d e0 ldi r25, 0x0D ; 13 1ae8a: 0f 94 62 a4 call 0x348c4 ; 0x348c4 //! @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(); 1ae8e: 0c 94 84 d6 jmp 0x1ad08 ; 0x1ad08 0001ae92 : ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 1ae92: 61 e0 ldi r22, 0x01 ; 1 1ae94: 88 ea ldi r24, 0xA8 ; 168 1ae96: 9d e0 ldi r25, 0x0D ; 13 1ae98: 0e 94 b8 78 call 0xf170 ; 0xf170 1ae9c: 80 93 ed 03 sts 0x03ED, r24 ; 0x8003ed if (farm_mode) { 1aea0: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1aea4: 88 23 and r24, r24 1aea6: 41 f0 breq .+16 ; 0x1aeb8 oCheckMode = ClCheckMode::_Strict; 1aea8: 82 e0 ldi r24, 0x02 ; 2 1aeaa: 80 93 ed 03 sts 0x03ED, r24 ; 0x8003ed 1aeae: 62 e0 ldi r22, 0x02 ; 2 1aeb0: 88 ea ldi r24, 0xA8 ; 168 1aeb2: 9d e0 ldi r25, 0x0D ; 13 1aeb4: 0f 94 62 a4 call 0x348c4 ; 0x348c4 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); 1aeb8: 68 e2 ldi r22, 0x28 ; 40 1aeba: 87 ea ldi r24, 0xA7 ; 167 1aebc: 9d e0 ldi r25, 0x0D ; 13 1aebe: 0e 94 b8 78 call 0xf170 ; 0xf170 1aec2: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 1aec6: 60 e9 ldi r22, 0x90 ; 144 1aec8: 71 e0 ldi r23, 0x01 ; 1 1aeca: 85 ea ldi r24, 0xA5 ; 165 1aecc: 9d e0 ldi r25, 0x0D ; 13 1aece: 0e 94 a0 78 call 0xf140 ; 0xf140 oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 1aed2: 61 e0 ldi r22, 0x01 ; 1 1aed4: 84 ea ldi r24, 0xA4 ; 164 1aed6: 9d e0 ldi r25, 0x0D ; 13 1aed8: 0e 94 b8 78 call 0xf170 ; 0xf170 1aedc: 80 93 ea 03 sts 0x03EA, r24 ; 0x8003ea oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 1aee0: 61 e0 ldi r22, 0x01 ; 1 1aee2: 83 ea ldi r24, 0xA3 ; 163 1aee4: 9d e0 ldi r25, 0x0D ; 13 1aee6: 0e 94 b8 78 call 0xf170 ; 0xf170 1aeea: 80 93 e9 03 sts 0x03E9, r24 ; 0x8003e9 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 1aeee: 61 e0 ldi r22, 0x01 ; 1 1aef0: 82 ea ldi r24, 0xA2 ; 162 1aef2: 9d e0 ldi r25, 0x0D ; 13 1aef4: 0e 94 b8 78 call 0xf170 ; 0xf170 1aef8: 80 93 e8 03 sts 0x03E8, r24 ; 0x8003e8 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 1aefc: 61 e0 ldi r22, 0x01 ; 1 1aefe: 80 e2 ldi r24, 0x20 ; 32 1af00: 9c e0 ldi r25, 0x0C ; 12 1af02: 0e 94 b8 78 call 0xf170 ; 0xf170 1af06: 80 93 ee 03 sts 0x03EE, r24 ; 0x8003ee } 1af0a: 08 95 ret 0001af0c : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1af0c: 0f 93 push r16 1af0e: 1f 93 push r17 1af10: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1af12: 0e 94 bb bb call 0x17776 ; 0x17776 if (*str != '.') 1af16: fc 01 movw r30, r24 1af18: 20 81 ld r18, Z 1af1a: 2e 32 cpi r18, 0x2E ; 46 1af1c: 11 f0 breq .+4 ; 0x1af22 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 1af1e: 80 e0 ldi r24, 0x00 ; 0 1af20: 34 c0 rjmp .+104 ; 0x1af8a // 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); 1af22: b8 01 movw r22, r16 1af24: 6e 5f subi r22, 0xFE ; 254 1af26: 7f 4f sbci r23, 0xFF ; 255 1af28: 01 96 adiw r24, 0x01 ; 1 1af2a: 0e 94 bb bb call 0x17776 ; 0x17776 if (*str != '.') 1af2e: fc 01 movw r30, r24 1af30: 20 81 ld r18, Z 1af32: 2e 32 cpi r18, 0x2E ; 46 1af34: a1 f7 brne .-24 ; 0x1af1e return false; ++str; } str = Number(str, version + 2); 1af36: b8 01 movw r22, r16 1af38: 6c 5f subi r22, 0xFC ; 252 1af3a: 7f 4f sbci r23, 0xFF ; 255 1af3c: 01 96 adiw r24, 0x01 ; 1 1af3e: 0e 94 bb bb call 0x17776 ; 0x17776 version[3] = FIRMWARE_REVISION_RELEASED; 1af42: 20 e4 ldi r18, 0x40 ; 64 1af44: 30 e0 ldi r19, 0x00 ; 0 1af46: f8 01 movw r30, r16 1af48: 37 83 std Z+7, r19 ; 0x07 1af4a: 26 83 std Z+6, r18 ; 0x06 1af4c: fc 01 movw r30, r24 1af4e: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1af50: 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'; 1af52: 89 2f mov r24, r25 1af54: 8f 7d andi r24, 0xDF ; 223 1af56: c1 f1 breq .+112 ; 0x1afc8 1af58: 87 ef ldi r24, 0xF7 ; 247 1af5a: 89 0f add r24, r25 1af5c: 82 30 cpi r24, 0x02 ; 2 1af5e: a0 f1 brcs .+104 ; 0x1afc8 1af60: 9d 30 cpi r25, 0x0D ; 13 1af62: 91 f1 breq .+100 ; 0x1afc8 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 == '-'){ 1af64: 9d 32 cpi r25, 0x2D ; 45 1af66: 99 f7 brne .-26 ; 0x1af4e // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1af68: 11 96 adiw r26, 0x01 ; 1 1af6a: 9c 91 ld r25, X 1af6c: 92 34 cpi r25, 0x42 ; 66 1af6e: e1 f0 breq .+56 ; 0x1afa8 1af70: 7c f4 brge .+30 ; 0x1af90 1af72: 91 34 cpi r25, 0x41 ; 65 1af74: a1 f6 brne .-88 ; 0x1af1e 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); 1af76: 0a 5f subi r16, 0xFA ; 250 1af78: 1f 4f sbci r17, 0xFF ; 255 1af7a: 28 e0 ldi r18, 0x08 ; 8 1af7c: 30 e0 ldi r19, 0x00 ; 0 1af7e: 45 e0 ldi r20, 0x05 ; 5 1af80: 6b e0 ldi r22, 0x0B ; 11 1af82: 76 e8 ldi r23, 0x86 ; 134 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); 1af84: cf 01 movw r24, r30 1af86: 0e 94 0b c2 call 0x18416 ; 0x18416 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1af8a: 1f 91 pop r17 1af8c: 0f 91 pop r16 1af8e: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1af90: 94 34 cpi r25, 0x44 ; 68 1af92: 91 f0 breq .+36 ; 0x1afb8 1af94: 92 35 cpi r25, 0x52 ; 82 1af96: 19 f6 brne .-122 ; 0x1af1e 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); 1af98: 0a 5f subi r16, 0xFA ; 250 1af9a: 1f 4f sbci r17, 0xFF ; 255 1af9c: 20 e2 ldi r18, 0x20 ; 32 1af9e: 30 e0 ldi r19, 0x00 ; 0 1afa0: 42 e0 ldi r20, 0x02 ; 2 1afa2: 6f ef ldi r22, 0xFF ; 255 1afa4: 75 e8 ldi r23, 0x85 ; 133 1afa6: ee cf rjmp .-36 ; 0x1af84 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); 1afa8: 0a 5f subi r16, 0xFA ; 250 1afaa: 1f 4f sbci r17, 0xFF ; 255 1afac: 20 e1 ldi r18, 0x10 ; 16 1afae: 30 e0 ldi r19, 0x00 ; 0 1afb0: 44 e0 ldi r20, 0x04 ; 4 1afb2: 66 e0 ldi r22, 0x06 ; 6 1afb4: 76 e8 ldi r23, 0x86 ; 134 1afb6: e6 cf rjmp .-52 ; 0x1af84 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); 1afb8: 0a 5f subi r16, 0xFA ; 250 1afba: 1f 4f sbci r17, 0xFF ; 255 1afbc: 30 e0 ldi r19, 0x00 ; 0 1afbe: 20 e0 ldi r18, 0x00 ; 0 1afc0: 43 e0 ldi r20, 0x03 ; 3 1afc2: 62 e0 ldi r22, 0x02 ; 2 1afc4: 76 e8 ldi r23, 0x86 ; 134 1afc6: de cf rjmp .-68 ; 0x1af84 // 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; 1afc8: 81 e0 ldi r24, 0x01 ; 1 1afca: df cf rjmp .-66 ; 0x1af8a 0001afcc : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 1afcc: 44 e1 ldi r20, 0x14 ; 20 1afce: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 1afd0: 66 23 and r22, r22 1afd2: 89 f0 breq .+34 ; 0x1aff6 strncpy_P(lcd_status_message, message, LCD_WIDTH); 1afd4: bc 01 movw r22, r24 1afd6: 85 e6 ldi r24, 0x65 ; 101 1afd8: 94 e0 ldi r25, 0x04 ; 4 1afda: 0f 94 2b a2 call 0x34456 ; 0x34456 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 1afde: 10 92 79 04 sts 0x0479, r1 ; 0x800479 <_ZL18lcd_status_message.lto_priv.423+0x14> lcd_status_message_idx = 0; // Print message from beginning 1afe2: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.418> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 1afe6: 85 e3 ldi r24, 0x35 ; 53 1afe8: 99 e6 ldi r25, 0x69 ; 105 1afea: 0e 94 18 7d call 0xfa30 ; 0xfa30 // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 1afee: 81 e0 ldi r24, 0x01 ; 1 1aff0: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } 1aff4: 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); 1aff6: bc 01 movw r22, r24 1aff8: 85 e6 ldi r24, 0x65 ; 101 1affa: 94 e0 ldi r25, 0x04 ; 4 1affc: 0f 94 be aa call 0x3557c ; 0x3557c 1b000: ee cf rjmp .-36 ; 0x1afde 0001b002 : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 1b002: 90 91 c0 03 lds r25, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.421> 1b006: 89 17 cp r24, r25 1b008: 80 f4 brcc .+32 ; 0x1b02a return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 1b00a: 91 30 cpi r25, 0x01 ; 1 1b00c: 61 f4 brne .+24 ; 0x1b026 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 1b00e: 80 91 7a 04 lds r24, 0x047A ; 0x80047a <_ZL26lcd_status_message_timeout.lto_priv.422> 1b012: 88 23 and r24, r24 1b014: 51 f0 breq .+20 ; 0x1b02a 1b016: 40 e2 ldi r20, 0x20 ; 32 1b018: 5e e4 ldi r21, 0x4E ; 78 1b01a: 60 e0 ldi r22, 0x00 ; 0 1b01c: 70 e0 ldi r23, 0x00 ; 0 1b01e: 8a e7 ldi r24, 0x7A ; 122 1b020: 94 e0 ldi r25, 0x04 ; 4 1b022: 0d 94 6b 0b jmp 0x216d6 ; 0x216d6 ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 1b026: 80 e0 ldi r24, 0x00 ; 0 1b028: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 1b02a: 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; } 1b02c: 08 95 ret 0001b02e : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 1b02e: ef 92 push r14 1b030: ff 92 push r15 1b032: 1f 93 push r17 1b034: cf 93 push r28 1b036: df 93 push r29 1b038: ec 01 movw r28, r24 1b03a: 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)) { 1b03c: 86 2f mov r24, r22 1b03e: 0e 94 01 d8 call 0x1b002 ; 0x1b002 1b042: 88 23 and r24, r24 1b044: e9 f0 breq .+58 ; 0x1b080 bool same = !(progmem? strcmp_P(lcd_status_message, message): 1b046: be 01 movw r22, r28 1b048: 85 e6 ldi r24, 0x65 ; 101 1b04a: 94 e0 ldi r25, 0x04 ; 4 1b04c: 0f 94 ec a1 call 0x343d8 ; 0x343d8 1b050: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 1b052: 8a e7 ldi r24, 0x7A ; 122 1b054: 94 e0 ldi r25, 0x04 ; 4 1b056: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> lcd_status_message_level = severity; 1b05a: 10 93 c0 03 sts 0x03C0, r17 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.421> custom_message_type = CustomMsg::Status; 1b05e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d custom_message_state = 0; 1b062: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de if (!same) { 1b066: ef 28 or r14, r15 1b068: 59 f0 breq .+22 ; 0x1b080 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 1b06a: 61 e0 ldi r22, 0x01 ; 1 1b06c: ce 01 movw r24, r28 1b06e: 0e 94 e6 d7 call 0x1afcc ; 0x1afcc } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1b072: df 91 pop r29 1b074: cf 91 pop r28 1b076: 1f 91 pop r17 1b078: ff 90 pop r15 1b07a: 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(); 1b07c: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1b080: df 91 pop r29 1b082: cf 91 pop r28 1b084: 1f 91 pop r17 1b086: ff 90 pop r15 1b088: ef 90 pop r14 1b08a: 08 95 ret 0001b08c : manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) { 1b08c: ef 92 push r14 1b08e: ff 92 push r15 1b090: 1f 93 push r17 1b092: cf 93 push r28 1b094: df 93 push r29 1b096: 18 2f mov r17, r24 1b098: eb 01 movw r28, r22 1b09a: 7a 01 movw r14, r20 1b09c: 80 e0 ldi r24, 0x00 ; 0 1b09e: 0f 94 06 23 call 0x2460c ; 0x2460c lcd_beeper_quick_feedback(); FORCE_BL_ON_END; target_temperature[0] = 0; 1b0a2: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1b0a6: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d target_temperature_bed = 0; 1b0aa: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 1b0ae: 10 92 59 12 sts 0x1259, r1 ; 0x801259 manage_heater(); 1b0b2: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(); 1b0b6: 80 e0 ldi r24, 0x00 ; 0 1b0b8: 0e 94 b0 8a call 0x11560 ; 0x11560 lcd_clear(); 1b0bc: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 1b0c0: 83 e0 ldi r24, 0x03 ; 3 1b0c2: 9a e4 ldi r25, 0x4A ; 74 1b0c4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b0c8: ac 01 movw r20, r24 1b0ca: 60 e0 ldi r22, 0x00 ; 0 1b0cc: 80 e0 ldi r24, 0x00 ; 0 1b0ce: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 1b0d2: 83 ef ldi r24, 0xF3 ; 243 1b0d4: 99 e4 ldi r25, 0x49 ; 73 1b0d6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b0da: ac 01 movw r20, r24 1b0dc: 61 e0 ldi r22, 0x01 ; 1 1b0de: 80 e0 ldi r24, 0x00 ; 0 1b0e0: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 switch (testError) 1b0e4: 11 50 subi r17, 0x01 ; 1 1b0e6: 1a 30 cpi r17, 0x0A ; 10 1b0e8: 90 f4 brcc .+36 ; 0x1b10e 1b0ea: e1 2f mov r30, r17 1b0ec: f0 e0 ldi r31, 0x00 ; 0 1b0ee: 88 27 eor r24, r24 1b0f0: e3 58 subi r30, 0x83 ; 131 1b0f2: f7 42 sbci r31, 0x27 ; 39 1b0f4: 8f 4f sbci r24, 0xFF ; 255 1b0f6: 0d 94 4e a5 jmp 0x34a9c ; 0x34a9c <__tablejump2__> 1b0fa: 9a d8 rcall .-3788 ; 0x1a230 1b0fc: a6 d8 rcall .-3764 ; 0x1a24a 1b0fe: be d8 rcall .-3716 ; 0x1a27c 1b100: 04 d9 rcall .-3576 ; 0x1a30a 1b102: 10 d9 rcall .-3552 ; 0x1a324 1b104: 13 d9 rcall .-3546 ; 0x1a32c 1b106: 16 d9 rcall .-3540 ; 0x1a334 1b108: 19 d9 rcall .-3534 ; 0x1a33c 1b10a: 25 d9 rcall .-3510 ; 0x1a356 1b10c: 31 d9 rcall .-3486 ; 0x1a370 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 1b10e: 8f ed ldi r24, 0xDF ; 223 1b110: 99 e4 ldi r25, 0x49 ; 73 1b112: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b116: ac 01 movw r20, r24 1b118: 62 e0 ldi r22, 0x02 ; 2 1b11a: 80 e0 ldi r24, 0x00 ; 0 1b11c: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 1b120: 8f ec ldi r24, 0xCF ; 207 1b122: 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)); 1b124: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b128: ac 01 movw r20, r24 1b12a: 63 e0 ldi r22, 0x03 ; 3 1b12c: 80 e0 ldi r24, 0x00 ; 0 1b12e: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 1b132: 44 c0 rjmp .+136 ; 0x1b1bc 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)); 1b134: 82 ec ldi r24, 0xC2 ; 194 1b136: 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)); 1b138: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b13c: ac 01 movw r20, r24 1b13e: 62 e0 ldi r22, 0x02 ; 2 1b140: 80 e0 ldi r24, 0x00 ; 0 1b142: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1b146: 83 eb ldi r24, 0xB3 ; 179 1b148: 99 e4 ldi r25, 0x49 ; 73 1b14a: ec cf rjmp .-40 ; 0x1b124 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)); 1b14c: 88 ea ldi r24, 0xA8 ; 168 1b14e: 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)); 1b150: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b154: ac 01 movw r20, r24 1b156: 62 e0 ldi r22, 0x02 ; 2 1b158: 80 e0 ldi r24, 0x00 ; 0 1b15a: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1b15e: 83 eb ldi r24, 0xB3 ; 179 1b160: 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)); 1b162: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b166: ac 01 movw r20, r24 1b168: 63 e0 ldi r22, 0x03 ; 3 1b16a: 80 e0 ldi r24, 0x00 ; 0 1b16c: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(18, 3); 1b170: 63 e0 ldi r22, 0x03 ; 3 1b172: 82 e1 ldi r24, 0x12 ; 18 1b174: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print(_error_1); 1b178: ce 01 movw r24, r28 1b17a: 1e c0 rjmp .+60 ; 0x1b1b8 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)); 1b17c: 80 ea ldi r24, 0xA0 ; 160 1b17e: 99 e4 ldi r25, 0x49 ; 73 1b180: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b184: ac 01 movw r20, r24 1b186: 62 e0 ldi r22, 0x02 ; 2 1b188: 80 e0 ldi r24, 0x00 ; 0 1b18a: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(18, 2); 1b18e: 62 e0 ldi r22, 0x02 ; 2 1b190: 82 e1 ldi r24, 0x12 ; 18 1b192: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print(_error_1); 1b196: ce 01 movw r24, r28 1b198: 0e 94 ba 73 call 0xe774 ; 0xe774 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 1b19c: 86 e9 ldi r24, 0x96 ; 150 1b19e: 99 e4 ldi r25, 0x49 ; 73 1b1a0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b1a4: ac 01 movw r20, r24 1b1a6: 63 e0 ldi r22, 0x03 ; 3 1b1a8: 80 e0 ldi r24, 0x00 ; 0 1b1aa: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(18, 3); 1b1ae: 63 e0 ldi r22, 0x03 ; 3 1b1b0: 82 e1 ldi r24, 0x12 ; 18 1b1b2: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print(_error_2); 1b1b6: 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); 1b1b8: 0e 94 ba 73 call 0xe774 ; 0xe774 lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 1b1bc: 68 ee ldi r22, 0xE8 ; 232 1b1be: 73 e0 ldi r23, 0x03 ; 3 1b1c0: 80 e0 ldi r24, 0x00 ; 0 1b1c2: 90 e0 ldi r25, 0x00 ; 0 1b1c4: 0f 94 ce 0a call 0x2159c ; 0x2159c 1b1c8: 80 e0 ldi r24, 0x00 ; 0 1b1ca: 0f 94 06 23 call 0x2460c ; 0x2460c lcd_beeper_quick_feedback(); do { _delay(100); 1b1ce: 64 e6 ldi r22, 0x64 ; 100 1b1d0: 70 e0 ldi r23, 0x00 ; 0 1b1d2: 80 e0 ldi r24, 0x00 ; 0 1b1d4: 90 e0 ldi r25, 0x00 ; 0 1b1d6: 0f 94 ce 0a call 0x2159c ; 0x2159c manage_heater(); 1b1da: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(); 1b1de: 80 e0 ldi r24, 0x00 ; 0 1b1e0: 0e 94 b0 8a call 0x11560 ; 0x11560 } while (!lcd_clicked()); 1b1e4: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1b1e8: 88 23 and r24, r24 1b1ea: 89 f3 breq .-30 ; 0x1b1ce LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1b1ec: 85 e5 ldi r24, 0x55 ; 85 1b1ee: 9a e4 ldi r25, 0x4A ; 74 1b1f0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b1f4: 62 e0 ldi r22, 0x02 ; 2 1b1f6: 0e 94 17 d8 call 0x1b02e ; 0x1b02e lcd_return_to_status(); } 1b1fa: df 91 pop r29 1b1fc: cf 91 pop r28 1b1fe: 1f 91 pop r17 1b200: ff 90 pop r15 1b202: ef 90 pop r14 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 1b204: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 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)); 1b208: 84 e8 ldi r24, 0x84 ; 132 1b20a: 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)); 1b20c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b210: ac 01 movw r20, r24 1b212: 62 e0 ldi r22, 0x02 ; 2 1b214: 80 e0 ldi r24, 0x00 ; 0 1b216: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 1b21a: 80 ea ldi r24, 0xA0 ; 160 1b21c: 99 e4 ldi r25, 0x49 ; 73 1b21e: a1 cf rjmp .-190 ; 0x1b162 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)); 1b220: 8c e1 ldi r24, 0x1C ; 28 1b222: 9e e5 ldi r25, 0x5E ; 94 1b224: 95 cf rjmp .-214 ; 0x1b150 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)); 1b226: 89 e0 ldi r24, 0x09 ; 9 1b228: 9e e5 ldi r25, 0x5E ; 94 1b22a: 92 cf rjmp .-220 ; 0x1b150 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)); 1b22c: 85 e7 ldi r24, 0x75 ; 117 1b22e: 99 e4 ldi r25, 0x49 ; 73 1b230: ed cf rjmp .-38 ; 0x1b20c 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)); 1b232: 87 e6 ldi r24, 0x67 ; 103 1b234: 99 e4 ldi r25, 0x49 ; 73 1b236: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b23a: ac 01 movw r20, r24 1b23c: 62 e0 ldi r22, 0x02 ; 2 1b23e: 80 e0 ldi r24, 0x00 ; 0 1b240: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 1b244: 80 e6 ldi r24, 0x60 ; 96 1b246: 99 e4 ldi r25, 0x49 ; 73 1b248: 8c cf rjmp .-232 ; 0x1b162 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 1b24a: 8e e4 ldi r24, 0x4E ; 78 1b24c: 99 e4 ldi r25, 0x49 ; 73 1b24e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b252: ac 01 movw r20, r24 1b254: 62 e0 ldi r22, 0x02 ; 2 1b256: 80 e0 ldi r24, 0x00 ; 0 1b258: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 1b25c: 84 e4 ldi r24, 0x44 ; 68 1b25e: 99 e4 ldi r25, 0x49 ; 73 1b260: 80 cf rjmp .-256 ; 0x1b162 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1b262: 85 e1 ldi r24, 0x15 ; 21 1b264: 9a e4 ldi r25, 0x4A ; 74 1b266: 68 cf rjmp .-304 ; 0x1b138 0001b268 : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 1b268: 8f 92 push r8 1b26a: 9f 92 push r9 1b26c: af 92 push r10 1b26e: bf 92 push r11 1b270: cf 92 push r12 1b272: df 92 push r13 1b274: ef 92 push r14 1b276: ff 92 push r15 1b278: 0f 93 push r16 1b27a: 1f 93 push r17 1b27c: cf 93 push r28 1b27e: df 93 push r29 1b280: f8 2e mov r15, r24 1b282: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1b286: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1b28a: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1b28e: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1b292: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1b296: 4b 01 movw r8, r22 1b298: 6b 01 movw r12, r22 1b29a: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1b29e: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1b2a2: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1b2a6: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1b2aa: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1b2ae: 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 1b2b0: 9c e3 ldi r25, 0x3C ; 60 1b2b2: a9 2e mov r10, r25 target_temperature[0] = (_isbed) ? 0 : 200; 1b2b4: 88 ec ldi r24, 0xC8 ; 200 1b2b6: 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); 1b2b8: ff 20 and r15, r15 1b2ba: 31 f0 breq .+12 ; 0x1b2c8 1b2bc: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 1b2be: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1b2c0: 24 eb ldi r18, 0xB4 ; 180 1b2c2: a2 2e mov r10, r18 target_temperature[0] = (_isbed) ? 0 : 200; 1b2c4: 90 e0 ldi r25, 0x00 ; 0 1b2c6: 80 e0 ldi r24, 0x00 ; 0 1b2c8: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 1b2cc: 80 93 5d 12 sts 0x125D, r24 ; 0x80125d target_temperature_bed = (_isbed) ? 100 : 0; 1b2d0: 84 e6 ldi r24, 0x64 ; 100 1b2d2: 90 e0 ldi r25, 0x00 ; 0 1b2d4: f1 10 cpse r15, r1 1b2d6: 02 c0 rjmp .+4 ; 0x1b2dc 1b2d8: 90 e0 ldi r25, 0x00 ; 0 1b2da: 80 e0 ldi r24, 0x00 ; 0 1b2dc: 90 93 5a 12 sts 0x125A, r25 ; 0x80125a 1b2e0: 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(); 1b2e4: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 1b2e8: 81 e0 ldi r24, 0x01 ; 1 1b2ea: 0e 94 b0 8a call 0x11560 ; 0x11560 for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b2ee: e1 2c mov r14, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 1b2f0: 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 1b2f2: 85 e0 ldi r24, 0x05 ; 5 1b2f4: 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) 1b2f6: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 1b2fa: 81 11 cpse r24, r1 1b2fc: 1c c0 rjmp .+56 ; 0x1b336 { manage_heater(); 1b2fe: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 1b302: 81 e0 ldi r24, 0x01 ; 1 1b304: 0e 94 b0 8a call 0x11560 ; 0x11560 _progress = (_isbed? 1b308: 00 e9 ldi r16, 0x90 ; 144 1b30a: 11 e0 ldi r17, 0x01 ; 1 1b30c: 20 e0 ldi r18, 0x00 ; 0 1b30e: 42 e0 ldi r20, 0x02 ; 2 1b310: 6b 2d mov r22, r11 1b312: 87 e0 ldi r24, 0x07 ; 7 1b314: f1 10 cpse r15, r1 1b316: 01 c0 rjmp .+2 ; 0x1b31a 1b318: 88 e0 ldi r24, 0x08 ; 8 1b31a: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1b31e: 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 1b320: 8e 2d mov r24, r14 1b322: 69 2d mov r22, r9 1b324: 0f 94 ed a4 call 0x349da ; 0x349da <__udivmodqi4> 1b328: 91 11 cpse r25, r1 1b32a: 02 c0 rjmp .+4 ; 0x1b330 1b32c: 0e 94 2d 7b call 0xf65a ; 0xf65a thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b330: e3 94 inc r14 1b332: ea 10 cpse r14, r10 1b334: e0 cf rjmp .-64 ; 0x1b2f6 MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 1b336: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1b33a: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d target_temperature_bed = 0; 1b33e: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 1b342: 10 92 59 12 sts 0x1259, r1 ; 0x801259 manage_heater(); 1b346: 0f 94 43 37 call 0x26e86 ; 0x26e86 1b34a: b6 01 movw r22, r12 1b34c: dd 0c add r13, r13 1b34e: 88 0b sbc r24, r24 1b350: 99 0b sbc r25, r25 1b352: 4e 01 movw r8, r28 1b354: dd 0f add r29, r29 1b356: aa 08 sbc r10, r10 1b358: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b35a: ff 20 and r15, r15 1b35c: 09 f4 brne .+2 ; 0x1b360 1b35e: 4d c0 rjmp .+154 ; 0x1b3fa 1b360: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1b364: 9b 01 movw r18, r22 1b366: ac 01 movw r20, r24 1b368: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1b36c: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1b370: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1b374: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1b378: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1b37c: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1b380: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b382: c5 01 movw r24, r10 1b384: b4 01 movw r22, r8 1b386: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1b38a: 9b 01 movw r18, r22 1b38c: ac 01 movw r20, r24 1b38e: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1b392: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1b396: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1b39a: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1b39e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1b3a2: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1b3a6: 10 91 3b 12 lds r17, 0x123B ; 0x80123b 1b3aa: 11 11 cpse r17, r1 1b3ac: 0c c0 rjmp .+24 ; 0x1b3c6 1b3ae: f1 10 cpse r15, r1 1b3b0: 44 c0 rjmp .+136 ; 0x1b43a 1b3b2: 69 30 cpi r22, 0x09 ; 9 1b3b4: 71 05 cpc r23, r1 1b3b6: 0c f0 brlt .+2 ; 0x1b3ba 1b3b8: 46 c0 rjmp .+140 ; 0x1b446 { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b3ba: 8e e1 ldi r24, 0x1E ; 30 1b3bc: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 1b3be: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b3c0: c8 17 cp r28, r24 1b3c2: d9 07 cpc r29, r25 1b3c4: 3c f4 brge .+14 ; 0x1b3d4 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 1b3c6: 4f ed ldi r20, 0xDF ; 223 1b3c8: 52 e0 ldi r21, 0x02 ; 2 1b3ca: ba 01 movw r22, r20 1b3cc: 80 e0 ldi r24, 0x00 ; 0 1b3ce: 0e 94 46 d8 call 0x1b08c ; 0x1b08c MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 1b3d2: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); #endif //THERMAL_MODEL manage_heater(); 1b3d4: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 1b3d8: 81 e0 ldi r24, 0x01 ; 1 1b3da: 0e 94 b0 8a call 0x11560 ; 0x11560 return _stepresult; } 1b3de: 81 2f mov r24, r17 1b3e0: df 91 pop r29 1b3e2: cf 91 pop r28 1b3e4: 1f 91 pop r17 1b3e6: 0f 91 pop r16 1b3e8: ff 90 pop r15 1b3ea: ef 90 pop r14 1b3ec: df 90 pop r13 1b3ee: cf 90 pop r12 1b3f0: bf 90 pop r11 1b3f2: af 90 pop r10 1b3f4: 9f 90 pop r9 1b3f6: 8f 90 pop r8 1b3f8: 08 95 ret target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b3fa: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1b3fe: 9b 01 movw r18, r22 1b400: ac 01 movw r20, r24 1b402: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1b406: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1b40a: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1b40e: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1b412: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1b416: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1b41a: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b41c: c5 01 movw r24, r10 1b41e: b4 01 movw r22, r8 1b420: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1b424: 9b 01 movw r18, r22 1b426: ac 01 movw r20, r24 1b428: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1b42c: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1b430: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1b434: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1b438: b2 cf rjmp .-156 ; 0x1b39e */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b43a: 89 e0 ldi r24, 0x09 ; 9 1b43c: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1b43e: 6e 31 cpi r22, 0x1E ; 30 1b440: 71 05 cpc r23, r1 1b442: 0c f4 brge .+2 ; 0x1b446 1b444: bc cf rjmp .-136 ; 0x1b3be else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 1b446: 4f ed ldi r20, 0xDF ; 223 1b448: 52 e0 ldi r21, 0x02 ; 2 1b44a: ba 01 movw r22, r20 1b44c: 81 e0 ldi r24, 0x01 ; 1 1b44e: 0e 94 46 d8 call 0x1b08c ; 0x1b08c 1b452: c0 cf rjmp .-128 ; 0x1b3d4 0001b454 : return _stepresult; } static bool lcd_selfcheck_pulleys(int axis) { 1b454: 2f 92 push r2 1b456: 3f 92 push r3 1b458: 4f 92 push r4 1b45a: 5f 92 push r5 1b45c: 6f 92 push r6 1b45e: 7f 92 push r7 1b460: 8f 92 push r8 1b462: 9f 92 push r9 1b464: af 92 push r10 1b466: bf 92 push r11 1b468: cf 92 push r12 1b46a: df 92 push r13 1b46c: ef 92 push r14 1b46e: ff 92 push r15 1b470: 0f 93 push r16 1b472: 1f 93 push r17 1b474: cf 93 push r28 1b476: df 93 push r29 1b478: 8c 01 movw r16, r24 float current_position_init; float move; bool endstop_triggered = false; int i; unsigned long timeout_counter; refresh_cmd_timeout(); 1b47a: 0e 94 9c 65 call 0xcb38 ; 0xcb38 manage_inactivity(true); 1b47e: 81 e0 ldi r24, 0x01 ; 1 1b480: 0e 94 b0 8a call 0x11560 ; 0x11560 if (axis == 0) move = 50; //X_AXIS else move = 50; //Y_AXIS current_position_init = current_position[axis]; 1b484: 18 01 movw r2, r16 1b486: 22 0c add r2, r2 1b488: 33 1c adc r3, r3 1b48a: 22 0c add r2, r2 1b48c: 33 1c adc r3, r3 1b48e: e1 01 movw r28, r2 1b490: cf 59 subi r28, 0x9F ; 159 1b492: dd 4e sbci r29, 0xED ; 237 1b494: 88 80 ld r8, Y 1b496: 99 80 ldd r9, Y+1 ; 0x01 1b498: aa 80 ldd r10, Y+2 ; 0x02 1b49a: bb 80 ldd r11, Y+3 ; 0x03 current_position[axis] += 2; 1b49c: 20 e0 ldi r18, 0x00 ; 0 1b49e: 30 e0 ldi r19, 0x00 ; 0 1b4a0: 40 e0 ldi r20, 0x00 ; 0 1b4a2: 50 e4 ldi r21, 0x40 ; 64 1b4a4: c5 01 movw r24, r10 1b4a6: b4 01 movw r22, r8 1b4a8: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1b4ac: 68 83 st Y, r22 1b4ae: 79 83 std Y+1, r23 ; 0x01 1b4b0: 8a 83 std Y+2, r24 ; 0x02 1b4b2: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b4b4: 60 e0 ldi r22, 0x00 ; 0 1b4b6: 70 e0 ldi r23, 0x00 ; 0 1b4b8: 84 e3 ldi r24, 0x34 ; 52 1b4ba: 92 e4 ldi r25, 0x42 ; 66 1b4bc: 0f 94 a8 49 call 0x29350 ; 0x29350 1b4c0: 95 e0 ldi r25, 0x05 ; 5 1b4c2: e9 2e mov r14, r25 1b4c4: f1 2c mov r15, r1 for (i = 0; i < 5; i++) { refresh_cmd_timeout(); 1b4c6: 0e 94 9c 65 call 0xcb38 ; 0xcb38 current_position[axis] = current_position[axis] + move; 1b4ca: 20 e0 ldi r18, 0x00 ; 0 1b4cc: 30 e0 ldi r19, 0x00 ; 0 1b4ce: 48 e4 ldi r20, 0x48 ; 72 1b4d0: 52 e4 ldi r21, 0x42 ; 66 1b4d2: 68 81 ld r22, Y 1b4d4: 79 81 ldd r23, Y+1 ; 0x01 1b4d6: 8a 81 ldd r24, Y+2 ; 0x02 1b4d8: 9b 81 ldd r25, Y+3 ; 0x03 1b4da: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1b4de: 68 83 st Y, r22 1b4e0: 79 83 std Y+1, r23 ; 0x01 1b4e2: 8a 83 std Y+2, r24 ; 0x02 1b4e4: 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); 1b4e6: 6c e6 ldi r22, 0x6C ; 108 1b4e8: 70 e0 ldi r23, 0x00 ; 0 1b4ea: 8e e2 ldi r24, 0x2E ; 46 1b4ec: 0e 94 59 d1 call 0x1a2b2 ; 0x1a2b2 st_current_set(0, 850); //set motor current higher plan_buffer_line_curposXYZE(200); 1b4f0: 60 e0 ldi r22, 0x00 ; 0 1b4f2: 70 e0 ldi r23, 0x00 ; 0 1b4f4: 88 e4 ldi r24, 0x48 ; 72 1b4f6: 93 e4 ldi r25, 0x43 ; 67 1b4f8: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 1b4fc: 0f 94 5b 18 call 0x230b6 ; 0x230b6 if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]); //set back to normal operation currents 1b500: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb 1b504: 62 e2 ldi r22, 0x22 ; 34 1b506: 70 e0 ldi r23, 0x00 ; 0 1b508: 81 11 cpse r24, r1 1b50a: 02 c0 rjmp .+4 ; 0x1b510 1b50c: 64 e4 ldi r22, 0x44 ; 68 1b50e: 70 e0 ldi r23, 0x00 ; 0 1b510: 8e e2 ldi r24, 0x2E ; 46 1b512: 0e 94 59 d1 call 0x1a2b2 ; 0x1a2b2 else st_current_set(0, tmp_motor_loud[0]); //set motor current back current_position[axis] = current_position[axis] - move; 1b516: 20 e0 ldi r18, 0x00 ; 0 1b518: 30 e0 ldi r19, 0x00 ; 0 1b51a: 48 e4 ldi r20, 0x48 ; 72 1b51c: 52 e4 ldi r21, 0x42 ; 66 1b51e: 68 81 ld r22, Y 1b520: 79 81 ldd r23, Y+1 ; 0x01 1b522: 8a 81 ldd r24, Y+2 ; 0x02 1b524: 9b 81 ldd r25, Y+3 ; 0x03 1b526: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1b52a: 68 83 st Y, r22 1b52c: 79 83 std Y+1, r23 ; 0x01 1b52e: 8a 83 std Y+2, r24 ; 0x02 1b530: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(50); 1b532: 60 e0 ldi r22, 0x00 ; 0 1b534: 70 e0 ldi r23, 0x00 ; 0 1b536: 88 e4 ldi r24, 0x48 ; 72 1b538: 92 e4 ldi r25, 0x42 ; 66 1b53a: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 1b53e: 0f 94 5b 18 call 0x230b6 ; 0x230b6 if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1b542: 1e 99 sbic 0x03, 6 ; 3 1b544: 3a c0 rjmp .+116 ; 0x1b5ba 1b546: 1d 99 sbic 0x03, 5 ; 3 1b548: 38 c0 rjmp .+112 ; 0x1b5ba 1b54a: 21 e0 ldi r18, 0x01 ; 1 1b54c: e2 1a sub r14, r18 1b54e: 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++) { 1b550: 09 f0 breq .+2 ; 0x1b554 1b552: b9 cf rjmp .-142 ; 0x1b4c6 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) { lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } timeout_counter = _millis() + 2500; 1b554: 0f 94 01 0b call 0x21602 ; 0x21602 1b558: 2b 01 movw r4, r22 1b55a: 3c 01 movw r6, r24 1b55c: 24 ec ldi r18, 0xC4 ; 196 1b55e: 42 0e add r4, r18 1b560: 29 e0 ldi r18, 0x09 ; 9 1b562: 52 1e adc r5, r18 1b564: 61 1c adc r6, r1 1b566: 71 1c adc r7, r1 endstop_triggered = false; manage_inactivity(true); 1b568: 81 e0 ldi r24, 0x01 ; 1 1b56a: 0e 94 b0 8a call 0x11560 ; 0x11560 1b56e: e1 01 movw r28, r2 1b570: cf 59 subi r28, 0x9F ; 159 1b572: dd 4e sbci r29, 0xED ; 237 1b574: c8 80 ld r12, Y 1b576: d9 80 ldd r13, Y+1 ; 0x01 1b578: ea 80 ldd r14, Y+2 ; 0x02 1b57a: 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]) { 1b57c: 20 e0 ldi r18, 0x00 ; 0 1b57e: 30 e0 ldi r19, 0x00 ; 0 1b580: 40 e8 ldi r20, 0x80 ; 128 1b582: 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) || 1b584: 1e 99 sbic 0x03, 6 ; 3 1b586: 26 c0 rjmp .+76 ; 0x1b5d4 1b588: 1d 99 sbic 0x03, 5 ; 3 1b58a: 24 c0 rjmp .+72 ; 0x1b5d4 lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } else { current_position[axis] -= 1; 1b58c: c7 01 movw r24, r14 1b58e: b6 01 movw r22, r12 1b590: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1b594: 68 83 st Y, r22 1b596: 79 83 std Y+1, r23 ; 0x01 1b598: 8a 83 std Y+2, r24 ; 0x02 1b59a: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b59c: 60 e0 ldi r22, 0x00 ; 0 1b59e: 70 e0 ldi r23, 0x00 ; 0 1b5a0: 84 e3 ldi r24, 0x34 ; 52 1b5a2: 92 e4 ldi r25, 0x42 ; 66 1b5a4: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 1b5a8: 0f 94 5b 18 call 0x230b6 ; 0x230b6 if (_millis() > timeout_counter) { 1b5ac: 0f 94 01 0b call 0x21602 ; 0x21602 1b5b0: 46 16 cp r4, r22 1b5b2: 57 06 cpc r5, r23 1b5b4: 68 06 cpc r6, r24 1b5b6: 79 06 cpc r7, r25 1b5b8: e8 f6 brcc .-70 ; 0x1b574 lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); 1b5ba: 68 ec ldi r22, 0xC8 ; 200 1b5bc: 72 e0 ldi r23, 0x02 ; 2 1b5be: 01 2b or r16, r17 1b5c0: 11 f0 breq .+4 ; 0x1b5c6 1b5c2: 6a ec ldi r22, 0xCA ; 202 1b5c4: 72 e0 ldi r23, 0x02 ; 2 1b5c6: 4f ed ldi r20, 0xDF ; 223 1b5c8: 52 e0 ldi r21, 0x02 ; 2 1b5ca: 87 e0 ldi r24, 0x07 ; 7 1b5cc: 0e 94 46 d8 call 0x1b08c ; 0x1b08c return(false); 1b5d0: 80 e0 ldi r24, 0x00 ; 0 1b5d2: 30 c0 rjmp .+96 ; 0x1b634 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]) { 1b5d4: c5 01 movw r24, r10 1b5d6: b4 01 movw r22, r8 1b5d8: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1b5dc: a7 01 movw r20, r14 1b5de: 96 01 movw r18, r12 1b5e0: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1b5e4: 18 16 cp r1, r24 1b5e6: 4c f3 brlt .-46 ; 0x1b5ba 1b5e8: 20 e0 ldi r18, 0x00 ; 0 1b5ea: 30 e0 ldi r19, 0x00 ; 0 1b5ec: 40 e8 ldi r20, 0x80 ; 128 1b5ee: 5f e3 ldi r21, 0x3F ; 63 1b5f0: c5 01 movw r24, r10 1b5f2: b4 01 movw r22, r8 1b5f4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1b5f8: a7 01 movw r20, r14 1b5fa: 96 01 movw r18, r12 1b5fc: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1b600: 87 fd sbrc r24, 7 1b602: db cf rjmp .-74 ; 0x1b5ba current_position[axis] += 10; 1b604: e1 01 movw r28, r2 1b606: cf 59 subi r28, 0x9F ; 159 1b608: dd 4e sbci r29, 0xED ; 237 1b60a: 20 e0 ldi r18, 0x00 ; 0 1b60c: 30 e0 ldi r19, 0x00 ; 0 1b60e: 40 e2 ldi r20, 0x20 ; 32 1b610: 51 e4 ldi r21, 0x41 ; 65 1b612: c7 01 movw r24, r14 1b614: b6 01 movw r22, r12 1b616: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1b61a: 68 83 st Y, r22 1b61c: 79 83 std Y+1, r23 ; 0x01 1b61e: 8a 83 std Y+2, r24 ; 0x02 1b620: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b622: 60 e0 ldi r22, 0x00 ; 0 1b624: 70 e0 ldi r23, 0x00 ; 0 1b626: 84 e3 ldi r24, 0x34 ; 52 1b628: 92 e4 ldi r25, 0x42 ; 66 1b62a: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 1b62e: 0f 94 5b 18 call 0x230b6 ; 0x230b6 return(true); 1b632: 81 e0 ldi r24, 0x01 ; 1 return(false); } } } return(true); } 1b634: df 91 pop r29 1b636: cf 91 pop r28 1b638: 1f 91 pop r17 1b63a: 0f 91 pop r16 1b63c: ff 90 pop r15 1b63e: ef 90 pop r14 1b640: df 90 pop r13 1b642: cf 90 pop r12 1b644: bf 90 pop r11 1b646: af 90 pop r10 1b648: 9f 90 pop r9 1b64a: 8f 90 pop r8 1b64c: 7f 90 pop r7 1b64e: 6f 90 pop r6 1b650: 5f 90 pop r5 1b652: 4f 90 pop r4 1b654: 3f 90 pop r3 1b656: 2f 90 pop r2 1b658: 08 95 ret 0001b65a : } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1b65a: 2f 92 push r2 1b65c: 3f 92 push r3 1b65e: 4f 92 push r4 1b660: 5f 92 push r5 1b662: 6f 92 push r6 1b664: 7f 92 push r7 1b666: 8f 92 push r8 1b668: 9f 92 push r9 1b66a: af 92 push r10 1b66c: bf 92 push r11 1b66e: cf 92 push r12 1b670: df 92 push r13 1b672: ef 92 push r14 1b674: ff 92 push r15 1b676: 0f 93 push r16 1b678: 1f 93 push r17 1b67a: cf 93 push r28 1b67c: df 93 push r29 1b67e: 7c 01 movw r14, r24 1b680: 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); 1b682: cb 01 movw r24, r22 1b684: 6a e0 ldi r22, 0x0A ; 10 1b686: 70 e0 ldi r23, 0x00 ; 0 1b688: 0f 94 1b a5 call 0x34a36 ; 0x34a36 <__divmodhi4> 1b68c: 66 0e add r6, r22 1b68e: 77 1e adc r7, r23 if (_axis == X_AXIS) { 1b690: e1 14 cp r14, r1 1b692: f1 04 cpc r15, r1 1b694: e1 f4 brne .+56 ; 0x1b6ce current_position[Z_AXIS] += 17; 1b696: 20 e0 ldi r18, 0x00 ; 0 1b698: 30 e0 ldi r19, 0x00 ; 0 1b69a: 48 e8 ldi r20, 0x88 ; 136 1b69c: 51 e4 ldi r21, 0x41 ; 65 1b69e: 60 91 69 12 lds r22, 0x1269 ; 0x801269 1b6a2: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 1b6a6: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 1b6aa: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 1b6ae: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1b6b2: 60 93 69 12 sts 0x1269, r22 ; 0x801269 1b6b6: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 1b6ba: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 1b6be: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b6c2: 60 e0 ldi r22, 0x00 ; 0 1b6c4: 70 e0 ldi r23, 0x00 ; 0 1b6c6: 84 e3 ldi r24, 0x34 ; 52 1b6c8: 92 e4 ldi r25, 0x42 ; 66 1b6ca: 0f 94 a8 49 call 0x29350 ; 0x29350 } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1b6ce: 10 e0 ldi r17, 0x00 ; 0 1b6d0: 00 e0 ldi r16, 0x00 ; 0 1b6d2: d0 e0 ldi r29, 0x00 ; 0 1b6d4: c0 e0 ldi r28, 0x00 ; 0 1b6d6: d1 2c mov r13, r1 1b6d8: c1 2c mov r12, r1 1b6da: 31 2c mov r3, r1 1b6dc: 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; 1b6de: 57 01 movw r10, r14 1b6e0: aa 0c add r10, r10 1b6e2: bb 1c adc r11, r11 1b6e4: aa 0c add r10, r10 1b6e6: bb 1c adc r11, r11 1b6e8: c5 01 movw r24, r10 1b6ea: 8f 59 subi r24, 0x9F ; 159 1b6ec: 9d 4e sbci r25, 0xED ; 237 1b6ee: 4c 01 movw r8, r24 { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1b6f0: 94 e0 ldi r25, 0x04 ; 4 1b6f2: 29 2e mov r2, r25 1b6f4: 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; 1b6f6: 20 e0 ldi r18, 0x00 ; 0 1b6f8: 30 e0 ldi r19, 0x00 ; 0 1b6fa: 40 e8 ldi r20, 0x80 ; 128 1b6fc: 5f e3 ldi r21, 0x3F ; 63 1b6fe: f4 01 movw r30, r8 1b700: 60 81 ld r22, Z 1b702: 71 81 ldd r23, Z+1 ; 0x01 1b704: 82 81 ldd r24, Z+2 ; 0x02 1b706: 93 81 ldd r25, Z+3 ; 0x03 1b708: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1b70c: f4 01 movw r30, r8 1b70e: 60 83 st Z, r22 1b710: 71 83 std Z+1, r23 ; 0x01 1b712: 82 83 std Z+2, r24 ; 0x02 1b714: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b716: 60 e0 ldi r22, 0x00 ; 0 1b718: 70 e0 ldi r23, 0x00 ; 0 1b71a: 84 e3 ldi r24, 0x34 ; 52 1b71c: 92 e4 ldi r25, 0x42 ; 66 1b71e: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 1b722: 0f 94 5b 18 call 0x230b6 ; 0x230b6 if ((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) || (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) || 1b726: 1e 99 sbic 0x03, 6 ; 3 1b728: 04 c0 rjmp .+8 ; 0x1b732 1b72a: 1d 99 sbic 0x03, 5 ; 3 1b72c: 02 c0 rjmp .+4 ; 0x1b732 1b72e: 1c 9b sbis 0x03, 4 ; 3 1b730: 39 c0 rjmp .+114 ; 0x1b7a4 (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING)) { if (_axis == 0) { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b732: 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) 1b734: e1 14 cp r14, r1 1b736: f1 04 cpc r15, r1 1b738: 51 f4 brne .+20 ; 0x1b74e { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b73a: 56 fa bst r5, 6 1b73c: 55 24 eor r5, r5 1b73e: 50 f8 bld r5, 0 _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2; 1b740: 1d 99 sbic 0x03, 5 ; 3 1b742: 8e c0 rjmp .+284 ; 0x1b860 } 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; 1b744: c2 e0 ldi r28, 0x02 ; 2 1b746: 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; 1b748: 44 24 eor r4, r4 1b74a: 43 94 inc r4 1b74c: 2c c0 rjmp .+88 ; 0x1b7a6 { _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) 1b74e: f1 e0 ldi r31, 0x01 ; 1 1b750: ef 16 cp r14, r31 1b752: f1 04 cpc r15, r1 1b754: 41 f4 brne .+16 ; 0x1b766 { _stepresult = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b756: 55 fa bst r5, 5 1b758: 55 24 eor r5, r5 1b75a: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 2; 1b75c: 1e 9b sbis 0x03, 6 ; 3 1b75e: f2 cf rjmp .-28 ; 0x1b744 1b760: d0 e0 ldi r29, 0x00 ; 0 1b762: c0 e0 ldi r28, 0x00 ; 0 1b764: f1 cf rjmp .-30 ; 0x1b748 } if (_axis == 2) { _stepresult = ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b766: 54 fa bst r5, 4 1b768: 55 24 eor r5, r5 1b76a: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 1; 1b76c: 83 b1 in r24, 0x03 ; 3 1b76e: 82 95 swap r24 1b770: 86 95 lsr r24 1b772: 86 95 lsr r24 1b774: 83 70 andi r24, 0x03 ; 3 1b776: 21 e0 ldi r18, 0x01 ; 1 1b778: 82 27 eor r24, r18 1b77a: 81 70 andi r24, 0x01 ; 1 1b77c: c8 2f mov r28, r24 1b77e: 80 e0 ldi r24, 0x00 ; 0 1b780: d8 2f mov r29, r24 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); 1b782: 8f 93 push r24 1b784: cf 93 push r28 1b786: 1f 92 push r1 1b788: 5f 92 push r5 1b78a: e8 e9 ldi r30, 0x98 ; 152 1b78c: f4 e8 ldi r31, 0x84 ; 132 1b78e: ff 93 push r31 1b790: ef 93 push r30 1b792: 0f 94 00 a3 call 0x34600 ; 0x34600 1b796: 0f 90 pop r0 1b798: 0f 90 pop r0 1b79a: 0f 90 pop r0 1b79c: 0f 90 pop r0 1b79e: 0f 90 pop r0 1b7a0: 0f 90 pop r0 1b7a2: d2 cf rjmp .-92 ; 0x1b748 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) || 1b7a4: 41 2c mov r4, r1 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); } _stepdone = true; } if (_lcd_refresh < 6) 1b7a6: 06 30 cpi r16, 0x06 ; 6 1b7a8: 11 05 cpc r17, r1 1b7aa: 0c f0 brlt .+2 ; 0x1b7ae 1b7ac: 4f c0 rjmp .+158 ; 0x1b84c { _lcd_refresh++; 1b7ae: 0f 5f subi r16, 0xFF ; 255 1b7b0: 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(); 1b7b2: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 1b7b6: 81 e0 ldi r24, 0x01 ; 1 1b7b8: 0e 94 b0 8a call 0x11560 ; 0x11560 (_travel_done <= _travel) ? _travel_done++ : _stepdone = true; 1b7bc: 6c 14 cp r6, r12 1b7be: 7d 04 cpc r7, r13 1b7c0: 34 f0 brlt .+12 ; 0x1b7ce 1b7c2: 8f ef ldi r24, 0xFF ; 255 1b7c4: c8 1a sub r12, r24 1b7c6: d8 0a sbc r13, r24 } while (!_stepdone); 1b7c8: 44 20 and r4, r4 1b7ca: 09 f4 brne .+2 ; 0x1b7ce 1b7cc: 94 cf rjmp .-216 ; 0x1b6f6 if (!_stepresult) 1b7ce: 51 10 cpse r5, r1 1b7d0: 20 c0 rjmp .+64 ; 0x1b812 { const char *_error_1; const char *_error_2; if (_axis == X_AXIS) _error_1 = "X"; if (_axis == Y_AXIS) _error_1 = "Y"; 1b7d2: 6a ec ldi r22, 0xCA ; 202 1b7d4: 72 e0 ldi r23, 0x02 ; 2 1b7d6: 91 e0 ldi r25, 0x01 ; 1 1b7d8: e9 16 cp r14, r25 1b7da: f1 04 cpc r15, r1 1b7dc: 41 f0 breq .+16 ; 0x1b7ee if (_axis == Z_AXIS) _error_1 = "Z"; 1b7de: 6c ec ldi r22, 0xCC ; 204 1b7e0: 72 e0 ldi r23, 0x02 ; 2 1b7e2: e2 e0 ldi r30, 0x02 ; 2 1b7e4: ee 16 cp r14, r30 1b7e6: f1 04 cpc r15, r1 1b7e8: 11 f0 breq .+4 ; 0x1b7ee 1b7ea: 68 ec ldi r22, 0xC8 ; 200 1b7ec: 72 e0 ldi r23, 0x02 ; 2 if (_err_endstop == 0) _error_2 = "X"; if (_err_endstop == 1) _error_2 = "Y"; 1b7ee: 4a ec ldi r20, 0xCA ; 202 1b7f0: 52 e0 ldi r21, 0x02 ; 2 1b7f2: c1 30 cpi r28, 0x01 ; 1 1b7f4: d1 05 cpc r29, r1 1b7f6: 31 f0 breq .+12 ; 0x1b804 if (_err_endstop == 2) _error_2 = "Z"; 1b7f8: 4c ec ldi r20, 0xCC ; 204 1b7fa: 52 e0 ldi r21, 0x02 ; 2 1b7fc: 22 97 sbiw r28, 0x02 ; 2 1b7fe: 11 f0 breq .+4 ; 0x1b804 1b800: 48 ec ldi r20, 0xC8 ; 200 1b802: 52 e0 ldi r21, 0x02 ; 2 if (_travel_done >= _travel) { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); 1b804: 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) 1b806: c6 14 cp r12, r6 1b808: d7 04 cpc r13, r7 1b80a: 0c f4 brge .+2 ; 0x1b80e { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); } else { lcd_selftest_error(TestError::Motor, _error_1, _error_2); 1b80c: 83 e0 ldi r24, 0x03 ; 3 1b80e: 0e 94 46 d8 call 0x1b08c ; 0x1b08c } } current_position[_axis] = 0; //simulate axis home to avoid negative numbers for axis position, especially Z. 1b812: f5 01 movw r30, r10 1b814: ef 59 subi r30, 0x9F ; 159 1b816: fd 4e sbci r31, 0xED ; 237 1b818: 10 82 st Z, r1 1b81a: 11 82 std Z+1, r1 ; 0x01 1b81c: 12 82 std Z+2, r1 ; 0x02 1b81e: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1b820: 0f 94 68 48 call 0x290d0 ; 0x290d0 return _stepresult; } 1b824: 85 2d mov r24, r5 1b826: df 91 pop r29 1b828: cf 91 pop r28 1b82a: 1f 91 pop r17 1b82c: 0f 91 pop r16 1b82e: ff 90 pop r15 1b830: ef 90 pop r14 1b832: df 90 pop r13 1b834: cf 90 pop r12 1b836: bf 90 pop r11 1b838: af 90 pop r10 1b83a: 9f 90 pop r9 1b83c: 8f 90 pop r8 1b83e: 7f 90 pop r7 1b840: 6f 90 pop r6 1b842: 5f 90 pop r5 1b844: 4f 90 pop r4 1b846: 3f 90 pop r3 1b848: 2f 90 pop r2 1b84a: 08 95 ret { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1b84c: 10 e0 ldi r17, 0x00 ; 0 1b84e: 00 e0 ldi r16, 0x00 ; 0 1b850: 20 e0 ldi r18, 0x00 ; 0 1b852: 43 e0 ldi r20, 0x03 ; 3 1b854: 63 2d mov r22, r3 1b856: 82 2d mov r24, r2 1b858: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1b85c: 38 2e mov r3, r24 1b85e: a9 cf rjmp .-174 ; 0x1b7b2 (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; 1b860: c1 e0 ldi r28, 0x01 ; 1 1b862: d0 e0 ldi r29, 0x00 ; 0 1b864: 71 cf rjmp .-286 ; 0x1b748 0001b866 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 1b866: 0f 94 18 05 call 0x20a30 ; 0x20a30 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1b86a: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.421> 1b86e: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 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() 1b872: 81 11 cpse r24, r1 1b874: 39 c0 rjmp .+114 ; 0x1b8e8 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 1b876: 80 91 40 02 lds r24, 0x0240 ; 0x800240 1b87a: 81 11 cpse r24, r1 1b87c: 02 c0 rjmp .+4 ; 0x1b882 #endif ) { return false; // abort if error persists } return true; 1b87e: 81 e0 ldi r24, 0x01 ; 1 1b880: 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; 1b882: 8f ef ldi r24, 0xFF ; 255 1b884: 80 93 55 12 sts 0x1255, r24 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1b888: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d #endif manage_heater(); 1b88c: 0f 94 43 37 call 0x26e86 ; 0x26e86 { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); setExtruderAutoFanState(3); //force enables the hotend fan 1b890: 83 e0 ldi r24, 0x03 ; 3 1b892: 0e 94 0a 78 call 0xf014 ; 0xf014 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 1b896: 0f 94 01 0b call 0x21602 ; 0x21602 1b89a: 60 93 07 17 sts 0x1707, r22 ; 0x801707 1b89e: 70 93 08 17 sts 0x1708, r23 ; 0x801708 1b8a2: 80 93 09 17 sts 0x1709, r24 ; 0x801709 1b8a6: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a fan_measuring = true; 1b8aa: 81 e0 ldi r24, 0x01 ; 1 1b8ac: 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) 1b8b0: 68 ee ldi r22, 0xE8 ; 232 1b8b2: 73 e0 ldi r23, 0x03 ; 3 1b8b4: 80 e0 ldi r24, 0x00 ; 0 1b8b6: 90 e0 ldi r25, 0x00 ; 0 1b8b8: 0f 94 ce 0a call 0x2159c ; 0x2159c manage_heater(); 1b8bc: 0f 94 43 37 call 0x26e86 ; 0x26e86 setExtruderAutoFanState(1); //releases lock on the hotend fan 1b8c0: 81 e0 ldi r24, 0x01 ; 1 1b8c2: 0e 94 0a 78 call 0xf014 ; 0xf014 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1b8c6: 10 92 55 12 sts 0x1255, r1 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1b8ca: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d #endif manage_heater(); 1b8ce: 0f 94 43 37 call 0x26e86 ; 0x26e86 _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 1b8d2: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 1b8d6: 90 91 b8 03 lds r25, 0x03B8 ; 0x8003b8 1b8da: 45 97 sbiw r24, 0x15 ; 21 1b8dc: 84 f6 brge .-96 ; 0x1b87e LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 1b8de: 62 e0 ldi r22, 0x02 ; 2 1b8e0: 8a ec ldi r24, 0xCA ; 202 1b8e2: 98 e6 ldi r25, 0x68 ; 104 1b8e4: 0e 94 17 d8 call 0x1b02e ; 0x1b02e if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 1b8e8: 80 e0 ldi r24, 0x00 ; 0 } return true; } 1b8ea: 08 95 ret 0001b8ec : //! @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; 1b8ec: 0e 94 33 dc call 0x1b866 ; 0x1b866 1b8f0: 88 23 and r24, r24 1b8f2: 21 f0 breq .+8 ; 0x1b8fc // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 1b8f4: 80 ef ldi r24, 0xF0 ; 240 1b8f6: 98 e6 ldi r25, 0x68 ; 104 1b8f8: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 } 1b8fc: 08 95 ret 0001b8fe : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 1b8fe: cf 93 push r28 1b900: df 93 push r29 1b902: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1b904: 80 e0 ldi r24, 0x00 ; 0 1b906: 0e 94 01 d8 call 0x1b002 ; 0x1b002 1b90a: 88 23 and r24, r24 1b90c: 31 f0 breq .+12 ; 0x1b91a lcd_updatestatus(message, true); 1b90e: 61 e0 ldi r22, 0x01 ; 1 1b910: ce 01 movw r24, r28 } 1b912: df 91 pop r29 1b914: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 1b916: 0c 94 e6 d7 jmp 0x1afcc ; 0x1afcc } 1b91a: df 91 pop r29 1b91c: cf 91 pop r28 1b91e: 08 95 ret 0001b920 : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 1b920: 61 e0 ldi r22, 0x01 ; 1 1b922: 82 e0 ldi r24, 0x02 ; 2 1b924: 9d e6 ldi r25, 0x6D ; 109 1b926: 0e 94 65 8d call 0x11aca ; 0x11aca custom_message_type = CustomMsg::FilamentLoading; //just print status message 1b92a: 82 e0 ldi r24, 0x02 ; 2 1b92c: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1b930: 88 ec ldi r24, 0xC8 ; 200 1b932: 9a e5 ldi r25, 0x5A ; 90 1b934: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b938: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe lcd_return_to_status(); 1b93c: 0f 94 18 05 call 0x20a30 ; 0x20a30 lcd_draw_update = 3; 1b940: 83 e0 ldi r24, 0x03 ; 3 1b942: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } 1b946: 08 95 ret 0001b948 : //! @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; 1b948: 0e 94 33 dc call 0x1b866 ; 0x1b866 1b94c: 88 23 and r24, r24 1b94e: 51 f1 breq .+84 ; 0x1b9a4 cmdqueue_serial_disabled = false; 1b950: 10 92 93 03 sts 0x0393, r1 ; 0x800393 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1b954: 88 ec ldi r24, 0xC8 ; 200 1b956: 9a e5 ldi r25, 0x5A ; 90 1b958: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1b95c: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe st_synchronize(); 1b960: 0f 94 5b 18 call 0x230b6 ; 0x230b6 custom_message_type = CustomMsg::Resuming; 1b964: 88 e0 ldi r24, 0x08 ; 8 1b966: 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(); 1b96a: 0e 94 fd 77 call 0xeffa ; 0xeffa setExtruderAutoFanState(1); 1b96e: 81 e0 ldi r24, 0x01 ; 1 1b970: 0e 94 0a 78 call 0xf014 ; 0xf014 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); Stopped = false; 1b974: 10 92 3b 12 sts 0x123B, r1 ; 0x80123b restore_print_from_ram_and_continue(default_retraction); 1b978: 60 e0 ldi r22, 0x00 ; 0 1b97a: 70 e0 ldi r23, 0x00 ; 0 1b97c: 80 e8 ldi r24, 0x80 ; 128 1b97e: 9f e3 ldi r25, 0x3F ; 63 1b980: 0e 94 13 67 call 0xce26 ; 0xce26 did_pause_print = false; 1b984: 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(); 1b988: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 1b98c: 82 30 cpi r24, 0x02 ; 2 1b98e: 11 f4 brne .+4 ; 0x1b994 1b990: 0f 94 85 16 call 0x22d0a ; 0x22d0a refresh_cmd_timeout(); 1b994: 0e 94 9c 65 call 0xcb38 ; 0xcb38 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 1b998: 8f ed ldi r24, 0xDF ; 223 1b99a: 98 e6 ldi r25, 0x68 ; 104 1b99c: 0e 94 18 7d call 0xfa30 ; 0xfa30 custom_message_type = CustomMsg::Status; 1b9a0: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d } 1b9a4: 08 95 ret 0001b9a6 : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 1b9a6: cf 93 push r28 1b9a8: df 93 push r29 1b9aa: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1b9ac: 80 e0 ldi r24, 0x00 ; 0 1b9ae: 0e 94 01 d8 call 0x1b002 ; 0x1b002 1b9b2: 88 23 and r24, r24 1b9b4: 31 f0 breq .+12 ; 0x1b9c2 lcd_updatestatus(message); 1b9b6: 60 e0 ldi r22, 0x00 ; 0 1b9b8: ce 01 movw r24, r28 } 1b9ba: df 91 pop r29 1b9bc: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 1b9be: 0c 94 e6 d7 jmp 0x1afcc ; 0x1afcc } 1b9c2: df 91 pop r29 1b9c4: cf 91 pop r28 1b9c6: 08 95 ret 0001b9c8 : 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) { 1b9c8: cf 93 push r28 1b9ca: df 93 push r29 1b9cc: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 1b9ce: 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) { 1b9d0: 66 23 and r22, r22 1b9d2: 89 f1 breq .+98 ; 0x1ba36 1b9d4: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 1b9d6: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 cancel_heatup = true; 1b9da: 81 e0 ldi r24, 0x01 ; 1 1b9dc: 80 93 5f 0d sts 0x0D5F, r24 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.390> heating_status = HeatingStatus::NO_HEATING; 1b9e0: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb // Clear any saved printing state cancel_saved_printing(); 1b9e4: 0e 94 62 64 call 0xc8c4 ; 0xc8c4 // Abort the planner planner_abort_hard(); 1b9e8: 0f 94 22 4c call 0x29844 ; 0x29844 // Reset the queue cmdqueue_reset(); 1b9ec: 0e 94 bf 83 call 0x1077e ; 0x1077e cmdqueue_serial_disabled = false; 1b9f0: 10 92 93 03 sts 0x0393, r1 ; 0x800393 st_reset_timer(); 1b9f4: 0f 94 a5 18 call 0x2314a ; 0x2314a CRITICAL_SECTION_END; 1b9f8: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 1b9fa: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd print_job_timer.stop(); 1b9fe: 0f 94 a9 16 call 0x22d52 ; 0x22d52 } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 1ba02: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 1ba06: 88 23 and r24, r24 1ba08: 21 f0 breq .+8 ; 0x1ba12 // Reset the sd status card.sdprinting = false; 1ba0a: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 card.closefile(); 1ba0e: 0f 94 6f 65 call 0x2cade ; 0x2cade } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 1ba12: 82 e2 ldi r24, 0x22 ; 34 1ba14: 99 e6 ldi r25, 0x69 ; 105 1ba16: 0e 94 18 7d call 0xfa30 ; 0xfa30 #ifdef MESH_BED_LEVELING mbl.active = false; 1ba1a: 10 92 09 13 sts 0x1309, r1 ; 0x801309 #endif if (interactive) { 1ba1e: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 1ba20: 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; 1ba24: 81 e0 ldi r24, 0x01 ; 1 1ba26: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1ba2a: 10 92 61 0d sts 0x0D61, r1 ; 0x800d61 <_ZL13printer_state.lto_priv.385> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 1ba2e: df 91 pop r29 1ba30: 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(); 1ba32: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 } void ConditionalStop() { CRITICAL_SECTION_START; 1ba36: 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; 1ba38: 81 e0 ldi r24, 0x01 ; 1 1ba3a: 80 93 5f 0d sts 0x0D5F, r24 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.390> heating_status = HeatingStatus::NO_HEATING; 1ba3e: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb // Clear any saved printing state cancel_saved_printing(); 1ba42: 0e 94 62 64 call 0xc8c4 ; 0xc8c4 // Abort the planner planner_abort_hard(); 1ba46: 0f 94 22 4c call 0x29844 ; 0x29844 // Reset the queue cmdqueue_reset(); 1ba4a: 0e 94 bf 83 call 0x1077e ; 0x1077e cmdqueue_serial_disabled = false; 1ba4e: 10 92 93 03 sts 0x0393, r1 ; 0x800393 st_reset_timer(); 1ba52: 0f 94 a5 18 call 0x2314a ; 0x2314a CRITICAL_SECTION_END; 1ba56: df bf out 0x3f, r29 ; 63 1ba58: d4 cf rjmp .-88 ; 0x1ba02 0001ba5a : } void lcd_print_stop() { print_stop(true); 1ba5a: 60 e0 ldi r22, 0x00 ; 0 1ba5c: 81 e0 ldi r24, 0x01 ; 1 1ba5e: 0c 94 e4 dc jmp 0x1b9c8 ; 0x1b9c8 0001ba62 : lcd_update(2); } #ifndef TMC2130 static void lcd_show_end_stops() { lcd_puts_at_P(0, 0, (PSTR("End stops diag"))); 1ba62: 45 ee ldi r20, 0xE5 ; 229 1ba64: 53 e8 ldi r21, 0x83 ; 131 1ba66: 60 e0 ldi r22, 0x00 ; 0 1ba68: 80 e0 ldi r24, 0x00 ; 0 1ba6a: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 1, (READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) ? (PSTR("X1")) : (PSTR("X0"))); 1ba6e: 1e 99 sbic 0x03, 6 ; 3 1ba70: 16 c0 rjmp .+44 ; 0x1ba9e 1ba72: 4f ed ldi r20, 0xDF ; 223 1ba74: 53 e8 ldi r21, 0x83 ; 131 1ba76: 61 e0 ldi r22, 0x01 ; 1 1ba78: 80 e0 ldi r24, 0x00 ; 0 1ba7a: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 1ba7e: 1d 9b sbis 0x03, 5 ; 3 1ba80: 11 c0 rjmp .+34 ; 0x1baa4 1ba82: 4c ed ldi r20, 0xDC ; 220 1ba84: 53 e8 ldi r21, 0x83 ; 131 1ba86: 62 e0 ldi r22, 0x02 ; 2 1ba88: 80 e0 ldi r24, 0x00 ; 0 1ba8a: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 1ba8e: 1c 9b sbis 0x03, 4 ; 3 1ba90: 0c c0 rjmp .+24 ; 0x1baaa 1ba92: 46 ed ldi r20, 0xD6 ; 214 1ba94: 53 e8 ldi r21, 0x83 ; 131 1ba96: 63 e0 ldi r22, 0x03 ; 3 1ba98: 80 e0 ldi r24, 0x00 ; 0 1ba9a: 0c 94 62 70 jmp 0xe0c4 ; 0xe0c4 } #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"))); 1ba9e: 42 ee ldi r20, 0xE2 ; 226 1baa0: 53 e8 ldi r21, 0x83 ; 131 1baa2: e9 cf rjmp .-46 ; 0x1ba76 lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 1baa4: 49 ed ldi r20, 0xD9 ; 217 1baa6: 53 e8 ldi r21, 0x83 ; 131 1baa8: ee cf rjmp .-36 ; 0x1ba86 lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 1baaa: 43 ed ldi r20, 0xD3 ; 211 1baac: 53 e8 ldi r21, 0x83 ; 131 1baae: f3 cf rjmp .-26 ; 0x1ba96 0001bab0 : } static void menu_show_end_stops() { lcd_show_end_stops(); 1bab0: 0e 94 31 dd call 0x1ba62 ; 0x1ba62 menu_back_if_clicked(); 1bab4: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 0001bab8 : //! @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) { 1bab8: cf 92 push r12 1baba: df 92 push r13 1babc: ef 92 push r14 1babe: ff 92 push r15 1bac0: 0f 93 push r16 1bac2: 1f 93 push r17 1bac4: cf 93 push r28 1bac6: df 93 push r29 1bac8: d8 2f mov r29, r24 1baca: 6b 01 movw r12, r22 1bacc: 7a 01 movw r14, r20 1bace: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 1bad0: 40 e2 ldi r20, 0x20 ; 32 1bad2: 81 11 cpse r24, r1 1bad4: 01 c0 rjmp .+2 ; 0x1bad8 1bad6: 4e e3 ldi r20, 0x3E ; 62 1bad8: 63 e0 ldi r22, 0x03 ; 3 1bada: 80 e0 ldi r24, 0x00 ; 0 1badc: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_puts_P(first_choice); 1bae0: c6 01 movw r24, r12 1bae2: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 1bae6: 40 e2 ldi r20, 0x20 ; 32 1bae8: d1 30 cpi r29, 0x01 ; 1 1baea: 09 f4 brne .+2 ; 0x1baee 1baec: 4e e3 ldi r20, 0x3E ; 62 1baee: 63 e0 ldi r22, 0x03 ; 3 1baf0: 8c 2f mov r24, r28 1baf2: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_puts_P(second_choice); 1baf6: c7 01 movw r24, r14 1baf8: 0e 94 78 6f call 0xdef0 ; 0xdef0 if (third_choice) { 1bafc: 01 15 cp r16, r1 1bafe: 11 05 cpc r17, r1 1bb00: 19 f1 breq .+70 ; 0x1bb48 1bb02: c8 01 movw r24, r16 1bb04: 0f 94 fc a1 call 0x343f8 ; 0x343f8 <__strlen_P> 1bb08: d8 2e mov r13, r24 1bb0a: c7 01 movw r24, r14 1bb0c: 0f 94 fc a1 call 0x343f8 ; 0x343f8 <__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; 1bb10: 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;} 1bb12: 93 e1 ldi r25, 0x13 ; 19 1bb14: 9d 19 sub r25, r13 1bb16: 8c 0f add r24, r28 1bb18: 89 17 cp r24, r25 1bb1a: 08 f4 brcc .+2 ; 0x1bb1e 1bb1c: 89 2f mov r24, r25 1bb1e: 83 31 cpi r24, 0x13 ; 19 1bb20: 08 f0 brcs .+2 ; 0x1bb24 1bb22: 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 ? '>': ' '); 1bb24: 40 e2 ldi r20, 0x20 ; 32 1bb26: d2 30 cpi r29, 0x02 ; 2 1bb28: 09 f4 brne .+2 ; 0x1bb2c 1bb2a: 4e e3 ldi r20, 0x3E ; 62 1bb2c: 63 e0 ldi r22, 0x03 ; 3 1bb2e: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_puts_P(third_choice); 1bb32: c8 01 movw r24, r16 } } 1bb34: df 91 pop r29 1bb36: cf 91 pop r28 1bb38: 1f 91 pop r17 1bb3a: 0f 91 pop r16 1bb3c: ff 90 pop r15 1bb3e: ef 90 pop r14 1bb40: df 90 pop r13 1bb42: 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); 1bb44: 0c 94 78 6f jmp 0xdef0 ; 0xdef0 } } 1bb48: df 91 pop r29 1bb4a: cf 91 pop r28 1bb4c: 1f 91 pop r17 1bb4e: 0f 91 pop r16 1bb50: ff 90 pop r15 1bb52: ef 90 pop r14 1bb54: df 90 pop r13 1bb56: cf 90 pop r12 1bb58: 08 95 ret 0001bb5a : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 1bb5a: 4f 92 push r4 1bb5c: 5f 92 push r5 1bb5e: 6f 92 push r6 1bb60: 7f 92 push r7 1bb62: 8f 92 push r8 1bb64: 9f 92 push r9 1bb66: af 92 push r10 1bb68: bf 92 push r11 1bb6a: cf 92 push r12 1bb6c: df 92 push r13 1bb6e: ef 92 push r14 1bb70: ff 92 push r15 1bb72: 0f 93 push r16 1bb74: 1f 93 push r17 1bb76: cf 93 push r28 1bb78: 8c 01 movw r16, r24 bool bDelayed; long nTime0 = _millis()/1000; 1bb7a: 0f 94 01 0b call 0x21602 ; 0x21602 1bb7e: 28 ee ldi r18, 0xE8 ; 232 1bb80: 33 e0 ldi r19, 0x03 ; 3 1bb82: 40 e0 ldi r20, 0x00 ; 0 1bb84: 50 e0 ldi r21, 0x00 ; 0 1bb86: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 1bb8a: 69 01 movw r12, r18 1bb8c: 7a 01 movw r14, r20 lcd_consume_click(); 1bb8e: 0e 94 cb 73 call 0xe796 ; 0xe796 KEEPALIVE_STATE(PAUSED_FOR_USER); 1bb92: 84 e0 ldi r24, 0x04 ; 4 1bb94: 80 93 78 02 sts 0x0278, r24 ; 0x800278 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 1bb98: 88 ee ldi r24, 0xE8 ; 232 1bb9a: 88 2e mov r8, r24 1bb9c: 83 e0 ldi r24, 0x03 ; 3 1bb9e: 98 2e mov r9, r24 1bba0: a1 2c mov r10, r1 1bba2: b1 2c mov r11, r1 1bba4: 28 01 movw r4, r16 1bba6: 71 2c mov r7, r1 1bba8: 61 2c mov r6, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 1bbaa: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 1bbae: 81 e0 ldi r24, 0x01 ; 1 1bbb0: 0e 94 b0 8a call 0x11560 ; 0x11560 bDelayed = ((_millis()/1000-nTime0) > nDelay); 1bbb4: 0f 94 01 0b call 0x21602 ; 0x21602 1bbb8: a5 01 movw r20, r10 1bbba: 94 01 movw r18, r8 1bbbc: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 1bbc0: 2c 19 sub r18, r12 1bbc2: 3d 09 sbc r19, r13 1bbc4: 4e 09 sbc r20, r14 1bbc6: 5f 09 sbc r21, r15 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click 1bbc8: 42 16 cp r4, r18 1bbca: 53 06 cpc r5, r19 1bbcc: 64 06 cpc r6, r20 1bbce: 75 06 cpc r7, r21 1bbd0: 20 f4 brcc .+8 ; 0x1bbda 1bbd2: c1 e0 ldi r28, 0x01 ; 1 1bbd4: 01 15 cp r16, r1 1bbd6: 11 05 cpc r17, r1 1bbd8: 09 f4 brne .+2 ; 0x1bbdc 1bbda: c0 e0 ldi r28, 0x00 ; 0 if (lcd_clicked() || bDelayed) { 1bbdc: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1bbe0: 81 11 cpse r24, r1 1bbe2: 02 c0 rjmp .+4 ; 0x1bbe8 1bbe4: cc 23 and r28, r28 1bbe6: 09 f3 breq .-62 ; 0x1bbaa KEEPALIVE_STATE(IN_HANDLER); 1bbe8: 82 e0 ldi r24, 0x02 ; 2 1bbea: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(!bDelayed); } } } 1bbee: 81 e0 ldi r24, 0x01 ; 1 1bbf0: 8c 27 eor r24, r28 1bbf2: cf 91 pop r28 1bbf4: 1f 91 pop r17 1bbf6: 0f 91 pop r16 1bbf8: ff 90 pop r15 1bbfa: ef 90 pop r14 1bbfc: df 90 pop r13 1bbfe: cf 90 pop r12 1bc00: bf 90 pop r11 1bc02: af 90 pop r10 1bc04: 9f 90 pop r9 1bc06: 8f 90 pop r8 1bc08: 7f 90 pop r7 1bc0a: 6f 90 pop r6 1bc0c: 5f 90 pop r5 1bc0e: 4f 90 pop r4 1bc10: 08 95 ret 0001bc12 : * 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) { 1bc12: af 92 push r10 1bc14: bf 92 push r11 1bc16: cf 92 push r12 1bc18: df 92 push r13 1bc1a: ef 92 push r14 1bc1c: ff 92 push r15 1bc1e: 0f 93 push r16 1bc20: 1f 93 push r17 1bc22: cf 93 push r28 1bc24: df 93 push r29 1bc26: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 1bc28: 0e 94 41 6f call 0xde82 ; 0xde82 * @param msg message to be displayed from PROGMEM * @return rest of the text (to be displayed on next page) */ static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg) { const char *msgend = msg; 1bc2c: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 1bc2e: 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; 1bc30: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 1bc32: 6f 2d mov r22, r15 1bc34: 80 e0 ldi r24, 0x00 ; 0 1bc36: 0e 94 b5 6f call 0xdf6a ; 0xdf6a // 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) 1bc3a: c6 01 movw r24, r12 1bc3c: 0e 94 e6 bb call 0x177cc ; 0x177cc 1bc40: 88 23 and r24, r24 1bc42: 29 f0 breq .+10 ; 0x1bc4e 1bc44: 8f ef ldi r24, 0xFF ; 255 1bc46: c8 1a sub r12, r24 1bc48: d8 0a sbc r13, r24 1bc4a: 09 f4 brne .+2 ; 0x1bc4e 1bc4c: 49 c0 rjmp .+146 ; 0x1bce0 1bc4e: c6 01 movw r24, r12 1bc50: 0f 94 fc a1 call 0x343f8 ; 0x343f8 <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 1bc54: 84 31 cpi r24, 0x14 ; 20 1bc56: 91 05 cpc r25, r1 1bc58: 10 f0 brcs .+4 ; 0x1bc5e 1bc5a: 84 e1 ldi r24, 0x14 ; 20 1bc5c: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 1bc5e: e6 01 movw r28, r12 1bc60: c8 0f add r28, r24 1bc62: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 1bc64: e3 e0 ldi r30, 0x03 ; 3 1bc66: fe 12 cpse r15, r30 1bc68: 0a c0 rjmp .+20 ; 0x1bc7e 1bc6a: 84 31 cpi r24, 0x14 ; 20 1bc6c: 41 f4 brne .+16 ; 0x1bc7e // 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; 1bc6e: fe 01 movw r30, r28 1bc70: 84 91 lpm r24, Z 1bc72: e1 2c mov r14, r1 if (multi_screen) 1bc74: 88 23 and r24, r24 1bc76: 19 f0 breq .+6 ; 0x1bc7e msgend = (msgend2 -= 2); 1bc78: 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; 1bc7a: ee 24 eor r14, r14 1bc7c: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 1bc7e: fe 01 movw r30, r28 1bc80: 84 91 lpm r24, Z 1bc82: 88 23 and r24, r24 1bc84: 09 f4 brne .+2 ; 0x1bc88 1bc86: 40 c0 rjmp .+128 ; 0x1bd08 1bc88: ce 01 movw r24, r28 1bc8a: 0e 94 e6 bb call 0x177cc ; 0x177cc 1bc8e: 81 11 cpse r24, r1 1bc90: 3b c0 rjmp .+118 ; 0x1bd08 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); 1bc92: fe 01 movw r30, r28 1bc94: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 1bc96: 92 ed ldi r25, 0xD2 ; 210 1bc98: 98 0f add r25, r24 1bc9a: 92 30 cpi r25, 0x02 ; 2 1bc9c: a8 f1 brcs .+106 ; 0x1bd08 1bc9e: 8c 32 cpi r24, 0x2C ; 44 1bca0: 99 f1 breq .+102 ; 0x1bd08 1bca2: 96 ec ldi r25, 0xC6 ; 198 1bca4: 98 0f add r25, r24 1bca6: 92 30 cpi r25, 0x02 ; 2 1bca8: 78 f1 brcs .+94 ; 0x1bd08 1bcaa: 8f 33 cpi r24, 0x3F ; 63 1bcac: 69 f1 breq .+90 ; 0x1bd08 1bcae: 81 32 cpi r24, 0x21 ; 33 1bcb0: 59 f1 breq .+86 ; 0x1bd08 1bcb2: 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)) 1bcb4: c0 16 cp r12, r16 1bcb6: d1 06 cpc r13, r17 1bcb8: 58 f4 brcc .+22 ; 0x1bcd0 1bcba: 58 01 movw r10, r16 1bcbc: f1 e0 ldi r31, 0x01 ; 1 1bcbe: af 1a sub r10, r31 1bcc0: b1 08 sbc r11, r1 1bcc2: c5 01 movw r24, r10 1bcc4: 0e 94 e6 bb call 0x177cc ; 0x177cc 1bcc8: 81 11 cpse r24, r1 1bcca: 1d c0 rjmp .+58 ; 0x1bd06 -- msgend; 1bccc: 85 01 movw r16, r10 1bcce: f2 cf rjmp .-28 ; 0x1bcb4 if (msgend == msg) 1bcd0: c0 16 cp r12, r16 1bcd2: d1 06 cpc r13, r17 1bcd4: c9 f0 breq .+50 ; 0x1bd08 1bcd6: 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) { 1bcd8: f3 94 inc r15 1bcda: 84 e0 ldi r24, 0x04 ; 4 1bcdc: f8 12 cpse r15, r24 1bcde: a9 cf rjmp .-174 ; 0x1bc32 } lcd_print(c); } } if (multi_screen) { 1bce0: ee 20 and r14, r14 1bce2: f9 f0 breq .+62 ; 0x1bd22 // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 1bce4: 48 e8 ldi r20, 0x88 ; 136 1bce6: 63 e0 ldi r22, 0x03 ; 3 1bce8: 83 e1 ldi r24, 0x13 ; 19 1bcea: 0e 94 6e 70 call 0xe0dc ; 0xe0dc } return multi_screen ? msgend : NULL; } 1bcee: ce 01 movw r24, r28 1bcf0: df 91 pop r29 1bcf2: cf 91 pop r28 1bcf4: 1f 91 pop r17 1bcf6: 0f 91 pop r16 1bcf8: ff 90 pop r15 1bcfa: ef 90 pop r14 1bcfc: df 90 pop r13 1bcfe: cf 90 pop r12 1bd00: bf 90 pop r11 1bd02: af 90 pop r10 1bd04: 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)) 1bd06: 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) { 1bd08: cc 16 cp r12, r28 1bd0a: dd 06 cpc r13, r29 1bd0c: 28 f7 brcc .-54 ; 0x1bcd8 char c = char(pgm_read_byte(msg)); 1bd0e: f6 01 movw r30, r12 1bd10: 84 91 lpm r24, Z if (c == '\n') { 1bd12: 8a 30 cpi r24, 0x0A ; 10 1bd14: 09 f3 breq .-62 ; 0x1bcd8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1bd16: 0e 94 fd 70 call 0xe1fa ; 0xe1fa -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 1bd1a: ff ef ldi r31, 0xFF ; 255 1bd1c: cf 1a sub r12, r31 1bd1e: df 0a sbc r13, r31 1bd20: f3 cf rjmp .-26 ; 0x1bd08 if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 1bd22: d0 e0 ldi r29, 0x00 ; 0 1bd24: c0 e0 ldi r28, 0x00 ; 0 1bd26: e3 cf rjmp .-58 ; 0x1bcee 0001bd28 : } const char* lcd_display_message_fullscreen_P(const char *msg) { 1bd28: cf 93 push r28 1bd2a: df 93 push r29 1bd2c: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 1bd2e: 80 e0 ldi r24, 0x00 ; 0 1bd30: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_clear(); 1bd34: 0e 94 81 70 call 0xe102 ; 0xe102 return lcd_display_message_fullscreen_nonBlocking_P(msg); 1bd38: ce 01 movw r24, r28 } 1bd3a: df 91 pop r29 1bd3c: 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); 1bd3e: 0c 94 09 de jmp 0x1bc12 ; 0x1bc12 0001bd42 : { (void)lcd_selftest(); } bool lcd_selftest() { 1bd42: cf 92 push r12 1bd44: df 92 push r13 1bd46: ef 92 push r14 1bd48: ff 92 push r15 1bd4a: 0f 93 push r16 1bd4c: 1f 93 push r17 1bd4e: cf 93 push r28 1bd50: df 93 push r29 1bd52: 00 d0 rcall .+0 ; 0x1bd54 1bd54: 1f 92 push r1 1bd56: cd b7 in r28, 0x3d ; 61 1bd58: 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(); 1bd5a: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 uint8_t fanSpeedBckp = fanSpeed; 1bd5e: d0 90 55 12 lds r13, 0x1255 ; 0x801255 fanSpeed = 255; 1bd62: 8f ef ldi r24, 0xFF ; 255 1bd64: 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)); 1bd68: 82 e9 ldi r24, 0x92 ; 146 1bd6a: e8 2e mov r14, r24 1bd6c: 84 e8 ldi r24, 0x84 ; 132 1bd6e: 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()); 1bd70: 0c e8 ldi r16, 0x8C ; 140 1bd72: 14 e8 ldi r17, 0x84 ; 132 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)) { 1bd74: 20 e0 ldi r18, 0x00 ; 0 1bd76: 30 e0 ldi r19, 0x00 ; 0 1bd78: 48 e4 ldi r20, 0x48 ; 72 1bd7a: 52 e4 ldi r21, 0x42 ; 66 1bd7c: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1bd80: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1bd84: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1bd88: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1bd8c: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1bd90: 18 16 cp r1, r24 1bd92: 8c f0 brlt .+34 ; 0x1bdb6 1bd94: 20 e0 ldi r18, 0x00 ; 0 1bd96: 30 e0 ldi r19, 0x00 ; 0 1bd98: 48 e4 ldi r20, 0x48 ; 72 1bd9a: 52 e4 ldi r21, 0x42 ; 66 1bd9c: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1bda0: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1bda4: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1bda8: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1bdac: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1bdb0: 18 16 cp r1, r24 1bdb2: 0c f0 brlt .+2 ; 0x1bdb6 1bdb4: 42 c0 rjmp .+132 ; 0x1be3a lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 1bdb6: 80 e0 ldi r24, 0x00 ; 0 1bdb8: 99 e4 ldi r25, 0x49 ; 73 1bdba: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1bdbe: 0e 94 94 de call 0x1bd28 ; 0x1bd28 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1bdc2: 42 e8 ldi r20, 0x82 ; 130 1bdc4: 64 e0 ldi r22, 0x04 ; 4 1bdc6: 80 e0 ldi r24, 0x00 ; 0 1bdc8: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1bdcc: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1bdd0: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1bdd4: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1bdd8: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1bddc: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1bde0: 7f 93 push r23 1bde2: 6f 93 push r22 1bde4: ff 92 push r15 1bde6: ef 92 push r14 1bde8: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_putc(LCD_STR_DEGREE[0]); 1bdec: 81 e8 ldi r24, 0x81 ; 129 1bdee: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 1bdf2: 40 e8 ldi r20, 0x80 ; 128 1bdf4: 64 e0 ldi r22, 0x04 ; 4 1bdf6: 89 e0 ldi r24, 0x09 ; 9 1bdf8: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1bdfc: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1be00: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1be04: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1be08: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1be0c: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1be10: 7f 93 push r23 1be12: 6f 93 push r22 1be14: 1f 93 push r17 1be16: 0f 93 push r16 1be18: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_putc(LCD_STR_DEGREE[0]); 1be1c: 81 e8 ldi r24, 0x81 ; 129 1be1e: 0e 94 7c 6f call 0xdef8 ; 0xdef8 delay_keep_alive(1000); 1be22: 88 ee ldi r24, 0xE8 ; 232 1be24: 93 e0 ldi r25, 0x03 ; 3 1be26: 0e 94 0a 8d call 0x11a14 ; 0x11a14 serialecho_temperatures(); 1be2a: 0e 94 2d 7b call 0xf65a ; 0xf65a 1be2e: 0f b6 in r0, 0x3f ; 63 1be30: f8 94 cli 1be32: de bf out 0x3e, r29 ; 62 1be34: 0f be out 0x3f, r0 ; 63 1be36: cd bf out 0x3d, r28 ; 61 1be38: 9d cf rjmp .-198 ; 0x1bd74 } fanSpeed = fanSpeedBckp; 1be3a: d0 92 55 12 sts 0x1255, r13 ; 0x801255 lcd_update_enable(true); 1be3e: 81 e0 ldi r24, 0x01 ; 1 1be40: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 1be44: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 1be48: 83 e3 ldi r24, 0x33 ; 51 1be4a: 99 e4 ldi r25, 0x49 ; 73 1be4c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1be50: ac 01 movw r20, r24 1be52: 60 e0 ldi r22, 0x00 ; 0 1be54: 80 e0 ldi r24, 0x00 ; 0 1be56: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 #ifdef TMC2130 FORCE_HIGH_POWER_START; #endif // TMC2130 FORCE_BL_ON_START; _delay(2000); 1be5a: 60 ed ldi r22, 0xD0 ; 208 1be5c: 77 e0 ldi r23, 0x07 ; 7 1be5e: 80 e0 ldi r24, 0x00 ; 0 1be60: 90 e0 ldi r25, 0x00 ; 0 1be62: 0f 94 ce 0a call 0x2159c ; 0x2159c KEEPALIVE_STATE(IN_HANDLER); 1be66: 82 e0 ldi r24, 0x02 ; 2 1be68: 80 93 78 02 sts 0x0278, r24 ; 0x800278 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 1be6c: 00 ed ldi r16, 0xD0 ; 208 1be6e: 17 e0 ldi r17, 0x07 ; 7 1be70: 21 e0 ldi r18, 0x01 ; 1 1be72: 43 e0 ldi r20, 0x03 ; 3 1be74: 60 e0 ldi r22, 0x00 ; 0 1be76: 80 e0 ldi r24, 0x00 ; 0 1be78: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1be7c: 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 1be7e: 83 e0 ldi r24, 0x03 ; 3 1be80: 0e 94 0a 78 call 0xf014 ; 0xf014 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1be84: 10 92 55 12 sts 0x1255, r1 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1be88: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d #endif manage_heater(); 1be8c: 0f 94 43 37 call 0x26e86 ; 0x26e86 // 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]); 1be90: 4d e2 ldi r20, 0x2D ; 45 1be92: 62 e0 ldi r22, 0x02 ; 2 1be94: 82 e1 ldi r24, 0x12 ; 18 1be96: 0e 94 6e 70 call 0xe0dc ; 0xe0dc delay_keep_alive(1000 / sizeof(symbols)); 1be9a: 84 ef ldi r24, 0xF4 ; 244 1be9c: 91 e0 ldi r25, 0x01 ; 1 1be9e: 0e 94 0a 8d call 0x11a14 ; 0x11a14 // 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]); 1bea2: 4c e7 ldi r20, 0x7C ; 124 1bea4: 62 e0 ldi r22, 0x02 ; 2 1bea6: 82 e1 ldi r24, 0x12 ; 18 1bea8: 0e 94 6e 70 call 0xe0dc ; 0xe0dc delay_keep_alive(1000 / sizeof(symbols)); 1beac: 84 ef ldi r24, 0xF4 ; 244 1beae: 91 e0 ldi r25, 0x01 ; 1 1beb0: 0e 94 0a 8d call 0x11a14 ; 0x11a14 // 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]); 1beb4: 4d e2 ldi r20, 0x2D ; 45 1beb6: 62 e0 ldi r22, 0x02 ; 2 1beb8: 82 e1 ldi r24, 0x12 ; 18 1beba: 0e 94 6e 70 call 0xe0dc ; 0xe0dc delay_keep_alive(1000 / sizeof(symbols)); 1bebe: 84 ef ldi r24, 0xF4 ; 244 1bec0: 91 e0 ldi r25, 0x01 ; 1 1bec2: 0e 94 0a 8d call 0x11a14 ; 0x11a14 // 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]); 1bec6: 4c e7 ldi r20, 0x7C ; 124 1bec8: 62 e0 ldi r22, 0x02 ; 2 1beca: 82 e1 ldi r24, 0x12 ; 18 1becc: 0e 94 6e 70 call 0xe0dc ; 0xe0dc delay_keep_alive(1000 / sizeof(symbols)); 1bed0: 84 ef ldi r24, 0xF4 ; 244 1bed2: 91 e0 ldi r25, 0x01 ; 1 1bed4: 0e 94 0a 8d call 0x11a14 ; 0x11a14 } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1bed8: 0f 94 01 0b call 0x21602 ; 0x21602 1bedc: 60 93 07 17 sts 0x1707, r22 ; 0x801707 1bee0: 70 93 08 17 sts 0x1708, r23 ; 0x801708 1bee4: 80 93 09 17 sts 0x1709, r24 ; 0x801709 1bee8: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a #endif fan_measuring = true; 1beec: 81 e0 ldi r24, 0x01 ; 1 1beee: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 while(fan_measuring) { 1bef2: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 1bef6: 88 23 and r24, r24 1bef8: 29 f0 breq .+10 ; 0x1bf04 delay_keep_alive(100); 1befa: 84 e6 ldi r24, 0x64 ; 100 1befc: 90 e0 ldi r25, 0x00 ; 0 1befe: 0e 94 0a 8d call 0x11a14 ; 0x11a14 1bf02: f7 cf rjmp .-18 ; 0x1bef2 } gcode_M123(); 1bf04: 0e 94 70 65 call 0xcae0 ; 0xcae0 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 1bf08: 80 e0 ldi r24, 0x00 ; 0 1bf0a: 0e 94 0a 78 call 0xf014 ; 0xf014 if (fan_speed[0] < failThr) { 1bf0e: c0 90 b7 03 lds r12, 0x03B7 ; 0x8003b7 1bf12: d0 90 b8 03 lds r13, 0x03B8 ; 0x8003b8 1bf16: 94 e1 ldi r25, 0x14 ; 20 1bf18: c9 16 cp r12, r25 1bf1a: d1 04 cpc r13, r1 1bf1c: 54 f1 brlt .+84 ; 0x1bf72 lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 1bf1e: 00 ed ldi r16, 0xD0 ; 208 1bf20: 17 e0 ldi r17, 0x07 ; 7 1bf22: 21 e0 ldi r18, 0x01 ; 1 1bf24: 43 e0 ldi r20, 0x03 ; 3 1bf26: 6f 2d mov r22, r15 1bf28: 81 e0 ldi r24, 0x01 ; 1 1bf2a: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1bf2e: f8 2e mov r15, r24 default: _result = false; break; } #else //defined(TACH_1) _result = lcd_selftest_manual_fan_check(1, false); 1bf30: 60 e0 ldi r22, 0x00 ; 0 1bf32: 80 e0 ldi r24, 0x00 ; 0 1bf34: 0f 94 2f 8f call 0x31e5e ; 0x31e5e #endif //defined(TACH_1) if (!_result) 1bf38: 81 11 cpse r24, r1 1bf3a: 3a c0 rjmp .+116 ; 0x1bfb0 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning 1bf3c: 4f ed ldi r20, 0xDF ; 223 1bf3e: 52 e0 ldi r21, 0x02 ; 2 1bf40: ba 01 movw r22, r20 1bf42: 85 e0 ldi r24, 0x05 ; 5 1bf44: 0e 94 46 d8 call 0x1b08c ; 0x1b08c } } if (_swapped_fan) { 1bf48: 86 e4 ldi r24, 0x46 ; 70 1bf4a: c8 16 cp r12, r24 1bf4c: d1 04 cpc r13, r1 1bf4e: bc f0 brlt .+46 ; 0x1bf7e //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 1bf50: 60 e0 ldi r22, 0x00 ; 0 1bf52: 81 e0 ldi r24, 0x01 ; 1 1bf54: 0f 94 2f 8f call 0x31e5e ; 0x31e5e if (_result) { 1bf58: 88 23 and r24, r24 1bf5a: d9 f0 breq .+54 ; 0x1bf92 //print fan is stil turned on; check that it is spinning _result = lcd_selftest_manual_fan_check(1, false, true); 1bf5c: 61 e0 ldi r22, 0x01 ; 1 1bf5e: 80 e0 ldi r24, 0x00 ; 0 1bf60: 0f 94 2f 8f call 0x31e5e ; 0x31e5e if (!_result){ 1bf64: 81 11 cpse r24, r1 1bf66: 28 c0 rjmp .+80 ; 0x1bfb8 lcd_selftest_error(TestError::PrintFan, "", ""); 1bf68: 4f ed ldi r20, 0xDF ; 223 1bf6a: 52 e0 ldi r21, 0x02 ; 2 1bf6c: ba 01 movw r22, r20 1bf6e: 85 e0 ldi r24, 0x05 ; 5 1bf70: 04 c0 rjmp .+8 ; 0x1bf7a #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 1bf72: 4f ed ldi r20, 0xDF ; 223 1bf74: 52 e0 ldi r21, 0x02 ; 2 1bf76: ba 01 movw r22, r20 1bf78: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1bf7a: 0e 94 46 d8 call 0x1b08c ; 0x1b08c { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 1bf7e: 08 e8 ldi r16, 0x88 ; 136 1bf80: 13 e1 ldi r17, 0x13 ; 19 1bf82: 21 e0 ldi r18, 0x01 ; 1 1bf84: 43 e0 ldi r20, 0x03 ; 3 1bf86: 6f 2d mov r22, r15 1bf88: 8d e0 ldi r24, 0x0D ; 13 1bf8a: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1bf8e: e1 2c mov r14, r1 1bf90: 75 c1 rjmp .+746 ; 0x1c27c lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1bf92: 4f ed ldi r20, 0xDF ; 223 1bf94: 52 e0 ldi r21, 0x02 ; 2 1bf96: ba 01 movw r22, r20 1bf98: 89 e0 ldi r24, 0x09 ; 9 1bf9a: ef cf rjmp .-34 ; 0x1bf7a #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 1bf9c: 11 e0 ldi r17, 0x01 ; 1 1bf9e: 96 c0 rjmp .+300 ; 0x1c0cc lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1bfa0: 85 e5 ldi r24, 0x55 ; 85 1bfa2: 9a e4 ldi r25, 0x4A ; 74 1bfa4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1bfa8: 62 e0 ldi r22, 0x02 ; 2 1bfaa: 0e 94 17 d8 call 0x1b02e ; 0x1b02e 1bfae: 7e c1 rjmp .+764 ; 0x1c2ac { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 1bfb0: 96 e4 ldi r25, 0x46 ; 70 1bfb2: c9 16 cp r12, r25 1bfb4: d1 04 cpc r13, r1 1bfb6: 64 f6 brge .-104 ; 0x1bf50 } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 1bfb8: 00 ed ldi r16, 0xD0 ; 208 1bfba: 17 e0 ldi r17, 0x07 ; 7 1bfbc: 21 e0 ldi r18, 0x01 ; 1 1bfbe: 43 e0 ldi r20, 0x03 ; 3 1bfc0: 6f 2d mov r22, r15 1bfc2: 82 e0 ldi r24, 0x02 ; 2 1bfc4: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1bfc8: 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) || 1bfca: 1e 99 sbic 0x03, 6 ; 3 1bfcc: 04 c0 rjmp .+8 ; 0x1bfd6 { bool _result = true; if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1bfce: 1d 99 sbic 0x03, 5 ; 3 1bfd0: 02 c0 rjmp .+4 ; 0x1bfd6 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1bfd2: 1c 9b sbis 0x03, 4 ; 3 1bfd4: 48 c0 rjmp .+144 ; 0x1c066 #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; 1bfd6: 1e 9b sbis 0x03, 6 ; 3 1bfd8: 16 c0 rjmp .+44 ; 0x1c006 1bfda: 20 e0 ldi r18, 0x00 ; 0 1bfdc: 30 e0 ldi r19, 0x00 ; 0 1bfde: 40 e2 ldi r20, 0x20 ; 32 1bfe0: 51 e4 ldi r21, 0x41 ; 65 1bfe2: 60 91 61 12 lds r22, 0x1261 ; 0x801261 1bfe6: 70 91 62 12 lds r23, 0x1262 ; 0x801262 1bfea: 80 91 63 12 lds r24, 0x1263 ; 0x801263 1bfee: 90 91 64 12 lds r25, 0x1264 ; 0x801264 1bff2: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1bff6: 60 93 61 12 sts 0x1261, r22 ; 0x801261 1bffa: 70 93 62 12 sts 0x1262, r23 ; 0x801262 1bffe: 80 93 63 12 sts 0x1263, r24 ; 0x801263 1c002: 90 93 64 12 sts 0x1264, r25 ; 0x801264 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) current_position[1] += 10; 1c006: 1d 9b sbis 0x03, 5 ; 3 1c008: 16 c0 rjmp .+44 ; 0x1c036 1c00a: 20 e0 ldi r18, 0x00 ; 0 1c00c: 30 e0 ldi r19, 0x00 ; 0 1c00e: 40 e2 ldi r20, 0x20 ; 32 1c010: 51 e4 ldi r21, 0x41 ; 65 1c012: 60 91 65 12 lds r22, 0x1265 ; 0x801265 1c016: 70 91 66 12 lds r23, 0x1266 ; 0x801266 1c01a: 80 91 67 12 lds r24, 0x1267 ; 0x801267 1c01e: 90 91 68 12 lds r25, 0x1268 ; 0x801268 1c022: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1c026: 60 93 65 12 sts 0x1265, r22 ; 0x801265 1c02a: 70 93 66 12 sts 0x1266, r23 ; 0x801266 1c02e: 80 93 67 12 sts 0x1267, r24 ; 0x801267 1c032: 90 93 68 12 sts 0x1268, r25 ; 0x801268 #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10; 1c036: 1c 9b sbis 0x03, 4 ; 3 1c038: 16 c0 rjmp .+44 ; 0x1c066 1c03a: 20 e0 ldi r18, 0x00 ; 0 1c03c: 30 e0 ldi r19, 0x00 ; 0 1c03e: 40 e2 ldi r20, 0x20 ; 32 1c040: 51 e4 ldi r21, 0x41 ; 65 1c042: 60 91 69 12 lds r22, 0x1269 ; 0x801269 1c046: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 1c04a: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 1c04e: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 1c052: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1c056: 60 93 69 12 sts 0x1269, r22 ; 0x801269 1c05a: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 1c05e: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 1c062: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c066: 60 e0 ldi r22, 0x00 ; 0 1c068: 70 e0 ldi r23, 0x00 ; 0 1c06a: 84 e3 ldi r24, 0x34 ; 52 1c06c: 92 e4 ldi r25, 0x42 ; 66 1c06e: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 1c072: 0f 94 5b 18 call 0x230b6 ; 0x230b6 if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1c076: 1e 99 sbic 0x03, 6 ; 3 1c078: 04 c0 rjmp .+8 ; 0x1c082 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1c07a: 1d 99 sbic 0x03, 5 ; 3 1c07c: 02 c0 rjmp .+4 ; 0x1c082 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1c07e: 1c 9b sbis 0x03, 4 ; 3 1c080: 8d cf rjmp .-230 ; 0x1bf9c #endif //!TMC2130 ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1)) { _result = false; char _error[4] = ""; 1c082: 1a 82 std Y+2, r1 ; 0x02 1c084: 19 82 std Y+1, r1 ; 0x01 1c086: 1c 82 std Y+4, r1 ; 0x04 1c088: 1b 82 std Y+3, r1 ; 0x03 #ifndef TMC2130 if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X"); 1c08a: 1e 9b sbis 0x03, 6 ; 3 1c08c: 06 c0 rjmp .+12 ; 0x1c09a 1c08e: 68 ec ldi r22, 0xC8 ; 200 1c090: 72 e0 ldi r23, 0x02 ; 2 1c092: ce 01 movw r24, r28 1c094: 01 96 adiw r24, 0x01 ; 1 1c096: 0f 94 8a aa call 0x35514 ; 0x35514 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y"); 1c09a: 1d 9b sbis 0x03, 5 ; 3 1c09c: 06 c0 rjmp .+12 ; 0x1c0aa 1c09e: 6a ec ldi r22, 0xCA ; 202 1c0a0: 72 e0 ldi r23, 0x02 ; 2 1c0a2: ce 01 movw r24, r28 1c0a4: 01 96 adiw r24, 0x01 ; 1 1c0a6: 0f 94 8a aa call 0x35514 ; 0x35514 #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z"); 1c0aa: 1c 9b sbis 0x03, 4 ; 3 1c0ac: 06 c0 rjmp .+12 ; 0x1c0ba 1c0ae: 6c ec ldi r22, 0xCC ; 204 1c0b0: 72 e0 ldi r23, 0x02 ; 2 1c0b2: ce 01 movw r24, r28 1c0b4: 01 96 adiw r24, 0x01 ; 1 1c0b6: 0f 94 8a aa call 0x35514 ; 0x35514 lcd_selftest_error(TestError::Endstops, _error, ""); 1c0ba: 4f ed ldi r20, 0xDF ; 223 1c0bc: 52 e0 ldi r21, 0x02 ; 2 1c0be: be 01 movw r22, r28 1c0c0: 6f 5f subi r22, 0xFF ; 255 1c0c2: 7f 4f sbci r23, 0xFF ; 255 1c0c4: 82 e0 ldi r24, 0x02 ; 2 1c0c6: 0e 94 46 d8 call 0x1b08c ; 0x1b08c ((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; 1c0ca: 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(); 1c0cc: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 1c0d0: 81 e0 ldi r24, 0x01 ; 1 1c0d2: 0e 94 b0 8a call 0x11560 ; 0x11560 { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 1c0d6: 11 23 and r17, r17 1c0d8: 09 f4 brne .+2 ; 0x1c0dc 1c0da: 51 cf rjmp .-350 ; 0x1bf7e { //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); 1c0dc: 00 ed ldi r16, 0xD0 ; 208 1c0de: 17 e0 ldi r17, 0x07 ; 7 1c0e0: 21 e0 ldi r18, 0x01 ; 1 1c0e2: 43 e0 ldi r20, 0x03 ; 3 1c0e4: 6f 2d mov r22, r15 1c0e6: 84 e0 ldi r24, 0x04 ; 4 1c0e8: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1c0ec: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); #else _result = lcd_selfcheck_axis(X_AXIS, X_MAX_POS); 1c0ee: 6a ef ldi r22, 0xFA ; 250 1c0f0: 70 e0 ldi r23, 0x00 ; 0 1c0f2: 90 e0 ldi r25, 0x00 ; 0 1c0f4: 80 e0 ldi r24, 0x00 ; 0 1c0f6: 0e 94 2d db call 0x1b65a ; 0x1b65a } if (_result) 1c0fa: 88 23 and r24, r24 1c0fc: 09 f4 brne .+2 ; 0x1c100 1c0fe: 3f cf rjmp .-386 ; 0x1bf7e { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 1c100: 10 e0 ldi r17, 0x00 ; 0 1c102: 00 e0 ldi r16, 0x00 ; 0 1c104: 21 e0 ldi r18, 0x01 ; 1 1c106: 43 e0 ldi r20, 0x03 ; 3 1c108: 6f 2d mov r22, r15 1c10a: 84 e0 ldi r24, 0x04 ; 4 1c10c: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1c110: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(X_AXIS); 1c112: 90 e0 ldi r25, 0x00 ; 0 1c114: 80 e0 ldi r24, 0x00 ; 0 1c116: 0e 94 2a da call 0x1b454 ; 0x1b454 #endif } if (_result) 1c11a: 88 23 and r24, r24 1c11c: 09 f4 brne .+2 ; 0x1c120 1c11e: 2f cf rjmp .-418 ; 0x1bf7e { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 1c120: 0c ed ldi r16, 0xDC ; 220 1c122: 15 e0 ldi r17, 0x05 ; 5 1c124: 21 e0 ldi r18, 0x01 ; 1 1c126: 43 e0 ldi r20, 0x03 ; 3 1c128: 6f 2d mov r22, r15 1c12a: 85 e0 ldi r24, 0x05 ; 5 1c12c: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1c130: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); 1c132: 62 ed ldi r22, 0xD2 ; 210 1c134: 70 e0 ldi r23, 0x00 ; 0 1c136: 81 e0 ldi r24, 0x01 ; 1 1c138: 90 e0 ldi r25, 0x00 ; 0 1c13a: 0e 94 2d db call 0x1b65a ; 0x1b65a #endif // TMC2130 } if (_result) 1c13e: 88 23 and r24, r24 1c140: 09 f4 brne .+2 ; 0x1c144 1c142: 1d cf rjmp .-454 ; 0x1bf7e { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 1c144: 10 e0 ldi r17, 0x00 ; 0 1c146: 00 e0 ldi r16, 0x00 ; 0 1c148: 21 e0 ldi r18, 0x01 ; 1 1c14a: 43 e0 ldi r20, 0x03 ; 3 1c14c: 6f 2d mov r22, r15 1c14e: 86 e0 ldi r24, 0x06 ; 6 1c150: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1c154: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(Y_AXIS); 1c156: 81 e0 ldi r24, 0x01 ; 1 1c158: 90 e0 ldi r25, 0x00 ; 0 1c15a: 0e 94 2a da call 0x1b454 ; 0x1b454 #endif // TMC2130 } if (_result) 1c15e: 88 23 and r24, r24 1c160: 09 f4 brne .+2 ; 0x1c164 1c162: 0d cf rjmp .-486 ; 0x1bf7e enable_endstops(false); #endif //homeaxis(X_AXIS); //homeaxis(Y_AXIS); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1c164: e1 e0 ldi r30, 0x01 ; 1 1c166: fd e9 ldi r31, 0x9D ; 157 1c168: 85 91 lpm r24, Z+ 1c16a: 95 91 lpm r25, Z+ 1c16c: a5 91 lpm r26, Z+ 1c16e: b4 91 lpm r27, Z 1c170: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1c174: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1c178: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1c17c: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 1c180: e5 e0 ldi r30, 0x05 ; 5 1c182: fd e9 ldi r31, 0x9D ; 157 1c184: 85 91 lpm r24, Z+ 1c186: 95 91 lpm r25, Z+ 1c188: a5 91 lpm r26, Z+ 1c18a: b4 91 lpm r27, Z 1c18c: 80 93 65 12 sts 0x1265, r24 ; 0x801265 1c190: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1c194: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1c198: 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); 1c19c: 60 e0 ldi r22, 0x00 ; 0 1c19e: 70 e0 ldi r23, 0x00 ; 0 1c1a0: 80 e2 ldi r24, 0x20 ; 32 1c1a2: 91 e4 ldi r25, 0x41 ; 65 1c1a4: 0e 94 ef 6c call 0xd9de ; 0xd9de set_destination_to_current(); 1c1a8: 0e 94 09 67 call 0xce12 ; 0xce12 _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 1c1ac: 0c ed ldi r16, 0xDC ; 220 1c1ae: 15 e0 ldi r17, 0x05 ; 5 1c1b0: 21 e0 ldi r18, 0x01 ; 1 1c1b2: 43 e0 ldi r20, 0x03 ; 3 1c1b4: 6f 2d mov r22, r15 1c1b6: 86 e0 ldi r24, 0x06 ; 6 1c1b8: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1c1bc: 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); 1c1be: 62 ed ldi r22, 0xD2 ; 210 1c1c0: 70 e0 ldi r23, 0x00 ; 0 1c1c2: 82 e0 ldi r24, 0x02 ; 2 1c1c4: 90 e0 ldi r25, 0x00 ; 0 1c1c6: 0e 94 2d db call 0x1b65a ; 0x1b65a 1c1ca: 18 2f mov r17, r24 #endif //TMC2130 //raise Z to not damage the bed during and hotend testing raise_z(20); 1c1cc: 60 e0 ldi r22, 0x00 ; 0 1c1ce: 70 e0 ldi r23, 0x00 ; 0 1c1d0: 80 ea ldi r24, 0xA0 ; 160 1c1d2: 91 e4 ldi r25, 0x41 ; 65 1c1d4: 0e 94 ef 6c call 0xd9de ; 0xd9de eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 1); _result = bres; } #endif //TMC2130 if (_result) 1c1d8: 11 23 and r17, r17 1c1da: 09 f4 brne .+2 ; 0x1c1de 1c1dc: d0 ce rjmp .-608 ; 0x1bf7e { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 1c1de: 00 ed ldi r16, 0xD0 ; 208 1c1e0: 17 e0 ldi r17, 0x07 ; 7 1c1e2: 21 e0 ldi r18, 0x01 ; 1 1c1e4: 43 e0 ldi r20, 0x03 ; 3 1c1e6: 6f 2d mov r22, r15 1c1e8: 87 e0 ldi r24, 0x07 ; 7 1c1ea: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1c1ee: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 1c1f0: 81 e0 ldi r24, 0x01 ; 1 1c1f2: 0e 94 34 d9 call 0x1b268 ; 0x1b268 } if (_result) 1c1f6: 88 23 and r24, r24 1c1f8: 09 f4 brne .+2 ; 0x1c1fc 1c1fa: c1 ce rjmp .-638 ; 0x1bf7e { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 1c1fc: 08 ee ldi r16, 0xE8 ; 232 1c1fe: 13 e0 ldi r17, 0x03 ; 3 1c200: 21 e0 ldi r18, 0x01 ; 1 1c202: 43 e0 ldi r20, 0x03 ; 3 1c204: 6f 2d mov r22, r15 1c206: 88 e0 ldi r24, 0x08 ; 8 1c208: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1c20c: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 1c20e: 80 e0 ldi r24, 0x00 ; 0 1c210: 0e 94 34 d9 call 0x1b268 ; 0x1b268 1c214: e8 2e mov r14, r24 } if (_result) 1c216: 88 23 and r24, r24 1c218: 09 f4 brne .+2 ; 0x1c21c 1c21a: b1 ce rjmp .-670 ; 0x1bf7e { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 1c21c: 00 ed ldi r16, 0xD0 ; 208 1c21e: 17 e0 ldi r17, 0x07 ; 7 1c220: 21 e0 ldi r18, 0x01 ; 1 1c222: 43 e0 ldi r20, 0x03 ; 3 1c224: 6f 2d mov r22, r15 1c226: 89 e0 ldi r24, 0x09 ; 9 1c228: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 } } 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 1c22c: 21 e0 ldi r18, 0x01 ; 1 1c22e: 43 e0 ldi r20, 0x03 ; 3 1c230: 68 2f mov r22, r24 1c232: 8a e0 ldi r24, 0x0A ; 10 1c234: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 1c238: f8 2e mov r15, r24 #ifdef FILAMENT_SENSOR #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static bool lcd_selftest_fsensor(void) { fsensor.init(); 1c23a: 0f 94 24 6d call 0x2da48 ; 0x2da48 if (fsensor.isError()) 1c23e: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1c242: 83 30 cpi r24, 0x03 ; 3 1c244: 31 f4 brne .+12 ; 0x1c252 { lcd_selftest_error(TestError::WiringFsensor, "", ""); 1c246: 4f ed ldi r20, 0xDF ; 223 1c248: 52 e0 ldi r21, 0x02 ; 2 1c24a: ba 01 movw r22, r20 1c24c: 8a e0 ldi r24, 0x0A ; 10 1c24e: 0e 94 46 d8 call 0x1b08c ; 0x1b08c #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) 1c252: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1c256: 83 30 cpi r24, 0x03 ; 3 1c258: 09 f4 brne .+2 ; 0x1c25c 1c25a: 91 ce rjmp .-734 ; 0x1bf7e { _progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000); //fil sensor OK 1c25c: 00 ed ldi r16, 0xD0 ; 208 1c25e: 17 e0 ldi r17, 0x07 ; 7 1c260: 21 e0 ldi r18, 0x01 ; 1 1c262: 43 e0 ldi r20, 0x03 ; 3 1c264: 6f 2d mov r22, r15 1c266: 8b e0 ldi r24, 0x0B ; 11 1c268: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 1c26c: 08 e8 ldi r16, 0x88 ; 136 1c26e: 13 e1 ldi r17, 0x13 ; 19 1c270: 21 e0 ldi r18, 0x01 ; 1 1c272: 43 e0 ldi r20, 0x03 ; 3 1c274: 68 2f mov r22, r24 1c276: 8c e0 ldi r24, 0x0C ; 12 1c278: 0e 94 e4 c2 call 0x185c8 ; 0x185c8 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1c27c: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.421> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 1c280: 61 e0 ldi r22, 0x01 ; 1 1c282: 88 e6 ldi r24, 0x68 ; 104 1c284: 99 e6 ldi r25, 0x69 ; 105 1c286: 0e 94 65 8d call 0x11aca ; 0x11aca lcd_update_enable(true); 1c28a: 81 e0 ldi r24, 0x01 ; 1 1c28c: 0e 94 93 70 call 0xe126 ; 0xe126 if (_result) 1c290: ee 20 and r14, r14 1c292: 09 f4 brne .+2 ; 0x1c296 1c294: 85 ce rjmp .-758 ; 0x1bfa0 { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 1c296: 81 e0 ldi r24, 0x01 ; 1 1c298: 0e 94 39 d5 call 0x1aa72 ; 0x1aa72 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 1c29c: 85 e2 ldi r24, 0x25 ; 37 1c29e: 99 e4 ldi r25, 0x49 ; 73 1c2a0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1c2a4: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe lcd_return_to_status(); 1c2a8: 0f 94 18 05 call 0x20a30 ; 0x20a30 FORCE_HIGH_POWER_END; #endif // TMC2130 FORCE_BL_ON_END; KEEPALIVE_STATE(NOT_BUSY); 1c2ac: 81 e0 ldi r24, 0x01 ; 1 1c2ae: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(_result); } 1c2b2: 8e 2d mov r24, r14 1c2b4: 0f 90 pop r0 1c2b6: 0f 90 pop r0 1c2b8: 0f 90 pop r0 1c2ba: 0f 90 pop r0 1c2bc: df 91 pop r29 1c2be: cf 91 pop r28 1c2c0: 1f 91 pop r17 1c2c2: 0f 91 pop r16 1c2c4: ff 90 pop r15 1c2c6: ef 90 pop r14 1c2c8: df 90 pop r13 1c2ca: cf 90 pop r12 1c2cc: 08 95 ret 0001c2ce : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 1c2ce: 0c 94 a1 de jmp 0x1bd42 ; 0x1bd42 0001c2d2 : } /// @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) { 1c2d2: cf 92 push r12 1c2d4: df 92 push r13 1c2d6: ef 92 push r14 1c2d8: ff 92 push r15 1c2da: cf 93 push r28 1c2dc: 6b 01 movw r12, r22 1c2de: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 1c2e0: 82 e0 ldi r24, 0x02 ; 2 1c2e2: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 1c2e6: 8b e6 ldi r24, 0x6B ; 107 1c2e8: 9a e5 ldi r25, 0x5A ; 90 1c2ea: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1c2ee: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe FSensorBlockRunout fsBlockRunout; 1c2f2: 0f 94 86 78 call 0x2f10c ; 0x2f10c current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 1c2f6: 20 e0 ldi r18, 0x00 ; 0 1c2f8: 30 e0 ldi r19, 0x00 ; 0 1c2fa: 44 e3 ldi r20, 0x34 ; 52 1c2fc: 52 e4 ldi r21, 0x42 ; 66 1c2fe: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 1c302: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 1c306: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 1c30a: 90 91 70 12 lds r25, 0x1270 ; 0x801270 1c30e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1c312: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 1c316: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1c31a: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 1c31e: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 1c322: 6a e0 ldi r22, 0x0A ; 10 1c324: 77 e5 ldi r23, 0x57 ; 87 1c326: 8d ea ldi r24, 0xAD ; 173 1c328: 92 e4 ldi r25, 0x42 ; 66 1c32a: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 1c32e: 0f 94 5b 18 call 0x230b6 ; 0x230b6 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 1c332: 20 e0 ldi r18, 0x00 ; 0 1c334: 30 e0 ldi r19, 0x00 ; 0 1c336: 4c e0 ldi r20, 0x0C ; 12 1c338: 52 e4 ldi r21, 0x42 ; 66 1c33a: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 1c33e: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 1c342: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 1c346: 90 91 70 12 lds r25, 0x1270 ; 0x801270 1c34a: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1c34e: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 1c352: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1c356: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 1c35a: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 1c35e: 69 e2 ldi r22, 0x29 ; 41 1c360: 7c e5 ldi r23, 0x5C ; 92 1c362: 85 e8 ldi r24, 0x85 ; 133 1c364: 91 e4 ldi r25, 0x41 ; 65 1c366: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 1c36a: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 1c36e: 20 e0 ldi r18, 0x00 ; 0 1c370: 30 e0 ldi r19, 0x00 ; 0 1c372: a9 01 movw r20, r18 1c374: c7 01 movw r24, r14 1c376: b6 01 movw r22, r12 1c378: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1c37c: 88 23 and r24, r24 1c37e: e1 f0 breq .+56 ; 0x1c3b8 { current_position[E_AXIS] += unloadLength; 1c380: a7 01 movw r20, r14 1c382: 96 01 movw r18, r12 1c384: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 1c388: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 1c38c: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 1c390: 90 91 70 12 lds r25, 0x1270 ; 0x801270 1c394: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1c398: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 1c39c: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1c3a0: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 1c3a4: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 1c3a8: 60 e0 ldi r22, 0x00 ; 0 1c3aa: 70 e0 ldi r23, 0x00 ; 0 1c3ac: 80 e2 ldi r24, 0x20 ; 32 1c3ae: 91 e4 ldi r25, 0x41 ; 65 1c3b0: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 1c3b4: 0f 94 5b 18 call 0x230b6 ; 0x230b6 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 1c3b8: 81 e9 ldi r24, 0x91 ; 145 1c3ba: 96 e4 ldi r25, 0x46 ; 70 1c3bc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1c3c0: 0e 94 94 de call 0x1bd28 ; 0x1bd28 //disable extruder steppers so filament can be removed disable_e0(); 1c3c4: 14 9a sbi 0x02, 4 ; 2 _delay(100); 1c3c6: 64 e6 ldi r22, 0x64 ; 100 1c3c8: 70 e0 ldi r23, 0x00 ; 0 1c3ca: 80 e0 ldi r24, 0x00 ; 0 1c3cc: 90 e0 ldi r25, 0x00 ; 0 1c3ce: 0f 94 ce 0a call 0x2159c ; 0x2159c Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 1c3d2: 82 e0 ldi r24, 0x02 ; 2 1c3d4: 0f 94 06 23 call 0x2460c ; 0x2460c 1c3d8: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 1c3da: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1c3de: 81 11 cpse r24, r1 1c3e0: 07 c0 rjmp .+14 ; 0x1c3f0 1c3e2: c1 50 subi r28, 0x01 ; 1 1c3e4: 29 f0 breq .+10 ; 0x1c3f0 delay_keep_alive(100); 1c3e6: 84 e6 ldi r24, 0x64 ; 100 1c3e8: 90 e0 ldi r25, 0x00 ; 0 1c3ea: 0e 94 0a 8d call 0x11a14 ; 0x11a14 1c3ee: f5 cf rjmp .-22 ; 0x1c3da counterBeep++; } st_synchronize(); 1c3f0: 0f 94 5b 18 call 0x230b6 ; 0x230b6 while (lcd_clicked()) delay_keep_alive(100); 1c3f4: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1c3f8: 88 23 and r24, r24 1c3fa: 29 f0 breq .+10 ; 0x1c406 1c3fc: 84 e6 ldi r24, 0x64 ; 100 1c3fe: 90 e0 ldi r25, 0x00 ; 0 1c400: 0e 94 0a 8d call 0x11a14 ; 0x11a14 1c404: f7 cf rjmp .-18 ; 0x1c3f4 lcd_update_enable(true); 1c406: 81 e0 ldi r24, 0x01 ; 1 1c408: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_setstatuspgm(MSG_WELCOME); 1c40c: 8a e8 ldi r24, 0x8A ; 138 1c40e: 9c e6 ldi r25, 0x6C ; 108 1c410: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe custom_message_type = CustomMsg::Status; 1c414: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d clearFilamentAction(); 1c418: 0f 94 0d 09 call 0x2121a ; 0x2121a } 1c41c: cf 91 pop r28 1c41e: ff 90 pop r15 1c420: ef 90 pop r14 1c422: df 90 pop r13 1c424: cf 90 pop r12 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 1c426: 0d 94 dd 6c jmp 0x2d9ba ; 0x2d9ba 0001c42a : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 1c42a: cf 92 push r12 1c42c: df 92 push r13 1c42e: ef 92 push r14 1c430: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 1c432: 80 e0 ldi r24, 0x00 ; 0 1c434: 90 e0 ldi r25, 0x00 ; 0 1c436: a8 ec ldi r26, 0xC8 ; 200 1c438: b2 e4 ldi r27, 0x42 ; 66 1c43a: 80 93 69 12 sts 0x1269, r24 ; 0x801269 1c43e: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 1c442: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 1c446: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 1c44a: 65 e5 ldi r22, 0x55 ; 85 1c44c: 75 e5 ldi r23, 0x55 ; 85 1c44e: 85 e5 ldi r24, 0x55 ; 85 1c450: 91 e4 ldi r25, 0x41 ; 65 1c452: 0f 94 a8 49 call 0x29350 ; 0x29350 delay_keep_alive(2000); 1c456: 80 ed ldi r24, 0xD0 ; 208 1c458: 97 e0 ldi r25, 0x07 ; 7 1c45a: 0e 94 0a 8d call 0x11a14 ; 0x11a14 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c45e: 82 e9 ldi r24, 0x92 ; 146 1c460: 9d e3 ldi r25, 0x3D ; 61 1c462: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1c466: 0e 94 94 de call 0x1bd28 ; 0x1bd28 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 1c46a: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 1c46e: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 1c472: 07 2e mov r0, r23 1c474: 00 0c add r0, r0 1c476: 88 0b sbc r24, r24 1c478: 99 0b sbc r25, r25 1c47a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1c47e: 9b 01 movw r18, r22 1c480: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 1c482: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1c486: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1c48a: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1c48e: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1c492: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1c496: 9f 77 andi r25, 0x7F ; 127 1c498: 20 e0 ldi r18, 0x00 ; 0 1c49a: 30 e0 ldi r19, 0x00 ; 0 1c49c: 40 ea ldi r20, 0xA0 ; 160 1c49e: 50 e4 ldi r21, 0x40 ; 64 1c4a0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1c4a4: 18 16 cp r1, r24 1c4a6: b4 f5 brge .+108 ; 0x1c514 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c4a8: 82 e9 ldi r24, 0x92 ; 146 1c4aa: 9d e3 ldi r25, 0x3D ; 61 1c4ac: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1c4b0: 0e 94 94 de call 0x1bd28 ; 0x1bd28 lcd_set_cursor(0, 4); 1c4b4: 64 e0 ldi r22, 0x04 ; 4 1c4b6: 80 e0 ldi r24, 0x00 ; 0 1c4b8: 0e 94 b5 6f call 0xdf6a ; 0xdf6a 1c4bc: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 1c4c0: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 1c4c4: 07 2e mov r0, r23 1c4c6: 00 0c add r0, r0 1c4c8: 88 0b sbc r24, r24 1c4ca: 99 0b sbc r25, r25 1c4cc: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__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)); 1c4d0: 20 e0 ldi r18, 0x00 ; 0 1c4d2: 30 e0 ldi r19, 0x00 ; 0 1c4d4: 40 e0 ldi r20, 0x00 ; 0 1c4d6: 5f e3 ldi r21, 0x3F ; 63 1c4d8: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1c4dc: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1c4e0: 6b 01 movw r12, r22 1c4e2: 20 e0 ldi r18, 0x00 ; 0 1c4e4: 30 e0 ldi r19, 0x00 ; 0 1c4e6: 40 e0 ldi r20, 0x00 ; 0 1c4e8: 5f e3 ldi r21, 0x3F ; 63 1c4ea: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1c4ee: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1c4f2: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1c4f6: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1c4fa: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1c4fe: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1c502: a6 01 movw r20, r12 1c504: 82 e8 ldi r24, 0x82 ; 130 1c506: 0f 94 d2 09 call 0x213a4 ; 0x213a4 delay_keep_alive(1000); 1c50a: 88 ee ldi r24, 0xE8 ; 232 1c50c: 93 e0 ldi r25, 0x03 ; 3 1c50e: 0e 94 0a 8d call 0x11a14 ; 0x11a14 1c512: ab cf rjmp .-170 ; 0x1c46a } } 1c514: ff 90 pop r15 1c516: ef 90 pop r14 1c518: df 90 pop r13 1c51a: cf 90 pop r12 1c51c: 08 95 ret 0001c51e : //! @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 ) { 1c51e: 2f 92 push r2 1c520: 3f 92 push r3 1c522: 4f 92 push r4 1c524: 5f 92 push r5 1c526: 6f 92 push r6 1c528: 7f 92 push r7 1c52a: 8f 92 push r8 1c52c: 9f 92 push r9 1c52e: af 92 push r10 1c530: bf 92 push r11 1c532: cf 92 push r12 1c534: df 92 push r13 1c536: ef 92 push r14 1c538: ff 92 push r15 1c53a: 0f 93 push r16 1c53c: 1f 93 push r17 1c53e: cf 93 push r28 1c540: df 93 push r29 1c542: 00 d0 rcall .+0 ; 0x1c544 1c544: 00 d0 rcall .+0 ; 0x1c546 1c546: cd b7 in r28, 0x3d ; 61 1c548: de b7 in r29, 0x3e ; 62 1c54a: 5c 01 movw r10, r24 1c54c: 6c 83 std Y+4, r22 ; 0x04 1c54e: 34 2e mov r3, r20 1c550: 3b 83 std Y+3, r19 ; 0x03 1c552: 2a 83 std Y+2, r18 ; 0x02 1c554: 48 01 movw r8, r16 1c556: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 1c558: 00 97 sbiw r24, 0x00 ; 0 1c55a: 09 f0 breq .+2 ; 0x1c55e 1c55c: 51 c0 rjmp .+162 ; 0x1c600 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); 1c55e: 87 01 movw r16, r14 1c560: 22 2d mov r18, r2 1c562: a4 01 movw r20, r8 1c564: 6a 81 ldd r22, Y+2 ; 0x02 1c566: 7b 81 ldd r23, Y+3 ; 0x03 1c568: 83 2d mov r24, r3 1c56a: 0e 94 5c dd call 0x1bab8 ; 0x1bab8 1c56e: d1 2c mov r13, r1 1c570: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 1c572: 0f 94 01 0b call 0x21602 ; 0x21602 1c576: 2b 01 movw r4, r22 1c578: 3c 01 movw r6, r24 lcd_consume_click(); 1c57a: 0e 94 cb 73 call 0xe796 ; 0xe796 KEEPALIVE_STATE(PAUSED_FOR_USER); 1c57e: 84 e0 ldi r24, 0x04 ; 4 1c580: 80 93 78 02 sts 0x0278, r24 ; 0x800278 1c584: de 82 std Y+6, r13 ; 0x06 1c586: cd 82 std Y+5, r12 ; 0x05 1c588: 24 e6 ldi r18, 0x64 ; 100 1c58a: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 1c58c: 82 e3 ldi r24, 0x32 ; 50 1c58e: 90 e0 ldi r25, 0x00 ; 0 1c590: 0e 94 0a 8d call 0x11a14 ; 0x11a14 if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 1c594: 3c 81 ldd r19, Y+4 ; 0x04 1c596: 31 11 cpse r19, r1 1c598: 3a c0 rjmp .+116 ; 0x1c60e current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 1c59a: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1c59e: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1c5a2: 00 97 sbiw r24, 0x00 ; 0 1c5a4: 09 f0 breq .+2 ; 0x1c5a8 1c5a6: 42 c0 rjmp .+132 ; 0x1c62c } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 1c5a8: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1c5ac: 88 23 and r24, r24 1c5ae: 09 f4 brne .+2 ; 0x1c5b2 1c5b0: 67 c0 rjmp .+206 ; 0x1c680 if (msg_next == NULL) { 1c5b2: 8d 81 ldd r24, Y+5 ; 0x05 1c5b4: 9e 81 ldd r25, Y+6 ; 0x06 1c5b6: 89 2b or r24, r25 1c5b8: 09 f0 breq .+2 ; 0x1c5bc 1c5ba: 5e c0 rjmp .+188 ; 0x1c678 if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 1c5bc: 82 e0 ldi r24, 0x02 ; 2 1c5be: 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; 1c5c2: 91 e0 ldi r25, 0x01 ; 1 1c5c4: 90 93 5a 02 sts 0x025A, r25 ; 0x80025a lcd_draw_update = 2; 1c5c8: 80 93 59 02 sts 0x0259, r24 ; 0x800259 return current_selection; } 1c5cc: 83 2d mov r24, r3 1c5ce: 26 96 adiw r28, 0x06 ; 6 1c5d0: 0f b6 in r0, 0x3f ; 63 1c5d2: f8 94 cli 1c5d4: de bf out 0x3e, r29 ; 62 1c5d6: 0f be out 0x3f, r0 ; 63 1c5d8: cd bf out 0x3d, r28 ; 61 1c5da: df 91 pop r29 1c5dc: cf 91 pop r28 1c5de: 1f 91 pop r17 1c5e0: 0f 91 pop r16 1c5e2: ff 90 pop r15 1c5e4: ef 90 pop r14 1c5e6: df 90 pop r13 1c5e8: cf 90 pop r12 1c5ea: bf 90 pop r11 1c5ec: af 90 pop r10 1c5ee: 9f 90 pop r9 1c5f0: 8f 90 pop r8 1c5f2: 7f 90 pop r7 1c5f4: 6f 90 pop r6 1c5f6: 5f 90 pop r5 1c5f8: 4f 90 pop r4 1c5fa: 3f 90 pop r3 1c5fc: 2f 90 pop r2 1c5fe: 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; 1c600: 0e 94 94 de call 0x1bd28 ; 0x1bd28 1c604: 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) { 1c606: 89 2b or r24, r25 1c608: 09 f0 breq .+2 ; 0x1c60c 1c60a: b3 cf rjmp .-154 ; 0x1c572 1c60c: a8 cf rjmp .-176 ; 0x1c55e 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) { 1c60e: 0f 94 01 0b call 0x21602 ; 0x21602 1c612: 64 19 sub r22, r4 1c614: 75 09 sbc r23, r5 1c616: 86 09 sbc r24, r6 1c618: 97 09 sbc r25, r7 1c61a: 61 33 cpi r22, 0x31 ; 49 1c61c: 75 47 sbci r23, 0x75 ; 117 1c61e: 81 05 cpc r24, r1 1c620: 91 05 cpc r25, r1 1c622: 08 f4 brcc .+2 ; 0x1c626 1c624: ba cf rjmp .-140 ; 0x1c59a current_selection = LCD_BUTTON_TIMEOUT; 1c626: 33 24 eor r3, r3 1c628: 3a 94 dec r3 1c62a: c8 cf rjmp .-112 ; 0x1c5bc goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 1c62c: 2d 81 ldd r18, Y+5 ; 0x05 1c62e: 3e 81 ldd r19, Y+6 ; 0x06 1c630: 23 2b or r18, r19 1c632: f9 f4 brne .+62 ; 0x1c672 if (third_choice) { // third_choice is not nullptr, safe to dereference 1c634: e1 14 cp r14, r1 1c636: f1 04 cpc r15, r1 1c638: b1 f0 breq .+44 ; 0x1c666 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 1c63a: 97 ff sbrs r25, 7 1c63c: 0f c0 rjmp .+30 ; 0x1c65c 1c63e: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 1c640: 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); 1c642: 87 01 movw r16, r14 1c644: 22 2d mov r18, r2 1c646: a4 01 movw r20, r8 1c648: 6a 81 ldd r22, Y+2 ; 0x02 1c64a: 7b 81 ldd r23, Y+3 ; 0x03 1c64c: 83 2d mov r24, r3 1c64e: 0e 94 5c dd call 0x1bab8 ; 0x1bab8 lcd_encoder = 0; 1c652: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1c656: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e 1c65a: a6 cf rjmp .-180 ; 0x1c5a8 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) { 1c65c: 32 e0 ldi r19, 0x02 ; 2 1c65e: 33 16 cp r3, r19 1c660: 81 f3 breq .-32 ; 0x1c642 // Rotating knob clockwise current_selection++; 1c662: 33 94 inc r3 1c664: ee cf rjmp .-36 ; 0x1c642 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 1c666: 39 2e mov r3, r25 1c668: 30 94 com r3 1c66a: 33 1c adc r3, r3 1c66c: 33 24 eor r3, r3 1c66e: 33 1c adc r3, r3 1c670: e8 cf rjmp .-48 ; 0x1c642 } } 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); 1c672: 87 e0 ldi r24, 0x07 ; 7 1c674: 0f 94 06 23 call 0x2460c ; 0x2460c goto exit; } else break; } } if (multi_screen) { 1c678: c1 14 cp r12, r1 1c67a: d1 04 cpc r13, r1 1c67c: 79 f4 brne .+30 ; 0x1c69c 1c67e: 84 cf rjmp .-248 ; 0x1c588 1c680: 99 81 ldd r25, Y+1 ; 0x01 1c682: 91 50 subi r25, 0x01 ; 1 1c684: 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) { 1c686: 91 11 cpse r25, r1 1c688: 81 cf rjmp .-254 ; 0x1c58c goto exit; } else break; } } if (multi_screen) { 1c68a: c1 14 cp r12, r1 1c68c: d1 04 cpc r13, r1 1c68e: 61 f0 breq .+24 ; 0x1c6a8 if (msg_next == NULL) { 1c690: 2d 81 ldd r18, Y+5 ; 0x05 1c692: 3e 81 ldd r19, Y+6 ; 0x06 1c694: 23 2b or r18, r19 1c696: 11 f4 brne .+4 ; 0x1c69c 1c698: be 82 std Y+6, r11 ; 0x06 1c69a: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 1c69c: 8d 81 ldd r24, Y+5 ; 0x05 1c69e: 9e 81 ldd r25, Y+6 ; 0x06 1c6a0: 0e 94 94 de call 0x1bd28 ; 0x1bd28 1c6a4: 9e 83 std Y+6, r25 ; 0x06 1c6a6: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 1c6a8: 8d 81 ldd r24, Y+5 ; 0x05 1c6aa: 9e 81 ldd r25, Y+6 ; 0x06 1c6ac: 89 2b or r24, r25 1c6ae: 09 f0 breq .+2 ; 0x1c6b2 1c6b0: 6b cf rjmp .-298 ; 0x1c588 lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 1c6b2: 87 01 movw r16, r14 1c6b4: 22 2d mov r18, r2 1c6b6: a4 01 movw r20, r8 1c6b8: 6a 81 ldd r22, Y+2 ; 0x02 1c6ba: 7b 81 ldd r23, Y+3 ; 0x03 1c6bc: 83 2d mov r24, r3 1c6be: 0e 94 5c dd call 0x1bab8 ; 0x1bab8 1c6c2: 62 cf rjmp .-316 ; 0x1c588 0001c6c4 : //! @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) { 1c6c4: bf 92 push r11 1c6c6: cf 92 push r12 1c6c8: df 92 push r13 1c6ca: ef 92 push r14 1c6cc: ff 92 push r15 1c6ce: 0f 93 push r16 1c6d0: 1f 93 push r17 1c6d2: cf 93 push r28 1c6d4: df 93 push r29 1c6d6: ec 01 movw r28, r24 1c6d8: d6 2e mov r13, r22 1c6da: 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); 1c6dc: 88 ea ldi r24, 0xA8 ; 168 1c6de: 98 e4 ldi r25, 0x48 ; 72 1c6e0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1c6e4: 8c 01 movw r16, r24 1c6e6: 82 ea ldi r24, 0xA2 ; 162 1c6e8: 98 e4 ldi r25, 0x48 ; 72 1c6ea: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1c6ee: 2a e0 ldi r18, 0x0A ; 10 1c6f0: c2 2e mov r12, r18 1c6f2: f1 2c mov r15, r1 1c6f4: e1 2c mov r14, r1 1c6f6: 9c 01 movw r18, r24 1c6f8: 4b 2d mov r20, r11 1c6fa: 6d 2d mov r22, r13 1c6fc: ce 01 movw r24, r28 1c6fe: 0e 94 8f e2 call 0x1c51e ; 0x1c51e } 1c702: df 91 pop r29 1c704: cf 91 pop r28 1c706: 1f 91 pop r17 1c708: 0f 91 pop r16 1c70a: ff 90 pop r15 1c70c: ef 90 pop r14 1c70e: df 90 pop r13 1c710: cf 90 pop r12 1c712: bf 90 pop r11 1c714: 08 95 ret 0001c716 : crashdet_use_eeprom_setting(); } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) 1c716: cf 93 push r28 1c718: 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) 1c71a: 88 ef ldi r24, 0xF8 ; 248 1c71c: 9b e4 ldi r25, 0x4B ; 75 1c71e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1c722: 40 e0 ldi r20, 0x00 ; 0 1c724: 60 e0 ldi r22, 0x00 ; 0 1c726: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 1c72a: 81 11 cpse r24, r1 1c72c: 20 c0 rjmp .+64 ; 0x1c76e #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 1c72e: 0e 94 06 75 call 0xea0c ; 0xea0c if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 1c732: c2 30 cpi r28, 0x02 ; 2 1c734: e0 f0 brcs .+56 ; 0x1c76e 1c736: 8c 17 cp r24, r28 1c738: d0 f0 brcs .+52 ; 0x1c76e softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 1c73a: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1c73c: 8a ea ldi r24, 0xAA ; 170 1c73e: 95 e5 ldi r25, 0x55 ; 85 1c740: dc 01 movw r26, r24 1c742: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x8e5> 1c746: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x8e6> 1c74a: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x8e7> 1c74e: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x8e8> boot_app_flags = BOOT_APP_FLG_USER0; 1c752: 80 e8 ldi r24, 0x80 ; 128 1c754: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x8e4> boot_copy_size = 0; 1c758: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x8e2> 1c75c: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x8e1> bootapp_reboot_user0(lang << 3); 1c760: cc 0f add r28, r28 1c762: cc 0f add r28, r28 1c764: cc 0f add r28, r28 boot_reserved = reserved; 1c766: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x8e3> // bootapp_print_vars(); softReset(); 1c76a: 0e 94 7a 66 call 0xccf4 ; 0xccf4 lang_boot_update_start(lang); lcd_update_enable(true); 1c76e: 81 e0 ldi r24, 0x01 ; 1 1c770: 0e 94 93 70 call 0xe126 ; 0xe126 menu_goto(lcd_language_menu, 0, true, true); 1c774: 21 e0 ldi r18, 0x01 ; 1 1c776: 41 e0 ldi r20, 0x01 ; 1 1c778: 70 e0 ldi r23, 0x00 ; 0 1c77a: 60 e0 ldi r22, 0x00 ; 0 1c77c: 86 ec ldi r24, 0xC6 ; 198 1c77e: 93 ee ldi r25, 0xE3 ; 227 1c780: 0e 94 12 63 call 0xc624 ; 0xc624 1c784: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout } } 1c788: cf 91 pop r28 1c78a: 08 95 ret 0001c78c : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 1c78c: cf 93 push r28 1c78e: df 93 push r29 MENU_BEGIN(); 1c790: 0e 94 67 74 call 0xe8ce ; 0xe8ce 1c794: 10 92 60 04 sts 0x0460, r1 ; 0x800460 1c798: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1c79c: 84 30 cpi r24, 0x04 ; 4 1c79e: 08 f0 brcs .+2 ; 0x1c7a2 1c7a0: 5c c0 rjmp .+184 ; 0x1c85a 1c7a2: 10 92 63 04 sts 0x0463, r1 ; 0x800463 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 1c7a6: 0e 94 89 74 call 0xe912 ; 0xe912 1c7aa: 88 23 and r24, r24 1c7ac: 31 f0 breq .+12 ; 0x1c7ba 1c7ae: 87 e9 ldi r24, 0x97 ; 151 1c7b0: 98 e4 ldi r25, 0x48 ; 72 1c7b2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1c7b6: 0e 94 29 73 call 0xe652 ; 0xe652 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 1c7ba: 8e e6 ldi r24, 0x6E ; 110 1c7bc: 95 e6 ldi r25, 0x65 ; 101 1c7be: 0e 94 9f 74 call 0xe93e ; 0xe93e 1c7c2: 0e 94 7c 73 call 0xe6f8 ; 0xe6f8 1c7c6: 88 23 and r24, r24 1c7c8: 49 f0 breq .+18 ; 0x1c7dc #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 1c7ca: 80 e0 ldi r24, 0x00 ; 0 1c7cc: 0e 94 29 75 call 0xea52 ; 0xea52 1c7d0: 81 11 cpse r24, r1 1c7d2: 43 c0 rjmp .+134 ; 0x1c85a MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 1c7d4: df 91 pop r29 1c7d6: cf 91 pop r28 1c7d8: 0c 94 8b e3 jmp 0x1c716 ; 0x1c716 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(); 1c7dc: 0e 94 06 75 call 0xea0c ; 0xea0c 1c7e0: 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) 1c7e2: c1 e0 ldi r28, 0x01 ; 1 1c7e4: cd 17 cp r28, r29 1c7e6: 60 f5 brcc .+88 ; 0x1c840 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; 1c7e8: 80 e0 ldi r24, 0x00 ; 0 1c7ea: 91 e0 ldi r25, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) 1c7ec: 21 e0 ldi r18, 0x01 ; 1 while (pgm_read_dword((uint32_t*)table) == LANG_MAGIC) //magic valid 1c7ee: fc 01 movw r30, r24 1c7f0: 45 91 lpm r20, Z+ 1c7f2: 55 91 lpm r21, Z+ 1c7f4: 65 91 lpm r22, Z+ 1c7f6: 74 91 lpm r23, Z 1c7f8: 45 3a cpi r20, 0xA5 ; 165 1c7fa: 5a 45 sbci r21, 0x5A ; 90 1c7fc: 64 4b sbci r22, 0xB4 ; 180 1c7fe: 7b 44 sbci r23, 0x4B ; 75 1c800: 19 f0 breq .+6 ; 0x1c808 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; 1c802: 8f e3 ldi r24, 0x3F ; 63 1c804: 9f e3 ldi r25, 0x3F ; 63 1c806: 06 c0 rjmp .+12 ; 0x1c814 #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 1c808: fc 01 movw r30, r24 1c80a: c2 13 cpse r28, r18 1c80c: 10 c0 rjmp .+32 ; 0x1c82e 1c80e: 3a 96 adiw r30, 0x0a ; 10 1c810: 85 91 lpm r24, Z+ 1c812: 94 91 lpm r25, Z #endif //XFLASH if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 1c814: 0e 94 9f 74 call 0xe93e ; 0xe93e 1c818: 0e 94 7c 73 call 0xe6f8 ; 0xe6f8 1c81c: 88 23 and r24, r24 1c81e: 71 f0 breq .+28 ; 0x1c83c #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 1c820: 8c 2f mov r24, r28 1c822: 0e 94 29 75 call 0xea52 ; 0xea52 1c826: 81 11 cpse r24, r1 1c828: 18 c0 rjmp .+48 ; 0x1c85a 1c82a: 8c 2f mov r24, r28 1c82c: d3 cf rjmp .-90 ; 0x1c7d4 table += pgm_read_word((uint16_t*)(table + 4)); 1c82e: 34 96 adiw r30, 0x04 ; 4 1c830: 45 91 lpm r20, Z+ 1c832: 54 91 lpm r21, Z 1c834: 84 0f add r24, r20 1c836: 95 1f adc r25, r21 count++; 1c838: 2f 5f subi r18, 0xFF ; 255 1c83a: d9 cf rjmp .-78 ; 0x1c7ee } } 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) 1c83c: cf 5f subi r28, 0xFF ; 255 1c83e: d2 cf rjmp .-92 ; 0x1c7e4 #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 1c840: 0e 94 de 62 call 0xc5bc ; 0xc5bc #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 1c844: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1c848: 8f 5f subi r24, 0xFF ; 255 1c84a: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1c84e: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1c852: 8f 5f subi r24, 0xFF ; 255 1c854: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1c858: 9f cf rjmp .-194 ; 0x1c798 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 1c85a: df 91 pop r29 1c85c: cf 91 pop r28 1c85e: 08 95 ret 0001c860 : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 1c860: 2f 92 push r2 1c862: 3f 92 push r3 1c864: 4f 92 push r4 1c866: 5f 92 push r5 1c868: 6f 92 push r6 1c86a: 7f 92 push r7 1c86c: 8f 92 push r8 1c86e: 9f 92 push r9 1c870: af 92 push r10 1c872: bf 92 push r11 1c874: cf 92 push r12 1c876: df 92 push r13 1c878: ef 92 push r14 1c87a: ff 92 push r15 1c87c: 0f 93 push r16 1c87e: 1f 93 push r17 1c880: cf 93 push r28 1c882: df 93 push r29 1c884: cd b7 in r28, 0x3d ; 61 1c886: de b7 in r29, 0x3e ; 62 1c888: 2d 97 sbiw r28, 0x0d ; 13 1c88a: 0f b6 in r0, 0x3f ; 63 1c88c: f8 94 cli 1c88e: de bf out 0x3e, r29 ; 62 1c890: 0f be out 0x3f, r0 ; 63 1c892: 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) 1c894: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1c898: 81 30 cpi r24, 0x01 ; 1 1c89a: 51 f1 breq .+84 ; 0x1c8f0 1c89c: 30 f0 brcs .+12 ; 0x1c8aa 1c89e: 82 30 cpi r24, 0x02 ; 2 1c8a0: 09 f4 brne .+2 ; 0x1c8a4 1c8a2: 88 c2 rjmp .+1296 ; 0x1cdb4 { _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. 1c8a4: 10 92 96 03 sts 0x0396, r1 ; 0x800396 1c8a8: 04 c1 rjmp .+520 ; 0x1cab2 switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 1c8aa: 80 91 26 14 lds r24, 0x1426 ; 0x801426 1c8ae: 88 23 and r24, r24 1c8b0: 49 f0 breq .+18 ; 0x1c8c4 { card.presort_flag = false; 1c8b2: 10 92 26 14 sts 0x1426, r1 ; 0x801426 lcd_update_enabled = false; 1c8b6: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a card.presort(); 1c8ba: 0f 94 8d 6e call 0x2dd1a ; 0x2dd1a lcd_update_enabled = true; 1c8be: 81 e0 ldi r24, 0x01 ; 1 1c8c0: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a } _md->fileCnt = card.getnrfilenames(); 1c8c4: 0f 94 be 6b call 0x2d77c ; 0x2d77c 1c8c8: 90 93 9e 03 sts 0x039E, r25 ; 0x80039e 1c8cc: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1c8d0: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1c8d4: 81 11 cpse r24, r1 1c8d6: e7 c0 rjmp .+462 ; 0x1caa6 1c8d8: 89 e0 ldi r24, 0x09 ; 9 1c8da: 9f e0 ldi r25, 0x0F ; 15 1c8dc: 0f 94 3e a4 call 0x3487c ; 0x3487c 1c8e0: 80 93 a0 03 sts 0x03A0, r24 ; 0x8003a0 _md->menuState = _standard; 1c8e4: 81 e0 ldi r24, 0x01 ; 1 1c8e6: 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. 1c8ea: 8f ef ldi r24, 0xFF ; 255 1c8ec: 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. 1c8f0: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 1c8f4: 81 11 cpse r24, r1 1c8f6: 07 c0 rjmp .+14 ; 0x1c906 { _md->lcd_scrollTimer.start(); 1c8f8: 81 ea ldi r24, 0xA1 ; 161 1c8fa: 93 e0 ldi r25, 0x03 ; 3 1c8fc: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> lcd_draw_update = 1; 1c900: 81 e0 ldi r24, 0x01 ; 1 1c902: 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. 1c906: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1c90a: 81 11 cpse r24, r1 1c90c: 21 c0 rjmp .+66 ; 0x1c950 1c90e: 64 ef ldi r22, 0xF4 ; 244 1c910: 71 e0 ldi r23, 0x01 ; 1 1c912: 81 ea ldi r24, 0xA1 ; 161 1c914: 93 e0 ldi r25, 0x03 ; 3 1c916: 0f 94 30 0b call 0x21660 ; 0x21660 ::expired(unsigned short)> 1c91a: 88 23 and r24, r24 1c91c: a1 f0 breq .+40 ; 0x1c946 1c91e: 80 91 9f 03 lds r24, 0x039F ; 0x80039f 1c922: 8f 3f cpi r24, 0xFF ; 255 1c924: 81 f0 breq .+32 ; 0x1c946 { _md->menuState = _scrolling; 1c926: 82 e0 ldi r24, 0x02 ; 2 1c928: 80 93 96 03 sts 0x0396, r24 ; 0x800396 _md->offset = 0; 1c92c: 10 92 97 03 sts 0x0397, r1 ; 0x800397 _md->scrollPointer = NULL; 1c930: 10 92 9a 03 sts 0x039A, r1 ; 0x80039a 1c934: 10 92 99 03 sts 0x0399, r1 ; 0x800399 _md->lcd_scrollTimer.start(); 1c938: 81 ea ldi r24, 0xA1 ; 161 1c93a: 93 e0 ldi r25, 0x03 ; 3 1c93c: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 1c940: 81 e0 ldi r24, 0x01 ; 1 1c942: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } if (lcd_draw_update == 0 && !lcd_clicked()) 1c946: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1c94a: 88 23 and r24, r24 1c94c: 09 f4 brne .+2 ; 0x1c950 1c94e: ad c0 rjmp .+346 ; 0x1caaa 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. 1c950: 8f ef ldi r24, 0xFF ; 255 1c952: 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(); 1c956: 81 ea ldi r24, 0xA1 ; 161 1c958: 93 e0 ldi r25, 0x03 ; 3 1c95a: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> MENU_BEGIN(); 1c95e: 0e 94 67 74 call 0xe8ce ; 0xe8ce 1c962: 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); 1c966: ce 01 movw r24, r28 1c968: 01 96 adiw r24, 0x01 ; 1 1c96a: 7c 01 movw r14, r24 if (!check_file(selected_filename)) { result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); lcd_update_enable(true); } if (result) { enquecommandf_P(MSG_M23, selected_filename); 1c96c: fb e0 ldi r31, 0x0B ; 11 1c96e: 2f 2e mov r2, r31 1c970: fd e6 ldi r31, 0x6D ; 109 1c972: 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(); 1c974: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1c978: 84 30 cpi r24, 0x04 ; 4 1c97a: 08 f0 brcs .+2 ; 0x1c97e 1c97c: 9a c0 rjmp .+308 ; 0x1cab2 1c97e: 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 1c982: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 1c986: 88 23 and r24, r24 1c988: 09 f4 brne .+2 ; 0x1c98c 1c98a: ac c0 rjmp .+344 ; 0x1cae4 1c98c: 89 ef ldi r24, 0xF9 ; 249 1c98e: 98 e4 ldi r25, 0x48 ; 72 1c990: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1c994: 0e 94 29 73 call 0xe652 ; 0xe652 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;}; 1c998: 69 ed ldi r22, 0xD9 ; 217 1c99a: 73 e1 ldi r23, 0x13 ; 19 1c99c: 82 e8 ldi r24, 0x82 ; 130 1c99e: 94 e1 ldi r25, 0x14 ; 20 1c9a0: 0f 94 19 2c call 0x25832 ; 0x25832 card.getWorkDirName(); if (card.filename[0] == '/') 1c9a4: 80 91 d9 13 lds r24, 0x13D9 ; 0x8013d9 1c9a8: 8f 32 cpi r24, 0x2F ; 47 1c9aa: 09 f0 breq .+2 ; 0x1c9ae 1c9ac: 9e c0 rjmp .+316 ; 0x1caea { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 1c9ae: 80 91 48 16 lds r24, 0x1648 ; 0x801648 1c9b2: 88 23 and r24, r24 1c9b4: 41 f0 breq .+16 ; 0x1c9c6 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 1c9b6: 8e ee ldi r24, 0xEE ; 238 1c9b8: 98 e4 ldi r25, 0x48 ; 72 1c9ba: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1c9be: 68 e4 ldi r22, 0x48 ; 72 1c9c0: 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. 1c9c2: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1c9c6: c0 90 9d 03 lds r12, 0x039D ; 0x80039d 1c9ca: 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; 1c9ce: 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. 1c9d0: 91 e0 ldi r25, 0x01 ; 1 1c9d2: c9 1a sub r12, r25 1c9d4: d1 08 sbc r13, r1 1c9d6: 08 f4 brcc .+2 ; 0x1c9da 1c9d8: e0 c1 rjmp .+960 ; 0x1cd9a { if (menu_item == menu_line) //If the file is on the screen. 1c9da: 80 91 63 04 lds r24, 0x0463 ; 0x800463 1c9de: 90 91 62 04 lds r25, 0x0462 ; 0x800462 1c9e2: 89 13 cpse r24, r25 1c9e4: d6 c1 rjmp .+940 ; 0x1cd92 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 1c9e6: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 1c9ea: c6 01 movw r24, r12 1c9ec: 0f 94 04 77 call 0x2ee08 ; 0x2ee08 #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 1c9f0: 80 91 63 04 lds r24, 0x0463 ; 0x800463 1c9f4: 90 e0 ldi r25, 0x00 ; 0 1c9f6: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1c9fa: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1c9fe: 10 91 23 14 lds r17, 0x1423 ; 0x801423 1ca02: 82 17 cp r24, r18 1ca04: 93 07 cpc r25, r19 1ca06: 51 f4 brne .+20 ; 0x1ca1c { _md->selectedFileID = i; 1ca08: d0 92 9c 03 sts 0x039C, r13 ; 0x80039c 1ca0c: c0 92 9b 03 sts 0x039B, r12 ; 0x80039b _md->isDir = card.filenameIsDir; 1ca10: 10 93 98 03 sts 0x0398, r17 ; 0x800398 _md->row = menu_row; 1ca14: 40 91 60 04 lds r20, 0x0460 ; 0x800460 1ca18: 40 93 9f 03 sts 0x039F, r20 ; 0x80039f 1ca1c: 40 91 59 02 lds r20, 0x0259 ; 0x800259 } if (card.filenameIsDir) 1ca20: 11 23 and r17, r17 1ca22: 09 f4 brne .+2 ; 0x1ca26 1ca24: 67 c0 rjmp .+206 ; 0x1caf4 #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) 1ca26: 44 23 and r20, r20 1ca28: e9 f0 breq .+58 ; 0x1ca64 { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1ca2a: 40 91 ee 13 lds r20, 0x13EE ; 0x8013ee 1ca2e: e9 ed ldi r30, 0xD9 ; 217 1ca30: ae 2e mov r10, r30 1ca32: e3 e1 ldi r30, 0x13 ; 19 1ca34: be 2e mov r11, r30 1ca36: 44 23 and r20, r20 1ca38: 21 f0 breq .+8 ; 0x1ca42 1ca3a: 7e ee ldi r23, 0xEE ; 238 1ca3c: a7 2e mov r10, r23 1ca3e: 73 e1 ldi r23, 0x13 ; 19 1ca40: b7 2e mov r11, r23 1ca42: 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)?'>':' '); 1ca46: 4e e3 ldi r20, 0x3E ; 62 1ca48: 82 17 cp r24, r18 1ca4a: 93 07 cpc r25, r19 1ca4c: 09 f0 breq .+2 ; 0x1ca50 1ca4e: 40 e2 ldi r20, 0x20 ; 32 1ca50: 80 e0 ldi r24, 0x00 ; 0 1ca52: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_putc(LCD_STR_FOLDER[0]); 1ca56: 85 e8 ldi r24, 0x85 ; 133 1ca58: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_print_pad(longFilename, len); 1ca5c: 62 e1 ldi r22, 0x12 ; 18 1ca5e: c5 01 movw r24, r10 1ca60: 0e 94 a2 73 call 0xe744 ; 0xe744 1ca64: 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)) 1ca68: 90 91 61 04 lds r25, 0x0461 ; 0x800461 1ca6c: 99 23 and r25, r25 1ca6e: 09 f4 brne .+2 ; 0x1ca72 1ca70: 90 c1 rjmp .+800 ; 0x1cd92 1ca72: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1ca76: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1ca7a: 82 17 cp r24, r18 1ca7c: 13 06 cpc r1, r19 1ca7e: 09 f0 breq .+2 ; 0x1ca82 1ca80: 88 c1 rjmp .+784 ; 0x1cd92 { lcd_update_enabled = false; 1ca82: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 1ca86: 61 e0 ldi r22, 0x01 ; 1 1ca88: 89 ed ldi r24, 0xD9 ; 217 1ca8a: 93 e1 ldi r25, 0x13 ; 19 1ca8c: 0f 94 17 70 call 0x2e02e ; 0x2e02e lcd_encoder = 0; 1ca90: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1ca94: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e menu_data_reset(); //Forces reloading of cached variables. 1ca98: 0e 94 0a 63 call 0xc614 ; 0xc614 } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1ca9c: 00 93 5a 02 sts 0x025A, r16 ; 0x80025a menu_item_ret(); 1caa0: 0e 94 ce 62 call 0xc59c ; 0xc59c 1caa4: 95 cf rjmp .-214 ; 0x1c9d0 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); 1caa6: 82 e0 ldi r24, 0x02 ; 2 1caa8: 1b cf rjmp .-458 ; 0x1c8e0 _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()) 1caaa: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1caae: 81 11 cpse r24, r1 1cab0: 4f cf rjmp .-354 ; 0x1c950 _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 1cab2: 2d 96 adiw r28, 0x0d ; 13 1cab4: 0f b6 in r0, 0x3f ; 63 1cab6: f8 94 cli 1cab8: de bf out 0x3e, r29 ; 62 1caba: 0f be out 0x3f, r0 ; 63 1cabc: cd bf out 0x3d, r28 ; 61 1cabe: df 91 pop r29 1cac0: cf 91 pop r28 1cac2: 1f 91 pop r17 1cac4: 0f 91 pop r16 1cac6: ff 90 pop r15 1cac8: ef 90 pop r14 1caca: df 90 pop r13 1cacc: cf 90 pop r12 1cace: bf 90 pop r11 1cad0: af 90 pop r10 1cad2: 9f 90 pop r9 1cad4: 8f 90 pop r8 1cad6: 7f 90 pop r7 1cad8: 6f 90 pop r6 1cada: 5f 90 pop r5 1cadc: 4f 90 pop r4 1cade: 3f 90 pop r3 1cae0: 2f 90 pop r2 1cae2: 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 1cae4: 82 e0 ldi r24, 0x02 ; 2 1cae6: 9b e4 ldi r25, 0x4B ; 75 1cae8: 53 cf rjmp .-346 ; 0x1c990 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. 1caea: 62 e5 ldi r22, 0x52 ; 82 1caec: 7d ec ldi r23, 0xCD ; 205 1caee: 88 e8 ldi r24, 0x88 ; 136 1caf0: 94 e8 ldi r25, 0x84 ; 132 1caf2: 67 cf rjmp .-306 ; 0x1c9c2 menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1caf4: 44 23 and r20, r20 1caf6: d1 f0 breq .+52 ; 0x1cb2c { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1caf8: 40 91 ee 13 lds r20, 0x13EE ; 0x8013ee 1cafc: 69 ed ldi r22, 0xD9 ; 217 1cafe: a6 2e mov r10, r22 1cb00: 63 e1 ldi r22, 0x13 ; 19 1cb02: b6 2e mov r11, r22 1cb04: 44 23 and r20, r20 1cb06: 21 f0 breq .+8 ; 0x1cb10 1cb08: 5e ee ldi r21, 0xEE ; 238 1cb0a: a5 2e mov r10, r21 1cb0c: 53 e1 ldi r21, 0x13 ; 19 1cb0e: b5 2e mov r11, r21 1cb10: 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)?'>':' '); 1cb14: 4e e3 ldi r20, 0x3E ; 62 1cb16: 82 17 cp r24, r18 1cb18: 93 07 cpc r25, r19 1cb1a: 09 f0 breq .+2 ; 0x1cb1e 1cb1c: 40 e2 ldi r20, 0x20 ; 32 1cb1e: 80 e0 ldi r24, 0x00 ; 0 1cb20: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_print_pad(longFilename, len); 1cb24: 63 e1 ldi r22, 0x13 ; 19 1cb26: c5 01 movw r24, r10 1cb28: 0e 94 a2 73 call 0xe744 ; 0xe744 1cb2c: 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)) 1cb30: 90 91 61 04 lds r25, 0x0461 ; 0x800461 1cb34: 99 23 and r25, r25 1cb36: 09 f4 brne .+2 ; 0x1cb3a 1cb38: 2c c1 rjmp .+600 ; 0x1cd92 1cb3a: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1cb3e: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1cb42: 82 17 cp r24, r18 1cb44: 13 06 cpc r1, r19 1cb46: 09 f0 breq .+2 ; 0x1cb4a 1cb48: 24 c1 rjmp .+584 ; 0x1cd92 { lcd_update_enabled = false; 1cb4a: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 1cb4e: 80 91 94 03 lds r24, 0x0394 ; 0x800394 1cb52: 81 11 cpse r24, r1 1cb54: a3 cf rjmp .-186 ; 0x1ca9c // 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); 1cb56: 69 ed ldi r22, 0xD9 ; 217 1cb58: 73 e1 ldi r23, 0x13 ; 19 1cb5a: c7 01 movw r24, r14 1cb5c: 0f 94 a9 aa call 0x35552 ; 0x35552 1cb60: 47 01 movw r8, r14 1cb62: 45 e9 ldi r20, 0x95 ; 149 1cb64: a4 2e mov r10, r20 1cb66: 4f e0 ldi r20, 0x0F ; 15 1cb68: 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] == '.') { 1cb6a: f4 01 movw r30, r8 1cb6c: 61 91 ld r22, Z+ 1cb6e: 4f 01 movw r8, r30 1cb70: 66 23 and r22, r22 1cb72: 19 f0 breq .+6 ; 0x1cb7a 1cb74: 6e 32 cpi r22, 0x2E ; 46 1cb76: 09 f0 breq .+2 ; 0x1cb7a 1cb78: 4b c0 rjmp .+150 ; 0x1cc10 1cb7a: 60 e0 ldi r22, 0x00 ; 0 1cb7c: c5 01 movw r24, r10 1cb7e: 0f 94 62 a4 call 0x348c4 ; 0x348c4 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, '.'); 1cb82: 6e e2 ldi r22, 0x2E ; 46 1cb84: 70 e0 ldi r23, 0x00 ; 0 1cb86: c7 01 movw r24, r14 1cb88: 0f 94 95 aa call 0x3552a ; 0x3552a 1cb8c: 3c 01 movw r6, r24 if (extension_ptr) { 1cb8e: 89 2b or r24, r25 1cb90: 19 f0 breq .+6 ; 0x1cb98 extension_ptr++; // skip the '.' 1cb92: 8f ef ldi r24, 0xFF ; 255 1cb94: 68 1a sub r6, r24 1cb96: 78 0a sbc r7, r24 1cb98: 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); 1cb9a: 31 e9 ldi r19, 0x91 ; 145 1cb9c: a3 2e mov r10, r19 1cb9e: 3c e0 ldi r19, 0x0C ; 12 1cba0: 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') { 1cba2: 61 14 cp r6, r1 1cba4: 71 04 cpc r7, r1 1cba6: 21 f0 breq .+8 ; 0x1cbb0 1cba8: f4 01 movw r30, r8 1cbaa: 60 81 ld r22, Z 1cbac: 61 11 cpse r22, r1 1cbae: 01 c0 rjmp .+2 ; 0x1cbb2 1cbb0: 60 e0 ldi r22, 0x00 ; 0 1cbb2: c5 01 movw r24, r10 1cbb4: 0f 94 62 a4 call 0x348c4 ; 0x348c4 1cbb8: ff ef ldi r31, 0xFF ; 255 1cbba: af 1a sub r10, r31 1cbbc: bf 0a sbc r11, r31 1cbbe: 2f ef ldi r18, 0xFF ; 255 1cbc0: 82 1a sub r8, r18 1cbc2: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 1cbc4: 84 e9 ldi r24, 0x94 ; 148 1cbc6: a8 16 cp r10, r24 1cbc8: 8c e0 ldi r24, 0x0C ; 12 1cbca: b8 06 cpc r11, r24 1cbcc: 51 f7 brne .-44 ; 0x1cba2 { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 1cbce: 60 90 77 15 lds r6, 0x1577 ; 0x801577 1cbd2: 66 2d mov r22, r6 1cbd4: 8a e5 ldi r24, 0x5A ; 90 1cbd6: 9f e0 ldi r25, 0x0F ; 15 1cbd8: 0f 94 62 a4 call 0x348c4 ; 0x348c4 1cbdc: 85 ed ldi r24, 0xD5 ; 213 1cbde: 93 e1 ldi r25, 0x13 ; 19 1cbe0: 2a e0 ldi r18, 0x0A ; 10 1cbe2: a2 2e mov r10, r18 1cbe4: 2f e0 ldi r18, 0x0F ; 15 1cbe6: 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++) { 1cbe8: 71 2c mov r7, r1 1cbea: 4c 01 movw r8, r24 1cbec: e9 e0 ldi r30, 0x09 ; 9 1cbee: 8e 0e add r8, r30 1cbf0: 91 1c adc r9, r1 1cbf2: 76 14 cp r7, r6 1cbf4: d1 f0 breq .+52 ; 0x1cc2a #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); 1cbf6: 48 e0 ldi r20, 0x08 ; 8 1cbf8: 50 e0 ldi r21, 0x00 ; 0 1cbfa: b5 01 movw r22, r10 1cbfc: 8e 5a subi r24, 0xAE ; 174 1cbfe: 9f 4f sbci r25, 0xFF ; 255 1cc00: 0f 94 52 a4 call 0x348a4 ; 0x348a4 1cc04: 73 94 inc r7 1cc06: f8 e0 ldi r31, 0x08 ; 8 1cc08: af 0e add r10, r31 1cc0a: b1 1c adc r11, r1 1cc0c: c4 01 movw r24, r8 1cc0e: ed cf rjmp .-38 ; 0x1cbea if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1cc10: c5 01 movw r24, r10 1cc12: 0f 94 62 a4 call 0x348c4 ; 0x348c4 1cc16: ff ef ldi r31, 0xFF ; 255 1cc18: af 1a sub r10, r31 1cc1a: 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++) { 1cc1c: 2d e9 ldi r18, 0x9D ; 157 1cc1e: a2 16 cp r10, r18 1cc20: 2f e0 ldi r18, 0x0F ; 15 1cc22: b2 06 cpc r11, r18 1cc24: 09 f0 breq .+2 ; 0x1cc28 1cc26: a1 cf rjmp .-190 ; 0x1cb6a 1cc28: ac cf rjmp .-168 ; 0x1cb82 /** End of menus **/ /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; 1cc2a: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1cc2e: 88 23 and r24, r24 1cc30: 91 f0 breq .+36 ; 0x1cc56 if (!check_file(selected_filename)) { result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); lcd_update_enable(true); } if (result) { enquecommandf_P(MSG_M23, selected_filename); 1cc32: ff 92 push r15 1cc34: ef 92 push r14 1cc36: 3f 92 push r3 1cc38: 2f 92 push r2 1cc3a: 0e 94 2b 8e call 0x11c56 ; 0x11c56 enquecommand_P(MSG_M24); 1cc3e: 61 e0 ldi r22, 0x01 ; 1 1cc40: 87 e0 ldi r24, 0x07 ; 7 1cc42: 9d e6 ldi r25, 0x6D ; 109 1cc44: 0e 94 65 8d call 0x11aca ; 0x11aca 1cc48: 0f 90 pop r0 1cc4a: 0f 90 pop r0 1cc4c: 0f 90 pop r0 1cc4e: 0f 90 pop r0 } lcd_return_to_status(); 1cc50: 0f 94 18 05 call 0x20a30 ; 0x20a30 1cc54: 23 cf rjmp .-442 ; 0x1ca9c /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 1cc56: 61 e0 ldi r22, 0x01 ; 1 1cc58: c7 01 movw r24, r14 1cc5a: 0f 94 4e 71 call 0x2e29c ; 0x2e29c } uint32_t CardReader::getFileSize() { return filesize; 1cc5e: 40 90 e4 16 lds r4, 0x16E4 ; 0x8016e4 1cc62: 50 90 e5 16 lds r5, 0x16E5 ; 0x8016e5 1cc66: 60 90 e6 16 lds r6, 0x16E6 ; 0x8016e6 1cc6a: 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); 1cc6e: 94 2d mov r25, r4 1cc70: 85 2d mov r24, r5 1cc72: 21 e0 ldi r18, 0x01 ; 1 1cc74: 42 16 cp r4, r18 1cc76: 28 e7 ldi r18, 0x78 ; 120 1cc78: 52 06 cpc r5, r18 1cc7a: 61 04 cpc r6, r1 1cc7c: 71 04 cpc r7, r1 1cc7e: 10 f0 brcs .+4 ; 0x1cc84 1cc80: 90 e0 ldi r25, 0x00 ; 0 1cc82: 88 e7 ldi r24, 0x78 ; 120 1cc84: a9 2e mov r10, r25 1cc86: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 1cc88: 81 e0 ldi r24, 0x01 ; 1 1cc8a: 48 16 cp r4, r24 1cc8c: 88 e7 ldi r24, 0x78 ; 120 1cc8e: 58 06 cpc r5, r24 1cc90: 61 04 cpc r6, r1 1cc92: 71 04 cpc r7, r1 1cc94: 08 f4 brcc .+2 ; 0x1cc98 1cc96: 5d c0 rjmp .+186 ; 0x1cd52 startPos = filesize - END_FILE_SECTION; 1cc98: 98 e7 ldi r25, 0x78 ; 120 1cc9a: 59 1a sub r5, r25 1cc9c: 61 08 sbc r6, r1 1cc9e: 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);}; 1cca0: 40 92 eb 16 sts 0x16EB, r4 ; 0x8016eb 1cca4: 50 92 ec 16 sts 0x16EC, r5 ; 0x8016ec 1cca8: 60 92 ed 16 sts 0x16ED, r6 ; 0x8016ed 1ccac: 70 92 ee 16 sts 0x16EE, r7 ; 0x8016ee 1ccb0: c3 01 movw r24, r6 1ccb2: b2 01 movw r22, r4 1ccb4: 0f 94 86 67 call 0x2cf0c ; 0x2cf0c card.setIndex(startPos); } cmdqueue_reset(); 1ccb8: 0e 94 bf 83 call 0x1077e ; 0x1077e cmdqueue_serial_disabled = true; 1ccbc: 00 93 93 03 sts 0x0393, r16 ; 0x800393 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 1ccc0: 8a eb ldi r24, 0xBA ; 186 1ccc2: 98 e4 ldi r25, 0x48 ; 72 1ccc4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1ccc8: bc 01 movw r22, r24 1ccca: c5 01 movw r24, r10 1cccc: 0e 94 6c 72 call 0xe4d8 ; 0xe4d8 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; } 1ccd0: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 1ccd4: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 1ccd8: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 1ccdc: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee while (!card.eof() && !result) { 1cce0: 40 91 e4 16 lds r20, 0x16E4 ; 0x8016e4 1cce4: 50 91 e5 16 lds r21, 0x16E5 ; 0x8016e5 1cce8: 60 91 e6 16 lds r22, 0x16E6 ; 0x8016e6 1ccec: 70 91 e7 16 lds r23, 0x16E7 ; 0x8016e7 1ccf0: 84 17 cp r24, r20 1ccf2: 95 07 cpc r25, r21 1ccf4: a6 07 cpc r26, r22 1ccf6: b7 07 cpc r27, r23 1ccf8: 80 f5 brcc .+96 ; 0x1cd5a 1ccfa: 11 11 cpse r17, r1 1ccfc: 2e c0 rjmp .+92 ; 0x1cd5a 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); }; 1ccfe: 20 91 6a 16 lds r18, 0x166A ; 0x80166a 1cd02: 21 11 cpse r18, r1 1cd04: 03 c0 rjmp .+6 ; 0x1cd0c 1cd06: 80 e0 ldi r24, 0x00 ; 0 1cd08: 90 e0 ldi r25, 0x00 ; 0 1cd0a: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 1cd0c: 84 19 sub r24, r4 1cd0e: 95 09 sbc r25, r5 1cd10: 0e 94 a2 71 call 0xe344 ; 0xe344 card.sdprinting = true; 1cd14: 00 93 d7 13 sts 0x13D7, r16 ; 0x8013d7 get_command(); 1cd18: 0e 94 21 86 call 0x10c42 ; 0x10c42 #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 1cd1c: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1cd20: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1cd24: 89 2b or r24, r25 1cd26: a1 f2 breq .-88 ; 0x1ccd0 { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 1cd28: 88 e6 ldi r24, 0x68 ; 104 1cd2a: 99 e6 ldi r25, 0x69 ; 105 1cd2c: 0f 94 89 39 call 0x27312 ; 0x27312 1cd30: 81 11 cpse r24, r1 1cd32: 05 c0 rjmp .+10 ; 0x1cd3e 1cd34: 83 e8 ldi r24, 0x83 ; 131 1cd36: 94 e8 ldi r25, 0x84 ; 132 1cd38: 0f 94 89 39 call 0x27312 ; 0x27312 1cd3c: 81 11 cpse r24, r1 1cd3e: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 1cd40: 80 91 53 12 lds r24, 0x1253 ; 0x801253 1cd44: 81 11 cpse r24, r1 1cd46: 02 c0 rjmp .+4 ; 0x1cd4c cmdqueue_pop_front(); 1cd48: 0e 94 9e 79 call 0xf33c ; 0xf33c cmdbuffer_front_already_processed = false; 1cd4c: 10 92 53 12 sts 0x1253, r1 ; 0x801253 1cd50: e5 cf rjmp .-54 ; 0x1cd1c 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; 1cd52: 41 2c mov r4, r1 1cd54: 51 2c mov r5, r1 1cd56: 32 01 movw r6, r4 1cd58: af cf rjmp .-162 ; 0x1ccb8 // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 1cd5a: 0e 94 c3 71 call 0xe386 ; 0xe386 cmdqueue_serial_disabled = false; 1cd5e: 10 92 93 03 sts 0x0393, r1 ; 0x800393 card.printingHasFinished(); 1cd62: 0f 94 86 72 call 0x2e50c ; 0x2e50c lcd_setstatuspgm(MSG_WELCOME); 1cd66: 8a e8 ldi r24, 0x8A ; 138 1cd68: 9c e6 ldi r25, 0x6C ; 108 1cd6a: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe 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)) { 1cd6e: 11 11 cpse r17, r1 1cd70: 60 cf rjmp .-320 ; 0x1cc32 result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); 1cd72: 8a ec ldi r24, 0xCA ; 202 1cd74: 98 e4 ldi r25, 0x48 ; 72 1cd76: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1cd7a: 41 e0 ldi r20, 0x01 ; 1 1cd7c: 60 e0 ldi r22, 0x00 ; 0 1cd7e: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 1cd82: 18 2f mov r17, r24 lcd_update_enable(true); 1cd84: 81 e0 ldi r24, 0x01 ; 1 1cd86: 0e 94 93 70 call 0xe126 ; 0xe126 } if (result) { 1cd8a: 11 23 and r17, r17 1cd8c: 09 f4 brne .+2 ; 0x1cd90 1cd8e: 51 cf rjmp .-350 ; 0x1cc32 1cd90: 5f cf rjmp .-322 ; 0x1cc50 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 1cd92: 8f 5f subi r24, 0xFF ; 255 1cd94: 80 93 63 04 sts 0x0463, r24 ; 0x800463 1cd98: 1b ce rjmp .-970 ; 0x1c9d0 else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 1cd9a: 0e 94 de 62 call 0xc5bc ; 0xc5bc _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(); 1cd9e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1cda2: 8f 5f subi r24, 0xFF ; 255 1cda4: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1cda8: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1cdac: 8f 5f subi r24, 0xFF ; 255 1cdae: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1cdb2: e0 cd rjmp .-1088 ; 0x1c974 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. 1cdb4: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1cdb8: 11 e0 ldi r17, 0x01 ; 1 1cdba: 81 11 cpse r24, r1 1cdbc: 05 c0 rjmp .+10 ; 0x1cdc8 1cdbe: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1cdc2: 81 11 cpse r24, r1 1cdc4: 01 c0 rjmp .+2 ; 0x1cdc8 1cdc6: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 1cdc8: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1cdcc: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1cdd0: 89 2b or r24, r25 1cdd2: 91 f4 brne .+36 ; 0x1cdf8 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 1cdd4: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 1cdd8: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1cddc: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1cde0: 0f 94 04 77 call 0x2ee08 ; 0x2ee08 #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1cde4: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 1cde8: 81 11 cpse r24, r1 1cdea: 46 c0 rjmp .+140 ; 0x1ce78 1cdec: 89 ed ldi r24, 0xD9 ; 217 1cdee: 93 e1 ldi r25, 0x13 ; 19 1cdf0: 90 93 9a 03 sts 0x039A, r25 ; 0x80039a 1cdf4: 80 93 99 03 sts 0x0399, r24 ; 0x800399 } if (rewindFlag) 1cdf8: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 1cdfa: 10 92 97 03 sts 0x0397, r1 ; 0x800397 if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 1cdfe: 6c e2 ldi r22, 0x2C ; 44 1ce00: 71 e0 ldi r23, 0x01 ; 1 1ce02: 81 ea ldi r24, 0xA1 ; 161 1ce04: 93 e0 ldi r25, 0x03 ; 3 1ce06: 0f 94 30 0b call 0x21660 ; 0x21660 ::expired(unsigned short)> 1ce0a: 81 11 cpse r24, r1 1ce0c: 03 c0 rjmp .+6 ; 0x1ce14 1ce0e: 11 23 and r17, r17 1ce10: 09 f4 brne .+2 ; 0x1ce14 1ce12: 4f ce rjmp .-866 ; 0x1cab2 { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 1ce14: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1ce18: 02 e1 ldi r16, 0x12 ; 18 1ce1a: 81 11 cpse r24, r1 1ce1c: 01 c0 rjmp .+2 ; 0x1ce20 1ce1e: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 1ce20: 4e e3 ldi r20, 0x3E ; 62 1ce22: 60 91 9f 03 lds r22, 0x039F ; 0x80039f 1ce26: 80 e0 ldi r24, 0x00 ; 0 1ce28: 0e 94 6e 70 call 0xe0dc ; 0xe0dc if (_md->isDir) 1ce2c: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1ce30: 88 23 and r24, r24 1ce32: 19 f0 breq .+6 ; 0x1ce3a 1ce34: 85 e8 ldi r24, 0x85 ; 133 1ce36: 0e 94 fd 70 call 0xe1fa ; 0xe1fa lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 1ce3a: 20 91 97 03 lds r18, 0x0397 ; 0x800397 1ce3e: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1ce42: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1ce46: 60 2f mov r22, r16 1ce48: 82 0f add r24, r18 1ce4a: 91 1d adc r25, r1 1ce4c: 0e 94 a2 73 call 0xe744 ; 0xe744 1ce50: 81 11 cpse r24, r1 1ce52: 15 c0 rjmp .+42 ; 0x1ce7e { _md->lcd_scrollTimer.start(); 1ce54: 81 ea ldi r24, 0xA1 ; 161 1ce56: 93 e0 ldi r25, 0x03 ; 3 1ce58: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> _md->offset++; 1ce5c: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1ce60: 8f 5f subi r24, 0xFF ; 255 1ce62: 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. 1ce66: 11 23 and r17, r17 1ce68: 09 f4 brne .+2 ; 0x1ce6c 1ce6a: 23 ce rjmp .-954 ; 0x1cab2 1ce6c: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 1ce70: 81 e0 ldi r24, 0x01 ; 1 1ce72: 80 93 96 03 sts 0x0396, r24 ; 0x800396 1ce76: 1d ce rjmp .-966 ; 0x1cab2 #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; 1ce78: 8e ee ldi r24, 0xEE ; 238 1ce7a: 93 e1 ldi r25, 0x13 ; 19 1ce7c: b9 cf rjmp .-142 ; 0x1cdf0 1ce7e: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 1ce82: f1 cf rjmp .-30 ; 0x1ce66 0001ce84 : } 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 1ce84: 41 e0 ldi r20, 0x01 ; 1 1ce86: 61 e0 ldi r22, 0x01 ; 1 1ce88: 89 e6 ldi r24, 0x69 ; 105 1ce8a: 94 e8 ldi r25, 0x84 ; 132 1ce8c: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 if (disable == LCD_LEFT_BUTTON_CHOICE) 1ce90: 81 11 cpse r24, r1 1ce92: 07 c0 rjmp .+14 ; 0x1cea2 { enquecommand_P(PSTR("G99")); 1ce94: 61 e0 ldi r22, 0x01 ; 1 1ce96: 85 e6 ldi r24, 0x65 ; 101 1ce98: 94 e8 ldi r25, 0x84 ; 132 1ce9a: 0e 94 65 8d call 0x11aca ; 0x11aca lcd_return_to_status(); 1ce9e: 0f 94 18 05 call 0x20a30 ; 0x20a30 } lcd_update_enable(true); 1cea2: 81 e0 ldi r24, 0x01 ; 1 1cea4: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_draw_update = 2; 1cea8: 82 e0 ldi r24, 0x02 ; 2 1ceaa: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } 1ceae: 08 95 ret 0001ceb0 : 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() { 1ceb0: cf 93 push r28 1ceb2: df 93 push r29 if (MMU2::mmu2.Enabled()) { 1ceb4: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1ceb8: 81 30 cpi r24, 0x01 ; 1 1ceba: f9 f4 brne .+62 ; 0x1cefa const uint8_t filament = choose_menu_P( _T(MSG_SELECT_FILAMENT), MSG_FILAMENT,(_T(MSG_CANCEL)+1)); //Hack to reuse MSG but strip 1st char off 1cebc: 87 e2 ldi r24, 0x27 ; 39 1cebe: 9d e3 ldi r25, 0x3D ; 61 1cec0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1cec4: ec 01 movw r28, r24 } void lcd_v2_calibration() { if (MMU2::mmu2.Enabled()) { const uint8_t filament = choose_menu_P( 1cec6: 84 e1 ldi r24, 0x14 ; 20 1cec8: 9d e3 ldi r25, 0x3D ; 61 1ceca: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1cece: be 01 movw r22, r28 1ced0: 6f 5f subi r22, 0xFF ; 255 1ced2: 7f 4f sbci r23, 0xFF ; 255 _T(MSG_SELECT_FILAMENT), MSG_FILAMENT,(_T(MSG_CANCEL)+1)); //Hack to reuse MSG but strip 1st char off 1ced4: 0e 94 b3 cf call 0x19f66 ; 0x19f66 if (filament < MMU_FILAMENT_COUNT) { 1ced8: 85 30 cpi r24, 0x05 ; 5 1ceda: 98 f5 brcc .+102 ; 0x1cf42 lay1cal_filament = filament; 1cedc: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 1cee0: 8a e0 ldi r24, 0x0A ; 10 1cee2: 80 93 94 03 sts 0x0394, r24 ; 0x800394 menu_goto(lcd_generic_preheat_menu, 0, true); 1cee6: 20 e0 ldi r18, 0x00 ; 0 1cee8: 41 e0 ldi r20, 0x01 ; 1 1ceea: 70 e0 ldi r23, 0x00 ; 0 1ceec: 60 e0 ldi r22, 0x00 ; 0 1ceee: 88 e4 ldi r24, 0x48 ; 72 1cef0: 97 e3 ldi r25, 0x37 ; 55 } 1cef2: df 91 pop r29 1cef4: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 1cef6: 0c 94 12 63 jmp 0xc624 ; 0xc624 menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1cefa: 8f e5 ldi r24, 0x5F ; 95 1cefc: 9f e0 ldi r25, 0x0F ; 15 1cefe: 0f 94 3e a4 call 0x3487c ; 0x3487c 1cf02: 81 11 cpse r24, r1 1cf04: ed cf rjmp .-38 ; 0x1cee0 { bool loaded = false; if (fsensor.isReady()) { 1cf06: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1cf0a: 82 30 cpi r24, 0x02 ; 2 1cf0c: f1 f4 brne .+60 ; 0x1cf4a 1cf0e: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1cf12: 81 11 cpse r24, r1 1cf14: e5 cf rjmp .-54 ; 0x1cee0 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)); 1cf16: 86 ef ldi r24, 0xF6 ; 246 1cf18: 9c e3 ldi r25, 0x3C ; 60 1cf1a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1cf1e: 0e 94 94 de call 0x1bd28 ; 0x1bd28 lcd_consume_click(); 1cf22: 0e 94 cb 73 call 0xe796 ; 0xe796 1cf26: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 1cf28: 84 e6 ldi r24, 0x64 ; 100 1cf2a: 90 e0 ldi r25, 0x00 ; 0 1cf2c: 0e 94 0a 8d call 0x11a14 ; 0x11a14 if (lcd_clicked()) { 1cf30: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1cf34: 81 11 cpse r24, r1 1cf36: 02 c0 rjmp .+4 ; 0x1cf3c 1cf38: 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 1cf3a: b1 f7 brne .-20 ; 0x1cf28 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 1cf3c: 81 e0 ldi r24, 0x01 ; 1 1cf3e: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 1cf42: df 91 pop r29 1cf44: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 1cf46: 0c 94 76 63 jmp 0xc6ec ; 0xc6ec { 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); 1cf4a: 8d e2 ldi r24, 0x2D ; 45 1cf4c: 92 e4 ldi r25, 0x42 ; 66 1cf4e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1cf52: 41 e0 ldi r20, 0x01 ; 1 1cf54: 60 e0 ldi r22, 0x00 ; 0 1cf56: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 1cf5a: 91 e0 ldi r25, 0x01 ; 1 1cf5c: 81 11 cpse r24, r1 1cf5e: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 1cf60: 81 e0 ldi r24, 0x01 ; 1 1cf62: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a } if (!loaded) { 1cf66: 91 11 cpse r25, r1 1cf68: bb cf rjmp .-138 ; 0x1cee0 1cf6a: d5 cf rjmp .-86 ; 0x1cf16 0001cf6c : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 1cf6c: cf 93 push r28 1cf6e: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 1cf70: 83 ed ldi r24, 0xD3 ; 211 1cf72: 9f e3 ldi r25, 0x3F ; 63 1cf74: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1cf78: 40 e0 ldi r20, 0x00 ; 0 1cf7a: 6c 2f mov r22, r28 1cf7c: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 if (result == LCD_LEFT_BUTTON_CHOICE) { 1cf80: 81 11 cpse r24, r1 1cf82: 03 c0 rjmp .+6 ; 0x1cf8a lcd_mesh_calibration_z(); } } 1cf84: 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(); 1cf86: 0c 94 66 c2 jmp 0x184cc ; 0x184cc } } 1cf8a: cf 91 pop r28 1cf8c: 08 95 ret 0001cf8e : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 1cf8e: bf 92 push r11 1cf90: cf 92 push r12 1cf92: df 92 push r13 1cf94: ef 92 push r14 1cf96: ff 92 push r15 1cf98: 0f 93 push r16 1cf9a: 1f 93 push r17 1cf9c: cf 93 push r28 1cf9e: df 93 push r29 1cfa0: 00 d0 rcall .+0 ; 0x1cfa2 1cfa2: 1f 92 push r1 1cfa4: cd b7 in r28, 0x3d ; 61 1cfa6: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 1cfa8: 8c ea ldi r24, 0xAC ; 172 1cfaa: 9d e0 ldi r25, 0x0D ; 13 1cfac: 0f 94 3e a4 call 0x3487c ; 0x3487c 1cfb0: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 1cfb2: 8b ea ldi r24, 0xAB ; 171 1cfb4: 9d e0 ldi r25, 0x0D ; 13 1cfb6: 0f 94 3e a4 call 0x3487c ; 0x3487c 1cfba: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 1cfbc: 8a ea ldi r24, 0xAA ; 170 1cfbe: 9d e0 ldi r25, 0x0D ; 13 1cfc0: 0f 94 3e a4 call 0x3487c ; 0x3487c 1cfc4: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 1cfc6: 0e 94 67 74 call 0xe8ce ; 0xe8ce 1cfca: 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'; 1cfce: 80 e3 ldi r24, 0x30 ; 48 1cfd0: d8 2e mov r13, r24 1cfd2: df 0c add r13, r15 sToggle[1] = 'x'; 1cfd4: 98 e7 ldi r25, 0x78 ; 120 1cfd6: 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'; 1cfd8: 20 e3 ldi r18, 0x30 ; 48 1cfda: e2 2e mov r14, r18 1cfdc: 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(); 1cfde: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1cfe2: 84 30 cpi r24, 0x04 ; 4 1cfe4: 08 f0 brcs .+2 ; 0x1cfe8 1cfe6: 56 c0 rjmp .+172 ; 0x1d094 1cfe8: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 1cfec: 0e 94 a7 62 call 0xc54e ; 0xc54e 1cff0: 88 23 and r24, r24 1cff2: 31 f0 breq .+12 ; 0x1d000 1cff4: 87 e0 ldi r24, 0x07 ; 7 1cff6: f8 12 cpse r15, r24 1cff8: 03 c0 rjmp .+6 ; 0x1d000 1cffa: 81 e0 ldi r24, 0x01 ; 1 1cffc: 0e 94 b6 e7 call 0x1cf6c ; 0x1cf6c // 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)); 1d000: 87 e9 ldi r24, 0x97 ; 151 1d002: 98 e4 ldi r25, 0x48 ; 72 1d004: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d008: 0e 94 29 73 call 0xe652 ; 0xe652 sToggle[0] = points_nr + '0'; 1d00c: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 1d00e: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 1d010: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 1d012: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 1d014: 80 e9 ldi r24, 0x90 ; 144 1d016: 98 e4 ldi r25, 0x48 ; 72 1d018: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d01c: 20 e0 ldi r18, 0x00 ; 0 1d01e: 4c e0 ldi r20, 0x0C ; 12 1d020: 5d eb ldi r21, 0xBD ; 189 1d022: be 01 movw r22, r28 1d024: 6f 5f subi r22, 0xFF ; 255 1d026: 7f 4f sbci r23, 0xFF ; 255 1d028: 0e 94 b9 75 call 0xeb72 ; 0xeb72 sToggle[0] = mbl_z_probe_nr + '0'; 1d02c: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 1d02e: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 1d030: 82 e8 ldi r24, 0x82 ; 130 1d032: 98 e4 ldi r25, 0x48 ; 72 1d034: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d038: 20 e0 ldi r18, 0x00 ; 0 1d03a: 4d ef ldi r20, 0xFD ; 253 1d03c: 5c eb ldi r21, 0xBC ; 188 1d03e: be 01 movw r22, r28 1d040: 6f 5f subi r22, 0xFF ; 255 1d042: 7f 4f sbci r23, 0xFF ; 255 1d044: 0e 94 b9 75 call 0xeb72 ; 0xeb72 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); 1d048: 87 e0 ldi r24, 0x07 ; 7 1d04a: f8 12 cpse r15, r24 1d04c: 20 c0 rjmp .+64 ; 0x1d08e 1d04e: 8c e5 ldi r24, 0x5C ; 92 1d050: 93 e6 ldi r25, 0x63 ; 99 1d052: c1 10 cpse r12, r1 1d054: 02 c0 rjmp .+4 ; 0x1d05a 1d056: 86 e5 ldi r24, 0x56 ; 86 1d058: 93 e6 ldi r25, 0x63 ; 99 1d05a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d05e: 8c 01 movw r16, r24 1d060: 8c e6 ldi r24, 0x6C ; 108 1d062: 98 e4 ldi r25, 0x48 ; 72 1d064: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d068: 22 e0 ldi r18, 0x02 ; 2 1d06a: 48 e1 ldi r20, 0x18 ; 24 1d06c: 5d eb ldi r21, 0xBD ; 189 1d06e: b8 01 movw r22, r16 1d070: 0e 94 b9 75 call 0xeb72 ; 0xeb72 MENU_END(); 1d074: 0e 94 de 62 call 0xc5bc ; 0xc5bc 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(); 1d078: 90 91 60 04 lds r25, 0x0460 ; 0x800460 1d07c: 9f 5f subi r25, 0xFF ; 255 1d07e: 90 93 60 04 sts 0x0460, r25 ; 0x800460 1d082: 90 91 62 04 lds r25, 0x0462 ; 0x800462 1d086: 9f 5f subi r25, 0xFF ; 255 1d088: 90 93 62 04 sts 0x0462, r25 ; 0x800462 1d08c: a8 cf rjmp .-176 ; 0x1cfde 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); 1d08e: 8c e7 ldi r24, 0x7C ; 124 1d090: 98 e4 ldi r25, 0x48 ; 72 1d092: e3 cf rjmp .-58 ; 0x1d05a MENU_END(); } 1d094: 0f 90 pop r0 1d096: 0f 90 pop r0 1d098: 0f 90 pop r0 1d09a: 0f 90 pop r0 1d09c: df 91 pop r29 1d09e: cf 91 pop r28 1d0a0: 1f 91 pop r17 1d0a2: 0f 91 pop r16 1d0a4: ff 90 pop r15 1d0a6: ef 90 pop r14 1d0a8: df 90 pop r13 1d0aa: cf 90 pop r12 1d0ac: bf 90 pop r11 1d0ae: 08 95 ret 0001d0b0 : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 1d0b0: cf 92 push r12 1d0b2: df 92 push r13 1d0b4: ef 92 push r14 1d0b6: ff 92 push r15 1d0b8: 0f 93 push r16 1d0ba: 1f 93 push r17 1d0bc: cf 93 push r28 1d0be: df 93 push r29 1d0c0: d8 2e mov r13, r24 1d0c2: 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) 1d0c4: 01 e0 ldi r16, 0x01 ; 1 1d0c6: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 1d0ca: 81 11 cpse r24, r1 1d0cc: 01 c0 rjmp .+2 ; 0x1d0d0 1d0ce: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 1d0d0: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 1d0d4: 8d 2d mov r24, r13 1d0d6: 9c 2d mov r25, r12 1d0d8: 0e 94 94 de call 0x1bd28 ; 0x1bd28 1d0dc: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 1d0de: 0e 94 cb 73 call 0xe796 ; 0xe796 KEEPALIVE_STATE(PAUSED_FOR_USER); 1d0e2: 84 e0 ldi r24, 0x04 ; 4 1d0e4: 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); 1d0e8: 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) { 1d0ea: 20 97 sbiw r28, 0x00 ; 0 1d0ec: 29 f4 brne .+10 ; 0x1d0f8 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 1d0ee: 49 e8 ldi r20, 0x89 ; 137 1d0f0: 63 e0 ldi r22, 0x03 ; 3 1d0f2: 83 e1 ldi r24, 0x13 ; 19 1d0f4: 0e 94 6e 70 call 0xe0dc ; 0xe0dc * @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); 1d0f8: 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); 1d0fa: 82 e3 ldi r24, 0x32 ; 50 1d0fc: 90 e0 ldi r25, 0x00 ; 0 1d0fe: 0e 94 0a 8d call 0x11a14 ; 0x11a14 if (lcd_clicked()) { 1d102: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1d106: 88 23 and r24, r24 1d108: 81 f0 breq .+32 ; 0x1d12a if (msg_next == NULL) { 1d10a: 20 97 sbiw r28, 0x00 ; 0 1d10c: 81 f4 brne .+32 ; 0x1d12e KEEPALIVE_STATE(IN_HANDLER); 1d10e: 82 e0 ldi r24, 0x02 ; 2 1d110: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 1d114: 00 93 5a 02 sts 0x025A, r16 ; 0x80025a if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 1d118: df 91 pop r29 1d11a: cf 91 pop r28 1d11c: 1f 91 pop r17 1d11e: 0f 91 pop r16 1d120: ff 90 pop r15 1d122: ef 90 pop r14 1d124: df 90 pop r13 1d126: cf 90 pop r12 1d128: 08 95 ret 1d12a: 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) { 1d12c: 31 f7 brne .-52 ; 0x1d0fa else { break; } } } if (multi_screen) { 1d12e: e1 14 cp r14, r1 1d130: f1 04 cpc r15, r1 1d132: d9 f2 breq .-74 ; 0x1d0ea if (msg_next == NULL) 1d134: 20 97 sbiw r28, 0x00 ; 0 1d136: 11 f4 brne .+4 ; 0x1d13c msg_next = msg; 1d138: cd 2d mov r28, r13 1d13a: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 1d13c: ce 01 movw r24, r28 1d13e: 0e 94 94 de call 0x1bd28 ; 0x1bd28 1d142: ec 01 movw r28, r24 1d144: d2 cf rjmp .-92 ; 0x1d0ea 0001d146 : 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' 1d146: 41 30 cpi r20, 0x01 ; 1 1d148: 41 f4 brne .+16 ; 0x1d15a if (lcd_show_multiscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 1d14a: 40 e0 ldi r20, 0x00 ; 0 1d14c: 61 e0 ldi r22, 0x01 ; 1 1d14e: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 1d152: 81 30 cpi r24, 0x01 ; 1 1d154: 41 f4 brne .+16 ; 0x1d166 lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 1d156: 0c 94 2d dd jmp 0x1ba5a ; 0x1ba5a { if (check == 1) { // Warning, stop print if user selects 'No' if (lcd_show_multiscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print 1d15a: 42 30 cpi r20, 0x02 ; 2 1d15c: 21 f4 brne .+8 ; 0x1d166 lcd_show_fullscreen_message_and_wait_P(strict); 1d15e: cb 01 movw r24, r22 1d160: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 1d164: f8 cf rjmp .-16 ; 0x1d156 lcd_print_stop(); } } 1d166: 08 95 ret 0001d168 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 1d168: 0f 93 push r16 1d16a: 1f 93 push r17 1d16c: 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)) { 1d16e: 8c ea ldi r24, 0xAC ; 172 1d170: 9c e0 ldi r25, 0x0C ; 12 1d172: 0f 94 3e a4 call 0x3487c ; 0x3487c 1d176: 81 11 cpse r24, r1 1d178: 23 c0 rjmp .+70 ; 0x1d1c0 goto done; } if (fsensor.isEnabled() && !fsensor.getFilamentPresent()) { 1d17a: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1d17e: 88 23 and r24, r24 1d180: f9 f0 breq .+62 ; 0x1d1c0 1d182: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1d186: 81 11 cpse r24, r1 1d188: 1b c0 rjmp .+54 ; 0x1d1c0 if (oCheckFilament == ClCheckMode::_None) { 1d18a: c0 91 ee 03 lds r28, 0x03EE ; 0x8003ee 1d18e: cc 23 and r28, r28 1d190: b9 f0 breq .+46 ; 0x1d1c0 goto done; } render_M862_warnings( 1d192: 80 ed ldi r24, 0xD0 ; 208 1d194: 9c e4 ldi r25, 0x4C ; 76 1d196: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d19a: 8c 01 movw r16, r24 1d19c: 87 ea ldi r24, 0xA7 ; 167 1d19e: 9c e4 ldi r25, 0x4C ; 76 1d1a0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d1a4: 4c 2f mov r20, r28 1d1a6: b8 01 movw r22, r16 1d1a8: 0e 94 a3 e8 call 0x1d146 ; 0x1d146 _T(MSG_MISSING_FILAMENT_CONTINUE) ,_T(MSG_MISSING_FILAMENT_CANCELLED) ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 1d1ac: 81 e0 ldi r24, 0x01 ; 1 1d1ae: 90 91 5e 0d lds r25, 0x0D5E ; 0x800d5e 1d1b2: 91 30 cpi r25, 0x01 ; 1 1d1b4: 09 f4 brne .+2 ; 0x1d1b8 1d1b6: 80 e0 ldi r24, 0x00 ; 0 } } done: return true; } 1d1b8: cf 91 pop r28 1d1ba: 1f 91 pop r17 1d1bc: 0f 91 pop r16 1d1be: 08 95 ret return false; } } done: return true; 1d1c0: 81 e0 ldi r24, 0x01 ; 1 1d1c2: fa cf rjmp .-12 ; 0x1d1b8 0001d1c4 : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 1d1c4: 1f 93 push r17 1d1c6: cf 93 push r28 1d1c8: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 1d1ca: 10 91 ed 03 lds r17, 0x03ED ; 0x8003ed 1d1ce: 11 23 and r17, r17 1d1d0: 19 f1 breq .+70 ; 0x1d218 1d1d2: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 1d1d4: 85 ea ldi r24, 0xA5 ; 165 1d1d6: 9d e0 ldi r25, 0x0D ; 13 1d1d8: 0f 94 4c a4 call 0x34898 ; 0x34898 if (nDiameter == nDiameter_um) 1d1dc: 8c 17 cp r24, r28 1d1de: 9d 07 cpc r25, r29 1d1e0: d9 f0 breq .+54 ; 0x1d218 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 1d1e2: 87 e4 ldi r24, 0x47 ; 71 1d1e4: 9c e4 ldi r25, 0x4C ; 76 1d1e6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d1ea: ec 01 movw r28, r24 1d1ec: 82 e1 ldi r24, 0x12 ; 18 1d1ee: 9c e4 ldi r25, 0x4C ; 76 1d1f0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d1f4: 41 2f mov r20, r17 1d1f6: be 01 movw r22, r28 1d1f8: 0e 94 a3 e8 call 0x1d146 ; 0x1d146 _T(MSG_NOZZLE_DIFFERS_CONTINUE) ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { 1d1fc: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1d200: 81 11 cpse r24, r1 1d202: 0a c0 rjmp .+20 ; 0x1d218 bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1d204: 10 92 ec 03 sts 0x03EC, r1 ; 0x8003ec menu_submenu(lcd_hw_setup_menu); 1d208: 60 e0 ldi r22, 0x00 ; 0 1d20a: 87 e4 ldi r24, 0x47 ; 71 1d20c: 9f eb ldi r25, 0xBF ; 191 } } 1d20e: df 91 pop r29 1d210: cf 91 pop r28 1d212: 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); 1d214: 0c 94 38 63 jmp 0xc670 ; 0xc670 } } 1d218: df 91 pop r29 1d21a: cf 91 pop r28 1d21c: 1f 91 pop r17 1d21e: 08 95 ret 0001d220 : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 1d220: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1d224: 88 23 and r24, r24 1d226: 61 f0 breq .+24 ; 0x1d240 1d228: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1d22c: 88 23 and r24, r24 1d22e: 41 f0 breq .+16 ; 0x1d240 lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 1d230: 8e ee ldi r24, 0xEE ; 238 1d232: 94 e4 ldi r25, 0x44 ; 68 1d234: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d238: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 1d23c: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 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; 1d240: 85 e0 ldi r24, 0x05 ; 5 1d242: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e 1d246: fa cf rjmp .-12 ; 0x1d23c 0001d248 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 1d248: cf 93 push r28 1d24a: 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); 1d24c: 86 e2 ldi r24, 0x26 ; 38 1d24e: 90 e4 ldi r25, 0x40 ; 64 1d250: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d254: 41 e0 ldi r20, 0x01 ; 1 1d256: 4c 27 eor r20, r28 1d258: 60 e0 ldi r22, 0x00 ; 0 1d25a: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 1d25e: 91 e0 ldi r25, 0x01 ; 1 1d260: 81 11 cpse r24, r1 1d262: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 1d264: c9 17 cp r28, r25 1d266: 59 f0 breq .+22 ; 0x1d27e lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 1d268: 8c ef ldi r24, 0xFC ; 252 1d26a: 9f e3 ldi r25, 0x3F ; 63 1d26c: cc 23 and r28, r28 1d26e: 11 f0 breq .+4 ; 0x1d274 1d270: 85 e9 ldi r24, 0x95 ; 149 1d272: 90 e6 ldi r25, 0x60 ; 96 1d274: 0e 94 95 75 call 0xeb2a ; 0xeb2a } #endif //STEEL_SHEET } 1d278: 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)); 1d27a: 0c 94 58 e8 jmp 0x1d0b0 ; 0x1d0b0 } #endif //STEEL_SHEET } 1d27e: cf 91 pop r28 1d280: 08 95 ret 0001d282 : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 1d282: cf 93 push r28 1d284: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 1d286: 84 e8 ldi r24, 0x84 ; 132 1d288: 9f e3 ldi r25, 0x3F ; 63 1d28a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d28e: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 1d292: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d296: 81 30 cpi r24, 0x01 ; 1 1d298: 69 f4 brne .+26 ; 0x1d2b4 { lcd_show_fullscreen_message_and_wait_P( 1d29a: 8b e2 ldi r24, 0x2B ; 43 1d29c: 9f e3 ldi r25, 0x3F ; 63 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 1d29e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d2a2: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 1d2a6: 89 e5 ldi r24, 0x59 ; 89 1d2a8: 9e e3 ldi r25, 0x3E ; 62 1d2aa: 0e 94 95 75 call 0xeb2a ; 0xeb2a _T(MSG_WIZARD_V2_CAL_2)); } 1d2ae: 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( 1d2b0: 0c 94 58 e8 jmp 0x1d0b0 ; 0x1d0b0 if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 1d2b4: cc 23 and r28, r28 1d2b6: b9 f3 breq .-18 ; 0x1d2a6 { lcd_show_fullscreen_message_and_wait_P( 1d2b8: 89 ef ldi r24, 0xF9 ; 249 1d2ba: 9e e3 ldi r25, 0x3E ; 62 1d2bc: f0 cf rjmp .-32 ; 0x1d29e 0001d2be : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 1d2be: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d2c2: 81 30 cpi r24, 0x01 ; 1 1d2c4: 71 f4 brne .+28 ; 0x1d2e2 lcd_show_fullscreen_message_and_wait_P( 1d2c6: 80 e0 ldi r24, 0x00 ; 0 1d2c8: 9e e3 ldi r25, 0x3E ; 62 1d2ca: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d2ce: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 _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; 1d2d2: 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; 1d2d4: 80 93 94 03 sts 0x0394, r24 ; 0x800394 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 1d2d8: 61 e0 ldi r22, 0x01 ; 1 1d2da: 86 e0 ldi r24, 0x06 ; 6 1d2dc: 94 e8 ldi r25, 0x84 ; 132 1d2de: 0c 94 65 8d jmp 0x11aca ; 0x11aca // 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( 1d2e2: 84 eb ldi r24, 0xB4 ; 180 1d2e4: 9d e3 ldi r25, 0x3D ; 61 1d2e6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d2ea: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 1d2ee: 80 e0 ldi r24, 0x00 ; 0 1d2f0: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_clear(); 1d2f4: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 1d2f8: 8f ea ldi r24, 0xAF ; 175 1d2fa: 92 e6 ldi r25, 0x62 ; 98 1d2fc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d300: ac 01 movw r20, r24 1d302: 62 e0 ldi r22, 0x02 ; 2 1d304: 80 e0 ldi r24, 0x00 ; 0 1d306: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 eFilamentAction = FilamentAction::Load; 1d30a: 81 e0 ldi r24, 0x01 ; 1 1d30c: e3 cf rjmp .-58 ; 0x1d2d4 0001d30e : //! ---------------------- | ---------------- //! 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) { 1d30e: af 92 push r10 1d310: bf 92 push r11 1d312: cf 92 push r12 1d314: df 92 push r13 1d316: ef 92 push r14 1d318: ff 92 push r15 1d31a: 0f 93 push r16 1d31c: 1f 93 push r17 1d31e: cf 93 push r28 1d320: 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); 1d322: 88 23 and r24, r24 1d324: 29 f0 breq .+10 ; 0x1d330 1d326: 61 e0 ldi r22, 0x01 ; 1 1d328: 8f e5 ldi r24, 0x5F ; 95 1d32a: 9f e0 ldi r25, 0x0F ; 15 1d32c: 0f 94 62 a4 call 0x348c4 ; 0x348c4 FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 1d330: 8e e0 ldi r24, 0x0E ; 14 1d332: e8 2e mov r14, r24 1d334: 84 e8 ldi r24, 0x84 ; 132 1d336: 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; 1d338: 97 ed ldi r25, 0xD7 ; 215 1d33a: c9 2e mov r12, r25 1d33c: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1d33e: 2c e3 ldi r18, 0x3C ; 60 1d340: a2 2e mov r10, r18 1d342: b1 2c mov r11, r1 1d344: 0c 2f mov r16, r28 1d346: 10 e0 ldi r17, 0x00 ; 0 1d348: 1f 92 push r1 1d34a: cf 93 push r28 1d34c: ff 92 push r15 1d34e: ef 92 push r14 1d350: 0f 94 00 a3 call 0x34600 ; 0x34600 switch (state) { 1d354: 0f 90 pop r0 1d356: 0f 90 pop r0 1d358: 0f 90 pop r0 1d35a: 0f 90 pop r0 1d35c: ef ef ldi r30, 0xFF ; 255 1d35e: ec 0f add r30, r28 1d360: ed 30 cpi r30, 0x0D ; 13 1d362: a0 f4 brcc .+40 ; 0x1d38c 1d364: f0 e0 ldi r31, 0x00 ; 0 1d366: 88 27 eor r24, r24 1d368: e7 54 subi r30, 0x47 ; 71 1d36a: f6 41 sbci r31, 0x16 ; 22 1d36c: 8f 4f sbci r24, 0xFF ; 255 1d36e: 0d 94 4e a5 jmp 0x34a9c ; 0x34a9c <__tablejump2__> 1d372: 14 ea ldi r17, 0xA4 ; 164 1d374: 34 ea ldi r19, 0xA4 ; 164 1d376: 40 ea ldi r20, 0xA0 ; 160 1d378: 4a ea ldi r20, 0xAA ; 170 1d37a: 84 ea ldi r24, 0xA4 ; 164 1d37c: 9e ea ldi r25, 0xAE ; 174 1d37e: b5 ea ldi r27, 0xA5 ; 165 1d380: af ea ldi r26, 0xAF ; 175 1d382: b9 ea ldi r27, 0xA9 ; 169 1d384: c7 ea ldi r28, 0xA7 ; 167 1d386: d0 ea ldi r29, 0xA0 ; 160 1d388: e4 ea ldi r30, 0xA4 ; 164 1d38a: e4 ea ldi r30, 0xA4 ; 164 // 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; 1d38c: 10 92 73 12 sts 0x1273, r1 ; 0x801273 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 1d390: 8f e5 ldi r24, 0x5F ; 95 1d392: 9f e0 ldi r25, 0x0F ; 15 1d394: 0f 94 3e a4 call 0x3487c ; 0x3487c 1d398: 82 30 cpi r24, 0x02 ; 2 1d39a: 39 f4 brne .+14 ; 0x1d3aa // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 1d39c: 8a ec ldi r24, 0xCA ; 202 1d39e: 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)); 1d3a0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d3a4: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 1d3a8: 0f c0 rjmp .+30 ; 0x1d3c8 // 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); 1d3aa: 85 e6 ldi r24, 0x65 ; 101 1d3ac: 93 e4 ldi r25, 0x43 ; 67 1d3ae: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d3b2: 40 e0 ldi r20, 0x00 ; 0 1d3b4: 60 e0 ldi r22, 0x00 ; 0 1d3b6: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1d3ba: 81 11 cpse r24, r1 1d3bc: 07 c0 rjmp .+14 ; 0x1d3cc 1d3be: 61 e0 ldi r22, 0x01 ; 1 1d3c0: 8f e5 ldi r24, 0x5F ; 95 1d3c2: 9f e0 ldi r25, 0x0F ; 15 1d3c4: 0f 94 62 a4 call 0x348c4 ; 0x348c4 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 1d3c8: c1 e0 ldi r28, 0x01 ; 1 1d3ca: bc cf rjmp .-136 ; 0x1d344 1d3cc: 60 e0 ldi r22, 0x00 ; 0 1d3ce: 8f e5 ldi r24, 0x5F ; 95 1d3d0: 9f e0 ldi r25, 0x0F ; 15 1d3d2: 0f 94 62 a4 call 0x348c4 ; 0x348c4 1d3d6: 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); 1d3d8: 10 e0 ldi r17, 0x00 ; 0 1d3da: 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); 1d3dc: 1f 93 push r17 1d3de: 0f 93 push r16 1d3e0: 80 e8 ldi r24, 0x80 ; 128 1d3e2: 98 e6 ldi r25, 0x68 ; 104 1d3e4: 9f 93 push r25 1d3e6: 8f 93 push r24 1d3e8: 0f 94 00 a3 call 0x34600 ; 0x34600 switch (state) { 1d3ec: 0f 90 pop r0 1d3ee: 0f 90 pop r0 1d3f0: 0f 90 pop r0 1d3f2: 0f 90 pop r0 1d3f4: cc 30 cpi r28, 0x0C ; 12 1d3f6: 09 f4 brne .+2 ; 0x1d3fa 1d3f8: ed c0 rjmp .+474 ; 0x1d5d4 1d3fa: cd 30 cpi r28, 0x0D ; 13 1d3fc: 09 f4 brne .+2 ; 0x1d400 1d3fe: ff c0 rjmp .+510 ; 0x1d5fe case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 1d400: 84 ec ldi r24, 0xC4 ; 196 1d402: 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) { 1d404: cc 23 and r28, r28 1d406: 09 f4 brne .+2 ; 0x1d40a 1d408: fc c0 rjmp .+504 ; 0x1d602 break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 1d40a: 81 e0 ldi r24, 0x01 ; 1 1d40c: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_update(2); 1d410: 82 e0 ldi r24, 0x02 ; 2 } 1d412: cf 91 pop r28 1d414: 1f 91 pop r17 1d416: 0f 91 pop r16 1d418: ff 90 pop r15 1d41a: ef 90 pop r14 1d41c: df 90 pop r13 1d41e: cf 90 pop r12 1d420: bf 90 pop r11 1d422: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 1d424: 0c 94 54 6f jmp 0xdea8 ; 0xdea8 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1d428: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.421> 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)) { 1d42c: 81 e0 ldi r24, 0x01 ; 1 1d42e: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c state = S::Selftest; 1d432: 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)) { 1d434: 88 23 and r24, r24 1d436: 09 f4 brne .+2 ; 0x1d43a 1d438: 85 cf rjmp .-246 ; 0x1d344 state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1d43a: 82 e0 ldi r24, 0x02 ; 2 1d43c: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 1d440: 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)) { 1d442: 88 23 and r24, r24 1d444: 09 f4 brne .+2 ; 0x1d448 1d446: 7e cf rjmp .-260 ; 0x1d344 // 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)) { 1d448: 84 e0 ldi r24, 0x04 ; 4 1d44a: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c state = S::Z; 1d44e: 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)) { 1d450: 88 23 and r24, r24 1d452: 09 f4 brne .+2 ; 0x1d456 1d454: 77 cf rjmp .-274 ; 0x1d344 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)) { 1d456: 80 e1 ldi r24, 0x10 ; 16 1d458: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c state = S::IsFil; 1d45c: 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)) { 1d45e: 88 23 and r24, r24 1d460: 09 f4 brne .+2 ; 0x1d464 1d462: 70 cf rjmp .-288 ; 0x1d344 state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 1d464: cc e0 ldi r28, 0x0C ; 12 1d466: 6e cf rjmp .-292 ; 0x1d344 } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 1d468: 8c e1 ldi r24, 0x1C ; 28 1d46a: 93 e4 ldi r25, 0x43 ; 67 1d46c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d470: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 wizard_event = lcd_selftest(); 1d474: 0e 94 a1 de call 0x1bd42 ; 0x1bd42 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); 1d478: 81 11 cpse r24, r1 1d47a: a6 cf rjmp .-180 ; 0x1d3c8 } 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); 1d47c: cd e0 ldi r28, 0x0D ; 13 1d47e: 62 cf rjmp .-316 ; 0x1d344 break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 1d480: 8e ed ldi r24, 0xDE ; 222 1d482: 92 e4 ldi r25, 0x42 ; 66 1d484: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d488: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 wizard_event = gcode_M45(false, 0); 1d48c: 80 e0 ldi r24, 0x00 ; 0 1d48e: 0f 94 7c 7d call 0x2faf8 ; 0x2faf8 1d492: f2 cf rjmp .-28 ; 0x1d478 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 1d494: 86 eb ldi r24, 0xB6 ; 182 1d496: 92 e4 ldi r25, 0x42 ; 66 1d498: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d49c: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 1d4a0: 88 e8 ldi r24, 0x88 ; 136 1d4a2: 92 e4 ldi r25, 0x42 ; 66 1d4a4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d4a8: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 1d4ac: 88 e6 ldi r24, 0x68 ; 104 1d4ae: 92 e4 ldi r25, 0x42 ; 66 1d4b0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d4b4: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 wizard_event = gcode_M45(true, 0); 1d4b8: 81 e0 ldi r24, 0x01 ; 1 1d4ba: 0f 94 7c 7d call 0x2faf8 ; 0x2faf8 if (!wizard_event) { 1d4be: 88 23 and r24, r24 1d4c0: e9 f2 breq .-70 ; 0x1d47c state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 1d4c2: 60 e0 ldi r22, 0x00 ; 0 1d4c4: 70 e0 ldi r23, 0x00 ; 0 1d4c6: 88 ed ldi r24, 0xD8 ; 216 1d4c8: 91 e4 ldi r25, 0x41 ; 65 1d4ca: 0e 94 51 6d call 0xdaa2 ; 0xdaa2 if(!MMU2::mmu2.Enabled()) { 1d4ce: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d4d2: 81 30 cpi r24, 0x01 ; 1 1d4d4: 09 f4 brne .+2 ; 0x1d4d8 1d4d6: 78 cf rjmp .-272 ; 0x1d3c8 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1d4d8: d0 92 5e 12 sts 0x125E, r13 ; 0x80125e 1d4dc: 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)); 1d4e0: 83 e4 ldi r24, 0x43 ; 67 1d4e2: 92 e4 ldi r25, 0x42 ; 66 1d4e4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d4e8: 0e 94 94 de call 0x1bd28 ; 0x1bd28 wait_preheat(); 1d4ec: 0e 94 15 e2 call 0x1c42a ; 0x1c42a unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 1d4f0: 60 e0 ldi r22, 0x00 ; 0 1d4f2: 70 e0 ldi r23, 0x00 ; 0 1d4f4: cb 01 movw r24, r22 1d4f6: 0e 94 69 e1 call 0x1c2d2 ; 0x1c2d2 lcd_wizard_load(); // load filament 1d4fa: 0e 94 5f e9 call 0x1d2be ; 0x1d2be 1d4fe: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1d502: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d 1d506: 60 cf rjmp .-320 ; 0x1d3c8 1d508: d0 92 5e 12 sts 0x125E, r13 ; 0x80125e 1d50c: c0 92 5d 12 sts 0x125D, r12 ; 0x80125d resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1d510: b0 92 5a 12 sts 0x125A, r11 ; 0x80125a 1d514: 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); 1d518: 8d e2 ldi r24, 0x2D ; 45 1d51a: 92 e4 ldi r25, 0x42 ; 66 1d51c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d520: 41 e0 ldi r20, 0x01 ; 1 1d522: 60 e0 ldi r22, 0x00 ; 0 1d524: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1d528: 88 23 and r24, r24 1d52a: 09 f1 breq .+66 ; 0x1d56e state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 1d52c: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d530: c7 e0 ldi r28, 0x07 ; 7 1d532: 81 30 cpi r24, 0x01 ; 1 1d534: 09 f4 brne .+2 ; 0x1d538 1d536: 06 cf rjmp .-500 ; 0x1d344 else state = S::Preheat; 1d538: c6 e0 ldi r28, 0x06 ; 6 1d53a: 04 cf rjmp .-504 ; 0x1d344 } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 1d53c: 20 e0 ldi r18, 0x00 ; 0 1d53e: 41 e0 ldi r20, 0x01 ; 1 1d540: 70 e0 ldi r23, 0x00 ; 0 1d542: 60 e0 ldi r22, 0x00 ; 0 1d544: 8a e5 ldi r24, 0x5A ; 90 1d546: 98 e3 ldi r25, 0x38 ; 56 1d548: 0e 94 12 63 call 0xc624 ; 0xc624 lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 1d54c: 8c ee ldi r24, 0xEC ; 236 1d54e: 91 e4 ldi r25, 0x41 ; 65 1d550: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d554: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 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); 1d558: 06 e0 ldi r16, 0x06 ; 6 1d55a: 10 e0 ldi r17, 0x00 ; 0 1d55c: 3f cf rjmp .-386 ; 0x1d3dc 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(); 1d55e: 0e 94 15 e2 call 0x1c42a ; 0x1c42a lcd_wizard_load(); 1d562: 0e 94 5f e9 call 0x1d2be ; 0x1d2be state = S::Lay1CalHot; 1d566: ca e0 ldi r28, 0x0A ; 10 1d568: ed ce rjmp .-550 ; 0x1d344 break; case S::LoadFilCold: lcd_wizard_load(); 1d56a: 0e 94 5f e9 call 0x1d2be ; 0x1d2be 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; 1d56e: c9 e0 ldi r28, 0x09 ; 9 1d570: e9 ce rjmp .-558 ; 0x1d344 case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 1d572: 81 e0 ldi r24, 0x01 ; 1 1d574: 0e 94 41 e9 call 0x1d282 ; 0x1d282 menu_goto(lcd_v2_calibration, 0, true); 1d578: 20 e0 ldi r18, 0x00 ; 0 1d57a: 41 e0 ldi r20, 0x01 ; 1 1d57c: 70 e0 ldi r23, 0x00 ; 0 1d57e: 60 e0 ldi r22, 0x00 ; 0 1d580: 88 e5 ldi r24, 0x58 ; 88 1d582: 97 ee ldi r25, 0xE7 ; 231 1d584: 0e 94 12 63 call 0xc624 ; 0xc624 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); 1d588: 09 e0 ldi r16, 0x09 ; 9 1d58a: 10 e0 ldi r17, 0x00 ; 0 1d58c: 27 cf rjmp .-434 ; 0x1d3dc 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); 1d58e: 80 e0 ldi r24, 0x00 ; 0 1d590: 0e 94 41 e9 call 0x1d282 ; 0x1d282 lcd_commands_type = LcdCommands::Layer1Cal; 1d594: 84 e0 ldi r24, 0x04 ; 4 1d596: 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); 1d59a: 0a e0 ldi r16, 0x0A ; 10 1d59c: 10 e0 ldi r17, 0x00 ; 0 1d59e: 1e cf rjmp .-452 ; 0x1d3dc 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); 1d5a0: 89 e9 ldi r24, 0x99 ; 153 1d5a2: 91 e4 ldi r25, 0x41 ; 65 1d5a4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d5a8: 41 e0 ldi r20, 0x01 ; 1 1d5aa: 60 e0 ldi r22, 0x00 ; 0 1d5ac: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 1d5b0: 81 11 cpse r24, r1 1d5b2: 07 c0 rjmp .+14 ; 0x1d5c2 { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 1d5b4: 89 e6 ldi r24, 0x69 ; 105 1d5b6: 91 e4 ldi r25, 0x41 ; 65 1d5b8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d5bc: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 1d5c0: d6 cf rjmp .-84 ; 0x1d56e state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 1d5c2: 83 e0 ldi r24, 0x03 ; 3 1d5c4: 91 e4 ldi r25, 0x41 ; 65 1d5c6: ec ce rjmp .-552 ; 0x1d3a0 1d5c8: 60 e0 ldi r22, 0x00 ; 0 1d5ca: 8f e5 ldi r24, 0x5F ; 95 1d5cc: 9f e0 ldi r25, 0x0F ; 15 1d5ce: 0f 94 62 a4 call 0x348c4 ; 0x348c4 1d5d2: 04 cf rjmp .-504 ; 0x1d3dc msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 1d5d4: 85 ea ldi r24, 0xA5 ; 165 1d5d6: 90 e4 ldi r25, 0x40 ; 64 1d5d8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d5dc: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1d5de: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.421> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 1d5e2: 8a e8 ldi r24, 0x8A ; 138 1d5e4: 9c e6 ldi r25, 0x6C ; 108 1d5e6: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe lcd_return_to_status(); 1d5ea: 0f 94 18 05 call 0x20a30 ; 0x20a30 default: // exiting for later re-entry break; } if (msg) { 1d5ee: 01 15 cp r16, r1 1d5f0: 11 05 cpc r17, r1 1d5f2: 09 f4 brne .+2 ; 0x1d5f6 1d5f4: 0a cf rjmp .-492 ; 0x1d40a lcd_show_fullscreen_message_and_wait_P(msg); 1d5f6: c8 01 movw r24, r16 1d5f8: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 1d5fc: 06 cf rjmp .-500 ; 0x1d40a lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 1d5fe: 83 e4 ldi r24, 0x43 ; 67 1d600: 90 e4 ldi r25, 0x40 ; 64 1d602: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1d606: 8c 01 movw r16, r24 1d608: f2 cf rjmp .-28 ; 0x1d5ee 0001d60a
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1d60a: cf 93 push r28 1d60c: df 93 push r29 1d60e: 00 d0 rcall .+0 ; 0x1d610 1d610: 00 d0 rcall .+0 ; 0x1d612 1d612: 00 d0 rcall .+0 ; 0x1d614 1d614: 1f 92 push r1 1d616: cd b7 in r28, 0x3d ; 61 1d618: de b7 in r29, 0x3e ; 62 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1d61a: 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); 1d61c: 84 b5 in r24, 0x24 ; 36 1d61e: 82 60 ori r24, 0x02 ; 2 1d620: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1d622: 84 b5 in r24, 0x24 ; 36 1d624: 81 60 ori r24, 0x01 ; 1 1d626: 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); 1d628: 85 b5 in r24, 0x25 ; 37 1d62a: 82 60 ori r24, 0x02 ; 2 1d62c: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1d62e: 85 b5 in r24, 0x25 ; 37 1d630: 81 60 ori r24, 0x01 ; 1 1d632: 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); 1d634: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1d638: 81 60 ori r24, 0x01 ; 1 1d63a: 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; 1d63e: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1d642: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1d646: 82 60 ori r24, 0x02 ; 2 1d648: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1d64c: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1d650: 81 60 ori r24, 0x01 ; 1 1d652: 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); 1d656: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d65a: 81 60 ori r24, 0x01 ; 1 1d65c: 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); 1d660: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1d664: 84 60 ori r24, 0x04 ; 4 1d666: 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); 1d66a: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1d66e: 81 60 ori r24, 0x01 ; 1 1d670: 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 1d674: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1d678: 82 60 ori r24, 0x02 ; 2 1d67a: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1d67e: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1d682: 81 60 ori r24, 0x01 ; 1 1d684: 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 1d688: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d68c: 81 60 ori r24, 0x01 ; 1 1d68e: 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 1d692: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1d696: 82 60 ori r24, 0x02 ; 2 1d698: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1d69c: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1d6a0: 81 60 ori r24, 0x01 ; 1 1d6a2: 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 1d6a6: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d6aa: 81 60 ori r24, 0x01 ; 1 1d6ac: 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 1d6b0: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1d6b4: 82 60 ori r24, 0x02 ; 2 1d6b6: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1d6ba: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1d6be: 81 60 ori r24, 0x01 ; 1 1d6c0: 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 1d6c4: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d6c8: 81 60 ori r24, 0x01 ; 1 1d6ca: 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); 1d6ce: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d6d2: 84 60 ori r24, 0x04 ; 4 1d6d4: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1d6d8: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d6dc: 82 60 ori r24, 0x02 ; 2 1d6de: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1d6e2: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d6e6: 81 60 ori r24, 0x01 ; 1 1d6e8: 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); 1d6ec: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d6f0: 80 68 ori r24, 0x80 ; 128 1d6f2: 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; 1d6f6: 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) { 1d6fa: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1d6fc: f8 94 cli wdt_reset(); 1d6fe: a8 95 wdr MCUSR &= ~_BV(WDRF); 1d700: 84 b7 in r24, 0x34 ; 52 1d702: 87 7f andi r24, 0xF7 ; 247 1d704: 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" ); 1d706: 0f b6 in r0, 0x3f ; 63 1d708: f8 94 cli 1d70a: a8 95 wdr 1d70c: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d710: 88 61 ori r24, 0x18 ; 24 1d712: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d716: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d71a: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1d71c: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1d71e: 9f b7 in r25, 0x3f ; 63 1d720: 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 1d722: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1d726: 84 e0 ldi r24, 0x04 ; 4 1d728: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1d730: 81 60 ori r24, 0x01 ; 1 1d732: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1d73a: 8d 7f andi r24, 0xFD ; 253 1d73c: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1d744: 8b 7f andi r24, 0xFB ; 251 1d746: 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; 1d74a: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1d74e: 9f bf out 0x3f, r25 ; 63 return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1d750: 73 98 cbi 0x0e, 3 ; 14 SET_OUTPUT(LCD_PINS_RS); 1d752: 57 9a sbi 0x0a, 7 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1d754: 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); 1d756: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1d75a: 82 60 ori r24, 0x02 ; 2 1d75c: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_OUTPUT(LCD_PINS_D5); 1d760: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1d764: 81 60 ori r24, 0x01 ; 1 1d766: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_OUTPUT(LCD_PINS_D6); 1d76a: 3d 9a sbi 0x07, 5 ; 7 SET_OUTPUT(LCD_PINS_D7); 1d76c: 3e 9a sbi 0x07, 6 ; 7 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1d76e: 80 91 00 04 lds r24, 0x0400 ; 0x800400 <_ZL19lcd_displayfunction.lto_priv.511> 1d772: 88 60 ori r24, 0x08 ; 8 1d774: 80 93 00 04 sts 0x0400, r24 ; 0x800400 <_ZL19lcd_displayfunction.lto_priv.511> 1d778: 2f ef ldi r18, 0xFF ; 255 1d77a: 30 e7 ldi r19, 0x70 ; 112 1d77c: 82 e0 ldi r24, 0x02 ; 2 1d77e: 21 50 subi r18, 0x01 ; 1 1d780: 30 40 sbci r19, 0x00 ; 0 1d782: 80 40 sbci r24, 0x00 ; 0 1d784: e1 f7 brne .-8 ; 0x1d77e 1d786: 00 c0 rjmp .+0 ; 0x1d788 1d788: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1d78a: 81 e0 ldi r24, 0x01 ; 1 1d78c: 0e 94 b9 70 call 0xe172 ; 0xe172 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1d790: 86 ec ldi r24, 0xC6 ; 198 1d792: 93 e7 ldi r25, 0x73 ; 115 1d794: 90 93 fb 03 sts 0x03FB, r25 ; 0x8003fb <_lcdout+0x9> 1d798: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa <_lcdout+0x8> 1d79c: 10 92 fd 03 sts 0x03FD, r1 ; 0x8003fd <_lcdout+0xb> 1d7a0: 10 92 fc 03 sts 0x03FC, r1 ; 0x8003fc <_lcdout+0xa> 1d7a4: 12 e0 ldi r17, 0x02 ; 2 1d7a6: 10 93 f5 03 sts 0x03F5, r17 ; 0x8003f5 <_lcdout+0x3> 1d7aa: 10 92 ff 03 sts 0x03FF, r1 ; 0x8003ff <_lcdout+0xd> 1d7ae: 10 92 fe 03 sts 0x03FE, r1 ; 0x8003fe <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1d7b2: 0e 94 fa 70 call 0xe1f4 ; 0xe1f4 lcd_longpress_func = menu_lcd_longpress_func; 1d7b6: 87 e5 ldi r24, 0x57 ; 87 1d7b8: 96 ec ldi r25, 0xC6 ; 198 1d7ba: 90 93 07 04 sts 0x0407, r25 ; 0x800407 1d7be: 80 93 06 04 sts 0x0406, r24 ; 0x800406 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1d7c2: 8f e1 ldi r24, 0x1F ; 31 1d7c4: 98 ef ldi r25, 0xF8 ; 248 1d7c6: 90 93 05 04 sts 0x0405, r25 ; 0x800405 1d7ca: 80 93 04 04 sts 0x0404, r24 ; 0x800404 menu_menu = lcd_status_screen; 1d7ce: 8e e9 ldi r24, 0x9E ; 158 1d7d0: 97 e3 ldi r25, 0x37 ; 55 1d7d2: 90 93 03 04 sts 0x0403, r25 ; 0x800403 1d7d6: 80 93 02 04 sts 0x0402, r24 ; 0x800402 SET_INPUT(BTN_EN1); 1d7da: 6f 98 cbi 0x0d, 7 ; 13 SET_INPUT(BTN_EN2); 1d7dc: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1d7e0: 87 7f andi r24, 0xF7 ; 247 1d7e2: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1d7e6: 77 9a sbi 0x0e, 7 ; 14 WRITE(BTN_EN2, HIGH); 1d7e8: 9f b7 in r25, 0x3f ; 63 1d7ea: f8 94 cli 1d7ec: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d7f0: 88 60 ori r24, 0x08 ; 8 1d7f2: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d7f6: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1d7f8: 50 98 cbi 0x0a, 0 ; 10 WRITE(BTN_ENC, HIGH); 1d7fa: 58 9a sbi 0x0b, 0 ; 11 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1d7fc: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1d800: 8b 7f andi r24, 0xFB ; 251 1d802: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1d806: 9f b7 in r25, 0x3f ; 63 1d808: f8 94 cli 1d80a: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d80e: 84 60 ori r24, 0x04 ; 4 1d810: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d814: 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); 1d816: af e9 ldi r26, 0x9F ; 159 1d818: bf e0 ldi r27, 0x0F ; 15 1d81a: 11 97 sbiw r26, 0x01 ; 1 1d81c: f1 f7 brne .-4 ; 0x1d81a 1d81e: 00 c0 rjmp .+0 ; 0x1d820 1d820: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1d822: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1d826: 01 e0 ldi r16, 0x01 ; 1 1d828: 82 fb bst r24, 2 1d82a: 88 27 eor r24, r24 1d82c: 80 f9 bld r24, 0 1d82e: 80 27 eor r24, r16 1d830: 80 93 01 04 sts 0x0401, r24 ; 0x800401 #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1d834: 44 e1 ldi r20, 0x14 ; 20 1d836: 50 e0 ldi r21, 0x00 ; 0 1d838: 6a e8 ldi r22, 0x8A ; 138 1d83a: 7c e6 ldi r23, 0x6C ; 108 1d83c: 85 e6 ldi r24, 0x65 ; 101 1d83e: 94 e0 ldi r25, 0x04 ; 4 1d840: 0f 94 2b a2 call 0x34456 ; 0x34456 extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1d844: 84 b1 in r24, 0x04 ; 4 1d846: 81 7f andi r24, 0xF1 ; 241 1d848: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 1d84a: 84 b1 in r24, 0x04 ; 4 1d84c: 87 60 ori r24, 0x07 ; 7 1d84e: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1d850: 85 b1 in r24, 0x05 ; 5 1d852: 81 7f andi r24, 0xF1 ; 241 1d854: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 1d856: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 1d858: 80 e5 ldi r24, 0x50 ; 80 1d85a: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 1d85c: 1d bc out 0x2d, r1 ; 45 } void lcd_splash() { lcd_clear(); // clears display and homes screen 1d85e: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1d862: 81 e6 ldi r24, 0x61 ; 97 1d864: 97 e8 ldi r25, 0x87 ; 135 1d866: 9f 93 push r25 1d868: 8f 93 push r24 1d86a: 88 e6 ldi r24, 0x68 ; 104 1d86c: 97 e8 ldi r25, 0x87 ; 135 1d86e: 9f 93 push r25 1d870: 8f 93 push r24 1d872: 0e 94 66 6f call 0xdecc ; 0xdecc static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1d876: 6a 9a sbi 0x0d, 2 ; 13 eSoundMode = static_cast(eeprom_init_default_byte((uint8_t*)EEPROM_SOUND_MODE, e_SOUND_MODE_DEFAULT)); 1d878: 60 e0 ldi r22, 0x00 ; 0 1d87a: 87 ed ldi r24, 0xD7 ; 215 1d87c: 9e e0 ldi r25, 0x0E ; 14 1d87e: 0e 94 b8 78 call 0xf170 ; 0xf170 1d882: 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); 1d886: 60 e0 ldi r22, 0x00 ; 0 1d888: 88 e0 ldi r24, 0x08 ; 8 1d88a: 9f e0 ldi r25, 0x0F ; 15 1d88c: 0e 94 b8 78 call 0xf170 ; 0xf170 1d890: 80 93 1c 06 sts 0x061C, r24 ; 0x80061c MYSERIAL.begin(BAUDRATE); 1d894: 0f 94 59 90 call 0x320b2 ; 0x320b2 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1d898: 8a e1 ldi r24, 0x1A ; 26 1d89a: 9b e7 ldi r25, 0x7B ; 123 1d89c: 90 93 59 04 sts 0x0459, r25 ; 0x800459 <_uartout+0x9> 1d8a0: 80 93 58 04 sts 0x0458, r24 ; 0x800458 <_uartout+0x8> 1d8a4: 10 92 5b 04 sts 0x045B, r1 ; 0x80045b <_uartout+0xb> 1d8a8: 10 92 5a 04 sts 0x045A, r1 ; 0x80045a <_uartout+0xa> 1d8ac: 10 93 53 04 sts 0x0453, r17 ; 0x800453 <_uartout+0x3> 1d8b0: 10 92 5d 04 sts 0x045D, r1 ; 0x80045d <_uartout+0xd> 1d8b4: 10 92 5c 04 sts 0x045C, r1 ; 0x80045c <_uartout+0xc> stdout = uartout; 1d8b8: 80 e5 ldi r24, 0x50 ; 80 1d8ba: 94 e0 ldi r25, 0x04 ; 4 1d8bc: 90 93 14 17 sts 0x1714, r25 ; 0x801714 <__iob+0x3> 1d8c0: 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); 1d8c4: 60 e0 ldi r22, 0x00 ; 0 1d8c6: 84 ec ldi r24, 0xC4 ; 196 1d8c8: 9f e0 ldi r25, 0x0F ; 15 1d8ca: 0e 94 b8 78 call 0xf170 ; 0xf170 1d8ce: 80 93 60 0d sts 0x0D60, r24 ; 0x800d60 if (farm_mode) { 1d8d2: 0f 90 pop r0 1d8d4: 0f 90 pop r0 1d8d6: 0f 90 pop r0 1d8d8: 0f 90 pop r0 1d8da: 88 23 and r24, r24 1d8dc: 71 f0 breq .+28 ; 0x1d8fa no_response = true; //we need confirmation by recieving PRUSA thx 1d8de: 00 93 08 04 sts 0x0408, r16 ; 0x800408 <_ZL11no_response.lto_priv.491> prusa_statistics(8); 1d8e2: 88 e0 ldi r24, 0x08 ; 8 1d8e4: 0f 94 a0 2f call 0x25f40 ; 0x25f40 #ifdef HAS_SECOND_SERIAL_PORT selectedSerialPort = 1; #endif //HAS_SECOND_SERIAL_PORT MYSERIAL.begin(BAUDRATE); 1d8e8: 0f 94 59 90 call 0x320b2 ; 0x320b2 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1d8ec: 10 92 f2 16 sts 0x16F2, r1 ; 0x8016f2 1d8f0: 61 e0 ldi r22, 0x01 ; 1 1d8f2: 87 e8 ldi r24, 0x87 ; 135 1d8f4: 9f e0 ldi r25, 0x0F ; 15 1d8f6: 0f 94 62 a4 call 0x348c4 ; 0x348c4 } #endif //PRUSA_SN_SUPPORT #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); 1d8fa: 89 e5 ldi r24, 0x59 ; 89 1d8fc: 98 e8 ldi r25, 0x88 ; 136 1d8fe: 0e 94 18 7d call 0xfa30 ; 0xfa30 #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) SERIAL_PROTOCOLLNPGM("start"); #endif SERIAL_ECHO_START; 1d902: 84 ee ldi r24, 0xE4 ; 228 1d904: 92 ea ldi r25, 0xA2 ; 162 1d906: 0e 94 1f 7b call 0xf63e ; 0xf63e puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1d90a: 82 e4 ldi r24, 0x42 ; 66 1d90c: 98 e8 ldi r25, 0x88 ; 136 1d90e: 0f 94 27 a3 call 0x3464e ; 0x3464e // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1d912: 60 e0 ldi r22, 0x00 ; 0 1d914: 8c ea ldi r24, 0xAC ; 172 1d916: 9c e0 ldi r25, 0x0C ; 12 1d918: 0e 94 b8 78 call 0xf170 ; 0xf170 1d91c: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1d91e: 0f 94 de 95 call 0x32bbc ; 0x32bbc } MMU2::mmu2.Status(); 1d922: 0f 94 23 65 call 0x2ca46 ; 0x2ca46 } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1d926: 86 e9 ldi r24, 0x96 ; 150 1d928: 97 e8 ldi r25, 0x87 ; 135 1d92a: 0e 94 1f 7b call 0xf63e ; 0xf63e uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1d92e: 62 e0 ldi r22, 0x02 ; 2 1d930: 86 ed ldi r24, 0xD6 ; 214 1d932: 9e e0 ldi r25, 0x0E ; 14 1d934: 0e 94 b8 78 call 0xf170 ; 0xf170 if (status == (uint8_t)EEPROM::Enabled) 1d938: 81 30 cpi r24, 0x01 ; 1 1d93a: 09 f0 breq .+2 ; 0x1d93e 1d93c: 74 c0 rjmp .+232 ; 0x1da26 { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1d93e: 8e e5 ldi r24, 0x5E ; 94 1d940: 93 e6 ldi r25, 0x63 ; 99 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1d942: 0e 94 18 7d call 0xfa30 ; 0xfa30 #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1d946: 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); 1d948: 10 ff sbrs r17, 0 1d94a: 04 c0 rjmp .+8 ; 0x1d954 1d94c: 80 e6 ldi r24, 0x60 ; 96 1d94e: 9a e6 ldi r25, 0x6A ; 106 1d950: 0f 94 27 a3 call 0x3464e ; 0x3464e if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1d954: 11 ff sbrs r17, 1 1d956: 04 c0 rjmp .+8 ; 0x1d960 1d958: 80 e5 ldi r24, 0x50 ; 80 1d95a: 9a e6 ldi r25, 0x6A ; 106 1d95c: 0f 94 27 a3 call 0x3464e ; 0x3464e if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1d960: 12 ff sbrs r17, 2 1d962: 04 c0 rjmp .+8 ; 0x1d96c 1d964: 8f e3 ldi r24, 0x3F ; 63 1d966: 9a e6 ldi r25, 0x6A ; 106 1d968: 0f 94 27 a3 call 0x3464e ; 0x3464e if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1d96c: 13 ff sbrs r17, 3 1d96e: 04 c0 rjmp .+8 ; 0x1d978 1d970: 8f e2 ldi r24, 0x2F ; 47 1d972: 9a e6 ldi r25, 0x6A ; 106 1d974: 0f 94 27 a3 call 0x3464e ; 0x3464e if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1d978: 15 ff sbrs r17, 5 1d97a: 04 c0 rjmp .+8 ; 0x1d984 1d97c: 8f e1 ldi r24, 0x1F ; 31 1d97e: 9a e6 ldi r25, 0x6A ; 106 1d980: 0f 94 27 a3 call 0x3464e ; 0x3464e MCUSR = 0; 1d984: 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; 1d986: 84 ee ldi r24, 0xE4 ; 228 1d988: 92 ea ldi r25, 0xA2 ; 162 1d98a: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1d98e: 8f e0 ldi r24, 0x0F ; 15 1d990: 9a e6 ldi r25, 0x6A ; 106 1d992: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1d996: 8e e2 ldi r24, 0x2E ; 46 1d998: 98 e8 ldi r25, 0x88 ; 136 1d99a: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1d99e: 83 e0 ldi r24, 0x03 ; 3 1d9a0: 9a e6 ldi r25, 0x6A ; 106 1d9a2: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1d9a6: 86 e2 ldi r24, 0x26 ; 38 1d9a8: 98 e8 ldi r25, 0x88 ; 136 1d9aa: 0e 94 18 7d call 0xfa30 ; 0xfa30 #endif #endif SERIAL_ECHO_START; 1d9ae: 84 ee ldi r24, 0xE4 ; 228 1d9b0: 92 ea ldi r25, 0xA2 ; 162 1d9b2: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1d9b6: 84 ef ldi r24, 0xF4 ; 244 1d9b8: 99 e6 ldi r25, 0x69 ; 105 1d9ba: 0e 94 1f 7b call 0xf63e ; 0xf63e /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1d9be: 80 91 0d 17 lds r24, 0x170D ; 0x80170d <__brkval> 1d9c2: 90 91 0e 17 lds r25, 0x170E ; 0x80170e <__brkval+0x1> 1d9c6: fe 01 movw r30, r28 1d9c8: 31 96 adiw r30, 0x01 ; 1 1d9ca: 7f 01 movw r14, r30 1d9cc: bf 01 movw r22, r30 1d9ce: 00 97 sbiw r24, 0x00 ; 0 1d9d0: 69 f1 breq .+90 ; 0x1da2c 1d9d2: 68 1b sub r22, r24 1d9d4: 79 0b sbc r23, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1d9d6: 07 2e mov r0, r23 1d9d8: 00 0c add r0, r0 1d9da: 88 0b sbc r24, r24 1d9dc: 99 0b sbc r25, r25 1d9de: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1d9e2: 8d ed ldi r24, 0xDD ; 221 1d9e4: 99 e6 ldi r25, 0x69 ; 105 1d9e6: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1d9ea: 80 ee ldi r24, 0xE0 ; 224 1d9ec: 96 e0 ldi r25, 0x06 ; 6 1d9ee: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a #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); 1d9f2: 6a ef ldi r22, 0xFA ; 250 1d9f4: 70 e0 ldi r23, 0x00 ; 0 1d9f6: 8e ee ldi r24, 0xEE ; 238 1d9f8: 9e e0 ldi r25, 0x0E ; 14 1d9fa: 0e 94 a0 78 call 0xf140 ; 0xf140 1d9fe: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1da00: 68 ec ldi r22, 0xC8 ; 200 1da02: 70 e0 ldi r23, 0x00 ; 0 1da04: 8c ee ldi r24, 0xEC ; 236 1da06: 9e e0 ldi r25, 0x0E ; 14 1da08: 0e 94 a0 78 call 0xf140 ; 0xf140 if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1da0c: 0a 3f cpi r16, 0xFA ; 250 1da0e: 11 05 cpc r17, r1 1da10: 09 f0 breq .+2 ; 0x1da14 1da12: 09 c6 rjmp .+3090 ; 0x1e626 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1da14: 01 e0 ldi r16, 0x01 ; 1 1da16: 88 3c cpi r24, 0xC8 ; 200 1da18: 91 05 cpc r25, r1 1da1a: 09 f4 brne .+2 ; 0x1da1e 1da1c: 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(); 1da1e: 0e 94 80 85 call 0x10b00 ; 0x10b00 1da22: b8 2e mov r11, r24 1da24: 08 c6 rjmp .+3088 ; 0x1e636 1da26: 88 e5 ldi r24, 0x58 ; 88 1da28: 93 e6 ldi r25, 0x63 ; 99 1da2a: 8b cf rjmp .-234 ; 0x1d942 1da2c: 67 51 subi r22, 0x17 ; 23 1da2e: 77 41 sbci r23, 0x17 ; 23 1da30: d2 cf rjmp .-92 ; 0x1d9d6 minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1da32: 81 e3 ldi r24, 0x31 ; 49 1da34: 91 e0 ldi r25, 0x01 ; 1 1da36: 90 93 55 02 sts 0x0255, r25 ; 0x800255 <_ZL8maxttemp.lto_priv.435+0x1> 1da3a: 80 93 54 02 sts 0x0254, r24 ; 0x800254 <_ZL8maxttemp.lto_priv.435> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1da3e: 80 91 0b 04 lds r24, 0x040B ; 0x80040b <_ZL12maxttemp_raw.lto_priv.429> 1da42: 90 91 0c 04 lds r25, 0x040C ; 0x80040c <_ZL12maxttemp_raw.lto_priv.429+0x1> 1da46: 0f 94 c4 8f call 0x31f88 ; 0x31f88 1da4a: 20 e0 ldi r18, 0x00 ; 0 1da4c: 30 e8 ldi r19, 0x80 ; 128 1da4e: 48 e9 ldi r20, 0x98 ; 152 1da50: 53 e4 ldi r21, 0x43 ; 67 1da52: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1da56: 18 16 cp r1, r24 1da58: 54 f4 brge .+20 ; 0x1da6e #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1da5a: 80 91 0b 04 lds r24, 0x040B ; 0x80040b <_ZL12maxttemp_raw.lto_priv.429> 1da5e: 90 91 0c 04 lds r25, 0x040C ; 0x80040c <_ZL12maxttemp_raw.lto_priv.429+0x1> 1da62: 40 96 adiw r24, 0x10 ; 16 1da64: 90 93 0c 04 sts 0x040C, r25 ; 0x80040c <_ZL12maxttemp_raw.lto_priv.429+0x1> 1da68: 80 93 0b 04 sts 0x040B, r24 ; 0x80040b <_ZL12maxttemp_raw.lto_priv.429> 1da6c: e8 cf rjmp .-48 ; 0x1da3e #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1da6e: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.427> 1da72: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.427+0x1> 1da76: 0f 94 a1 11 call 0x22342 ; 0x22342 1da7a: 20 e0 ldi r18, 0x00 ; 0 1da7c: 30 e0 ldi r19, 0x00 ; 0 1da7e: 40 ef ldi r20, 0xF0 ; 240 1da80: 51 e4 ldi r21, 0x41 ; 65 1da82: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1da86: 87 ff sbrs r24, 7 1da88: 0a c0 rjmp .+20 ; 0x1da9e #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1da8a: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.427> 1da8e: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.427+0x1> 1da92: 40 97 sbiw r24, 0x10 ; 16 1da94: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.427+0x1> 1da98: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.427> 1da9c: e8 cf rjmp .-48 ; 0x1da6e #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1da9e: 80 91 09 04 lds r24, 0x0409 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.430> 1daa2: 90 91 0a 04 lds r25, 0x040A ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.430+0x1> 1daa6: 0f 94 a1 11 call 0x22342 ; 0x22342 1daaa: 20 e0 ldi r18, 0x00 ; 0 1daac: 30 e0 ldi r19, 0x00 ; 0 1daae: 4a ef ldi r20, 0xFA ; 250 1dab0: 52 e4 ldi r21, 0x42 ; 66 1dab2: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1dab6: 18 16 cp r1, r24 1dab8: 54 f4 brge .+20 ; 0x1dace #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1daba: 80 91 09 04 lds r24, 0x0409 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.430> 1dabe: 90 91 0a 04 lds r25, 0x040A ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.430+0x1> 1dac2: 40 96 adiw r24, 0x10 ; 16 1dac4: 90 93 0a 04 sts 0x040A, r25 ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.430+0x1> 1dac8: 80 93 09 04 sts 0x0409, r24 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.430> 1dacc: e8 cf rjmp .-48 ; 0x1da9e #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1dace: 9f b7 in r25, 0x3f ; 63 1dad0: f8 94 cli TCNT0 = 0; 1dad2: 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; 1dad4: 8f ef ldi r24, 0xFF ; 255 1dad6: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1dad8: 83 e3 ldi r24, 0x33 ; 51 1dada: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1dadc: 12 e0 ldi r17, 0x02 ; 2 1dade: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1dae0: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1dae4: 81 60 ori r24, 0x01 ; 1 1dae6: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1daea: 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; 1daec: 80 e8 ldi r24, 0x80 ; 128 1daee: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1daf2: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1daf6: 84 60 ori r24, 0x04 ; 4 1daf8: 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; 1dafc: 2f b7 in r18, 0x3f ; 63 1dafe: f8 94 cli SET_OUTPUT(BEEPER); 1db00: 6a 9a sbi 0x0d, 2 ; 13 WRITE(BEEPER, LOW); 1db02: 72 98 cbi 0x0e, 2 ; 14 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1db04: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1db08: 80 62 ori r24, 0x20 ; 32 1db0a: 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); 1db0e: 81 e0 ldi r24, 0x01 ; 1 1db10: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1db14: 85 e1 ldi r24, 0x15 ; 21 1db16: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1db1a: 8f ef ldi r24, 0xFF ; 255 1db1c: 90 e0 ldi r25, 0x00 ; 0 1db1e: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1db22: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1db26: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1db2a: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1db2e: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1db32: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1db36: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1db3a: 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")); 1db3c: 84 ea ldi r24, 0xA4 ; 164 1db3e: 97 e8 ldi r25, 0x87 ; 135 1db40: 0f 94 27 a3 call 0x3464e ; 0x3464e DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1db44: 8f e5 ldi r24, 0x5F ; 95 1db46: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1db4a: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1db4e: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1db52: 80 64 ori r24, 0x40 ; 64 1db54: 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); 1db58: 8f e9 ldi r24, 0x9F ; 159 1db5a: 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(); 1db5e: 0e 94 bb ba call 0x17576 ; 0x17576 // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1db62: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1db64: f8 94 cli // CTC TCCRxB &= ~(1< 1db6a: 8f 7e andi r24, 0xEF ; 239 1db6c: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB |= (1< 1db74: 88 60 ori r24, 0x08 ; 8 1db76: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxA &= ~(1< 1db7e: 8d 7f andi r24, 0xFD ; 253 1db80: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(1< 1db88: 8e 7f andi r24, 0xFE ; 254 1db8a: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1db92: 8f 73 andi r24, 0x3F ; 63 1db94: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(3< 1db9c: 8f 7c andi r24, 0xCF ; 207 1db9e: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // x/256 prescaler TCCRxB |= (1< 1dba6: 84 60 ori r24, 0x04 ; 4 1dba8: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1dbb0: 8d 7f andi r24, 0xFD ; 253 1dbb2: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1dbba: 8e 7f andi r24, 0xFE ; 254 1dbbc: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> // reset counter TCNTx = 0; 1dbc0: 10 92 95 00 sts 0x0095, r1 ; 0x800095 <__TEXT_REGION_LENGTH__+0x7c2095> 1dbc4: 10 92 94 00 sts 0x0094, r1 ; 0x800094 <__TEXT_REGION_LENGTH__+0x7c2094> OCRxA = TEMP_TIM_OCRA_OVF; 1dbc8: 2b ee ldi r18, 0xEB ; 235 1dbca: 31 e4 ldi r19, 0x41 ; 65 1dbcc: 30 93 99 00 sts 0x0099, r19 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1dbd0: 20 93 98 00 sts 0x0098, r18 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1dbd4: c1 9a sbi 0x18, 1 ; 24 ENABLE_TEMP_MGR_INTERRUPT(); 1dbd6: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1dbda: 82 60 ori r24, 0x02 ; 2 1dbdc: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1dbe0: 9f bf out 0x3f, r25 ; 63 // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1dbe2: 10 92 3e 0d sts 0x0D3E, r1 ; 0x800d3e block_buffer_tail = 0; 1dbe6: 10 92 3f 0d sts 0x0D3F, r1 ; 0x800d3f memset(position, 0, sizeof(position)); // clear position 1dbea: 80 e1 ldi r24, 0x10 ; 16 1dbec: ec e3 ldi r30, 0x3C ; 60 1dbee: f6 e0 ldi r31, 0x06 ; 6 1dbf0: df 01 movw r26, r30 1dbf2: 28 2f mov r18, r24 1dbf4: 1d 92 st X+, r1 1dbf6: 2a 95 dec r18 1dbf8: e9 f7 brne .-6 ; 0x1dbf4 #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1dbfa: e6 e3 ldi r30, 0x36 ; 54 1dbfc: f4 e0 ldi r31, 0x04 ; 4 1dbfe: df 01 movw r26, r30 1dc00: 28 2f mov r18, r24 1dc02: 1d 92 st X+, r1 1dc04: 2a 95 dec r18 1dc06: e9 f7 brne .-6 ; 0x1dc02 #endif memset(previous_speed, 0, sizeof(previous_speed)); 1dc08: e6 e2 ldi r30, 0x26 ; 38 1dc0a: f4 e0 ldi r31, 0x04 ; 4 1dc0c: df 01 movw r26, r30 1dc0e: 1d 92 st X+, r1 1dc10: 8a 95 dec r24 1dc12: e9 f7 brne .-6 ; 0x1dc0e previous_nominal_speed = 0.0; 1dc14: 10 92 22 04 sts 0x0422, r1 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.444> 1dc18: 10 92 23 04 sts 0x0423, r1 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.444+0x1> 1dc1c: 10 92 24 04 sts 0x0424, r1 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.444+0x2> 1dc20: 10 92 25 04 sts 0x0425, r1 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.444+0x3> plan_reset_next_e_queue = false; 1dc24: 10 92 21 04 sts 0x0421, r1 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.442> plan_reset_next_e_sched = false; 1dc28: 10 92 20 04 sts 0x0420, r1 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.443> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1dc2c: 84 e0 ldi r24, 0x04 ; 4 1dc2e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 if (!READ(BTN_ENC)) 1dc32: 48 99 sbic 0x09, 0 ; 9 1dc34: b0 c0 rjmp .+352 ; 0x1dd96 1dc36: bf ef ldi r27, 0xFF ; 255 1dc38: e3 ed ldi r30, 0xD3 ; 211 1dc3a: f0 e3 ldi r31, 0x30 ; 48 1dc3c: b1 50 subi r27, 0x01 ; 1 1dc3e: e0 40 sbci r30, 0x00 ; 0 1dc40: f0 40 sbci r31, 0x00 ; 0 1dc42: e1 f7 brne .-8 ; 0x1dc3c 1dc44: 00 c0 rjmp .+0 ; 0x1dc46 1dc46: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1dc48: 48 99 sbic 0x09, 0 ; 9 1dc4a: a5 c0 rjmp .+330 ; 0x1dd96 { lcd_clear(); 1dc4c: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_P(PSTR("Factory RESET")); 1dc50: 8e ef ldi r24, 0xFE ; 254 1dc52: 97 e8 ldi r25, 0x87 ; 135 1dc54: 0e 94 78 6f call 0xdef0 ; 0xdef0 SET_OUTPUT(BEEPER); 1dc58: 6a 9a sbi 0x0d, 2 ; 13 if(eSoundMode!=e_SOUND_MODE_SILENT) 1dc5a: 80 91 47 04 lds r24, 0x0447 ; 0x800447 1dc5e: 82 30 cpi r24, 0x02 ; 2 1dc60: 09 f0 breq .+2 ; 0x1dc64 WRITE(BEEPER, HIGH); 1dc62: 72 9a sbi 0x0e, 2 ; 14 while (!READ(BTN_ENC)); 1dc64: 48 9b sbis 0x09, 0 ; 9 1dc66: fe cf rjmp .-4 ; 0x1dc64 WRITE(BEEPER, LOW); 1dc68: 72 98 cbi 0x0e, 2 ; 14 1dc6a: 2f ef ldi r18, 0xFF ; 255 1dc6c: 37 ea ldi r19, 0xA7 ; 167 1dc6e: 81 e6 ldi r24, 0x61 ; 97 1dc70: 21 50 subi r18, 0x01 ; 1 1dc72: 30 40 sbci r19, 0x00 ; 0 1dc74: 80 40 sbci r24, 0x00 ; 0 1dc76: e1 f7 brne .-8 ; 0x1dc70 1dc78: 00 c0 rjmp .+0 ; 0x1dc7a 1dc7a: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1dc7c: 84 ee ldi r24, 0xE4 ; 228 1dc7e: 97 e8 ldi r25, 0x87 ; 135 1dc80: 9a 83 std Y+2, r25 ; 0x02 1dc82: 89 83 std Y+1, r24 ; 0x01 1dc84: 89 ed ldi r24, 0xD9 ; 217 1dc86: 97 e8 ldi r25, 0x87 ; 135 1dc88: 9c 83 std Y+4, r25 ; 0x04 1dc8a: 8b 83 std Y+3, r24 ; 0x03 1dc8c: 8b ec ldi r24, 0xCB ; 203 1dc8e: 97 e8 ldi r25, 0x87 ; 135 1dc90: 9e 83 std Y+6, r25 ; 0x06 1dc92: 8d 83 std Y+5, r24 ; 0x05 1dc94: 8e eb ldi r24, 0xBE ; 190 1dc96: 97 e8 ldi r25, 0x87 ; 135 1dc98: 98 87 std Y+8, r25 ; 0x08 1dc9a: 8f 83 std Y+7, r24 ; 0x07 1dc9c: 85 eb ldi r24, 0xB5 ; 181 1dc9e: 97 e8 ldi r25, 0x87 ; 135 1dca0: 9a 87 std Y+10, r25 ; 0x0a 1dca2: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1dca4: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_putc_at(0, 0, '>'); 1dca8: 4e e3 ldi r20, 0x3E ; 62 1dcaa: 60 e0 ldi r22, 0x00 ; 0 1dcac: 80 e0 ldi r24, 0x00 ; 0 1dcae: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_consume_click(); 1dcb2: 0e 94 cb 73 call 0xe796 ; 0xe796 } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1dcb6: 10 e0 ldi r17, 0x00 ; 0 1dcb8: d1 2c mov r13, r1 1dcba: 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]); 1dcbc: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1dcc0: f6 01 movw r30, r12 1dcc2: e8 0f add r30, r24 1dcc4: f1 1d adc r31, r1 1dcc6: 87 fd sbrc r24, 7 1dcc8: fa 95 dec r31 1dcca: ee 0f add r30, r30 1dccc: ff 1f adc r31, r31 1dcce: ee 0d add r30, r14 1dcd0: ff 1d adc r31, r15 1dcd2: 40 81 ld r20, Z 1dcd4: 51 81 ldd r21, Z+1 ; 0x01 1dcd6: 6c 2d mov r22, r12 1dcd8: 81 e0 ldi r24, 0x01 ; 1 1dcda: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 1dcde: 9f ef ldi r25, 0xFF ; 255 1dce0: c9 1a sub r12, r25 1dce2: 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++) { 1dce4: a4 e0 ldi r26, 0x04 ; 4 1dce6: ca 16 cp r12, r26 1dce8: d1 04 cpc r13, r1 1dcea: 41 f7 brne .-48 ; 0x1dcbc lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1dcec: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 1dcf0: 81 e0 ldi r24, 0x01 ; 1 1dcf2: 0e 94 b0 8a call 0x11560 ; 0x11560 if (lcd_encoder) { 1dcf6: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1dcfa: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1dcfe: 00 97 sbiw r24, 0x00 ; 0 1dd00: 71 f1 breq .+92 ; 0x1dd5e if (lcd_encoder < 0) { 1dd02: 97 ff sbrs r25, 7 1dd04: 12 c0 rjmp .+36 ; 0x1dd2a cursor_pos--; 1dd06: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1dd08: 14 30 cpi r17, 0x04 ; 4 1dd0a: 0c f4 brge .+2 ; 0x1dd0e 1dd0c: 3a c2 rjmp .+1140 ; 0x1e182 cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1dd0e: 87 e0 ldi r24, 0x07 ; 7 1dd10: 0f 94 06 23 call 0x2460c ; 0x2460c if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1dd14: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1dd18: 18 16 cp r1, r24 1dd1a: 2c f0 brlt .+10 ; 0x1dd26 first++; 1dd1c: 8f 5f subi r24, 0xFF ; 255 1dd1e: 80 93 46 04 sts 0x0446, r24 ; 0x800446 lcd_clear(); 1dd22: 0e 94 81 70 call 0xe102 ; 0xe102 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1dd26: 13 e0 ldi r17, 0x03 ; 3 1dd28: 03 c0 rjmp .+6 ; 0x1dd30 if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1dd2a: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1dd2c: 14 30 cpi r17, 0x04 ; 4 1dd2e: 78 f7 brcc .-34 ; 0x1dd0e if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1dd30: 4d ea ldi r20, 0xAD ; 173 1dd32: 57 e8 ldi r21, 0x87 ; 135 1dd34: 60 e0 ldi r22, 0x00 ; 0 1dd36: 80 e0 ldi r24, 0x00 ; 0 1dd38: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(0, cursor_pos); 1dd3c: 61 2f mov r22, r17 1dd3e: 80 e0 ldi r24, 0x00 ; 0 1dd40: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_putc('>'); 1dd44: 8e e3 ldi r24, 0x3E ; 62 1dd46: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_encoder = 0; 1dd4a: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1dd4e: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e _delay(100); 1dd52: 64 e6 ldi r22, 0x64 ; 100 1dd54: 70 e0 ldi r23, 0x00 ; 0 1dd56: 80 e0 ldi r24, 0x00 ; 0 1dd58: 90 e0 ldi r25, 0x00 ; 0 1dd5a: 0f 94 ce 0a call 0x2159c ; 0x2159c } if (lcd_clicked()) { 1dd5e: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1dd62: 88 23 and r24, r24 1dd64: 09 f4 brne .+2 ; 0x1dd68 1dd66: a8 cf rjmp .-176 ; 0x1dcb8 return(cursor_pos + first); 1dd68: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1dd6c: 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(); 1dd6e: 0e 94 81 70 call 0xe102 ; 0xe102 Sound_MakeCustom(100,0,false); 1dd72: 40 e0 ldi r20, 0x00 ; 0 1dd74: 70 e0 ldi r23, 0x00 ; 0 1dd76: 60 e0 ldi r22, 0x00 ; 0 1dd78: 84 e6 ldi r24, 0x64 ; 100 1dd7a: 90 e0 ldi r25, 0x00 ; 0 1dd7c: 0f 94 f3 24 call 0x249e6 ; 0x249e6 switch (level) { 1dd80: 12 30 cpi r17, 0x02 ; 2 1dd82: 09 f4 brne .+2 ; 0x1dd86 1dd84: 35 c2 rjmp .+1130 ; 0x1e1f0 1dd86: 08 f0 brcs .+2 ; 0x1dd8a 1dd88: 0d c2 rjmp .+1050 ; 0x1e1a4 1dd8a: 11 23 and r17, r17 1dd8c: 09 f4 brne .+2 ; 0x1dd90 1dd8e: 28 c2 rjmp .+1104 ; 0x1e1e0 1dd90: 11 30 cpi r17, 0x01 ; 1 1dd92: 09 f4 brne .+2 ; 0x1dd96 1dd94: 28 c2 rjmp .+1104 ; 0x1e1e6 case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1dd96: 82 e0 ldi r24, 0x02 ; 2 1dd98: 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); 1dd9c: 60 e0 ldi r22, 0x00 ; 0 1dd9e: 8f ef ldi r24, 0xFF ; 255 1dda0: 9f e0 ldi r25, 0x0F ; 15 1dda2: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1dda6: 61 e0 ldi r22, 0x01 ; 1 1dda8: 8f e5 ldi r24, 0x5F ; 95 1ddaa: 9f e0 ldi r25, 0x0F ; 15 1ddac: 0e 94 b8 78 call 0xf170 ; 0xf170 void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); #else st_current_init(); //Initialize Digipot Motor Current 1ddb0: 0f 94 e4 17 call 0x22fc8 ; 0x22fc8 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; 1ddb4: 85 e0 ldi r24, 0x05 ; 5 1ddb6: e8 eb ldi r30, 0xB8 ; 184 1ddb8: f2 e0 ldi r31, 0x02 ; 2 1ddba: d7 01 movw r26, r14 1ddbc: 01 90 ld r0, Z+ 1ddbe: 0d 92 st X+, r0 1ddc0: 8a 95 dec r24 1ddc2: e1 f7 brne .-8 ; 0x1ddbc SET_OUTPUT(X_MS1_PIN); 1ddc4: 99 9a sbi 0x13, 1 ; 19 SET_OUTPUT(X_MS2_PIN); 1ddc6: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_MS1_PIN); 1ddc8: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1ddcc: 80 68 ori r24, 0x80 ; 128 1ddce: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Y_MS2_PIN); 1ddd2: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_MS1_PIN); 1ddd4: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1ddd8: 80 64 ori r24, 0x40 ; 64 1ddda: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Z_MS2_PIN); 1ddde: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1dde2: 80 62 ori r24, 0x20 ; 32 1dde4: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS1_PIN); 1dde8: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1ddec: 88 60 ori r24, 0x08 ; 8 1ddee: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS2_PIN); 1ddf2: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1ddf6: 80 61 ori r24, 0x10 ; 16 1ddf8: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1ddfc: 67 01 movw r12, r14 1ddfe: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i<=4;i++) microstep_mode(i,microstep_modes[i]); 1de00: f6 01 movw r30, r12 1de02: 61 91 ld r22, Z+ 1de04: 6f 01 movw r12, r30 1de06: 81 2f mov r24, r17 1de08: 0f 94 a7 17 call 0x22f4e ; 0x22f4e 1de0c: 1f 5f subi r17, 0xFF ; 255 1de0e: 15 30 cpi r17, 0x05 ; 5 1de10: b9 f7 brne .-18 ; 0x1de00 microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 1de12: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de16: 82 60 ori r24, 0x02 ; 2 1de18: 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); 1de1c: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de20: 81 60 ori r24, 0x01 ; 1 1de22: 80 93 0a 01 sts 0x010A, r24 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_DIR_PIN) && (Y2_DIR_PIN > -1) SET_OUTPUT(Y2_DIR_PIN); #endif #endif #if defined(Z_DIR_PIN) && Z_DIR_PIN > -1 SET_OUTPUT(Z_DIR_PIN); 1de26: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de2a: 84 60 ori r24, 0x04 ; 4 1de2c: 80 93 0a 01 sts 0x010A, r24 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_DIR_PIN) && (Z2_DIR_PIN > -1) SET_OUTPUT(Z2_DIR_PIN); #endif #endif #if defined(E0_DIR_PIN) && E0_DIR_PIN > -1 SET_OUTPUT(E0_DIR_PIN); 1de30: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de34: 80 64 ori r24, 0x40 ; 64 1de36: 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); 1de3a: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 1de3c: 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); 1de3e: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 1de40: 16 9a sbi 0x02, 6 ; 2 SET_OUTPUT(Y2_ENABLE_PIN); if(!Y_ENABLE_ON) WRITE(Y2_ENABLE_PIN,HIGH); #endif #endif #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 SET_OUTPUT(Z_ENABLE_PIN); 1de42: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 1de44: 15 9a sbi 0x02, 5 ; 2 SET_OUTPUT(Z2_ENABLE_PIN); if(!Z_ENABLE_ON) WRITE(Z2_ENABLE_PIN,HIGH); #endif #endif #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) SET_OUTPUT(E0_ENABLE_PIN); 1de46: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 1de48: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 1de4a: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 1de4c: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 1de4e: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 1de50: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 1de52: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 1de54: 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); 1de56: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 1de58: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 1de5a: 3f 98 cbi 0x07, 7 ; 7 #ifdef TACH0PULLUP WRITE(TACH_0, HIGH); 1de5c: 47 9a sbi 0x08, 7 ; 8 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 1de5e: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 1de60: 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(); 1de62: 17 9a sbi 0x02, 7 ; 2 1de64: 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); 1de68: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 1de6a: 41 98 cbi 0x08, 1 ; 8 #endif //DEBUG_YSTEP_DUP_PIN #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_STEP_PIN) && (Y2_STEP_PIN > -1) SET_OUTPUT(Y2_STEP_PIN); WRITE(Y2_STEP_PIN,INVERT_Y_STEP_PIN); #endif disable_y(); 1de6c: 16 9a sbi 0x02, 6 ; 2 1de6e: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 1de72: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 1de74: 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); 1de76: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 1de78: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 1de7a: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 1de80: 8f 7e andi r24, 0xEF ; 239 1de82: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 1de8a: 88 60 ori r24, 0x08 ; 8 1de8c: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 1de94: 8d 7f andi r24, 0xFD ; 253 1de96: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 1de9e: 8e 7f andi r24, 0xFE ; 254 1dea0: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 1dea8: 8f 73 andi r24, 0x3F ; 63 1deaa: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 1deb2: 8f 7c andi r24, 0xCF ; 207 1deb4: 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< 1debc: 88 7f andi r24, 0xF8 ; 248 1debe: 82 60 ori r24, 0x02 ; 2 1dec0: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 1dec4: 80 e0 ldi r24, 0x00 ; 0 1dec6: 90 e4 ldi r25, 0x40 ; 64 1dec8: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1decc: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 1ded0: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 1ded4: 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; 1ded8: 10 92 4f 04 sts 0x044F, r1 ; 0x80044f <_ZL11nextMainISR.lto_priv.437+0x1> 1dedc: 10 92 4e 04 sts 0x044E, r1 ; 0x80044e <_ZL11nextMainISR.lto_priv.437> nextAdvanceISR = ADV_NEVER; 1dee0: 8f ef ldi r24, 0xFF ; 255 1dee2: 9f ef ldi r25, 0xFF ; 255 1dee4: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 1dee8: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> main_Rate = ADV_NEVER; 1deec: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.439+0x1> 1def0: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.439> current_adv_steps = 0; 1def4: 10 92 49 04 sts 0x0449, r1 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 1def8: 10 92 48 04 sts 0x0448, r1 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 1defc: 81 e0 ldi r24, 0x01 ; 1 1defe: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.386> current_adv_steps = 0; #endif enable_endstops(true); // Start with endstops active. After homing they can be disabled ENABLE_STEPPER_DRIVER_INTERRUPT(); 1df02: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1df06: 82 60 ori r24, 0x02 ; 2 1df08: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 1df0c: 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(); 1df0e: 0e 94 4f 62 call 0xc49e ; 0xc49e // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 1df12: 81 e6 ldi r24, 0x61 ; 97 1df14: 92 e1 ldi r25, 0x12 ; 18 1df16: 0e 94 d7 6a call 0xd5ae ; 0xd5ae plan_set_position_curposXYZE(); 1df1a: 0f 94 68 48 call 0x290d0 ; 0x290d0 } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 1df1e: 84 e9 ldi r24, 0x94 ; 148 1df20: 9c e0 ldi r25, 0x0C ; 12 1df22: 0f 94 3e a4 call 0x3487c ; 0x3487c 1df26: 82 34 cpi r24, 0x42 ; 66 1df28: 59 f4 brne .+22 ; 0x1df40 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); 1df2a: 6f ef ldi r22, 0xFF ; 255 1df2c: 84 e9 ldi r24, 0x94 ; 148 1df2e: 9c e0 ldi r25, 0x0C ; 12 1df30: 0f 94 86 a4 call 0x3490c ; 0x3490c // 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); 1df34: 85 e9 ldi r24, 0x95 ; 149 1df36: 9c e0 ldi r25, 0x0C ; 12 1df38: 0f 94 4c a4 call 0x34898 ; 0x34898 lcd_show_fullscreen_message_and_wait_P(kill_msg); 1df3c: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 1df40: 0f 94 24 6d call 0x2da48 ; 0x2da48 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 1df44: 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); 1df46: 88 e0 ldi r24, 0x08 ; 8 1df48: 0f 94 a0 2f call 0x25f40 ; 0x25f40 // Enable Toshiba FlashAir SD card / WiFi enahanced card. card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1); 1df4c: 8b eb ldi r24, 0xBB ; 187 1df4e: 9f e0 ldi r25, 0x0F ; 15 1df50: 0f 94 3e a4 call 0x3487c ; 0x3487c 1df54: 91 e0 ldi r25, 0x01 ; 1 1df56: 81 30 cpi r24, 0x01 ; 1 1df58: 09 f0 breq .+2 ; 0x1df5c 1df5a: 90 e0 ldi r25, 0x00 ; 0 1df5c: 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(); 1df60: 81 e0 ldi r24, 0x01 ; 1 1df62: 0f 94 c5 72 call 0x2e58a ; 0x2e58a #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 1df66: 60 e0 ldi r22, 0x00 ; 0 1df68: 84 e6 ldi r24, 0x64 ; 100 1df6a: 9f e0 ldi r25, 0x0F ; 15 1df6c: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 1df70: 60 e0 ldi r22, 0x00 ; 0 1df72: 86 e6 ldi r24, 0x66 ; 102 1df74: 9f e0 ldi r25, 0x0F ; 15 1df76: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 1df7a: 60 e0 ldi r22, 0x00 ; 0 1df7c: 88 e6 ldi r24, 0x68 ; 104 1df7e: 9f e0 ldi r25, 0x0F ; 15 1df80: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 1df84: 60 e0 ldi r22, 0x00 ; 0 1df86: 85 e6 ldi r24, 0x65 ; 101 1df88: 9f e0 ldi r25, 0x0F ; 15 1df8a: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 1df8e: 70 e0 ldi r23, 0x00 ; 0 1df90: 60 e0 ldi r22, 0x00 ; 0 1df92: 8f ef ldi r24, 0xFF ; 255 1df94: 9e e0 ldi r25, 0x0E ; 14 1df96: 0e 94 a0 78 call 0xf140 ; 0xf140 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 1df9a: 70 e0 ldi r23, 0x00 ; 0 1df9c: 60 e0 ldi r22, 0x00 ; 0 1df9e: 85 e0 ldi r24, 0x05 ; 5 1dfa0: 9f e0 ldi r25, 0x0F ; 15 1dfa2: 0e 94 a0 78 call 0xf140 ; 0xf140 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 1dfa6: 70 e0 ldi r23, 0x00 ; 0 1dfa8: 60 e0 ldi r22, 0x00 ; 0 1dfaa: 83 e0 ldi r24, 0x03 ; 3 1dfac: 9f e0 ldi r25, 0x0F ; 15 1dfae: 0e 94 a0 78 call 0xf140 ; 0xf140 eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 1dfb2: 70 e0 ldi r23, 0x00 ; 0 1dfb4: 60 e0 ldi r22, 0x00 ; 0 1dfb6: 81 e0 ldi r24, 0x01 ; 1 1dfb8: 9f e0 ldi r25, 0x0F ; 15 1dfba: 0e 94 a0 78 call 0xf140 ; 0xf140 eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 1dfbe: 70 e0 ldi r23, 0x00 ; 0 1dfc0: 60 e0 ldi r22, 0x00 ; 0 1dfc2: 83 ed ldi r24, 0xD3 ; 211 1dfc4: 9e e0 ldi r25, 0x0E ; 14 1dfc6: 0e 94 a0 78 call 0xf140 ; 0xf140 eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 1dfca: 70 e0 ldi r23, 0x00 ; 0 1dfcc: 60 e0 ldi r22, 0x00 ; 0 1dfce: 80 ed ldi r24, 0xD0 ; 208 1dfd0: 9e e0 ldi r25, 0x0E ; 14 1dfd2: 0e 94 a0 78 call 0xf140 ; 0xf140 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 1dfd6: 60 e0 ldi r22, 0x00 ; 0 1dfd8: 82 ed ldi r24, 0xD2 ; 210 1dfda: 9e e0 ldi r25, 0x0E ; 14 1dfdc: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 1dfe0: 60 e0 ldi r22, 0x00 ; 0 1dfe2: 8f ec ldi r24, 0xCF ; 207 1dfe4: 9e e0 ldi r25, 0x0E ; 14 1dfe6: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 1dfea: 88 ea ldi r24, 0xA8 ; 168 1dfec: 9c e0 ldi r25, 0x0C ; 12 1dfee: 0f 94 47 6c call 0x2d88e ; 0x2d88e if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 1dff2: 81 ea ldi r24, 0xA1 ; 161 1dff4: 9d e0 ldi r25, 0x0D ; 13 1dff6: 0f 94 3e a4 call 0x3487c ; 0x3487c 1dffa: 8f 3f cpi r24, 0xFF ; 255 1dffc: 71 f4 brne .+28 ; 0x1e01a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1dffe: 60 e0 ldi r22, 0x00 ; 0 1e000: 81 ea ldi r24, 0xA1 ; 161 1e002: 9d e0 ldi r25, 0x0D ; 13 1e004: 0f 94 62 a4 call 0x348c4 ; 0x348c4 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); 1e008: 88 ef ldi r24, 0xF8 ; 248 1e00a: 9f e0 ldi r25, 0x0F ; 15 1e00c: 0f 94 4c a4 call 0x34898 ; 0x34898 eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 1e010: bc 01 movw r22, r24 1e012: 80 e5 ldi r24, 0x50 ; 80 1e014: 9d e0 ldi r25, 0x0D ; 13 1e016: 0f 94 80 a4 call 0x34900 ; 0x34900 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); 1e01a: 49 e4 ldi r20, 0x49 ; 73 1e01c: c4 2e mov r12, r20 1e01e: 4d e0 ldi r20, 0x0D ; 13 1e020: d4 2e mov r13, r20 1e022: 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); 1e024: b7 01 movw r22, r14 1e026: 81 2f mov r24, r17 1e028: 0e 94 13 79 call 0xf226 ; 0xf226 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 1e02c: a7 01 movw r20, r14 1e02e: 67 e0 ldi r22, 0x07 ; 7 1e030: 70 e0 ldi r23, 0x00 ; 0 1e032: c6 01 movw r24, r12 1e034: 0e 94 81 78 call 0xf102 ; 0xf102 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++) { 1e038: 1f 5f subi r17, 0xFF ; 255 1e03a: fb e0 ldi r31, 0x0B ; 11 1e03c: cf 0e add r12, r31 1e03e: d1 1c adc r13, r1 1e040: 18 30 cpi r17, 0x08 ; 8 1e042: 81 f7 brne .-32 ; 0x1e024 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)))) 1e044: 81 ea ldi r24, 0xA1 ; 161 1e046: 9d e0 ldi r25, 0x0D ; 13 1e048: 0f 94 3e a4 call 0x3487c ; 0x3487c 1e04c: 0e 94 e3 78 call 0xf1c6 ; 0xf1c6 1e050: 81 11 cpse r24, r1 1e052: 02 c0 rjmp .+4 ; 0x1e058 { eeprom_switch_to_next_sheet(); 1e054: 0e 94 05 79 call 0xf20a ; 0xf20a } check_babystep(); 1e058: 0e 94 77 7d call 0xfaee ; 0xfaee // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 1e05c: 80 e8 ldi r24, 0x80 ; 128 1e05e: 9c e0 ldi r25, 0x0C ; 12 1e060: 0f 94 3e a4 call 0x3487c ; 0x3487c 1e064: 8f 3f cpi r24, 0xFF ; 255 1e066: 41 f4 brne .+16 ; 0x1e078 #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); 1e068: 4f e0 ldi r20, 0x0F ; 15 1e06a: 50 e0 ldi r21, 0x00 ; 0 1e06c: 60 e8 ldi r22, 0x80 ; 128 1e06e: 7c e0 ldi r23, 0x0C ; 12 1e070: 8e ec ldi r24, 0xCE ; 206 1e072: 92 e0 ldi r25, 0x02 ; 2 1e074: 0f 94 52 a4 call 0x348a4 ; 0x348a4 //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); 1e078: 60 e0 ldi r22, 0x00 ; 0 1e07a: 89 e2 ldi r24, 0x29 ; 41 1e07c: 9d e0 ldi r25, 0x0D ; 13 1e07e: 0e 94 b8 78 call 0xf170 ; 0xf170 #endif //PINDA_TEMP_COMP eeprom_init_default_dword((uint32_t*)EEPROM_JOB_ID, 0); 1e082: 85 e0 ldi r24, 0x05 ; 5 1e084: 9d e0 ldi r25, 0x0D ; 13 1e086: 0f 94 47 6c call 0x2d88e ; 0x2d88e eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 1e08a: 8d ee ldi r24, 0xED ; 237 1e08c: 9f e0 ldi r25, 0x0F ; 15 1e08e: 0f 94 47 6c call 0x2d88e ; 0x2d88e eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 1e092: 81 ef ldi r24, 0xF1 ; 241 1e094: 9f e0 ldi r25, 0x0F ; 15 1e096: 0f 94 47 6c call 0x2d88e ; 0x2d88e eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 1e09a: 60 e0 ldi r22, 0x00 ; 0 1e09c: 8e ec ldi r24, 0xCE ; 206 1e09e: 9e e0 ldi r25, 0x0E ; 14 1e0a0: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 1e0a4: 61 e0 ldi r22, 0x01 ; 1 1e0a6: 87 ea ldi r24, 0xA7 ; 167 1e0a8: 9c e0 ldi r25, 0x0C ; 12 1e0aa: 0e 94 b8 78 call 0xf170 ; 0xf170 putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 1e0ae: 8e ef ldi r24, 0xFE ; 254 1e0b0: 9f e0 ldi r25, 0x0F ; 15 1e0b2: 0f 94 3e a4 call 0x3487c ; 0x3487c 1e0b6: 0e 94 29 75 call 0xea52 ; 0xea52 1e0ba: 81 11 cpse r24, r1 1e0bc: 02 c0 rjmp .+4 ; 0x1e0c2 lcd_language(); 1e0be: 0e 94 35 c2 call 0x1846a ; 0x1846a lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 1e0c2: 60 e0 ldi r22, 0x00 ; 0 1e0c4: 8f ea ldi r24, 0xAF ; 175 1e0c6: 9f e0 ldi r25, 0x0F ; 15 1e0c8: 0e 94 b8 78 call 0xf170 ; 0xf170 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 1e0cc: 86 ea ldi r24, 0xA6 ; 166 1e0ce: 9f e0 ldi r25, 0x0F ; 15 1e0d0: 0f 94 3e a4 call 0x3487c ; 0x3487c 1e0d4: 8f 3f cpi r24, 0xFF ; 255 1e0d6: d9 f4 brne .+54 ; 0x1e10e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e0d8: 61 e0 ldi r22, 0x01 ; 1 1e0da: 86 ea ldi r24, 0xA6 ; 166 1e0dc: 9f e0 ldi r25, 0x0F ; 15 1e0de: 0f 94 62 a4 call 0x348c4 ; 0x348c4 1e0e2: 30 eb ldi r19, 0xB0 ; 176 1e0e4: e3 2e mov r14, r19 1e0e6: 3f e0 ldi r19, 0x0F ; 15 1e0e8: 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); 1e0ea: 70 e0 ldi r23, 0x00 ; 0 1e0ec: 60 e0 ldi r22, 0x00 ; 0 1e0ee: c7 01 movw r24, r14 1e0f0: 0f 94 80 a4 call 0x34900 ; 0x34900 1e0f4: 22 e0 ldi r18, 0x02 ; 2 1e0f6: e2 0e add r14, r18 1e0f8: 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++) { 1e0fa: 3a eb ldi r19, 0xBA ; 186 1e0fc: e3 16 cp r14, r19 1e0fe: 3f e0 ldi r19, 0x0F ; 15 1e100: f3 06 cpc r15, r19 1e102: 99 f7 brne .-26 ; 0x1e0ea if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e104: 60 e0 ldi r22, 0x00 ; 0 1e106: 8f ea ldi r24, 0xAF ; 175 1e108: 9f e0 ldi r25, 0x0F ; 15 1e10a: 0f 94 62 a4 call 0x348c4 ; 0x348c4 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); 1e10e: 60 e0 ldi r22, 0x00 ; 0 1e110: 85 ea ldi r24, 0xA5 ; 165 1e112: 9f e0 ldi r25, 0x0F ; 15 1e114: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 1e118: 60 e0 ldi r22, 0x00 ; 0 1e11a: 8f e7 ldi r24, 0x7F ; 127 1e11c: 9c e0 ldi r25, 0x0C ; 12 1e11e: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 1e122: 60 e0 ldi r22, 0x00 ; 0 1e124: 89 e0 ldi r24, 0x09 ; 9 1e126: 9f e0 ldi r25, 0x0F ; 15 1e128: 0e 94 b8 78 call 0xf170 ; 0xf170 } 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); 1e12c: 61 e0 ldi r22, 0x01 ; 1 1e12e: 8c ea ldi r24, 0xAC ; 172 1e130: 9d e0 ldi r25, 0x0D ; 13 1e132: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 1e136: 63 e0 ldi r22, 0x03 ; 3 1e138: 8b ea ldi r24, 0xAB ; 171 1e13a: 9d e0 ldi r25, 0x0D ; 13 1e13c: 0e 94 b8 78 call 0xf170 ; 0xf170 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 1e140: 63 e0 ldi r22, 0x03 ; 3 1e142: 8a ea ldi r24, 0xAA ; 170 1e144: 9d e0 ldi r25, 0x0D ; 13 1e146: 0e 94 b8 78 call 0xf170 ; 0xf170 //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 1e14a: 61 e0 ldi r22, 0x01 ; 1 1e14c: 89 ea ldi r24, 0xA9 ; 169 1e14e: 9d e0 ldi r25, 0x0D ; 13 1e150: 0e 94 b8 78 call 0xf170 ; 0xf170 #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); 1e154: 84 e0 ldi r24, 0x04 ; 4 1e156: 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) { 1e15a: 02 30 cpi r16, 0x02 ; 2 1e15c: 09 f4 brne .+2 ; 0x1e160 1e15e: 81 c0 rjmp .+258 ; 0x1e262 1e160: 03 30 cpi r16, 0x03 ; 3 1e162: 09 f4 brne .+2 ; 0x1e166 1e164: 22 c1 rjmp .+580 ; 0x1e3aa 1e166: 01 30 cpi r16, 0x01 ; 1 1e168: 09 f0 breq .+2 ; 0x1e16c 1e16a: 87 c0 rjmp .+270 ; 0x1e27a //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)); 1e16c: 82 ec ldi r24, 0xC2 ; 194 1e16e: 9e e4 ldi r25, 0x4E ; 78 1e170: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1e174: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 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); 1e178: 68 ec ldi r22, 0xC8 ; 200 1e17a: 70 e0 ldi r23, 0x00 ; 0 1e17c: 8c ee ldi r24, 0xEC ; 236 1e17e: 9e e0 ldi r25, 0x0E ; 14 1e180: 7a c0 rjmp .+244 ; 0x1e276 first++; lcd_clear(); } } if (cursor_pos < 0) { 1e182: 1f 3f cpi r17, 0xFF ; 255 1e184: 09 f0 breq .+2 ; 0x1e188 1e186: d4 cd rjmp .-1112 ; 0x1dd30 cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1e188: 87 e0 ldi r24, 0x07 ; 7 1e18a: 0f 94 06 23 call 0x2460c ; 0x2460c if (first > 0) { 1e18e: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1e192: 18 16 cp r1, r24 1e194: 2c f4 brge .+10 ; 0x1e1a0 first--; 1e196: 81 50 subi r24, 0x01 ; 1 1e198: 80 93 46 04 sts 0x0446, r24 ; 0x800446 lcd_clear(); 1e19c: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 1e1a0: 10 e0 ldi r17, 0x00 ; 0 1e1a2: c6 cd rjmp .-1140 ; 0x1dd30 // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 1e1a4: 13 30 cpi r17, 0x03 ; 3 1e1a6: 31 f1 breq .+76 ; 0x1e1f4 1e1a8: 14 30 cpi r17, 0x04 ; 4 1e1aa: 09 f0 breq .+2 ; 0x1e1ae 1e1ac: f4 cd rjmp .-1048 ; 0x1dd96 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 1e1ae: 6d ee ldi r22, 0xED ; 237 1e1b0: 77 e8 ldi r23, 0x87 ; 135 1e1b2: 80 e0 ldi r24, 0x00 ; 0 1e1b4: 90 e1 ldi r25, 0x10 ; 16 1e1b6: 0e 94 6c 72 call 0xe4d8 ; 0xe4d8 // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1e1ba: 10 e0 ldi r17, 0x00 ; 0 1e1bc: 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); 1e1be: 6f ef ldi r22, 0xFF ; 255 1e1c0: c8 01 movw r24, r16 1e1c2: 0f 94 62 a4 call 0x348c4 ; 0x348c4 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 1e1c6: c8 01 movw r24, r16 1e1c8: 0e 94 a2 71 call 0xe344 ; 0xe344 break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1e1cc: 0f 5f subi r16, 0xFF ; 255 1e1ce: 1f 4f sbci r17, 0xFF ; 255 1e1d0: 01 15 cp r16, r1 1e1d2: b0 e1 ldi r27, 0x10 ; 16 1e1d4: 1b 07 cpc r17, r27 1e1d6: 99 f7 brne .-26 ; 0x1e1be eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 1e1d8: 0e 94 c3 71 call 0xe386 ; 0xe386 softReset(); 1e1dc: 0e 94 7a 66 call 0xccf4 ; 0xccf4 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 1e1e0: 0e 94 98 74 call 0xe930 ; 0xe930 1e1e4: d8 cd rjmp .-1104 ; 0x1dd96 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 1e1e6: 0e 94 3f 66 call 0xcc7e ; 0xcc7e lcd_menu_statistics(); 1e1ea: 0f 94 ff 14 call 0x229fe ; 0x229fe 1e1ee: d3 cd rjmp .-1114 ; 0x1dd96 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 1e1f0: 0e 94 3f 66 call 0xcc7e ; 0xcc7e // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 1e1f4: 0e 94 98 74 call 0xe930 ; 0xe930 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 1e1f8: 84 e0 ldi r24, 0x04 ; 4 1e1fa: 0e 94 e4 d4 call 0x1a9c8 ; 0x1a9c8 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); 1e1fe: 62 e0 ldi r22, 0x02 ; 2 1e200: 8f e5 ldi r24, 0x5F ; 95 1e202: 9f e0 ldi r25, 0x0F ; 15 1e204: 0f 94 86 a4 call 0x3490c ; 0x3490c lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 1e208: 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); 1e20c: 60 e0 ldi r22, 0x00 ; 0 1e20e: 84 ec ldi r24, 0xC4 ; 196 1e210: 9f e0 ldi r25, 0x0F ; 15 1e212: 0f 94 62 a4 call 0x348c4 ; 0x348c4 eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 1e216: 81 e0 ldi r24, 0x01 ; 1 1e218: 0e 94 eb 77 call 0xefd6 ; 0xefd6 1e21c: 11 e0 ldi r17, 0x01 ; 1 1e21e: 10 93 f2 16 sts 0x16F2, r17 ; 0x8016f2 1e222: 61 e0 ldi r22, 0x01 ; 1 1e224: 87 e0 ldi r24, 0x07 ; 7 1e226: 9f e0 ldi r25, 0x0F ; 15 1e228: 0f 94 62 a4 call 0x348c4 ; 0x348c4 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1e22c: 10 93 f3 16 sts 0x16F3, r17 ; 0x8016f3 1e230: 61 e0 ldi r22, 0x01 ; 1 1e232: 85 ed ldi r24, 0xD5 ; 213 1e234: 9e e0 ldi r25, 0x0E ; 14 1e236: 0f 94 62 a4 call 0x348c4 ; 0x348c4 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 1e23a: 10 93 ff 16 sts 0x16FF, r17 ; 0x8016ff oldPos = pat9125_y; 1e23e: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 1e242: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 1e246: 90 93 01 17 sts 0x1701, r25 ; 0x801701 1e24a: 80 93 00 17 sts 0x1700, r24 ; 0x801700 resetStepCount(); 1e24e: 0f 94 d5 6c call 0x2d9aa ; 0x2d9aa jamErrCnt = 0; 1e252: 10 92 06 17 sts 0x1706, r1 ; 0x801706 1e256: 61 e0 ldi r22, 0x01 ; 1 1e258: 8d ea ldi r24, 0xAD ; 173 1e25a: 9c e0 ldi r25, 0x0C ; 12 1e25c: 0f 94 62 a4 call 0x348c4 ; 0x348c4 1e260: 9a cd rjmp .-1228 ; 0x1dd96 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)); 1e262: 81 ea ldi r24, 0xA1 ; 161 1e264: 9e e4 ldi r25, 0x4E ; 78 1e266: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1e26a: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 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); 1e26e: 6a ef ldi r22, 0xFA ; 250 1e270: 70 e0 ldi r23, 0x00 ; 0 1e272: 8e ee ldi r24, 0xEE ; 238 1e274: 9e e0 ldi r25, 0x0E ; 14 1e276: 0f 94 9c a4 call 0x34938 ; 0x34938 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 1e27a: b1 10 cpse r11, r1 1e27c: 08 c0 rjmp .+16 ; 0x1e28e 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 1e27e: 8a e2 ldi r24, 0x2A ; 42 1e280: 9e e4 ldi r25, 0x4E ; 78 1e282: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1e286: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 Config_StoreSettings(); 1e28a: 0e 94 fb 85 call 0x10bf6 ; 0x10bf6 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 1e28e: 80 e8 ldi r24, 0x80 ; 128 1e290: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c 1e294: 88 23 and r24, r24 1e296: c9 f0 breq .+50 ; 0x1e2ca CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1e298: 87 ef ldi r24, 0xF7 ; 247 1e29a: 9f e0 ldi r25, 0x0F ; 15 1e29c: 0f 94 3e a4 call 0x3487c ; 0x3487c } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 1e2a0: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1e2a2: 81 30 cpi r24, 0x01 ; 1 1e2a4: 71 f4 brne .+28 ; 0x1e2c2 // 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)) { 1e2a6: 8e e1 ldi r24, 0x1E ; 30 1e2a8: 98 e8 ldi r25, 0x88 ; 136 1e2aa: 0e 94 d8 bd call 0x17bb0 ; 0x17bb0 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); 1e2ae: 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)) { 1e2b0: 88 23 and r24, r24 1e2b2: 39 f0 breq .+14 ; 0x1e2c2 // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 1e2b4: 88 ee ldi r24, 0xE8 ; 232 1e2b6: 9d e4 ldi r25, 0x4D ; 77 1e2b8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1e2bc: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 1e2c0: 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); 1e2c2: 86 ea ldi r24, 0xA6 ; 166 1e2c4: 9c e0 ldi r25, 0x0C ; 12 1e2c6: 0f 94 62 a4 call 0x348c4 ; 0x348c4 } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 1e2ca: 86 e1 ldi r24, 0x16 ; 22 1e2cc: 98 e8 ldi r25, 0x88 ; 136 1e2ce: 0e 94 d8 bd call 0x17bb0 ; 0x17bb0 1e2d2: 18 2f mov r17, r24 1e2d4: 88 23 and r24, r24 1e2d6: 29 f0 breq .+10 ; 0x1e2e2 if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 1e2d8: 87 e1 ldi r24, 0x17 ; 23 1e2da: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c 1e2de: 11 e0 ldi r17, 0x01 ; 1 1e2e0: 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; 1e2e2: f1 2c mov r15, r1 1e2e4: 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)); 1e2e6: f7 01 movw r30, r14 1e2e8: e4 5f subi r30, 0xF4 ; 244 1e2ea: f7 47 sbci r31, 0x77 ; 119 1e2ec: 64 91 lpm r22, Z 1e2ee: c7 01 movw r24, r14 1e2f0: 0f 94 62 a4 call 0x348c4 ; 0x348c4 1e2f4: 8f ef ldi r24, 0xFF ; 255 1e2f6: e8 1a sub r14, r24 1e2f8: 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){ 1e2fa: 9a e0 ldi r25, 0x0A ; 10 1e2fc: e9 16 cp r14, r25 1e2fe: f1 04 cpc r15, r1 1e300: 91 f7 brne .-28 ; 0x1e2e6 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])); 1e302: e6 e1 ldi r30, 0x16 ; 22 1e304: f8 e8 ldi r31, 0x88 ; 136 1e306: 65 91 lpm r22, Z+ 1e308: 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); 1e30a: 8a e0 ldi r24, 0x0A ; 10 1e30c: 90 e0 ldi r25, 0x00 ; 0 1e30e: 0f 94 80 a4 call 0x34900 ; 0x34900 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 1e312: e8 e1 ldi r30, 0x18 ; 24 1e314: f8 e8 ldi r31, 0x88 ; 136 1e316: 65 91 lpm r22, Z+ 1e318: 74 91 lpm r23, Z 1e31a: 8c e0 ldi r24, 0x0C ; 12 1e31c: 90 e0 ldi r25, 0x00 ; 0 1e31e: 0f 94 80 a4 call 0x34900 ; 0x34900 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 1e322: ea e1 ldi r30, 0x1A ; 26 1e324: f8 e8 ldi r31, 0x88 ; 136 1e326: 65 91 lpm r22, Z+ 1e328: 74 91 lpm r23, Z 1e32a: 8e e0 ldi r24, 0x0E ; 14 1e32c: 90 e0 ldi r25, 0x00 ; 0 1e32e: 0f 94 80 a4 call 0x34900 ; 0x34900 // 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])); 1e332: ec e1 ldi r30, 0x1C ; 28 1e334: f8 e8 ldi r31, 0x88 ; 136 1e336: 65 91 lpm r22, Z+ 1e338: 74 91 lpm r23, Z 1e33a: 80 e1 ldi r24, 0x10 ; 16 1e33c: 90 e0 ldi r25, 0x00 ; 0 1e33e: 0f 94 80 a4 call 0x34900 ; 0x34900 run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 1e342: 8f e5 ldi r24, 0x5F ; 95 1e344: 9f e0 ldi r25, 0x0F ; 15 1e346: 0f 94 3e a4 call 0x3487c ; 0x3487c 1e34a: 88 23 and r24, r24 1e34c: d9 f1 breq .+118 ; 0x1e3c4 // first time run of wizard or service prep lcd_wizard(WizState::Run); 1e34e: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 1e350: 0e 94 87 e9 call 0x1d30e ; 0x1d30e lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 1e354: 83 e0 ldi r24, 0x03 ; 3 1e356: 80 93 78 02 sts 0x0278, r24 ; 0x800278 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 1e35a: 81 e0 ldi r24, 0x01 ; 1 1e35c: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_clear(); 1e360: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_update(2); 1e364: 82 e0 ldi r24, 0x02 ; 2 1e366: 0e 94 54 6f call 0xdea8 ; 0xdea8 "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); 1e36a: 83 e0 ldi r24, 0x03 ; 3 1e36c: 9d e0 ldi r25, 0x0D ; 13 1e36e: 0f 94 3e a4 call 0x3487c ; 0x3487c 1e372: 18 2f mov r17, r24 if(crash_reason != dump_crash_reason::manual && (uint8_t)crash_reason != 0xFF) 1e374: 8f ef ldi r24, 0xFF ; 255 1e376: 81 0f add r24, r17 1e378: 8e 3f cpi r24, 0xFE ; 254 1e37a: 08 f0 brcs .+2 ; 0x1e37e 1e37c: 49 c0 rjmp .+146 ; 0x1e410 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1e37e: 80 e0 ldi r24, 0x00 ; 0 1e380: 0f 94 06 23 call 0x2460c ; 0x2460c { lcd_beeper_quick_feedback(); lcd_clear(); 1e384: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); 1e388: 8e eb ldi r24, 0xBE ; 190 1e38a: 99 e6 ldi r25, 0x69 ; 105 1e38c: 0e 94 78 6f call 0xdef0 ; 0xdef0 switch(crash_reason) 1e390: 12 30 cpi r17, 0x02 ; 2 1e392: b1 f1 breq .+108 ; 0x1e400 1e394: 13 30 cpi r17, 0x03 ; 3 1e396: 09 f4 brne .+2 ; 0x1e39a 1e398: 16 c1 rjmp .+556 ; 0x1e5c6 { case dump_crash_reason::stack_error: lcd_puts_P(_n("Static memory has\nbeen overwritten")); 1e39a: 8b e9 ldi r24, 0x9B ; 155 1e39c: 99 e6 ldi r25, 0x69 ; 105 { lcd_beeper_quick_feedback(); lcd_clear(); lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); switch(crash_reason) 1e39e: 11 30 cpi r17, 0x01 ; 1 1e3a0: 89 f1 breq .+98 ; 0x1e404 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 1e3a2: 81 2f mov r24, r17 1e3a4: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 1e3a8: 2f c0 rjmp .+94 ; 0x1e408 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)); 1e3aa: 86 e6 ldi r24, 0x66 ; 102 1e3ac: 9e e4 ldi r25, 0x4E ; 78 1e3ae: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1e3b2: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 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); 1e3b6: 6a ef ldi r22, 0xFA ; 250 1e3b8: 70 e0 ldi r23, 0x00 ; 0 1e3ba: 8e ee ldi r24, 0xEE ; 238 1e3bc: 9e e0 ldi r25, 0x0E ; 14 1e3be: 0f 94 9c a4 call 0x34938 ; 0x34938 1e3c2: da ce rjmp .-588 ; 0x1e178 // 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); 1e3c4: 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) { 1e3c6: 11 11 cpse r17, r1 1e3c8: c3 cf rjmp .-122 ; 0x1e350 // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 1e3ca: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c 1e3ce: 81 11 cpse r24, r1 1e3d0: 07 c0 rjmp .+14 ; 0x1e3e0 // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 1e3d2: 88 e7 ldi r24, 0x78 ; 120 1e3d4: 9d e4 ldi r25, 0x4D ; 77 // 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)); 1e3d6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1e3da: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 1e3de: ba cf rjmp .-140 ; 0x1e354 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)) { 1e3e0: 84 e0 ldi r24, 0x04 ; 4 1e3e2: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c 1e3e6: 81 11 cpse r24, r1 1e3e8: 03 c0 rjmp .+6 ; 0x1e3f0 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 1e3ea: 80 e0 ldi r24, 0x00 ; 0 1e3ec: 9d e4 ldi r25, 0x4D ; 77 1e3ee: f3 cf rjmp .-26 ; 0x1e3d6 } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 1e3f0: 80 e1 ldi r24, 0x10 ; 16 1e3f2: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c 1e3f6: 81 11 cpse r24, r1 1e3f8: ad cf rjmp .-166 ; 0x1e354 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1e3fa: 8c eb ldi r24, 0xBC ; 188 1e3fc: 90 e6 ldi r25, 0x60 ; 96 1e3fe: eb cf rjmp .-42 ; 0x1e3d6 { 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")); 1e400: 8a e8 ldi r24, 0x8A ; 138 1e402: 99 e6 ldi r25, 0x69 ; 105 1e404: 0e 94 78 6f call 0xdef0 ; 0xdef0 } } void lcd_wait_for_click() { lcd_wait_for_click_delay(0); 1e408: 90 e0 ldi r25, 0x00 ; 0 1e40a: 80 e0 ldi r24, 0x00 ; 0 1e40c: 0e 94 ad dd call 0x1bb5a ; 0x1bb5a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e410: 6f ef ldi r22, 0xFF ; 255 1e412: 83 e0 ldi r24, 0x03 ; 3 1e414: 9d e0 ldi r25, 0x0D ; 13 1e416: 0f 94 62 a4 call 0x348c4 ; 0x348c4 // 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(); 1e41a: 0e 94 49 d7 call 0x1ae92 ; 0x1ae92 KEEPALIVE_STATE(NOT_BUSY); 1e41e: 81 e0 ldi r24, 0x01 ; 1 1e420: 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" ); 1e424: 88 e1 ldi r24, 0x18 ; 24 1e426: 98 e2 ldi r25, 0x28 ; 40 1e428: 0f b6 in r0, 0x3f ; 63 1e42a: f8 94 cli 1e42c: a8 95 wdr 1e42e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1e432: 0f be out 0x3f, r0 ; 63 1e434: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 1e438: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1e43c: 80 64 ori r24, 0x40 ; 64 1e43e: 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; 1e442: 85 e0 ldi r24, 0x05 ; 5 1e444: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 1e446: 90 e0 ldi r25, 0x00 ; 0 1e448: e9 2e mov r14, r25 1e44a: 90 e0 ldi r25, 0x00 ; 0 1e44c: 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); 1e44e: cc 24 eor r12, r12 1e450: 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); 1e452: 24 e0 ldi r18, 0x04 ; 4 1e454: 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; 1e456: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 if(Stopped) { 1e45a: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 1e45e: 88 23 and r24, r24 1e460: 09 f4 brne .+2 ; 0x1e464 1e462: b4 c0 rjmp .+360 ; 0x1e5cc // 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); 1e464: 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. 1e468: 0e 94 90 66 call 0xcd20 ; 0xcd20 1e46c: 88 23 and r24, r24 1e46e: 09 f4 brne .+2 ; 0x1e472 1e470: b0 c0 rjmp .+352 ; 0x1e5d2 1e472: 80 91 79 02 lds r24, 0x0279 ; 0x800279 1e476: 81 30 cpi r24, 0x01 ; 1 1e478: 09 f0 breq .+2 ; 0x1e47c 1e47a: ab c0 rjmp .+342 ; 0x1e5d2 usb_timer.start(); 1e47c: 82 e4 ldi r24, 0x42 ; 66 1e47e: 92 e1 ldi r25, 0x12 ; 18 1e480: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> } else #endif { get_command(); 1e484: 0e 94 21 86 call 0x10c42 ; 0x10c42 // 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) 1e488: 80 91 56 02 lds r24, 0x0256 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.513> 1e48c: 88 23 and r24, r24 1e48e: 89 f0 breq .+34 ; 0x1e4b2 return; if(autostart_atmillis.expired(5000)) 1e490: 68 e8 ldi r22, 0x88 ; 136 1e492: 73 e1 ldi r23, 0x13 ; 19 1e494: 88 ee ldi r24, 0xE8 ; 232 1e496: 96 e1 ldi r25, 0x16 ; 22 1e498: 0f 94 30 0b call 0x21660 ; 0x21660 ::expired(unsigned short)> 1e49c: 81 11 cpse r24, r1 1e49e: 09 c0 rjmp .+18 ; 0x1e4b2 return; } autostart_stilltocheck = false; 1e4a0: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.513> if(!mounted) 1e4a4: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1e4a8: 88 23 and r24, r24 1e4aa: 09 f4 brne .+2 ; 0x1e4ae 1e4ac: 9e c0 rjmp .+316 ; 0x1e5ea 1e4ae: 0f 94 a1 67 call 0x2cf42 ; 0x2cf42 #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 1e4b2: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1e4b6: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1e4ba: 89 2b or r24, r25 1e4bc: 09 f4 brne .+2 ; 0x1e4c0 1e4be: 63 c0 rjmp .+198 ; 0x1e586 { cmdbuffer_front_already_processed = false; 1e4c0: 10 92 53 12 sts 0x1253, r1 ; 0x801253 #ifdef SDSUPPORT if(card.saving) 1e4c4: 80 91 d5 13 lds r24, 0x13D5 ; 0x8013d5 1e4c8: 88 23 and r24, r24 1e4ca: c1 f1 breq .+112 ; 0x1e53c { // 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) { 1e4cc: 00 91 38 12 lds r16, 0x1238 ; 0x801238 1e4d0: 10 91 39 12 lds r17, 0x1239 ; 0x801239 1e4d4: 02 5b subi r16, 0xB2 ; 178 1e4d6: 1f 4e sbci r17, 0xEF ; 239 1e4d8: 6f e5 ldi r22, 0x5F ; 95 1e4da: 78 e8 ldi r23, 0x88 ; 136 1e4dc: c8 01 movw r24, r16 1e4de: 0f 94 45 a2 call 0x3448a ; 0x3448a 1e4e2: 89 2b or r24, r25 1e4e4: 09 f0 breq .+2 ; 0x1e4e8 1e4e6: 8e c0 rjmp .+284 ; 0x1e604 else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 1e4e8: 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)); 1e4ec: f8 01 movw r30, r16 1e4ee: 01 90 ld r0, Z+ 1e4f0: 00 20 and r0, r0 1e4f2: e9 f7 brne .-6 ; 0x1e4ee 1e4f4: 31 97 sbiw r30, 0x01 ; 1 1e4f6: bf 01 movw r22, r30 1e4f8: 60 1b sub r22, r16 1e4fa: 71 0b sbc r23, r17 1e4fc: c8 01 movw r24, r16 1e4fe: 0f 94 64 75 call 0x2eac8 ; 0x2eac8 1e502: 62 e0 ldi r22, 0x02 ; 2 1e504: 70 e0 ldi r23, 0x00 ; 0 1e506: 8d ed ldi r24, 0xDD ; 221 1e508: 92 e0 ldi r25, 0x02 ; 2 1e50a: 0f 94 64 75 call 0x2eac8 ; 0x2eac8 file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 1e50e: 80 91 67 16 lds r24, 0x1667 ; 0x801667 1e512: 88 23 and r24, r24 1e514: 41 f0 breq .+16 ; 0x1e526 { SERIAL_ERROR_START; 1e516: 87 ec ldi r24, 0xC7 ; 199 1e518: 92 ea ldi r25, 0xA2 ; 162 1e51a: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 1e51e: 88 e6 ldi r24, 0x68 ; 104 1e520: 9a e6 ldi r25, 0x6A ; 106 1e522: 0e 94 18 7d call 0xfa30 ; 0xfa30 card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 1e526: 80 91 d6 13 lds r24, 0x13D6 ; 0x8013d6 1e52a: 88 23 and r24, r24 1e52c: 09 f4 brne .+2 ; 0x1e530 1e52e: 65 c0 rjmp .+202 ; 0x1e5fa */ void process_commands() { if (!buflen) return; //empty command 1e530: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1e534: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1e538: 89 2b or r24, r25 1e53a: 11 f0 breq .+4 ; 0x1e540 1e53c: 0e 94 50 8e call 0x11ca0 ; 0x11ca0 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 1e540: 80 91 53 12 lds r24, 0x1253 ; 0x801253 1e544: 81 11 cpse r24, r1 1e546: 19 c0 rjmp .+50 ; 0x1e57a 1e548: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1e54c: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1e550: 89 2b or r24, r25 1e552: 99 f0 breq .+38 ; 0x1e57a { // 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; 1e554: e0 91 38 12 lds r30, 0x1238 ; 0x801238 1e558: f0 91 39 12 lds r31, 0x1239 ; 0x801239 1e55c: e5 5b subi r30, 0xB5 ; 181 1e55e: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 1e560: 80 81 ld r24, Z 1e562: 82 30 cpi r24, 0x02 ; 2 1e564: 09 f0 breq .+2 ; 0x1e568 1e566: 53 c0 rjmp .+166 ; 0x1e60e { // 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(); 1e568: 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; 1e56a: 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); 1e56c: 81 81 ldd r24, Z+1 ; 0x01 1e56e: 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); 1e570: 0f 94 b4 39 call 0x27368 ; 0x27368 sei(); 1e574: 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(); 1e576: 0e 94 9e 79 call 0xf33c ; 0xf33c */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; 1e57a: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1e57e: 81 11 cpse r24, r1 1e580: 02 c0 rjmp .+4 ; 0x1e586 1e582: 0e 94 1c 7d call 0xfa38 ; 0xfa38 } host_keepalive(); } } //check heater every n milliseconds manage_heater(); 1e586: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(printingIsPaused()); 1e58a: 0e 94 90 66 call 0xcd20 ; 0xcd20 1e58e: 0e 94 b0 8a call 0x11560 ; 0x11560 //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 1e592: 80 91 5e 04 lds r24, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.441> 1e596: 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; 1e598: 10 92 5e 04 sts 0x045E, r1 ; 0x80045e <_ZL11endstop_hit.lto_priv.441> checkHitEndstops(); lcd_update(0); 1e59c: 80 e0 ldi r24, 0x00 ; 0 1e59e: 0e 94 54 6f call 0xdea8 ; 0xdea8 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) { 1e5a2: 80 91 5f 04 lds r24, 0x045F ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.501> 1e5a6: 81 11 cpse r24, r1 1e5a8: 07 c0 rjmp .+14 ; 0x1e5b8 return; } avoidRecursion = true; 1e5aa: c0 92 5f 04 sts 0x045F, r12 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.501> mmu_loop_inner(true); 1e5ae: 81 e0 ldi r24, 0x01 ; 1 1e5b0: 0f 94 96 97 call 0x32f2c ; 0x32f2c avoidRecursion = false; 1e5b4: 10 92 5f 04 sts 0x045F, r1 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.501> 1e5b8: e1 14 cp r14, r1 1e5ba: f1 04 cpc r15, r1 1e5bc: 09 f4 brne .+2 ; 0x1e5c0 1e5be: 4b cf rjmp .-362 ; 0x1e456 1e5c0: 0e 94 00 00 call 0 ; 0x0 <__vectors> 1e5c4: 48 cf rjmp .-368 ; 0x1e456 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")); 1e5c6: 8c e7 ldi r24, 0x7C ; 124 1e5c8: 99 e6 ldi r25, 0x69 ; 105 1e5ca: 1c cf rjmp .-456 ; 0x1e404 // 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); 1e5cc: c0 92 78 02 sts 0x0278, r12 ; 0x800278 1e5d0: 4b cf rjmp .-362 ; 0x1e468 } 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. 1e5d2: 60 e1 ldi r22, 0x10 ; 16 1e5d4: 77 e2 ldi r23, 0x27 ; 39 1e5d6: 82 e4 ldi r24, 0x42 ; 66 1e5d8: 92 e1 ldi r25, 0x12 ; 18 1e5da: 0f 94 30 0b call 0x21660 ; 0x21660 ::expired(unsigned short)> 1e5de: 88 23 and r24, r24 1e5e0: 09 f4 brne .+2 ; 0x1e5e4 1e5e2: 50 cf rjmp .-352 ; 0x1e484 1e5e4: b0 92 61 0d sts 0x0D61, r11 ; 0x800d61 <_ZL13printer_state.lto_priv.385> 1e5e8: 4d cf rjmp .-358 ; 0x1e484 return; } autostart_stilltocheck = false; if(!mounted) { mount(); 1e5ea: 81 e0 ldi r24, 0x01 ; 1 1e5ec: 0f 94 c5 72 call 0x2e58a ; 0x2e58a if(!mounted) //fail 1e5f0: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1e5f4: 81 11 cpse r24, r1 1e5f6: 5b cf rjmp .-330 ; 0x1e4ae 1e5f8: 5c cf rjmp .-328 ; 0x1e4b2 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); 1e5fa: 80 e9 ldi r24, 0x90 ; 144 1e5fc: 9a e6 ldi r25, 0x6A ; 106 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1e5fe: 0e 94 18 7d call 0xfa30 ; 0xfa30 1e602: 9e cf rjmp .-196 ; 0x1e540 if(card.logging) process_commands(); else SERIAL_PROTOCOLLNRPGM(MSG_OK); } else { card.closefile(); 1e604: 0f 94 6f 65 call 0x2cade ; 0x2cade SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1e608: 8e e7 ldi r24, 0x7E ; 126 1e60a: 9a e6 ldi r25, 0x6A ; 106 1e60c: f8 cf rjmp .-16 ; 0x1e5fe // 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){ 1e60e: 86 30 cpi r24, 0x06 ; 6 1e610: 09 f0 breq .+2 ; 0x1e614 1e612: b1 cf rjmp .-158 ; 0x1e576 1e614: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 1e618: 81 11 cpse r24, r1 1e61a: ad cf rjmp .-166 ; 0x1e576 cli(); 1e61c: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 1e61e: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 1e620: 81 e0 ldi r24, 0x01 ; 1 1e622: 90 e0 ldi r25, 0x00 ; 0 1e624: a5 cf rjmp .-182 ; 0x1e570 { 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; 1e626: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1e628: 88 3c cpi r24, 0xC8 ; 200 1e62a: 91 05 cpc r25, r1 1e62c: 09 f0 breq .+2 ; 0x1e630 1e62e: 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(); 1e630: 0e 94 6a 85 call 0x10ad4 ; 0x10ad4 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; 1e634: 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; 1e636: 82 ea ldi r24, 0xA2 ; 162 1e638: 92 ea ldi r25, 0xA2 ; 162 1e63a: a0 e0 ldi r26, 0x00 ; 0 1e63c: b0 e0 ldi r27, 0x00 ; 0 1e63e: 80 93 37 17 sts 0x1737, r24 ; 0x801737 <__bss_end+0x20> 1e642: 90 93 38 17 sts 0x1738, r25 ; 0x801738 <__bss_end+0x21> 1e646: a0 93 39 17 sts 0x1739, r26 ; 0x801739 <__bss_end+0x22> 1e64a: 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; 1e64e: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL14iState_sum_min.lto_priv.433> 1e652: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL14iState_sum_min.lto_priv.433+0x1> 1e656: 10 92 1e 04 sts 0x041E, r1 ; 0x80041e <_ZL14iState_sum_min.lto_priv.433+0x2> 1e65a: 10 92 1f 04 sts 0x041F, r1 ; 0x80041f <_ZL14iState_sum_min.lto_priv.433+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 1e65e: 20 91 d3 0d lds r18, 0x0DD3 ; 0x800dd3 1e662: 30 91 d4 0d lds r19, 0x0DD4 ; 0x800dd4 1e666: 40 91 d5 0d lds r20, 0x0DD5 ; 0x800dd5 1e66a: 50 91 d6 0d lds r21, 0x0DD6 ; 0x800dd6 1e66e: 60 e0 ldi r22, 0x00 ; 0 1e670: 70 e0 ldi r23, 0x00 ; 0 1e672: 8f e7 ldi r24, 0x7F ; 127 1e674: 93 e4 ldi r25, 0x43 ; 67 1e676: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1e67a: 60 93 18 04 sts 0x0418, r22 ; 0x800418 <_ZL14iState_sum_max.lto_priv.434> 1e67e: 70 93 19 04 sts 0x0419, r23 ; 0x800419 <_ZL14iState_sum_max.lto_priv.434+0x1> 1e682: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14iState_sum_max.lto_priv.434+0x2> 1e686: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14iState_sum_max.lto_priv.434+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 1e68a: 10 92 14 04 sts 0x0414, r1 ; 0x800414 <_ZL19temp_iState_min_bed.lto_priv.431> 1e68e: 10 92 15 04 sts 0x0415, r1 ; 0x800415 <_ZL19temp_iState_min_bed.lto_priv.431+0x1> 1e692: 10 92 16 04 sts 0x0416, r1 ; 0x800416 <_ZL19temp_iState_min_bed.lto_priv.431+0x2> 1e696: 10 92 17 04 sts 0x0417, r1 ; 0x800417 <_ZL19temp_iState_min_bed.lto_priv.431+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 1e69a: 20 91 df 0d lds r18, 0x0DDF ; 0x800ddf 1e69e: 30 91 e0 0d lds r19, 0x0DE0 ; 0x800de0 1e6a2: 40 91 e1 0d lds r20, 0x0DE1 ; 0x800de1 1e6a6: 50 91 e2 0d lds r21, 0x0DE2 ; 0x800de2 1e6aa: 60 e0 ldi r22, 0x00 ; 0 1e6ac: 70 e0 ldi r23, 0x00 ; 0 1e6ae: 8f e7 ldi r24, 0x7F ; 127 1e6b0: 93 e4 ldi r25, 0x43 ; 67 1e6b2: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1e6b6: 60 93 10 04 sts 0x0410, r22 ; 0x800410 <_ZL19temp_iState_max_bed.lto_priv.432> 1e6ba: 70 93 11 04 sts 0x0411, r23 ; 0x800411 <_ZL19temp_iState_max_bed.lto_priv.432+0x1> 1e6be: 80 93 12 04 sts 0x0412, r24 ; 0x800412 <_ZL19temp_iState_max_bed.lto_priv.432+0x2> 1e6c2: 90 93 13 04 sts 0x0413, r25 ; 0x800413 <_ZL19temp_iState_max_bed.lto_priv.432+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 1e6c6: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 1e6c8: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 1e6ca: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1e6ce: 88 60 ori r24, 0x08 ; 8 1e6d0: 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)); 1e6d4: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 1e6d8: 90 e0 ldi r25, 0x00 ; 0 1e6da: 64 e0 ldi r22, 0x04 ; 4 1e6dc: 95 95 asr r25 1e6de: 87 95 ror r24 1e6e0: 6a 95 dec r22 1e6e2: e1 f7 brne .-8 ; 0x1e6dc 1e6e4: 80 93 0f 04 sts 0x040F, r24 ; 0x80040f <_ZL12soft_pwm_fan.lto_priv.436> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 1e6e8: 8e e1 ldi r24, 0x1E ; 30 1e6ea: 90 e0 ldi r25, 0x00 ; 0 1e6ec: 90 93 0e 04 sts 0x040E, r25 ; 0x80040e <_ZL8minttemp.lto_priv.426+0x1> 1e6f0: 80 93 0d 04 sts 0x040D, r24 ; 0x80040d <_ZL8minttemp.lto_priv.426> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 1e6f4: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.428> 1e6f8: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.428+0x1> 1e6fc: 0f 94 c4 8f call 0x31f88 ; 0x31f88 1e700: 20 e0 ldi r18, 0x00 ; 0 1e702: 30 e0 ldi r19, 0x00 ; 0 1e704: 40 ef ldi r20, 0xF0 ; 240 1e706: 51 e4 ldi r21, 0x41 ; 65 1e708: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1e70c: 87 ff sbrs r24, 7 1e70e: 91 c9 rjmp .-3294 ; 0x1da32 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 1e710: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.428> 1e714: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.428+0x1> 1e718: 40 97 sbiw r24, 0x10 ; 16 1e71a: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL12minttemp_raw.lto_priv.428+0x1> 1e71e: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL12minttemp_raw.lto_priv.428> 1e722: e8 cf rjmp .-48 ; 0x1e6f4 0001e724 : } } void lcd_print_stop_finish(); void lcd_commands() 1e724: 2f 92 push r2 1e726: 3f 92 push r3 1e728: 4f 92 push r4 1e72a: 5f 92 push r5 1e72c: 6f 92 push r6 1e72e: 7f 92 push r7 1e730: 8f 92 push r8 1e732: 9f 92 push r9 1e734: af 92 push r10 1e736: bf 92 push r11 1e738: cf 92 push r12 1e73a: df 92 push r13 1e73c: ef 92 push r14 1e73e: ff 92 push r15 1e740: 0f 93 push r16 1e742: 1f 93 push r17 1e744: cf 93 push r28 1e746: df 93 push r29 1e748: 00 d0 rcall .+0 ; 0x1e74a 1e74a: 1f 92 push r1 1e74c: 1f 92 push r1 1e74e: cd b7 in r28, 0x3d ; 61 1e750: de b7 in r29, 0x3e ; 62 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) 1e752: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1e756: 81 30 cpi r24, 0x01 ; 1 1e758: 09 f0 breq .+2 ; 0x1e75c 1e75a: 5a c0 rjmp .+180 ; 0x1e810 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); 1e75c: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1e760: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f { if (!blocks_queued() && !homing_flag) 1e764: 98 13 cpse r25, r24 1e766: 54 c0 rjmp .+168 ; 0x1e810 1e768: 80 91 71 12 lds r24, 0x1271 ; 0x801271 1e76c: 81 11 cpse r24, r1 1e76e: 50 c0 rjmp .+160 ; 0x1e810 { custom_message_type = CustomMsg::Status; 1e770: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 1e774: 88 ee ldi r24, 0xE8 ; 232 1e776: 9b e4 ldi r25, 0x4B ; 75 1e778: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1e77c: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe lcd_commands_type = LcdCommands::Idle; 1e780: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1e784: 82 e0 ldi r24, 0x02 ; 2 1e786: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.385> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1e78a: 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(); 1e78e: 0f 94 a9 16 call 0x22d52 ; 0x22d52 save_statistics(); 1e792: 0e 94 0b 65 call 0xca16 ; 0xca16 // lift Z raise_z(10); 1e796: 60 e0 ldi r22, 0x00 ; 0 1e798: 70 e0 ldi r23, 0x00 ; 0 1e79a: 80 e2 ldi r24, 0x20 ; 32 1e79c: 91 e4 ldi r25, 0x41 ; 65 1e79e: 0e 94 ef 6c call 0xd9de ; 0xd9de // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1e7a2: 80 91 39 06 lds r24, 0x0639 ; 0x800639 1e7a6: 88 23 and r24, r24 1e7a8: 21 f1 breq .+72 ; 0x1e7f2 1e7aa: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 1e7ae: 88 23 and r24, r24 1e7b0: 01 f1 breq .+64 ; 0x1e7f2 current_position[X_AXIS] = X_CANCEL_POS; 1e7b2: 80 e0 ldi r24, 0x00 ; 0 1e7b4: 90 e0 ldi r25, 0x00 ; 0 1e7b6: a8 e4 ldi r26, 0x48 ; 72 1e7b8: b2 e4 ldi r27, 0x42 ; 66 1e7ba: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1e7be: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1e7c2: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1e7c6: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = Y_CANCEL_POS; 1e7ca: 80 e0 ldi r24, 0x00 ; 0 1e7cc: 90 e0 ldi r25, 0x00 ; 0 1e7ce: ae e3 ldi r26, 0x3E ; 62 1e7d0: b3 e4 ldi r27, 0x43 ; 67 1e7d2: 80 93 65 12 sts 0x1265, r24 ; 0x801265 1e7d6: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1e7da: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1e7de: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1e7e2: 60 e0 ldi r22, 0x00 ; 0 1e7e4: 70 e0 ldi r23, 0x00 ; 0 1e7e6: 84 e3 ldi r24, 0x34 ; 52 1e7e8: 92 e4 ldi r25, 0x42 ; 66 1e7ea: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 1e7ee: 0f 94 5b 18 call 0x230b6 ; 0x230b6 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1e7f2: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> // 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()) { 1e7f6: 88 23 and r24, r24 1e7f8: 09 f4 brne .+2 ; 0x1e7fc 1e7fa: bb c0 rjmp .+374 ; 0x1e972 // time to stop the error beep WRITE(BEEPER, LOW); 1e7fc: 72 98 cbi 0x0e, 2 ; 14 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 1e7fe: 0f 94 fd 0d call 0x21bfa ; 0x21bfa finishAndDisableSteppers(); //M84 1e802: 0e 94 d8 84 call 0x109b0 ; 0x109b0 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 1e806: 88 e0 ldi r24, 0x08 ; 8 1e808: 80 93 57 12 sts 0x1257, r24 ; 0x801257 did_pause_print = false; // Clear pause state in case the print was aborted while paused 1e80c: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 1e810: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1e814: 82 30 cpi r24, 0x02 ; 2 1e816: 09 f0 breq .+2 ; 0x1e81a 1e818: 63 c0 rjmp .+198 ; 0x1e8e0 1e81a: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1e81e: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f { if (!blocks_queued() && !homing_flag) 1e822: 98 13 cpse r25, r24 1e824: 5d c0 rjmp .+186 ; 0x1e8e0 1e826: 80 91 71 12 lds r24, 0x1271 ; 0x801271 1e82a: 81 11 cpse r24, r1 1e82c: 59 c0 rjmp .+178 ; 0x1e8e0 { if (custom_message_type != CustomMsg::M117) 1e82e: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 1e832: 87 30 cpi r24, 0x07 ; 7 1e834: 41 f0 breq .+16 ; 0x1e846 { custom_message_type = CustomMsg::Status; 1e836: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 1e83a: 89 ed ldi r24, 0xD9 ; 217 1e83c: 9b e4 ldi r25, 0x4B ; 75 1e83e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1e842: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe } lcd_commands_type = LcdCommands::Idle; 1e846: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1e84a: 82 e0 ldi r24, 0x02 ; 2 1e84c: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.385> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1e850: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 1e854: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 1e858: 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; 1e85c: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1e860: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 1e864: 60 91 4a 02 lds r22, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.489+0x8> 1e868: 70 91 4b 02 lds r23, 0x024B ; 0x80024b <_ZL14pause_position.lto_priv.489+0x9> 1e86c: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL14pause_position.lto_priv.489+0xa> 1e870: 90 91 4d 02 lds r25, 0x024D ; 0x80024d <_ZL14pause_position.lto_priv.489+0xb> 1e874: 0e 94 ef 6c call 0xd9de ; 0xd9de // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1e878: 80 91 39 06 lds r24, 0x0639 ; 0x800639 1e87c: 88 23 and r24, r24 1e87e: 51 f1 breq .+84 ; 0x1e8d4 1e880: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 1e884: 88 23 and r24, r24 1e886: 31 f1 breq .+76 ; 0x1e8d4 current_position[X_AXIS] = pause_position[X_AXIS]; 1e888: 80 91 42 02 lds r24, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.489> 1e88c: 90 91 43 02 lds r25, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.489+0x1> 1e890: a0 91 44 02 lds r26, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.489+0x2> 1e894: b0 91 45 02 lds r27, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.489+0x3> 1e898: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1e89c: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1e8a0: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1e8a4: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pause_position[Y_AXIS]; 1e8a8: 80 91 46 02 lds r24, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.489+0x4> 1e8ac: 90 91 47 02 lds r25, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.489+0x5> 1e8b0: a0 91 48 02 lds r26, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.489+0x6> 1e8b4: b0 91 49 02 lds r27, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.489+0x7> 1e8b8: 80 93 65 12 sts 0x1265, r24 ; 0x801265 1e8bc: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1e8c0: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1e8c4: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(50); 1e8c8: 60 e0 ldi r22, 0x00 ; 0 1e8ca: 70 e0 ldi r23, 0x00 ; 0 1e8cc: 88 e4 ldi r24, 0x48 ; 72 1e8ce: 92 e4 ldi r25, 0x42 ; 66 1e8d0: 0f 94 a8 49 call 0x29350 ; 0x29350 1e8d4: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> } // did we come here from a thermal error? if(get_temp_error()) { 1e8d8: 88 23 and r24, r24 1e8da: 09 f4 brne .+2 ; 0x1e8de 1e8dc: 74 c0 rjmp .+232 ; 0x1e9c6 // time to stop the error beep WRITE(BEEPER, LOW); 1e8de: 72 98 cbi 0x0e, 2 ; 14 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 1e8e0: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1e8e4: 84 30 cpi r24, 0x04 ; 4 1e8e6: 09 f0 breq .+2 ; 0x1e8ea 1e8e8: ad c0 rjmp .+346 ; 0x1ea44 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 1e8ea: 85 ea ldi r24, 0xA5 ; 165 1e8ec: 9d e0 ldi r25, 0x0D ; 13 1e8ee: 0f 94 4c a4 call 0x34898 ; 0x34898 1e8f2: 30 91 3e 0d lds r19, 0x0D3E ; 0x800d3e 1e8f6: 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) 1e8fa: 32 13 cpse r19, r18 1e8fc: 7c c1 rjmp .+760 ; 0x1ebf6 1e8fe: 20 91 3c 12 lds r18, 0x123C ; 0x80123c 1e902: 30 91 3d 12 lds r19, 0x123D ; 0x80123d 1e906: 23 2b or r18, r19 1e908: 09 f0 breq .+2 ; 0x1e90c 1e90a: 75 c1 rjmp .+746 ; 0x1ebf6 1e90c: 20 91 73 12 lds r18, 0x1273 ; 0x801273 1e910: 29 83 std Y+1, r18 ; 0x01 1e912: 21 11 cpse r18, r1 1e914: 70 c1 rjmp .+736 ; 0x1ebf6 { if (lcd_commands_step == 0) 1e916: 20 91 e2 03 lds r18, 0x03E2 ; 0x8003e2 1e91a: 21 11 cpse r18, r1 1e91c: 57 c0 rjmp .+174 ; 0x1e9cc lcd_commands_step = 12; 1e91e: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 1e920: 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; 1e924: 44 96 adiw r24, 0x14 ; 20 1e926: bc 01 movw r22, r24 1e928: 90 e0 ldi r25, 0x00 ; 0 1e92a: 80 e0 ldi r24, 0x00 ; 0 1e92c: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 1e930: 20 e0 ldi r18, 0x00 ; 0 1e932: 30 e0 ldi r19, 0x00 ; 0 1e934: 4a e7 ldi r20, 0x7A ; 122 1e936: 54 e4 ldi r21, 0x44 ; 68 1e938: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1e93c: 6b 01 movw r12, r22 1e93e: 7c 01 movw r14, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 1e940: e0 91 e2 03 lds r30, 0x03E2 ; 0x8003e2 1e944: e1 50 subi r30, 0x01 ; 1 1e946: ec 30 cpi r30, 0x0C ; 12 1e948: 08 f0 brcs .+2 ; 0x1e94c 1e94a: 7c c0 rjmp .+248 ; 0x1ea44 1e94c: f0 e0 ldi r31, 0x00 ; 0 1e94e: 88 27 eor r24, r24 1e950: e3 55 subi r30, 0x53 ; 83 1e952: fb 40 sbci r31, 0x0B ; 11 1e954: 8f 4f sbci r24, 0xFF ; 255 1e956: 0d 94 4e a5 jmp 0x34a9c ; 0x34a9c <__tablejump2__> 1e95a: c1 f7 brne .-16 ; 0x1e94c 1e95c: ab f7 brvc .-22 ; 0x1e948 1e95e: a7 f7 brid .-24 ; 0x1e948 1e960: a3 f7 brvc .-24 ; 0x1e94a 1e962: 9f f7 brid .-26 ; 0x1e94a 1e964: 99 f7 brne .-26 ; 0x1e94c 1e966: 24 f7 brge .-56 ; 0x1e930 1e968: 9f f6 brid .-90 ; 0x1e910 1e96a: 9b f6 brvc .-90 ; 0x1e912 1e96c: 34 f6 brge .-116 ; 0x1e8fa 1e96e: ee f4 brtc .+58 ; 0x1e9aa 1e970: e8 f4 brcc .+58 ; 0x1e9ac if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 1e972: 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(); 1e976: 0e 94 fd 77 call 0xeffa ; 0xeffa setExtruderAutoFanState(1); 1e97a: 81 e0 ldi r24, 0x01 ; 1 1e97c: 0e 94 0a 78 call 0xf014 ; 0xf014 // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1e980: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1e984: 81 30 cpi r24, 0x01 ; 1 1e986: 09 f0 breq .+2 ; 0x1e98a 1e988: 3a cf rjmp .-396 ; 0x1e7fe fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 1e98a: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 1e98e: 88 23 and r24, r24 1e990: 09 f4 brne .+2 ; 0x1e994 1e992: 35 cf rjmp .-406 ; 0x1e7fe #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1e994: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 1e998: 82 30 cpi r24, 0x02 ; 2 1e99a: 09 f4 brne .+2 ; 0x1e99e 1e99c: 30 cf rjmp .-416 ; 0x1e7fe #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()) 1e99e: 0e 94 90 66 call 0xcd20 ; 0xcd20 1e9a2: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 1e9a4: 0e 94 7e 64 call 0xc8fc ; 0xc8fc } // 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) { 1e9a8: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 1e9ac: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 1e9b0: 80 91 57 02 lds r24, 0x0257 ; 0x800257 1e9b4: 90 91 58 02 lds r25, 0x0258 ; 0x800258 1e9b8: 28 17 cp r18, r24 1e9ba: 39 07 cpc r19, r25 1e9bc: 0c f4 brge .+2 ; 0x1e9c0 1e9be: 1f cf rjmp .-450 ; 0x1e7fe MMU2::mmu2.unload(); // M702 1e9c0: 0f 94 cf 9d call 0x33b9e ; 0x33b9e 1e9c4: 1c cf rjmp .-456 ; 0x1e7fe } else { // Turn off the print fan fanSpeed = 0; 1e9c6: 10 92 55 12 sts 0x1255, r1 ; 0x801255 1e9ca: 8a cf rjmp .-236 ; 0x1e8e0 if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 1e9cc: 21 50 subi r18, 0x01 ; 1 1e9ce: a8 cf rjmp .-176 ; 0x1e920 preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 1e9d0: 65 e0 ldi r22, 0x05 ; 5 1e9d2: 8d e7 ldi r24, 0x7D ; 125 1e9d4: 95 e8 ldi r25, 0x85 ; 133 cmd_pre_meander_5, cmd_pre_meander_6, cmd_pre_meander_7, }; lay1cal_common_enqueue_loop(cmd_pre_meander, (sizeof(cmd_pre_meander)/sizeof(cmd_pre_meander[0]))); 1e9d6: 0e 94 14 8e call 0x11c28 ; 0x11c28 1e9da: 34 c0 rjmp .+104 ; 0x1ea44 //! @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()) 1e9dc: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1e9e0: 81 30 cpi r24, 0x01 ; 1 1e9e2: 69 f5 brne .+90 ; 0x1ea3e { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 1e9e4: 30 91 e1 03 lds r19, 0x03E1 ; 0x8003e1 1e9e8: 3b 83 std Y+3, r19 ; 0x03 { enquecommand_P(MSG_M83); 1e9ea: 61 e0 ldi r22, 0x01 ; 1 1e9ec: 87 e5 ldi r24, 0x57 ; 87 1e9ee: 9d e6 ldi r25, 0x6D ; 109 1e9f0: 0e 94 65 8d call 0x11aca ; 0x11aca enquecommand_P(PSTR("G1 Y-3 F1000")); 1e9f4: 61 e0 ldi r22, 0x01 ; 1 1e9f6: 80 e7 ldi r24, 0x70 ; 112 1e9f8: 95 e8 ldi r25, 0x85 ; 133 1e9fa: 0e 94 65 8d call 0x11aca ; 0x11aca enquecommand_P(PSTR("G1 Z0.4 F1000")); 1e9fe: 61 e0 ldi r22, 0x01 ; 1 1ea00: 82 e6 ldi r24, 0x62 ; 98 1ea02: 95 e8 ldi r25, 0x85 ; 133 1ea04: 0e 94 65 8d call 0x11aca ; 0x11aca uint8_t currentTool = MMU2::mmu2.get_current_tool(); 1ea08: 0f 94 1d 65 call 0x2ca3a ; 0x2ca3a if(currentTool == filament ){ 1ea0c: 9b 81 ldd r25, Y+3 ; 0x03 1ea0e: 98 17 cp r25, r24 1ea10: b1 f0 breq .+44 ; 0x1ea3e // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 1ea12: 8f 3f cpi r24, 0xFF ; 255 1ea14: 29 f0 breq .+10 ; 0x1ea20 // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 1ea16: 61 e0 ldi r22, 0x01 ; 1 1ea18: 8c e6 ldi r24, 0x6C ; 108 1ea1a: 99 e6 ldi r25, 0x69 ; 105 1ea1c: 0e 94 65 8d call 0x11aca ; 0x11aca } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 1ea20: 1f 92 push r1 1ea22: 2b 81 ldd r18, Y+3 ; 0x03 1ea24: 2f 93 push r18 1ea26: 8e e5 ldi r24, 0x5E ; 94 1ea28: 95 e8 ldi r25, 0x85 ; 133 1ea2a: 9f 93 push r25 1ea2c: 8f 93 push r24 1ea2e: 0e 94 2b 8e call 0x11c56 ; 0x11c56 1ea32: 0f 90 pop r0 1ea34: 0f 90 pop r0 1ea36: 0f 90 pop r0 1ea38: 0f 90 pop r0 return true; 1ea3a: 31 e0 ldi r19, 0x01 ; 1 1ea3c: 39 83 std Y+1, r19 ; 0x01 1ea3e: 89 81 ldd r24, Y+1 ; 0x01 1ea40: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 1ea44: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1ea48: 83 30 cpi r24, 0x03 ; 3 1ea4a: 09 f0 breq .+2 ; 0x1ea4e 1ea4c: d4 c0 rjmp .+424 ; 0x1ebf6 if (lcd_commands_step == 0) { 1ea4e: 90 91 e2 03 lds r25, 0x03E2 ; 0x8003e2 1ea52: 91 11 cpse r25, r1 1ea54: 09 c0 rjmp .+18 ; 0x1ea68 custom_message_type = CustomMsg::PidCal; 1ea56: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d custom_message_state = 1; 1ea5a: 91 e0 ldi r25, 0x01 ; 1 1ea5c: 90 93 de 03 sts 0x03DE, r25 ; 0x8003de lcd_draw_update = 3; 1ea60: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_commands_step = 3; 1ea64: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 1ea68: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1ea6c: 83 30 cpi r24, 0x03 ; 3 1ea6e: 19 f5 brne .+70 ; 0x1eab6 1ea70: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1ea74: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 1ea78: 98 13 cpse r25, r24 1ea7a: 1d c0 rjmp .+58 ; 0x1eab6 return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 1ea7c: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 pid_tuning_finished = false; 1ea80: 10 92 41 02 sts 0x0241, r1 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.425> 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); 1ea84: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1ea88: 8f 93 push r24 1ea8a: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 1ea8e: 8f 93 push r24 1ea90: 82 ef ldi r24, 0xF2 ; 242 1ea92: 95 e8 ldi r25, 0x85 ; 133 1ea94: 9f 93 push r25 1ea96: 8f 93 push r24 1ea98: 0e 94 2b 8e call 0x11c56 ; 0x11c56 lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 1ea9c: 8e ec ldi r24, 0xCE ; 206 1ea9e: 9b e4 ldi r25, 0x4B ; 75 1eaa0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1eaa4: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe lcd_commands_step = 2; 1eaa8: 82 e0 ldi r24, 0x02 ; 2 1eaaa: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 1eaae: 0f 90 pop r0 1eab0: 0f 90 pop r0 1eab2: 0f 90 pop r0 1eab4: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 1eab6: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1eaba: 82 30 cpi r24, 0x02 ; 2 1eabc: 09 f0 breq .+2 ; 0x1eac0 1eabe: 7c c0 rjmp .+248 ; 0x1ebb8 1eac0: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.425> 1eac4: 88 23 and r24, r24 1eac6: 09 f4 brne .+2 ; 0x1eaca 1eac8: 77 c0 rjmp .+238 ; 0x1ebb8 custom_message_state = 0; 1eaca: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 1eace: 8a eb ldi r24, 0xBA ; 186 1ead0: 9b e4 ldi r25, 0x4B ; 75 1ead2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1ead6: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe 1eada: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1eade: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 1eae2: 30 91 da 03 lds r19, 0x03DA ; 0x8003da <_Kp> 1eae6: 39 83 std Y+1, r19 ; 0x01 1eae8: 80 91 db 03 lds r24, 0x03DB ; 0x8003db <_Kp+0x1> 1eaec: 8b 83 std Y+3, r24 ; 0x03 1eaee: 10 91 dc 03 lds r17, 0x03DC ; 0x8003dc <_Kp+0x2> 1eaf2: 00 91 dd 03 lds r16, 0x03DD ; 0x8003dd <_Kp+0x3> 1eaf6: 20 e0 ldi r18, 0x00 ; 0 1eaf8: 30 e0 ldi r19, 0x00 ; 0 1eafa: a9 01 movw r20, r18 1eafc: b9 81 ldd r27, Y+1 ; 0x01 1eafe: f8 01 movw r30, r16 1eb00: 6b 2f mov r22, r27 1eb02: 78 2f mov r23, r24 1eb04: 8f 2f mov r24, r31 1eb06: 9e 2f mov r25, r30 1eb08: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1eb0c: 81 11 cpse r24, r1 1eb0e: 1f c0 rjmp .+62 ; 0x1eb4e 1eb10: 20 e0 ldi r18, 0x00 ; 0 1eb12: 30 e0 ldi r19, 0x00 ; 0 1eb14: a9 01 movw r20, r18 1eb16: 60 91 d6 03 lds r22, 0x03D6 ; 0x8003d6 <_Ki> 1eb1a: 70 91 d7 03 lds r23, 0x03D7 ; 0x8003d7 <_Ki+0x1> 1eb1e: 80 91 d8 03 lds r24, 0x03D8 ; 0x8003d8 <_Ki+0x2> 1eb22: 90 91 d9 03 lds r25, 0x03D9 ; 0x8003d9 <_Ki+0x3> 1eb26: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1eb2a: 81 11 cpse r24, r1 1eb2c: 10 c0 rjmp .+32 ; 0x1eb4e 1eb2e: 20 e0 ldi r18, 0x00 ; 0 1eb30: 30 e0 ldi r19, 0x00 ; 0 1eb32: a9 01 movw r20, r18 1eb34: 60 91 d2 03 lds r22, 0x03D2 ; 0x8003d2 <_Kd> 1eb38: 70 91 d3 03 lds r23, 0x03D3 ; 0x8003d3 <_Kd+0x1> 1eb3c: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 <_Kd+0x2> 1eb40: 90 91 d5 03 lds r25, 0x03D5 ; 0x8003d5 <_Kd+0x3> 1eb44: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1eb48: 88 23 and r24, r24 1eb4a: 09 f4 brne .+2 ; 0x1eb4e 1eb4c: 30 c2 rjmp .+1120 ; 0x1efae enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 1eb4e: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_Kd+0x3> 1eb52: 8f 93 push r24 1eb54: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 <_Kd+0x2> 1eb58: 8f 93 push r24 1eb5a: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 <_Kd+0x1> 1eb5e: 8f 93 push r24 1eb60: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 <_Kd> 1eb64: 8f 93 push r24 1eb66: 80 91 d9 03 lds r24, 0x03D9 ; 0x8003d9 <_Ki+0x3> 1eb6a: 8f 93 push r24 1eb6c: 80 91 d8 03 lds r24, 0x03D8 ; 0x8003d8 <_Ki+0x2> 1eb70: 8f 93 push r24 1eb72: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_Ki+0x1> 1eb76: 8f 93 push r24 1eb78: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 <_Ki> 1eb7c: 8f 93 push r24 1eb7e: 0f 93 push r16 1eb80: 1f 93 push r17 1eb82: 9b 81 ldd r25, Y+3 ; 0x03 1eb84: 9f 93 push r25 1eb86: 29 81 ldd r18, Y+1 ; 0x01 1eb88: 2f 93 push r18 1eb8a: 8b ed ldi r24, 0xDB ; 219 1eb8c: 95 e8 ldi r25, 0x85 ; 133 1eb8e: 9f 93 push r25 1eb90: 8f 93 push r24 1eb92: 0e 94 2b 8e call 0x11c56 ; 0x11c56 enquecommand_P(MSG_M500); 1eb96: 61 e0 ldi r22, 0x01 ; 1 1eb98: 87 e7 ldi r24, 0x77 ; 119 1eb9a: 99 e6 ldi r25, 0x69 ; 105 1eb9c: 0e 94 65 8d call 0x11aca ; 0x11aca 1eba0: 0f b6 in r0, 0x3f ; 63 1eba2: f8 94 cli 1eba4: de bf out 0x3e, r29 ; 62 1eba6: 0f be out 0x3f, r0 ; 63 1eba8: cd bf out 0x3d, r28 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 1ebaa: 8f ec ldi r24, 0xCF ; 207 1ebac: 93 e0 ldi r25, 0x03 ; 3 1ebae: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> lcd_commands_step = 1; 1ebb2: 81 e0 ldi r24, 0x01 ; 1 1ebb4: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 1ebb8: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1ebbc: 81 30 cpi r24, 0x01 ; 1 1ebbe: d9 f4 brne .+54 ; 0x1ebf6 1ebc0: 60 ed ldi r22, 0xD0 ; 208 1ebc2: 77 e0 ldi r23, 0x07 ; 7 1ebc4: 8f ec ldi r24, 0xCF ; 207 1ebc6: 93 e0 ldi r25, 0x03 ; 3 1ebc8: 0f 94 30 0b call 0x21660 ; 0x21660 ::expired(unsigned short)> 1ebcc: 88 23 and r24, r24 1ebce: 99 f0 breq .+38 ; 0x1ebf6 lcd_setstatuspgm(MSG_WELCOME); 1ebd0: 8a e8 ldi r24, 0x8A ; 138 1ebd2: 9c e6 ldi r25, 0x6C ; 108 1ebd4: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe custom_message_type = CustomMsg::Status; 1ebd8: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d pid_temp = DEFAULT_PID_TEMP; 1ebdc: 82 ed ldi r24, 0xD2 ; 210 1ebde: 90 e0 ldi r25, 0x00 ; 0 1ebe0: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f 1ebe4: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e lcd_commands_step = 0; 1ebe8: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_commands_type = LcdCommands::Idle; 1ebec: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1ebf0: 82 e0 ldi r24, 0x02 ; 2 1ebf2: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.385> break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 1ebf6: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1ebfa: 85 30 cpi r24, 0x05 ; 5 1ebfc: e9 f4 brne .+58 ; 0x1ec38 1ebfe: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1ec02: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 1ec06: 98 13 cpse r25, r24 1ec08: 17 c0 rjmp .+46 ; 0x1ec38 1ec0a: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1ec0e: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1ec12: 89 2b or r24, r25 1ec14: 89 f4 brne .+34 ; 0x1ec38 1ec16: 80 91 73 12 lds r24, 0x1273 ; 0x801273 1ec1a: 81 11 cpse r24, r1 1ec1c: 0d c0 rjmp .+26 ; 0x1ec38 #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) 1ec1e: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1ec22: 81 30 cpi r24, 0x01 ; 1 1ec24: 09 f4 brne .+2 ; 0x1ec28 1ec26: f8 c1 rjmp .+1008 ; 0x1f018 1ec28: 08 f4 brcc .+2 ; 0x1ec2c 1ec2a: c6 c1 rjmp .+908 ; 0x1efb8 1ec2c: 82 30 cpi r24, 0x02 ; 2 1ec2e: 09 f4 brne .+2 ; 0x1ec32 1ec30: de c1 rjmp .+956 ; 0x1efee 1ec32: 83 30 cpi r24, 0x03 ; 3 1ec34: 09 f4 brne .+2 ; 0x1ec38 1ec36: c4 c1 rjmp .+904 ; 0x1efc0 menu_depth = 3; break; } } } } 1ec38: 0f 90 pop r0 1ec3a: 0f 90 pop r0 1ec3c: 0f 90 pop r0 1ec3e: 0f 90 pop r0 1ec40: 0f 90 pop r0 1ec42: df 91 pop r29 1ec44: cf 91 pop r28 1ec46: 1f 91 pop r17 1ec48: 0f 91 pop r16 1ec4a: ff 90 pop r15 1ec4c: ef 90 pop r14 1ec4e: df 90 pop r13 1ec50: cf 90 pop r12 1ec52: bf 90 pop r11 1ec54: af 90 pop r10 1ec56: 9f 90 pop r9 1ec58: 8f 90 pop r8 1ec5a: 7f 90 pop r7 1ec5c: 6f 90 pop r6 1ec5e: 5f 90 pop r5 1ec60: 4f 90 pop r4 1ec62: 3f 90 pop r3 1ec64: 2f 90 pop r2 1ec66: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 1ec68: 0e 94 81 70 call 0xe102 ; 0xe102 menu_depth = 0; 1ec6c: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df menu_submenu(lcd_babystep_z, true); 1ec70: 61 e0 ldi r22, 0x01 ; 1 1ec72: 83 e5 ldi r24, 0x53 ; 83 1ec74: 95 ed ldi r25, 0xD5 ; 213 1ec76: 0e 94 38 63 call 0xc670 ; 0xc670 cmd_intro_mmu_10, cmd_intro_mmu_11, cmd_intro_mmu_12, }; if (MMU2::mmu2.Enabled()) 1ec7a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1ec7e: 81 30 cpi r24, 0x01 ; 1 1ec80: f1 f4 brne .+60 ; 0x1ecbe { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i) 1ec82: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 1ec86: 10 e0 ldi r17, 0x00 ; 0 1ec88: 81 11 cpse r24, r1 1ec8a: 01 c0 rjmp .+2 ; 0x1ec8e 1ec8c: 12 e0 ldi r17, 0x02 ; 2 1ec8e: 21 2f mov r18, r17 1ec90: 30 e0 ldi r19, 0x00 ; 0 1ec92: 22 0f add r18, r18 1ec94: 33 1f adc r19, r19 1ec96: 26 5b subi r18, 0xB6 ; 182 1ec98: 3a 47 sbci r19, 0x7A ; 122 1ec9a: 3a 83 std Y+2, r19 ; 0x02 1ec9c: 29 83 std Y+1, r18 ; 0x01 { enquecommand_P(static_cast(pgm_read_ptr(&intro_mmu_cmd[i]))); 1ec9e: e9 81 ldd r30, Y+1 ; 0x01 1eca0: fa 81 ldd r31, Y+2 ; 0x02 1eca2: 85 91 lpm r24, Z+ 1eca4: 94 91 lpm r25, Z 1eca6: 61 e0 ldi r22, 0x01 ; 1 1eca8: 0e 94 65 8d call 0x11aca ; 0x11aca cmd_intro_mmu_12, }; if (MMU2::mmu2.Enabled()) { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i) 1ecac: 1f 5f subi r17, 0xFF ; 255 1ecae: 89 81 ldd r24, Y+1 ; 0x01 1ecb0: 9a 81 ldd r25, Y+2 ; 0x02 1ecb2: 02 96 adiw r24, 0x02 ; 2 1ecb4: 9a 83 std Y+2, r25 ; 0x02 1ecb6: 89 83 std Y+1, r24 ; 0x01 1ecb8: 1a 30 cpi r17, 0x0A ; 10 1ecba: 89 f7 brne .-30 ; 0x1ec9e 1ecbc: c3 ce rjmp .-634 ; 0x1ea44 } } else { static const char fmt1[] PROGMEM = "G1 X%d E%-.3f F1000"; enquecommandf_P(fmt1, 60, count_e(layer_height, extrusion_width * 4.f, 60)); 1ecbe: 20 e0 ldi r18, 0x00 ; 0 1ecc0: 30 e0 ldi r19, 0x00 ; 0 1ecc2: 40 e8 ldi r20, 0x80 ; 128 1ecc4: 50 e4 ldi r21, 0x40 ; 64 1ecc6: c7 01 movw r24, r14 1ecc8: b6 01 movw r22, r12 1ecca: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1ecce: 20 e0 ldi r18, 0x00 ; 0 1ecd0: 30 e0 ldi r19, 0x00 ; 0 1ecd2: 40 e7 ldi r20, 0x70 ; 112 1ecd4: 52 e4 ldi r21, 0x42 ; 66 1ecd6: 0f 94 99 78 call 0x2f132 ; 0x2f132 1ecda: 9f 93 push r25 1ecdc: 8f 93 push r24 1ecde: 7f 93 push r23 1ece0: 6f 93 push r22 1ece2: 1f 92 push r1 1ece4: 8c e3 ldi r24, 0x3C ; 60 1ece6: 8f 93 push r24 1ece8: 26 e3 ldi r18, 0x36 ; 54 1ecea: 35 e8 ldi r19, 0x85 ; 133 1ecec: 3f 93 push r19 1ecee: 2f 93 push r18 1ecf0: 0e 94 2b 8e call 0x11c56 ; 0x11c56 enquecommandf_P(fmt1, 100, count_e(layer_height, extrusion_width * 8.f, 40)); 1ecf4: 20 e0 ldi r18, 0x00 ; 0 1ecf6: 30 e0 ldi r19, 0x00 ; 0 1ecf8: 40 e0 ldi r20, 0x00 ; 0 1ecfa: 51 e4 ldi r21, 0x41 ; 65 1ecfc: c7 01 movw r24, r14 1ecfe: b6 01 movw r22, r12 1ed00: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1ed04: 20 e0 ldi r18, 0x00 ; 0 1ed06: 30 e0 ldi r19, 0x00 ; 0 1ed08: 40 e2 ldi r20, 0x20 ; 32 1ed0a: 52 e4 ldi r21, 0x42 ; 66 1ed0c: 0f 94 99 78 call 0x2f132 ; 0x2f132 1ed10: 9f 93 push r25 1ed12: 8f 93 push r24 1ed14: 7f 93 push r23 1ed16: 6f 93 push r22 1ed18: 1f 92 push r1 1ed1a: 84 e6 ldi r24, 0x64 ; 100 1ed1c: 8f 93 push r24 1ed1e: 26 e3 ldi r18, 0x36 ; 54 1ed20: 35 e8 ldi r19, 0x85 ; 133 1ed22: 3f 93 push r19 1ed24: 2f 93 push r18 1ed26: 0e 94 2b 8e call 0x11c56 ; 0x11c56 enquecommand_P(PSTR("G1 F1080")); enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25)); enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25)); enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100)); enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20)); 1ed2a: 0f b6 in r0, 0x3f ; 63 1ed2c: f8 94 cli 1ed2e: de bf out 0x3e, r29 ; 62 1ed30: 0f be out 0x3f, r0 ; 63 1ed32: cd bf out 0x3d, r28 ; 61 1ed34: 87 ce rjmp .-754 ; 0x1ea44 cmd_pre_meander_5, cmd_pre_meander_6, cmd_pre_meander_7, }; lay1cal_common_enqueue_loop(cmd_pre_meander, (sizeof(cmd_pre_meander)/sizeof(cmd_pre_meander[0]))); 1ed36: 67 e0 ldi r22, 0x07 ; 7 1ed38: 88 e2 ldi r24, 0x28 ; 40 1ed3a: 95 e8 ldi r25, 0x85 ; 133 1ed3c: 4c ce rjmp .-872 ; 0x1e9d6 } //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { enquecommand_P(PSTR("G1 X50 Y155")); 1ed3e: 61 e0 ldi r22, 0x01 ; 1 1ed40: 8c e1 ldi r24, 0x1C ; 28 1ed42: 95 e8 ldi r25, 0x85 ; 133 1ed44: 0e 94 65 8d call 0x11aca ; 0x11aca static const char fmt1[] PROGMEM = "G1 Z%-.3f F7200"; enquecommandf_P(fmt1, layer_height); 1ed48: 8e e3 ldi r24, 0x3E ; 62 1ed4a: 8f 93 push r24 1ed4c: 8c e4 ldi r24, 0x4C ; 76 1ed4e: 8f 93 push r24 1ed50: 8c ec ldi r24, 0xCC ; 204 1ed52: 8f 93 push r24 1ed54: 8d ec ldi r24, 0xCD ; 205 1ed56: 8f 93 push r24 1ed58: 8c e0 ldi r24, 0x0C ; 12 1ed5a: 95 e8 ldi r25, 0x85 ; 133 1ed5c: 9f 93 push r25 1ed5e: 8f 93 push r24 1ed60: 0e 94 2b 8e call 0x11c56 ; 0x11c56 enquecommand_P(PSTR("G1 F1080")); 1ed64: 61 e0 ldi r22, 0x01 ; 1 1ed66: 83 e0 ldi r24, 0x03 ; 3 1ed68: 95 e8 ldi r25, 0x85 ; 133 1ed6a: 0e 94 65 8d call 0x11aca ; 0x11aca enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25)); 1ed6e: 20 e0 ldi r18, 0x00 ; 0 1ed70: 30 e0 ldi r19, 0x00 ; 0 1ed72: 40 e8 ldi r20, 0x80 ; 128 1ed74: 50 e4 ldi r21, 0x40 ; 64 1ed76: c7 01 movw r24, r14 1ed78: b6 01 movw r22, r12 1ed7a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1ed7e: 20 e0 ldi r18, 0x00 ; 0 1ed80: 30 e0 ldi r19, 0x00 ; 0 1ed82: 48 ec ldi r20, 0xC8 ; 200 1ed84: 51 e4 ldi r21, 0x41 ; 65 1ed86: 0f 94 99 78 call 0x2f132 ; 0x2f132 1ed8a: 9f 93 push r25 1ed8c: 8f 93 push r24 1ed8e: 7f 93 push r23 1ed90: 6f 93 push r22 1ed92: 1f 92 push r1 1ed94: 1b e9 ldi r17, 0x9B ; 155 1ed96: 1f 93 push r17 1ed98: 1f 92 push r1 1ed9a: 8b e4 ldi r24, 0x4B ; 75 1ed9c: 8f 93 push r24 1ed9e: 81 ef ldi r24, 0xF1 ; 241 1eda0: 94 e8 ldi r25, 0x84 ; 132 1eda2: 9f 93 push r25 1eda4: 8f 93 push r24 1eda6: 0e 94 2b 8e call 0x11c56 ; 0x11c56 enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25)); 1edaa: a7 01 movw r20, r14 1edac: 96 01 movw r18, r12 1edae: c7 01 movw r24, r14 1edb0: b6 01 movw r22, r12 1edb2: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1edb6: 20 e0 ldi r18, 0x00 ; 0 1edb8: 30 e0 ldi r19, 0x00 ; 0 1edba: 48 ec ldi r20, 0xC8 ; 200 1edbc: 51 e4 ldi r21, 0x41 ; 65 1edbe: 0f 94 99 78 call 0x2f132 ; 0x2f132 1edc2: 9f 93 push r25 1edc4: 8f 93 push r24 1edc6: 7f 93 push r23 1edc8: 6f 93 push r22 1edca: 1f 92 push r1 1edcc: 1f 93 push r17 1edce: 1f 92 push r1 1edd0: 84 e6 ldi r24, 0x64 ; 100 1edd2: 8f 93 push r24 1edd4: 81 ef ldi r24, 0xF1 ; 241 1edd6: 94 e8 ldi r25, 0x84 ; 132 1edd8: 9f 93 push r25 1edda: 8f 93 push r24 1eddc: 0e 94 2b 8e call 0x11c56 ; 0x11c56 enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100)); 1ede0: 20 e0 ldi r18, 0x00 ; 0 1ede2: 30 e0 ldi r19, 0x00 ; 0 1ede4: 48 ec ldi r20, 0xC8 ; 200 1ede6: 52 e4 ldi r21, 0x42 ; 66 1ede8: c7 01 movw r24, r14 1edea: b6 01 movw r22, r12 1edec: 0f 94 99 78 call 0x2f132 ; 0x2f132 1edf0: 9f 93 push r25 1edf2: 8f 93 push r24 1edf4: 7f 93 push r23 1edf6: 6f 93 push r22 1edf8: 1f 92 push r1 1edfa: 1f 93 push r17 1edfc: 1f 92 push r1 1edfe: 18 ec ldi r17, 0xC8 ; 200 1ee00: 1f 93 push r17 1ee02: 81 ef ldi r24, 0xF1 ; 241 1ee04: 94 e8 ldi r25, 0x84 ; 132 1ee06: 9f 93 push r25 1ee08: 8f 93 push r24 1ee0a: 0e 94 2b 8e call 0x11c56 ; 0x11c56 enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20)); 1ee0e: 0f b6 in r0, 0x3f ; 63 1ee10: f8 94 cli 1ee12: de bf out 0x3e, r29 ; 62 1ee14: 0f be out 0x3f, r0 ; 63 1ee16: cd bf out 0x3d, r28 ; 61 1ee18: 20 e0 ldi r18, 0x00 ; 0 1ee1a: 30 e0 ldi r19, 0x00 ; 0 1ee1c: 40 ea ldi r20, 0xA0 ; 160 1ee1e: 51 e4 ldi r21, 0x41 ; 65 1ee20: c7 01 movw r24, r14 1ee22: b6 01 movw r22, r12 1ee24: 0f 94 99 78 call 0x2f132 ; 0x2f132 1ee28: 9f 93 push r25 1ee2a: 8f 93 push r24 1ee2c: 7f 93 push r23 1ee2e: 6f 93 push r22 1ee30: 1f 92 push r1 1ee32: 87 e8 ldi r24, 0x87 ; 135 1ee34: 8f 93 push r24 1ee36: 1f 92 push r1 1ee38: 1f 93 push r17 1ee3a: 21 ef ldi r18, 0xF1 ; 241 1ee3c: 34 e8 ldi r19, 0x84 ; 132 1ee3e: 3f 93 push r19 1ee40: 2f 93 push r18 1ee42: 0e 94 2b 8e call 0x11c56 ; 0x11c56 1ee46: 71 cf rjmp .-286 ; 0x1ed2a //! @param cmd_buffer character buffer needed to format gcodes void lay1cal_meander(float layer_height, float extrusion_width) { const float short_length = 20; float long_length = 150; const float long_extrusion = count_e(layer_height, extrusion_width, long_length); 1ee48: 20 e0 ldi r18, 0x00 ; 0 1ee4a: 30 e0 ldi r19, 0x00 ; 0 1ee4c: 46 e1 ldi r20, 0x16 ; 22 1ee4e: 53 e4 ldi r21, 0x43 ; 67 1ee50: c7 01 movw r24, r14 1ee52: b6 01 movw r22, r12 1ee54: 0f 94 99 78 call 0x2f132 ; 0x2f132 1ee58: 56 2e mov r5, r22 1ee5a: 47 2e mov r4, r23 1ee5c: 38 2e mov r3, r24 1ee5e: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 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: c7 01 movw r24, r14 1ee6a: b6 01 movw r22, r12 1ee6c: 0f 94 99 78 call 0x2f132 ; 0x2f132 1ee70: 6b 83 std Y+3, r22 ; 0x03 1ee72: c7 2e mov r12, r23 1ee74: 78 2e mov r7, r24 1ee76: 69 2e mov r6, r25 1ee78: 85 e0 ldi r24, 0x05 ; 5 1ee7a: d8 2e mov r13, r24 //! @brief Print meander //! @param cmd_buffer character buffer needed to format gcodes void lay1cal_meander(float layer_height, float extrusion_width) { const float short_length = 20; float long_length = 150; 1ee7c: 81 2c mov r8, r1 1ee7e: 91 2c mov r9, r1 1ee80: 96 e1 ldi r25, 0x16 ; 22 1ee82: a9 2e mov r10, r25 1ee84: 93 e4 ldi r25, 0x43 ; 67 1ee86: b9 2e mov r11, r25 const float long_extrusion = count_e(layer_height, extrusion_width, long_length); const float short_extrusion = count_e(layer_height, extrusion_width, short_length); uint8_t y_pos = 135; uint8_t x_pos = 50; 1ee88: 32 e3 ldi r19, 0x32 ; 50 1ee8a: 3c 83 std Y+4, r19 ; 0x04 const float short_length = 20; float long_length = 150; const float long_extrusion = count_e(layer_height, extrusion_width, long_length); const float short_extrusion = count_e(layer_height, extrusion_width, short_length); uint8_t y_pos = 135; 1ee8c: 87 e8 ldi r24, 0x87 ; 135 1ee8e: 8d 83 std Y+5, r24 ; 0x05 uint8_t x_pos = 50; for(uint8_t i = 0; i <= 4; ++i) { enquecommandf_P(extrude_fmt, x_pos, y_pos, long_extrusion); 1ee90: 01 ef ldi r16, 0xF1 ; 241 1ee92: 14 e8 ldi r17, 0x84 ; 132 1ee94: 9d 81 ldd r25, Y+5 ; 0x05 1ee96: e9 2e mov r14, r25 1ee98: f1 2c mov r15, r1 1ee9a: 3c 81 ldd r19, Y+4 ; 0x04 1ee9c: 23 2f mov r18, r19 1ee9e: 30 e0 ldi r19, 0x00 ; 0 1eea0: 3a 83 std Y+2, r19 ; 0x02 1eea2: 29 83 std Y+1, r18 ; 0x01 1eea4: 2f 92 push r2 1eea6: 3f 92 push r3 1eea8: 4f 92 push r4 1eeaa: 5f 92 push r5 1eeac: 1f 92 push r1 1eeae: 9f 93 push r25 1eeb0: 1f 92 push r1 1eeb2: 8c 81 ldd r24, Y+4 ; 0x04 1eeb4: 8f 93 push r24 1eeb6: 1f 93 push r17 1eeb8: 0f 93 push r16 1eeba: 0e 94 2b 8e call 0x11c56 ; 0x11c56 y_pos -= short_length; 1eebe: b7 01 movw r22, r14 1eec0: ff 0c add r15, r15 1eec2: 88 0b sbc r24, r24 1eec4: 99 0b sbc r25, r25 1eec6: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1eeca: 20 e0 ldi r18, 0x00 ; 0 1eecc: 30 e0 ldi r19, 0x00 ; 0 1eece: 40 ea ldi r20, 0xA0 ; 160 1eed0: 51 e4 ldi r21, 0x41 ; 65 1eed2: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1eed6: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 1eeda: 6d 83 std Y+5, r22 ; 0x05 enquecommandf_P(extrude_fmt, x_pos, y_pos, short_extrusion); 1eedc: 6f 92 push r6 1eede: 7f 92 push r7 1eee0: cf 92 push r12 1eee2: 9b 81 ldd r25, Y+3 ; 0x03 1eee4: 9f 93 push r25 1eee6: 1f 92 push r1 1eee8: 2d 81 ldd r18, Y+5 ; 0x05 1eeea: 2f 93 push r18 1eeec: 1f 92 push r1 1eeee: 3c 81 ldd r19, Y+4 ; 0x04 1eef0: 3f 93 push r19 1eef2: 1f 93 push r17 1eef4: 0f 93 push r16 1eef6: 0e 94 2b 8e call 0x11c56 ; 0x11c56 x_pos += long_length; 1eefa: 29 81 ldd r18, Y+1 ; 0x01 1eefc: 3a 81 ldd r19, Y+2 ; 0x02 1eefe: b9 01 movw r22, r18 1ef00: 33 0f add r19, r19 1ef02: 88 0b sbc r24, r24 1ef04: 99 0b sbc r25, r25 1ef06: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1ef0a: a5 01 movw r20, r10 1ef0c: 94 01 movw r18, r8 1ef0e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1ef12: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 1ef16: 6c 83 std Y+4, r22 ; 0x04 long_length = -long_length; 1ef18: b7 fa bst r11, 7 1ef1a: b0 94 com r11 1ef1c: b7 f8 bld r11, 7 1ef1e: b0 94 com r11 1ef20: da 94 dec r13 const float long_extrusion = count_e(layer_height, extrusion_width, long_length); const float short_extrusion = count_e(layer_height, extrusion_width, short_length); uint8_t y_pos = 135; uint8_t x_pos = 50; for(uint8_t i = 0; i <= 4; ++i) 1ef22: 0f b6 in r0, 0x3f ; 63 1ef24: f8 94 cli 1ef26: de bf out 0x3e, r29 ; 62 1ef28: 0f be out 0x3f, r0 ; 63 1ef2a: cd bf out 0x3d, r28 ; 61 1ef2c: d1 10 cpse r13, r1 1ef2e: b2 cf rjmp .-156 ; 0x1ee94 1ef30: 89 cd rjmp .-1262 ; 0x1ea44 break; case 7: lay1cal_meander(layer_height, extrusion_width); break; case 6: lay1cal_square(0, layer_height, extrusion_width); 1ef32: b7 01 movw r22, r14 1ef34: a6 01 movw r20, r12 1ef36: 80 e0 ldi r24, 0x00 ; 0 break; case 4: lay1cal_square(8, layer_height, extrusion_width); break; case 3: lay1cal_square(12, layer_height, extrusion_width); 1ef38: 0f 94 c0 78 call 0x2f180 ; 0x2f180 1ef3c: 83 cd rjmp .-1274 ; 0x1ea44 break; case 6: lay1cal_square(0, layer_height, extrusion_width); break; case 5: lay1cal_square(4, layer_height, extrusion_width); 1ef3e: b7 01 movw r22, r14 1ef40: a6 01 movw r20, r12 1ef42: 84 e0 ldi r24, 0x04 ; 4 1ef44: f9 cf rjmp .-14 ; 0x1ef38 break; case 4: lay1cal_square(8, layer_height, extrusion_width); 1ef46: b7 01 movw r22, r14 1ef48: a6 01 movw r20, r12 1ef4a: 88 e0 ldi r24, 0x08 ; 8 1ef4c: f5 cf rjmp .-22 ; 0x1ef38 break; case 3: lay1cal_square(12, layer_height, extrusion_width); 1ef4e: b7 01 movw r22, r14 1ef50: a6 01 movw r20, r12 1ef52: 8c e0 ldi r24, 0x0C ; 12 1ef54: f1 cf rjmp .-30 ; 0x1ef38 1ef56: 90 91 01 13 lds r25, 0x1301 ; 0x801301 1ef5a: 99 83 std Y+1, r25 ; 0x01 cmd_cal_finish_3, cmd_cal_finish_4, cmd_cal_finish_5 }; lay1cal_common_enqueue_loop(cmd_cal_finish, (sizeof(cmd_cal_finish)/sizeof(cmd_cal_finish[0]))); 1ef5c: 66 e0 ldi r22, 0x06 ; 6 1ef5e: 85 ee ldi r24, 0xE5 ; 229 1ef60: 94 e8 ldi r25, 0x84 ; 132 1ef62: 0e 94 14 8e call 0x11c28 ; 0x11c28 if (mmu_enabled) enquecommand_P(MSG_M702); //unload from nozzle 1ef66: 29 81 ldd r18, Y+1 ; 0x01 1ef68: 21 30 cpi r18, 0x01 ; 1 1ef6a: 29 f4 brne .+10 ; 0x1ef76 1ef6c: 61 e0 ldi r22, 0x01 ; 1 1ef6e: 8c e6 ldi r24, 0x6C ; 108 1ef70: 99 e6 ldi r25, 0x69 ; 105 1ef72: 0e 94 65 8d call 0x11aca ; 0x11aca enquecommand_P(MSG_M84);// disable motors 1ef76: 61 e0 ldi r22, 0x01 ; 1 1ef78: 88 e6 ldi r24, 0x68 ; 104 1ef7a: 99 e6 ldi r25, 0x69 ; 105 1ef7c: 0e 94 65 8d call 0x11aca ; 0x11aca 1ef80: 61 cd rjmp .-1342 ; 0x1ea44 break; case 2: lay1cal_finish(MMU2::mmu2.Enabled()); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 1ef82: 8a e8 ldi r24, 0x8A ; 138 1ef84: 9c e6 ldi r25, 0x6C ; 108 1ef86: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe lcd_commands_step = 0; 1ef8a: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_commands_type = LcdCommands::Idle; 1ef8e: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1ef92: 82 e0 ldi r24, 0x02 ; 2 1ef94: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.385> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1ef98: 8f e5 ldi r24, 0x5F ; 95 1ef9a: 9f e0 ldi r25, 0x0F ; 15 1ef9c: 0f 94 3e a4 call 0x3487c ; 0x3487c 1efa0: 88 23 and r24, r24 1efa2: 09 f4 brne .+2 ; 0x1efa6 1efa4: 28 ce rjmp .-944 ; 0x1ebf6 lcd_wizard(WizState::RepeatLay1Cal); 1efa6: 8b e0 ldi r24, 0x0B ; 11 1efa8: 0e 94 87 e9 call 0x1d30e ; 0x1d30e 1efac: 4b cd rjmp .-1386 ; 0x1ea44 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."); 1efae: 8b ea ldi r24, 0xAB ; 171 1efb0: 95 e8 ldi r25, 0x85 ; 133 1efb2: 0e 94 1f 7b call 0xf63e ; 0xf63e 1efb6: f9 cd rjmp .-1038 ; 0x1ebaa #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 1efb8: 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; 1efba: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 1efbe: 3c ce rjmp .-904 ; 0x1ec38 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)); 1efc0: 83 e8 ldi r24, 0x83 ; 131 1efc2: 9b e4 ldi r25, 0x4B ; 75 1efc4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1efc8: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 enquecommand_P(G28W); 1efcc: 61 e0 ldi r22, 0x01 ; 1 1efce: 81 e7 ldi r24, 0x71 ; 113 1efd0: 99 e6 ldi r25, 0x69 ; 105 1efd2: 0e 94 65 8d call 0x11aca ; 0x11aca enquecommand_P(PSTR("G1 X125 Z200 F1000")); 1efd6: 61 e0 ldi r22, 0x01 ; 1 1efd8: 88 e9 ldi r24, 0x98 ; 152 1efda: 95 e8 ldi r25, 0x85 ; 133 1efdc: 0e 94 65 8d call 0x11aca ; 0x11aca enquecommand_P(PSTR("M109 S280")); 1efe0: 61 e0 ldi r22, 0x01 ; 1 1efe2: 8e e8 ldi r24, 0x8E ; 142 1efe4: 95 e8 ldi r25, 0x85 ; 133 1efe6: 0e 94 65 8d call 0x11aca ; 0x11aca } } enquecommand_P(G28W); //home enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 1efea: 82 e0 ldi r24, 0x02 ; 2 1efec: e6 cf rjmp .-52 ; 0x1efba break; case 2: enquecommand_P(PSTR("M84 XY")); 1efee: 61 e0 ldi r22, 0x01 ; 1 1eff0: 87 e8 ldi r24, 0x87 ; 135 1eff2: 95 e8 ldi r25, 0x85 ; 133 1eff4: 0e 94 65 8d call 0x11aca ; 0x11aca if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 1eff8: 8a e4 ldi r24, 0x4A ; 74 1effa: 9b e4 ldi r25, 0x4B ; 75 1effc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1f000: 41 e0 ldi r20, 0x01 ; 1 1f002: 60 e0 ldi r22, 0x00 ; 0 1f004: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 1f008: 81 11 cpse r24, r1 1f00a: 16 ce rjmp .-980 ; 0x1ec38 1f00c: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1f010: 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; 1f014: 81 e0 ldi r24, 0x01 ; 1 1f016: d1 cf rjmp .-94 ; 0x1efba } break; case 1: lcd_commands_step = 0; 1f018: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_commands_type = LcdCommands::Idle; 1f01c: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1f020: 82 e0 ldi r24, 0x02 ; 2 1f022: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.385> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 1f026: 20 e0 ldi r18, 0x00 ; 0 1f028: 41 e0 ldi r20, 0x01 ; 1 1f02a: 62 e0 ldi r22, 0x02 ; 2 1f02c: 70 e0 ldi r23, 0x00 ; 0 1f02e: 87 e4 ldi r24, 0x47 ; 71 1f030: 9f eb ldi r25, 0xBF ; 191 1f032: 0e 94 12 63 call 0xc624 ; 0xc624 menu_depth = 3; 1f036: 83 e0 ldi r24, 0x03 ; 3 1f038: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df 1f03c: fd cd rjmp .-1030 ; 0x1ec38 0001f03e : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 1f03e: 0f 93 push r16 1f040: 1f 93 push r17 1f042: cf 93 push r28 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 1f044: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f048: 82 fb bst r24, 2 1f04a: 88 27 eor r24, r24 1f04c: 80 f9 bld r24, 0 1f04e: 91 e0 ldi r25, 0x01 ; 1 1f050: 89 27 eor r24, r25 1f052: 90 91 01 04 lds r25, 0x0401 ; 0x800401 1f056: 89 17 cp r24, r25 1f058: 99 f1 breq .+102 ; 0x1f0c0 { if(menu_menu == lcd_sdcard_menu) { 1f05a: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1f05e: 90 91 03 04 lds r25, 0x0403 ; 0x800403 1f062: 80 53 subi r24, 0x30 ; 48 1f064: 94 4e sbci r25, 0xE4 ; 228 1f066: 11 f4 brne .+4 ; 0x1f06c // 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(); 1f068: 0e 94 76 63 call 0xc6ec ; 0xc6ec } lcd_draw_update = 2; 1f06c: 82 e0 ldi r24, 0x02 ; 2 1f06e: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_oldcardstatus = IS_SD_INSERTED; 1f072: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f076: c1 e0 ldi r28, 0x01 ; 1 1f078: 82 fb bst r24, 2 1f07a: 88 27 eor r24, r24 1f07c: 80 f9 bld r24, 0 1f07e: 8c 27 eor r24, r28 1f080: 80 93 01 04 sts 0x0401, r24 ; 0x800401 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 1f084: 0e 94 fa 70 call 0xe1f4 ; 0xe1f4 backlight_wake(); if (lcd_oldcardstatus) 1f088: 80 91 01 04 lds r24, 0x0401 ; 0x800401 1f08c: 88 23 and r24, r24 1f08e: 09 f4 brne .+2 ; 0x1f092 1f090: 88 c0 rjmp .+272 ; 0x1f1a2 { if (!card.mounted) 1f092: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1f096: 81 11 cpse r24, r1 1f098: 04 c0 rjmp .+8 ; 0x1f0a2 { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 1f09a: 0f 94 c5 72 call 0x2e58a ; 0x2e58a card.presort_flag = true; //force sorting of the SD menu 1f09e: c0 93 26 14 sts 0x1426, r28 ; 0x801426 } LCD_MESSAGERPGM(MSG_WELCOME); 1f0a2: 8a e8 ldi r24, 0x8A ; 138 1f0a4: 9c e6 ldi r25, 0x6C ; 108 1f0a6: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 1f0aa: 10 92 c9 03 sts 0x03C9, r1 ; 0x8003c9 menu_submenu(lcd_sdcard_menu, true); 1f0ae: 61 e0 ldi r22, 0x01 ; 1 1f0b0: 80 e3 ldi r24, 0x30 ; 48 1f0b2: 94 ee ldi r25, 0xE4 ; 228 1f0b4: 0e 94 38 63 call 0xc670 ; 0xc670 lcd_timeoutToStatus.start(); 1f0b8: 83 ee ldi r24, 0xE3 ; 227 1f0ba: 93 e0 ldi r25, 0x03 ; 3 1f0bc: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 1f0c0: 0f 94 01 0b call 0x21602 ; 0x21602 1f0c4: 00 91 c5 03 lds r16, 0x03C5 ; 0x8003c5 1f0c8: 10 91 c6 03 lds r17, 0x03C6 ; 0x8003c6 1f0cc: 20 91 c7 03 lds r18, 0x03C7 ; 0x8003c7 1f0d0: 30 91 c8 03 lds r19, 0x03C8 ; 0x8003c8 1f0d4: 06 17 cp r16, r22 1f0d6: 17 07 cpc r17, r23 1f0d8: 28 07 cpc r18, r24 1f0da: 39 07 cpc r19, r25 1f0dc: e8 f5 brcc .+122 ; 0x1f158 { if (lcd_draw_update) { 1f0de: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1f0e2: 88 23 and r24, r24 1f0e4: 31 f0 breq .+12 ; 0x1f0f2 lcd_timeoutToStatus.start(); 1f0e6: 83 ee ldi r24, 0xE3 ; 227 1f0e8: 93 e0 ldi r25, 0x03 ; 3 1f0ea: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> lcd_frame_start(); 1f0ee: 0e 94 41 6f call 0xde82 ; 0xde82 } (*menu_menu)(); 1f0f2: e0 91 02 04 lds r30, 0x0402 ; 0x800402 1f0f6: f0 91 03 04 lds r31, 0x0403 ; 0x800403 1f0fa: 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)))); 1f0fc: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1f100: 90 91 03 04 lds r25, 0x0403 ; 0x800403 1f104: 83 55 subi r24, 0x53 ; 83 1f106: 95 4d sbci r25, 0xD5 ; 213 1f108: 09 f4 brne .+2 ; 0x1f10c 1f10a: 5e c0 rjmp .+188 ; 0x1f1c8 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 1f10c: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1f110: 90 91 03 04 lds r25, 0x0403 ; 0x800403 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1f114: 27 e3 ldi r18, 0x37 ; 55 1f116: 8e 39 cpi r24, 0x9E ; 158 1f118: 92 07 cpc r25, r18 1f11a: 09 f0 breq .+2 ; 0x1f11e 1f11c: 76 c0 rjmp .+236 ; 0x1f20a } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 1f11e: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1f122: 82 30 cpi r24, 0x02 ; 2 1f124: 21 f4 brne .+8 ; 0x1f12e #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 1f126: 0e 94 fa 70 call 0xe1f4 ; 0xe1f4 lcd_status_message_idx = 0; // Re-draw message from beginning 1f12a: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.418> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 1f12e: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1f132: 88 23 and r24, r24 1f134: 19 f0 breq .+6 ; 0x1f13c 1f136: 81 50 subi r24, 0x01 ; 1 1f138: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 1f13c: 0f 94 01 0b call 0x21602 ; 0x21602 1f140: 6c 59 subi r22, 0x9C ; 156 1f142: 7f 4f sbci r23, 0xFF ; 255 1f144: 8f 4f sbci r24, 0xFF ; 255 1f146: 9f 4f sbci r25, 0xFF ; 255 1f148: 60 93 c5 03 sts 0x03C5, r22 ; 0x8003c5 1f14c: 70 93 c6 03 sts 0x03C6, r23 ; 0x8003c6 1f150: 80 93 c7 03 sts 0x03C7, r24 ; 0x8003c7 1f154: 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))) { 1f158: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1f15c: 88 23 and r24, r24 1f15e: 99 f0 breq .+38 ; 0x1f186 1f160: 80 91 08 04 lds r24, 0x0408 ; 0x800408 <_ZL11no_response.lto_priv.491> 1f164: 88 23 and r24, r24 1f166: 79 f0 breq .+30 ; 0x1f186 1f168: 60 e1 ldi r22, 0x10 ; 16 1f16a: 77 e2 ldi r23, 0x27 ; 39 1f16c: 81 ec ldi r24, 0xC1 ; 193 1f16e: 93 e0 ldi r25, 0x03 ; 3 1f170: 0f 94 30 0b call 0x21660 ; 0x21660 ::expired(unsigned short)> 1f174: 88 23 and r24, r24 1f176: 39 f0 breq .+14 ; 0x1f186 //send important status messages periodicaly prusa_statistics(8); 1f178: 88 e0 ldi r24, 0x08 ; 8 1f17a: 0f 94 a0 2f call 0x25f40 ; 0x25f40 NcTime.start(); 1f17e: 81 ec ldi r24, 0xC1 ; 193 1f180: 93 e0 ldi r25, 0x03 ; 3 1f182: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 1f186: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1f18a: 84 30 cpi r24, 0x04 ; 4 1f18c: 09 f0 breq .+2 ; 0x1f190 1f18e: 54 c0 rjmp .+168 ; 0x1f238 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) { 1f190: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 1f194: 81 11 cpse r24, r1 1f196: 50 c0 rjmp .+160 ; 0x1f238 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(); } 1f198: cf 91 pop r28 1f19a: 1f 91 pop r17 1f19c: 0f 91 pop r16 1f19e: 0c 94 92 f3 jmp 0x1e724 ; 0x1e724 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 1f1a2: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 mounted = false; 1f1a6: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 SERIAL_ECHO_START; 1f1aa: 84 ee ldi r24, 0xE4 ; 228 1f1ac: 92 ea ldi r25, 0xA2 ; 162 1f1ae: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 1f1b2: 88 e4 ldi r24, 0x48 ; 72 1f1b4: 99 e6 ldi r25, 0x69 ; 105 1f1b6: 0e 94 18 7d call 0xfa30 ; 0xfa30 lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 1f1ba: 83 ef ldi r24, 0xF3 ; 243 1f1bc: 9a e4 ldi r25, 0x4A ; 74 1f1be: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1f1c2: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe 1f1c6: 7c cf rjmp .-264 ; 0x1f0c0 // 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)))); 1f1c8: 0e 94 aa 66 call 0xcd54 ; 0xcd54 1f1cc: 81 11 cpse r24, r1 1f1ce: 0e c0 rjmp .+28 ; 0x1f1ec 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) 1f1d0: e0 91 02 04 lds r30, 0x0402 ; 0x800402 1f1d4: f0 91 03 04 lds r31, 0x0403 ; 0x800403 1f1d8: 30 97 sbiw r30, 0x00 ; 0 1f1da: 39 f5 brne .+78 ; 0x1f22a { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 1f1dc: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_return_to_status(); 1f1e0: 0f 94 18 05 call 0x20a30 ; 0x20a30 lcd_draw_update = 2; 1f1e4: 82 e0 ldi r24, 0x02 ; 2 1f1e6: 80 93 59 02 sts 0x0259, r24 ; 0x800259 1f1ea: 99 cf rjmp .-206 ; 0x1f11e // 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)))); 1f1ec: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1f1f0: 81 11 cpse r24, r1 1f1f2: 8c cf rjmp .-232 ; 0x1f10c 1f1f4: 40 e9 ldi r20, 0x90 ; 144 1f1f6: 5f e5 ldi r21, 0x5F ; 95 1f1f8: 61 e0 ldi r22, 0x01 ; 1 1f1fa: 70 e0 ldi r23, 0x00 ; 0 1f1fc: 83 ee ldi r24, 0xE3 ; 227 1f1fe: 93 e0 ldi r25, 0x03 ; 3 1f200: 0f 94 6b 0b call 0x216d6 ; 0x216d6 ::expired(unsigned long)> 1f204: 81 11 cpse r24, r1 1f206: e4 cf rjmp .-56 ; 0x1f1d0 1f208: 81 cf rjmp .-254 ; 0x1f10c } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 1f20a: 83 55 subi r24, 0x53 ; 83 1f20c: 95 4d sbci r25, 0xD5 ; 213 1f20e: 09 f4 brne .+2 ; 0x1f212 1f210: 86 cf rjmp .-244 ; 0x1f11e && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1f212: 40 e3 ldi r20, 0x30 ; 48 1f214: 55 e7 ldi r21, 0x75 ; 117 1f216: 60 e0 ldi r22, 0x00 ; 0 1f218: 70 e0 ldi r23, 0x00 ; 0 1f21a: 83 ee ldi r24, 0xE3 ; 227 1f21c: 93 e0 ldi r25, 0x03 ; 3 1f21e: 0f 94 6b 0b call 0x216d6 ; 0x216d6 ::expired(unsigned long)> 1f222: 88 23 and r24, r24 1f224: 09 f4 brne .+2 ; 0x1f228 1f226: 7b cf rjmp .-266 ; 0x1f11e 1f228: d3 cf rjmp .-90 ; 0x1f1d0 // 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; 1f22a: 81 e0 ldi r24, 0x01 ; 1 1f22c: 80 93 c4 03 sts 0x03C4, r24 ; 0x8003c4 (*menu_menu)(); 1f230: 19 95 eicall menu_leaving = 0; 1f232: 10 92 c4 03 sts 0x03C4, r1 ; 0x8003c4 1f236: d2 cf rjmp .-92 ; 0x1f1dc 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(); } 1f238: cf 91 pop r28 1f23a: 1f 91 pop r17 1f23c: 0f 91 pop r16 1f23e: 08 95 ret 0001f240 : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 1f240: 87 e1 ldi r24, 0x17 ; 23 1f242: 0e 94 46 d5 call 0x1aa8c ; 0x1aa8c 1f246: 81 11 cpse r24, r1 1f248: 06 c0 rjmp .+12 ; 0x1f256 // calibration already performed: ask before clearing the previous status result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_WIZARD_RERUN), false); } if (result) { calibration_status_clear(CALIBRATION_WIZARD_STEPS); 1f24a: 87 e1 ldi r24, 0x17 ; 23 1f24c: 0e 94 e4 d4 call 0x1a9c8 ; 0x1a9c8 lcd_wizard(WizState::Run); 1f250: 80 e0 ldi r24, 0x00 ; 0 1f252: 0c 94 87 e9 jmp 0x1d30e ; 0x1d30e 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_yes_no_and_wait_P(_T(MSG_WIZARD_RERUN), false); 1f256: 81 e3 ldi r24, 0x31 ; 49 1f258: 9d e3 ldi r25, 0x3D ; 61 1f25a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1f25e: 41 e0 ldi r20, 0x01 ; 1 1f260: 60 e0 ldi r22, 0x00 ; 0 1f262: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 } if (result) { 1f266: 88 23 and r24, r24 1f268: 81 f3 breq .-32 ; 0x1f24a calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 1f26a: 0f 94 18 05 call 0x20a30 ; 0x20a30 lcd_update_enable(true); 1f26e: 81 e0 ldi r24, 0x01 ; 1 1f270: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_update(2); 1f274: 82 e0 ldi r24, 0x02 ; 2 1f276: 0c 94 54 6f jmp 0xdea8 ; 0xdea8 0001f27a : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 1f27a: cf 93 push r28 1f27c: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 1f27e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d disable_x(); 1f282: 17 9a sbi 0x02, 7 ; 2 1f284: 10 92 39 06 sts 0x0639, r1 ; 0x800639 disable_y(); 1f288: 16 9a sbi 0x02, 6 ; 2 1f28a: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a disable_z(); disable_e0(); 1f28e: 14 9a sbi 0x02, 4 ; 2 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1f290: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 1f294: 10 92 59 12 sts 0x1259, r1 ; 0x801259 1f298: 68 2f mov r22, r24 1f29a: 86 ea ldi r24, 0xA6 ; 166 1f29c: 9f e0 ldi r25, 0x0F ; 15 1f29e: 0f 94 62 a4 call 0x348c4 ; 0x348c4 1f2a2: 6c 2f mov r22, r28 1f2a4: 8f ea ldi r24, 0xAF ; 175 1f2a6: 9f e0 ldi r25, 0x0F ; 15 1f2a8: 0f 94 62 a4 call 0x348c4 ; 0x348c4 // 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) { 1f2ac: cc 23 and r28, r28 1f2ae: 89 f0 breq .+34 ; 0x1f2d2 SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 1f2b0: 8a e9 ldi r24, 0x9A ; 154 1f2b2: 93 e8 ldi r25, 0x83 ; 131 1f2b4: 0e 94 18 7d call 0xfa30 ; 0xfa30 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 1f2b8: 81 e4 ldi r24, 0x41 ; 65 1f2ba: 9c e3 ldi r25, 0x3C ; 60 } else { SERIAL_ECHOLNPGM("PINDA calibration failed. Continue with pressing the knob."); lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 1f2bc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1f2c0: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 } lcd_update_enable(true); 1f2c4: 81 e0 ldi r24, 0x01 ; 1 1f2c6: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_update(2); 1f2ca: 82 e0 ldi r24, 0x02 ; 2 } 1f2cc: 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); 1f2ce: 0c 94 54 6f jmp 0xdea8 ; 0xdea8 if (result) { SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); } else { SERIAL_ECHOLNPGM("PINDA calibration failed. Continue with pressing the knob."); 1f2d2: 8f e5 ldi r24, 0x5F ; 95 1f2d4: 93 e8 ldi r25, 0x83 ; 131 1f2d6: 0e 94 18 7d call 0xfa30 ; 0xfa30 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 1f2da: 86 e2 ldi r24, 0x26 ; 38 1f2dc: 9c e3 ldi r25, 0x3C ; 60 1f2de: ee cf rjmp .-36 ; 0x1f2bc 0001f2e0 : // 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) { 1f2e0: 9f 92 push r9 1f2e2: af 92 push r10 1f2e4: bf 92 push r11 1f2e6: cf 92 push r12 1f2e8: df 92 push r13 1f2ea: ef 92 push r14 1f2ec: ff 92 push r15 1f2ee: 0f 93 push r16 1f2f0: 1f 93 push r17 1f2f2: cf 93 push r28 1f2f4: df 93 push r29 1f2f6: 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; 1f2f8: 10 92 69 12 sts 0x1269, r1 ; 0x801269 1f2fc: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 1f300: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 1f304: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c plan_set_position_curposXYZE(); 1f308: 0f 94 68 48 call 0x290d0 ; 0x290d0 // Until confirmed by the confirmation dialog. for (;;) { const char *msg = only_z ? _T(MSG_MOVE_CARRIAGE_TO_THE_TOP_Z) 1f30c: 85 ec ldi r24, 0xC5 ; 197 1f30e: 9b e3 ldi r25, 0x3B ; 59 1f310: 91 10 cpse r9, r1 1f312: 02 c0 rjmp .+4 ; 0x1f318 1f314: 82 e6 ldi r24, 0x62 ; 98 1f316: 9b e3 ldi r25, 0x3B ; 59 1f318: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1f31c: b8 2e mov r11, r24 1f31e: a9 2e mov r10, r25 : _T(MSG_MOVE_CARRIAGE_TO_THE_TOP); const char *msg_next = lcd_display_message_fullscreen_P(msg); 1f320: 0e 94 94 de call 0x1bd28 ; 0x1bd28 1f324: 8c 01 movw r16, r24 const bool multi_screen = msg_next != NULL; unsigned long previous_millis_msg = _millis(); 1f326: 0f 94 01 0b call 0x21602 ; 0x21602 1f32a: 6b 01 movw r12, r22 1f32c: 7c 01 movw r14, r24 // Until the user finishes the z up movement. lcd_encoder = 0; 1f32e: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1f332: 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); 1f336: 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(); 1f338: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 1f33c: 81 e0 ldi r24, 0x01 ; 1 1f33e: 0e 94 b0 8a call 0x11560 ; 0x11560 if (lcd_encoder) { 1f342: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1f346: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1f34a: 89 2b or r24, r25 1f34c: d9 f1 breq .+118 ; 0x1f3c4 _delay(50); 1f34e: 62 e3 ldi r22, 0x32 ; 50 1f350: 70 e0 ldi r23, 0x00 ; 0 1f352: 80 e0 ldi r24, 0x00 ; 0 1f354: 90 e0 ldi r25, 0x00 ; 0 1f356: 0f 94 ce 0a call 0x2159c ; 0x2159c 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; 1f35a: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e if (++ next_block_index == BLOCK_BUFFER_SIZE) 1f35e: 8f 5f subi r24, 0xFF ; 255 1f360: 80 31 cpi r24, 0x10 ; 16 1f362: 09 f4 brne .+2 ; 0x1f366 next_block_index = 0; 1f364: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 1f366: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f if (! planner_queue_full()) { 1f36a: 98 17 cp r25, r24 1f36c: 59 f1 breq .+86 ; 0x1f3c4 // Only move up, whatever direction the user rotates the encoder. current_position[Z_AXIS] += abs(lcd_encoder); 1f36e: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 1f372: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 1f376: 77 ff sbrs r23, 7 1f378: 03 c0 rjmp .+6 ; 0x1f380 1f37a: 71 95 neg r23 1f37c: 61 95 neg r22 1f37e: 71 09 sbc r23, r1 1f380: 07 2e mov r0, r23 1f382: 00 0c add r0, r0 1f384: 88 0b sbc r24, r24 1f386: 99 0b sbc r25, r25 1f388: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1f38c: 20 91 69 12 lds r18, 0x1269 ; 0x801269 1f390: 30 91 6a 12 lds r19, 0x126A ; 0x80126a 1f394: 40 91 6b 12 lds r20, 0x126B ; 0x80126b 1f398: 50 91 6c 12 lds r21, 0x126C ; 0x80126c 1f39c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1f3a0: 60 93 69 12 sts 0x1269, r22 ; 0x801269 1f3a4: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 1f3a8: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 1f3ac: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c lcd_encoder = 0; 1f3b0: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1f3b4: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60); 1f3b8: 65 e5 ldi r22, 0x55 ; 85 1f3ba: 75 e5 ldi r23, 0x55 ; 85 1f3bc: 85 e8 ldi r24, 0x85 ; 133 1f3be: 91 e4 ldi r25, 0x41 ; 65 1f3c0: 0f 94 a8 49 call 0x29350 ; 0x29350 } } if (lcd_clicked()) { 1f3c4: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1f3c8: 88 23 and r24, r24 1f3ca: c9 f1 breq .+114 ; 0x1f43e // Abort a move if in progress. planner_abort_hard(); 1f3cc: 0f 94 22 4c call 0x29844 ; 0x29844 planner_aborted = false; 1f3d0: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 while (lcd_clicked()) ; 1f3d4: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1f3d8: 81 11 cpse r24, r1 1f3da: fc cf rjmp .-8 ; 0x1f3d4 _delay(10); 1f3dc: 6a e0 ldi r22, 0x0A ; 10 1f3de: 70 e0 ldi r23, 0x00 ; 0 1f3e0: 80 e0 ldi r24, 0x00 ; 0 1f3e2: 90 e0 ldi r25, 0x00 ; 0 1f3e4: 0f 94 ce 0a call 0x2159c ; 0x2159c while (lcd_clicked()) ; 1f3e8: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 1f3ec: 81 11 cpse r24, r1 1f3ee: fc cf rjmp .-8 ; 0x1f3e8 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); 1f3f0: 89 e3 ldi r24, 0x39 ; 57 1f3f2: 9b e3 ldi r25, 0x3B ; 59 1f3f4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1f3f8: 41 e0 ldi r20, 0x01 ; 1 1f3fa: 60 e0 ldi r22, 0x00 ; 0 1f3fc: 0e 94 62 e3 call 0x1c6c4 ; 0x1c6c4 if (result == LCD_BUTTON_TIMEOUT) 1f400: 8f 3f cpi r24, 0xFF ; 255 1f402: d1 f1 breq .+116 ; 0x1f478 goto canceled; else if (result == LCD_LEFT_BUTTON_CHOICE) 1f404: 81 11 cpse r24, r1 1f406: 82 cf rjmp .-252 ; 0x1f30c 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; 1f408: 80 e0 ldi r24, 0x00 ; 0 1f40a: 90 e0 ldi r25, 0x00 ; 0 1f40c: af e4 ldi r26, 0x4F ; 79 1f40e: b3 e4 ldi r27, 0x43 ; 67 1f410: 80 93 69 12 sts 0x1269, r24 ; 0x801269 1f414: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 1f418: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 1f41c: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c } else { current_position[Z_AXIS] = Z_MAX_POS+4.f; } plan_set_position_curposXYZE(); 1f420: 0f 94 68 48 call 0x290d0 ; 0x290d0 return true; 1f424: 81 e0 ldi r24, 0x01 ; 1 canceled: return false; } 1f426: df 91 pop r29 1f428: cf 91 pop r28 1f42a: 1f 91 pop r17 1f42c: 0f 91 pop r16 1f42e: ff 90 pop r15 1f430: ef 90 pop r14 1f432: df 90 pop r13 1f434: cf 90 pop r12 1f436: bf 90 pop r11 1f438: af 90 pop r10 1f43a: 9f 90 pop r9 1f43c: 08 95 ret while (lcd_clicked()) ; _delay(10); while (lcd_clicked()) ; break; } if (multi_screen && _millis() - previous_millis_msg > 5000) { 1f43e: 01 15 cp r16, r1 1f440: 11 05 cpc r17, r1 1f442: 09 f4 brne .+2 ; 0x1f446 1f444: 79 cf rjmp .-270 ; 0x1f338 1f446: 0f 94 01 0b call 0x21602 ; 0x21602 1f44a: 6c 19 sub r22, r12 1f44c: 7d 09 sbc r23, r13 1f44e: 8e 09 sbc r24, r14 1f450: 9f 09 sbc r25, r15 1f452: 69 38 cpi r22, 0x89 ; 137 1f454: 73 41 sbci r23, 0x13 ; 19 1f456: 81 05 cpc r24, r1 1f458: 91 05 cpc r25, r1 1f45a: 08 f4 brcc .+2 ; 0x1f45e 1f45c: 6d cf rjmp .-294 ; 0x1f338 if (msg_next == NULL) 1f45e: 20 97 sbiw r28, 0x00 ; 0 1f460: 11 f4 brne .+4 ; 0x1f466 msg_next = msg; 1f462: cb 2d mov r28, r11 1f464: da 2d mov r29, r10 msg_next = lcd_display_message_fullscreen_P(msg_next); 1f466: ce 01 movw r24, r28 1f468: 0e 94 94 de call 0x1bd28 ; 0x1bd28 1f46c: ec 01 movw r28, r24 previous_millis_msg = _millis(); 1f46e: 0f 94 01 0b call 0x21602 ; 0x21602 1f472: 6b 01 movw r12, r22 1f474: 7c 01 movw r14, r24 1f476: 60 cf rjmp .-320 ; 0x1f338 } plan_set_position_curposXYZE(); return true; canceled: return false; 1f478: 80 e0 ldi r24, 0x00 ; 0 1f47a: d5 cf rjmp .-86 ; 0x1f426 0001f47c : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 1f47c: 2f 92 push r2 1f47e: 3f 92 push r3 1f480: 4f 92 push r4 1f482: 5f 92 push r5 1f484: 6f 92 push r6 1f486: 7f 92 push r7 1f488: 8f 92 push r8 1f48a: 9f 92 push r9 1f48c: af 92 push r10 1f48e: bf 92 push r11 1f490: cf 92 push r12 1f492: df 92 push r13 1f494: ef 92 push r14 1f496: ff 92 push r15 1f498: 0f 93 push r16 1f49a: 1f 93 push r17 1f49c: cf 93 push r28 1f49e: df 93 push r29 1f4a0: cd b7 in r28, 0x3d ; 61 1f4a2: de b7 in r29, 0x3e ; 62 1f4a4: 67 97 sbiw r28, 0x17 ; 23 1f4a6: 0f b6 in r0, 0x3f ; 63 1f4a8: f8 94 cli 1f4aa: de bf out 0x3e, r29 ; 62 1f4ac: 0f be out 0x3f, r0 ; 63 1f4ae: cd bf out 0x3d, r28 ; 61 1f4b0: 08 2f mov r16, r24 1f4b2: ce 01 movw r24, r28 1f4b4: 46 96 adiw r24, 0x16 ; 22 1f4b6: 9f 8b std Y+23, r25 ; 0x17 1f4b8: 8e 8b std Y+22, r24 ; 0x16 1f4ba: 83 e0 ldi r24, 0x03 ; 3 1f4bc: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 1f4be: 95 e1 ldi r25, 0x15 ; 21 1f4c0: 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 1f4c2: 0f 94 38 4e call 0x29c70 ; 0x29c70 tool_change_extruder = slot; 1f4c6: 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)); 1f4ca: 40 2f mov r20, r16 1f4cc: 64 e5 ldi r22, 0x54 ; 84 1f4ce: ce 01 movw r24, r28 1f4d0: 01 96 adiw r24, 0x01 ; 1 1f4d2: 0f 94 2b 4e call 0x29c56 ; 0x29c56 1f4d6: 49 81 ldd r20, Y+1 ; 0x01 1f4d8: 5a 81 ldd r21, Y+2 ; 0x02 1f4da: 6b 81 ldd r22, Y+3 ; 0x03 1f4dc: 7c 81 ldd r23, Y+4 ; 0x04 1f4de: 8d 81 ldd r24, Y+5 ; 0x05 1f4e0: 0f 94 77 95 call 0x32aee ; 0x32aee logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 1f4e4: 61 e0 ldi r22, 0x01 ; 1 1f4e6: 81 e0 ldi r24, 0x01 ; 1 1f4e8: 0f 94 08 9d call 0x33a10 ; 0x33a10 1f4ec: 18 2f mov r17, r24 1f4ee: 81 11 cpse r24, r1 1f4f0: 07 c0 rjmp .+14 ; 0x1f500 break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 1f4f2: 0f 94 8c 4d call 0x29b18 ; 0x29b18 // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 1f4f6: 0f 94 a6 9c call 0x3394c ; 0x3394c // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 1f4fa: 0f 94 96 9d call 0x33b2c ; 0x33b2c 1f4fe: e1 cf rjmp .-62 ; 0x1f4c2 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1f500: 0f 94 5b 18 call 0x230b6 ; 0x230b6 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 1f504: 0f 94 6e 4e call 0x29cdc ; 0x29cdc 1f508: 81 30 cpi r24, 0x01 ; 1 1f50a: 79 f1 breq .+94 ; 0x1f56a // 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(); 1f50c: 0f 94 96 9d call 0x33b2c ; 0x33b2c if (retries == 2 && cutter_enabled()) { 1f510: 92 e0 ldi r25, 0x02 ; 2 1f512: f9 12 cpse r15, r25 1f514: 09 c0 rjmp .+18 ; 0x1f528 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; 1f516: 8e ec ldi r24, 0xCE ; 206 1f518: 9e e0 ldi r25, 0x0E ; 14 1f51a: 0f 94 3e a4 call 0x3487c ; 0x3487c 1f51e: 81 30 cpi r24, 0x01 ; 1 1f520: 19 f4 brne .+6 ; 0x1f528 CutFilamentInner(slot); // try cutting filament tip at the last attempt 1f522: 80 2f mov r24, r16 1f524: 0f 94 7d 9e call 0x33cfa ; 0x33cfa 1f528: 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) { 1f52a: f1 10 cpse r15, r1 1f52c: ca cf rjmp .-108 ; 0x1f4c2 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()) { 1f52e: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 1f532: 88 23 and r24, r24 1f534: 09 f4 brne .+2 ; 0x1f538 1f536: ef c0 rjmp .+478 ; 0x1f716 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 1f538: 67 96 adiw r28, 0x17 ; 23 1f53a: 0f b6 in r0, 0x3f ; 63 1f53c: f8 94 cli 1f53e: de bf out 0x3e, r29 ; 62 1f540: 0f be out 0x3f, r0 ; 63 1f542: cd bf out 0x3d, r28 ; 61 1f544: df 91 pop r29 1f546: cf 91 pop r28 1f548: 1f 91 pop r17 1f54a: 0f 91 pop r16 1f54c: ff 90 pop r15 1f54e: ef 90 pop r14 1f550: df 90 pop r13 1f552: cf 90 pop r12 1f554: bf 90 pop r11 1f556: af 90 pop r10 1f558: 9f 90 pop r9 1f55a: 8f 90 pop r8 1f55c: 7f 90 pop r7 1f55e: 6f 90 pop r6 1f560: 5f 90 pop r5 1f562: 4f 90 pop r4 1f564: 3f 90 pop r3 1f566: 2f 90 pop r2 1f568: 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(); 1f56a: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 1f56e: 70 e0 ldi r23, 0x00 ; 0 1f570: 90 e0 ldi r25, 0x00 ; 0 1f572: 80 e0 ldi r24, 0x00 ; 0 1f574: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1f578: 9b 01 movw r18, r22 1f57a: ac 01 movw r20, r24 1f57c: 66 e6 ldi r22, 0x66 ; 102 1f57e: 76 e6 ldi r23, 0x66 ; 102 1f580: 8d e9 ldi r24, 0x9D ; 157 1f582: 92 e4 ldi r25, 0x42 ; 66 1f584: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1f588: 36 2e mov r3, r22 1f58a: 87 2e mov r8, r23 1f58c: 98 2e mov r9, r24 1f58e: 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)) 1f590: 26 2f mov r18, r22 1f592: 37 2f mov r19, r23 1f594: 48 2f mov r20, r24 1f596: 59 2f mov r21, r25 1f598: 60 e0 ldi r22, 0x00 ; 0 1f59a: 70 e0 ldi r23, 0x00 ; 0 1f59c: 80 e2 ldi r24, 0x20 ; 32 1f59e: 91 e4 ldi r25, 0x41 ; 65 1f5a0: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 1f5a4: 2b 01 movw r4, r22 1f5a6: 3c 01 movw r6, r24 1f5a8: e5 e6 ldi r30, 0x65 ; 101 1f5aa: f4 e0 ldi r31, 0x04 ; 4 1f5ac: 82 2d mov r24, r2 1f5ae: 11 92 st Z+, r1 1f5b0: 8a 95 dec r24 1f5b2: e9 f7 brne .-6 ; 0x1f5ae lcd_status_message_idx = 0; 1f5b4: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.418> 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); 1f5b8: 83 2d mov r24, r3 1f5ba: 98 2d mov r25, r8 1f5bc: a9 2d mov r26, r9 1f5be: be 2d mov r27, r14 1f5c0: bc 01 movw r22, r24 1f5c2: 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++) { 1f5c4: 91 2c mov r9, r1 1f5c6: 31 2c mov r3, r1 1f5c8: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 1f5ca: 5b 01 movw r10, r22 1f5cc: 6c 01 movw r12, r24 1f5ce: d7 fa bst r13, 7 1f5d0: d0 94 com r13 1f5d2: d7 f8 bld r13, 7 1f5d4: d0 94 com r13 1f5d6: 20 e0 ldi r18, 0x00 ; 0 1f5d8: 30 e0 ldi r19, 0x00 ; 0 1f5da: 48 e4 ldi r20, 0x48 ; 72 1f5dc: 52 e4 ldi r21, 0x42 ; 66 1f5de: 0f 94 3a 4e call 0x29c74 ; 0x29c74 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); 1f5e2: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1f5e6: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f while (planner_any_moves()) { 1f5ea: 98 17 cp r25, r24 1f5ec: 09 f4 brne .+2 ; 0x1f5f0 1f5ee: 49 c0 rjmp .+146 ; 0x1f682 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 1f5f0: 11 23 and r17, r17 1f5f2: 31 f0 breq .+12 ; 0x1f600 1f5f4: 0f 94 6e 4e call 0x29cdc ; 0x29cdc 1f5f8: 11 e0 ldi r17, 0x01 ; 1 1f5fa: 81 30 cpi r24, 0x01 ; 1 1f5fc: 09 f0 breq .+2 ; 0x1f600 1f5fe: 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); 1f600: 83 e0 ldi r24, 0x03 ; 3 1f602: 0f 94 47 18 call 0x2308e ; 0x2308e 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); 1f606: 20 91 6d 12 lds r18, 0x126D ; 0x80126d 1f60a: 30 91 6e 12 lds r19, 0x126E ; 0x80126e 1f60e: 40 91 6f 12 lds r20, 0x126F ; 0x80126f 1f612: 50 91 70 12 lds r21, 0x1270 ; 0x801270 1f616: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1f61a: a3 01 movw r20, r6 1f61c: 92 01 movw r18, r4 1f61e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1f622: 0f 94 44 a6 call 0x34c88 ; 0x34c88 1f626: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 1f62a: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 1f62c: e6 16 cp r14, r22 1f62e: c1 f0 breq .+48 ; 0x1f660 1f630: e3 2d mov r30, r3 1f632: e4 31 cpi r30, 0x14 ; 20 1f634: 08 f0 brcs .+2 ; 0x1f638 1f636: 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); 1f638: 33 24 eor r3, r3 1f63a: 33 94 inc r3 1f63c: 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] : '-'); 1f63e: 8f ef ldi r24, 0xFF ; 255 1f640: 11 11 cpse r17, r1 1f642: 01 c0 rjmp .+2 ; 0x1f646 1f644: 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; 1f646: f0 e0 ldi r31, 0x00 ; 0 1f648: eb 59 subi r30, 0x9B ; 155 1f64a: fb 4f sbci r31, 0xFB ; 251 1f64c: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 1f64e: 91 e0 ldi r25, 0x01 ; 1 1f650: 90 93 59 02 sts 0x0259, r25 ; 0x800259 if (!lcd_update_enabled) lcdui_print_status_line(); 1f654: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 1f658: 81 11 cpse r24, r1 1f65a: 02 c0 rjmp .+4 ; 0x1f660 1f65c: 0f 94 ae 0b call 0x2175c ; 0x2175c void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 1f660: 90 e0 ldi r25, 0x00 ; 0 1f662: 80 e0 ldi r24, 0x00 ; 0 1f664: 0e 94 0a 8d call 0x11a14 ; 0x11a14 } 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); 1f668: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 1f66a: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 1f66e: 88 23 and r24, r24 1f670: 09 f4 brne .+2 ; 0x1f674 1f672: b7 cf rjmp .-146 ; 0x1f5e2 return false; // power panic or a similar issue happened, bail out fast 1f674: 10 e0 ldi r17, 0x00 ; 0 1f676: 37 c0 rjmp .+110 ; 0x1f6e6 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); 1f678: c6 01 movw r24, r12 1f67a: b5 01 movw r22, r10 1f67c: 99 24 eor r9, r9 1f67e: 93 94 inc r9 1f680: aa cf rjmp .-172 ; 0x1f5d6 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++) { 1f682: 91 e0 ldi r25, 0x01 ; 1 1f684: 99 12 cpse r9, r25 1f686: f8 cf rjmp .-16 ; 0x1f678 return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 1f688: 0f 94 38 4e call 0x29c70 ; 0x29c70 if (!filament_inserted) { 1f68c: 11 11 cpse r17, r1 1f68e: 08 c0 rjmp .+16 ; 0x1f6a0 eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 1f690: 8f ec ldi r24, 0xCF ; 207 1f692: 9e e0 ldi r25, 0x0E ; 14 1f694: 0e 94 d7 78 call 0xf1ae ; 0xf1ae eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 1f698: 80 ed ldi r24, 0xD0 ; 208 1f69a: 9e e0 ldi r25, 0x0E ; 14 1f69c: 0e 94 ca 78 call 0xf194 ; 0xf194 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); 1f6a0: 44 e1 ldi r20, 0x14 ; 20 1f6a2: 50 e0 ldi r21, 0x00 ; 0 1f6a4: 65 e6 ldi r22, 0x65 ; 101 1f6a6: 74 e0 ldi r23, 0x04 ; 4 1f6a8: ce 01 movw r24, r28 1f6aa: 01 96 adiw r24, 0x01 ; 1 1f6ac: 0f 94 be aa call 0x3557c ; 0x3557c 1f6b0: fe 01 movw r30, r28 1f6b2: 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'; 1f6b4: 81 91 ld r24, Z+ 1f6b6: 87 fd sbrc r24, 7 1f6b8: 2c c0 rjmp .+88 ; 0x1f712 1f6ba: 80 e3 ldi r24, 0x30 ; 48 1f6bc: df 01 movw r26, r30 1f6be: 11 97 sbiw r26, 0x01 ; 1 1f6c0: 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++) { 1f6c2: 8e 89 ldd r24, Y+22 ; 0x16 1f6c4: 9f 89 ldd r25, Y+23 ; 0x17 1f6c6: 8e 17 cp r24, r30 1f6c8: 9f 07 cpc r25, r31 1f6ca: a1 f7 brne .-24 ; 0x1f6b4 // 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; 1f6cc: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 1f6ce: 84 ee ldi r24, 0xE4 ; 228 1f6d0: 92 ea ldi r25, 0xA2 ; 162 1f6d2: 0e 94 1f 7b call 0xf63e ; 0xf63e 1f6d6: 81 e8 ldi r24, 0x81 ; 129 1f6d8: 98 e8 ldi r25, 0x88 ; 136 1f6da: 0e 94 1f 7b call 0xf63e ; 0xf63e 1f6de: ce 01 movw r24, r28 1f6e0: 01 96 adiw r24, 0x01 ; 1 1f6e2: 0e 94 1d 86 call 0x10c3a ; 0x10c3a SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 1f6e6: 8a e7 ldi r24, 0x7A ; 122 1f6e8: 94 e0 ldi r25, 0x04 ; 4 1f6ea: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::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()) { 1f6ee: 11 23 and r17, r17 1f6f0: 09 f4 brne .+2 ; 0x1f6f4 1f6f2: 0c cf rjmp .-488 ; 0x1f50c // 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 1f6f4: 80 2f mov r24, r16 1f6f6: 0f 94 3d 65 call 0x2ca7a ; 0x2ca7a } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 1f6fa: 00 93 90 12 sts 0x1290, r16 ; 0x801290 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 1f6fe: 80 91 05 13 lds r24, 0x1305 ; 0x801305 1f702: 90 91 06 13 lds r25, 0x1306 ; 0x801306 1f706: 01 96 adiw r24, 0x01 ; 1 1f708: 90 93 06 13 sts 0x1306, r25 ; 0x801306 1f70c: 80 93 05 13 sts 0x1305, r24 ; 0x801305 1f710: 13 cf rjmp .-474 ; 0x1f538 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'; 1f712: 81 e3 ldi r24, 0x31 ; 49 1f714: d3 cf rjmp .-90 ; 0x1f6bc void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 1f716: 8a e2 ldi r24, 0x2A ; 42 1f718: 90 e8 ldi r25, 0x80 ; 128 1f71a: 90 93 93 12 sts 0x1293, r25 ; 0x801293 1f71e: 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 1f722: 61 e0 ldi r22, 0x01 ; 1 1f724: 81 e0 ldi r24, 0x01 ; 1 1f726: 0f 94 08 9d call 0x33a10 ; 0x33a10 1f72a: c7 ce rjmp .-626 ; 0x1f4ba 0001f72c : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 1f72c: cf 93 push r28 1f72e: df 93 push r29 1f730: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1f732: 0f 94 04 7a call 0x2f408 ; 0x2f408 1f736: c8 2f mov r28, r24 1f738: 88 23 and r24, r24 1f73a: 49 f1 breq .+82 ; 0x1f78e safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 1f73c: 88 ec ldi r24, 0xC8 ; 200 1f73e: 90 e0 ldi r25, 0x00 ; 0 1f740: 0f 94 bc 51 call 0x2a378 ; 0x2a378 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.373]> 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); 1f744: 82 e0 ldi r24, 0x02 ; 2 1f746: 0f 94 06 23 call 0x2460c ; 0x2460c void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 1f74a: 8f ea ldi r24, 0xAF ; 175 1f74c: 92 e6 ldi r25, 0x62 ; 98 1f74e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1f752: 6d 2f mov r22, r29 1f754: 0f 94 6d 4d call 0x29ada ; 0x29ada struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1f758: 0f 94 d0 79 call 0x2f3a0 ; 0x2f3a0 FullScreenMsgLoad(slot); { // used for MMU-menu operation "Load to Nozzle" ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 1f75c: 0f 94 86 78 call 0x2f10c ; 0x2f10c if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly 1f760: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 1f764: 83 36 cpi r24, 0x63 ; 99 1f766: 29 f0 breq .+10 ; 0x1f772 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 1f768: 62 e1 ldi r22, 0x12 ; 18 1f76a: 8d e1 ldi r24, 0x1D ; 29 1f76c: 9e e9 ldi r25, 0x9E ; 158 1f76e: 0f 94 db 79 call 0x2f3b6 ; 0x2f3b6 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 1f772: 8d 2f mov r24, r29 1f774: 0e 94 3e fa call 0x1f47c ; 0x1f47c // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 1f778: 0e 94 f5 bb call 0x177ea ; 0x177ea 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); 1f77c: 83 e0 ldi r24, 0x03 ; 3 1f77e: 0f 94 06 23 call 0x2460c ; 0x2460c #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 1f782: 0f 94 dd 6c call 0x2d9ba ; 0x2d9ba explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1f786: 0f 94 f9 79 call 0x2f3f2 ; 0x2f3f2 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 1f78a: 0f 94 6a 4d call 0x29ad4 ; 0x29ad4 return true; } 1f78e: 8c 2f mov r24, r28 1f790: df 91 pop r29 1f792: cf 91 pop r28 1f794: 08 95 ret 0001f796 : 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); 1f796: 0e 94 96 fb call 0x1f72c ; 0x1f72c // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 1f79a: 0e 94 48 64 call 0xc890 ; 0xc890 st_synchronize(); 1f79e: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // Ask user if the extruded color is correct: lcd_return_to_status(); 1f7a2: 0f 94 18 05 call 0x20a30 ; 0x20a30 lcd_load_filament_color_check(); 1f7a6: 0f 94 67 18 call 0x230ce ; 0x230ce lcd_setstatuspgm(MSG_WELCOME); 1f7aa: 8a e8 ldi r24, 0x8A ; 138 1f7ac: 9c e6 ldi r25, 0x6C ; 108 1f7ae: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe custom_message_type = CustomMsg::Status; 1f7b2: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d // Clear the filament action clearFilamentAction(); 1f7b6: 0d 94 0d 09 jmp 0x2121a ; 0x2121a 0001f7ba : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 1f7ba: cf 93 push r28 1f7bc: df 93 push r29 1f7be: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1f7c0: 0f 94 04 7a call 0x2f408 ; 0x2f408 1f7c4: c8 2f mov r28, r24 1f7c6: 88 23 and r24, r24 1f7c8: b9 f0 breq .+46 ; 0x1f7f8 return false; } if (slot != extruder) { 1f7ca: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 1f7ce: 8d 17 cp r24, r29 1f7d0: 99 f0 breq .+38 ; 0x1f7f8 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(); 1f7d2: 0e 94 ec 66 call 0xcdd8 ; 0xcdd8 if (/*FindaDetectsFilament()*/ 1f7d6: 81 11 cpse r24, r1 1f7d8: 02 c0 rjmp .+4 ; 0x1f7de /*!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(); 1f7da: 0f 94 cf 9d call 0x33b9e ; 0x33b9e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1f7de: 0f 94 d0 79 call 0x2f3a0 ; 0x2f3a0 // we need to unload manually as well -- but only if FINDA detects filament unload(); } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 1f7e2: 0f 94 86 78 call 0x2f10c ; 0x2f10c bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1f7e6: 0f 94 5b 18 call 0x230b6 ; 0x230b6 planner_synchronize(); ToolChangeCommon(slot); 1f7ea: 8d 2f mov r24, r29 1f7ec: 0e 94 3e fa call 0x1f47c ; 0x1f47c 1f7f0: 0f 94 dd 6c call 0x2d9ba ; 0x2d9ba explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1f7f4: 0f 94 f9 79 call 0x2f3f2 ; 0x2f3f2 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 1f7f8: 8c 2f mov r24, r28 1f7fa: df 91 pop r29 1f7fc: cf 91 pop r28 1f7fe: 08 95 ret 0001f800 : /// 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) { 1f800: 1f 93 push r17 1f802: cf 93 push r28 1f804: df 93 push r29 1f806: c8 2f mov r28, r24 1f808: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 1f80a: 0f 94 04 7a call 0x2f408 ; 0x2f408 1f80e: d8 2f mov r29, r24 1f810: 88 23 and r24, r24 1f812: 89 f0 breq .+34 ; 0x1f836 return false; } FSensorBlockRunout blockRunout; 1f814: 0f 94 86 78 call 0x2f10c ; 0x2f10c switch (code) { 1f818: c3 36 cpi r28, 0x63 ; 99 1f81a: 01 f1 breq .+64 ; 0x1f85c 1f81c: c8 37 cpi r28, 0x78 ; 120 1f81e: 81 f0 breq .+32 ; 0x1f840 1f820: cf 33 cpi r28, 0x3F ; 63 1f822: 39 f4 brne .+14 ; 0x1f832 case '?': { waitForHotendTargetTemp(100, [] {}); 1f824: 84 e6 ldi r24, 0x64 ; 100 1f826: 90 e0 ldi r25, 0x00 ; 0 1f828: 0f 94 bc 51 call 0x2a378 ; 0x2a378 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.373]> load_filament_to_nozzle(slot); 1f82c: 81 2f mov r24, r17 1f82e: 0e 94 96 fb call 0x1f72c ; 0x1f72c 1f832: 0f 94 dd 6c call 0x2d9ba ; 0x2d9ba execute_load_to_nozzle_sequence(); } break; } return true; } 1f836: 8d 2f mov r24, r29 1f838: df 91 pop r29 1f83a: cf 91 pop r28 1f83c: 1f 91 pop r17 1f83e: 08 95 ret } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 1f840: 10 92 58 02 sts 0x0258, r1 ; 0x800258 1f844: 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); 1f848: 81 2f mov r24, r17 1f84a: 0e 94 dd fb call 0x1f7ba ; 0x1f7ba 1f84e: 8f ea ldi r24, 0xAF ; 175 1f850: 90 e0 ldi r25, 0x00 ; 0 1f852: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1f856: 80 93 57 02 sts 0x0257, r24 ; 0x800257 1f85a: eb cf rjmp .-42 ; 0x1f832 thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 1f85c: 84 e6 ldi r24, 0x64 ; 100 1f85e: 90 e0 ldi r25, 0x00 ; 0 1f860: 0f 94 bc 51 call 0x2a378 ; 0x2a378 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.373]> execute_load_to_nozzle_sequence(); 1f864: 0e 94 f5 bb call 0x177ea ; 0x177ea 1f868: e4 cf rjmp .-56 ; 0x1f832 0001f86a : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 1f86a: cf 93 push r28 1f86c: 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); 1f86e: 83 e7 ldi r24, 0x73 ; 115 1f870: 96 e4 ldi r25, 0x46 ; 70 1f872: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1f876: 6c 2f mov r22, r28 1f878: 0f 94 6d 4d call 0x29ada ; 0x29ada return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1f87c: 8c 2f mov r24, r28 1f87e: 0e 94 dd fb call 0x1f7ba ; 0x1f7ba 1f882: 0f 94 5b 18 call 0x230b6 ; 0x230b6 planner_synchronize(); unload(); 1f886: 0f 94 cf 9d call 0x33b9e ; 0x33b9e ScreenUpdateEnable(); 1f88a: 0f 94 6a 4d call 0x29ad4 ; 0x29ad4 MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 1f88e: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 1f890: 0d 94 0d 09 jmp 0x2121a ; 0x2121a 0001f894 : 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(){ 1f894: cf 93 push r28 for(uint8_t i = 0; i < 5; ++i){ 1f896: c0 e0 ldi r28, 0x00 ; 0 1f898: 83 e7 ldi r24, 0x73 ; 115 1f89a: 96 e4 ldi r25, 0x46 ; 70 1f89c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 1f8a0: 6c 2f mov r22, r28 1f8a2: 0f 94 6d 4d call 0x29ada ; 0x29ada return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1f8a6: 8c 2f mov r24, r28 1f8a8: 0e 94 dd fb call 0x1f7ba ; 0x1f7ba 1f8ac: 0f 94 5b 18 call 0x230b6 ; 0x230b6 planner_synchronize(); unload(); 1f8b0: 0f 94 cf 9d call 0x33b9e ; 0x33b9e ScreenUpdateEnable(); 1f8b4: 0f 94 6a 4d call 0x29ad4 ; 0x29ad4 1f8b8: cf 5f subi r28, 0xFF ; 255 1f8ba: c5 30 cpi r28, 0x05 ; 5 1f8bc: 69 f7 brne .-38 ; 0x1f898 MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 1f8be: cf 91 pop r28 for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 1f8c0: 0d 94 0d 09 jmp 0x2121a ; 0x2121a 0001f8c4 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 1f8c4: 1f 93 push r17 1f8c6: cf 93 push r28 1f8c8: df 93 push r29 1f8ca: 00 d0 rcall .+0 ; 0x1f8cc 1f8cc: 1f 92 push r1 1f8ce: 1f 92 push r1 1f8d0: cd b7 in r28, 0x3d ; 61 1f8d2: de b7 in r29, 0x3e ; 62 1f8d4: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 1f8d6: 0f 94 04 7a call 0x2f408 ; 0x2f408 1f8da: 88 23 and r24, r24 1f8dc: d9 f0 breq .+54 ; 0x1f914 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 1f8de: 41 2f mov r20, r17 1f8e0: 62 e5 ldi r22, 0x52 ; 82 1f8e2: ce 01 movw r24, r28 1f8e4: 01 96 adiw r24, 0x01 ; 1 1f8e6: 0f 94 2b 4e call 0x29c56 ; 0x29c56 1f8ea: 49 81 ldd r20, Y+1 ; 0x01 1f8ec: 5a 81 ldd r21, Y+2 ; 0x02 1f8ee: 6b 81 ldd r22, Y+3 ; 0x03 1f8f0: 7c 81 ldd r23, Y+4 ; 0x04 1f8f2: 8d 81 ldd r24, Y+5 ; 0x05 1f8f4: 0f 94 77 95 call 0x32aee ; 0x32aee 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)); 1f8f8: 60 e0 ldi r22, 0x00 ; 0 1f8fa: 80 e0 ldi r24, 0x00 ; 0 1f8fc: 0f 94 08 9d call 0x33a10 ; 0x33a10 1f900: 88 23 and r24, r24 1f902: 69 f3 breq .-38 ; 0x1f8de // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 1f904: 20 91 ad 12 lds r18, 0x12AD ; 0x8012ad 1f908: 30 91 ae 12 lds r19, 0x12AE ; 0x8012ae 1f90c: 30 93 fe 12 sts 0x12FE, r19 ; 0x8012fe 1f910: 20 93 fd 12 sts 0x12FD, r18 ; 0x8012fd return true; } 1f914: 0f 90 pop r0 1f916: 0f 90 pop r0 1f918: 0f 90 pop r0 1f91a: 0f 90 pop r0 1f91c: 0f 90 pop r0 1f91e: df 91 pop r29 1f920: cf 91 pop r28 1f922: 1f 91 pop r17 1f924: 08 95 ret 0001f926 : 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; 1f926: 88 3e cpi r24, 0xE8 ; 232 1f928: 23 e0 ldi r18, 0x03 ; 3 1f92a: 92 07 cpc r25, r18 1f92c: 10 f0 brcs .+4 ; 0x1f932 1f92e: 87 ee ldi r24, 0xE7 ; 231 1f930: 93 e0 ldi r25, 0x03 ; 3 } 1f932: 08 95 ret 0001f934 : return 0; } int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 1f934: 90 91 47 0d lds r25, 0x0D47 ; 0x800d47 1f938: 80 91 46 0d lds r24, 0x0D46 ; 0x800d46 1f93c: 2f ef ldi r18, 0xFF ; 255 1f93e: 3f ef ldi r19, 0xFF ; 255 1f940: 89 17 cp r24, r25 1f942: 71 f0 breq .+28 ; 0x1f960 _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 1f944: e9 2f mov r30, r25 1f946: f0 e0 ldi r31, 0x00 ; 0 1f948: e7 5b subi r30, 0xB7 ; 183 1f94a: f2 4f sbci r31, 0xF2 ; 242 1f94c: 20 81 ld r18, Z 1f94e: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 1f950: 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 1f952: 80 91 45 0d lds r24, 0x0D45 ; 0x800d45 1f956: 98 17 cp r25, r24 1f958: 08 f0 brcs .+2 ; 0x1f95c 1f95a: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 1f95c: 90 93 47 0d sts 0x0D47, r25 ; 0x800d47 return rbuf_get(uart2_ibuf); } 1f960: c9 01 movw r24, r18 1f962: 08 95 ret 0001f964 : FILE _uart2io = {0}; int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 1f964: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 1f968: 95 ff sbrs r25, 5 1f96a: fc cf rjmp .-8 ; 0x1f964 UDR2 = c; // transmit byte 1f96c: 80 93 d6 00 sts 0x00D6, r24 ; 0x8000d6 <__TEXT_REGION_LENGTH__+0x7c20d6> // while (!uart2_txcomplete); // wait until byte sent // UCSR2A |= (1 << TXC2); // delete TXCflag return 0; } 1f970: 90 e0 ldi r25, 0x00 ; 0 1f972: 80 e0 ldi r24, 0x00 ; 0 1f974: 08 95 ret 0001f976 : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 1f976: 3f b7 in r19, 0x3f ; 63 cli(); 1f978: f8 94 cli m = timer2_overflow_count; 1f97a: 80 91 fc 05 lds r24, 0x05FC ; 0x8005fc 1f97e: 90 91 fd 05 lds r25, 0x05FD ; 0x8005fd 1f982: a0 91 fe 05 lds r26, 0x05FE ; 0x8005fe 1f986: b0 91 ff 05 lds r27, 0x05FF ; 0x8005ff #if defined(TCNT2) t = TCNT2; 1f98a: 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)) 1f98e: b8 9b sbis 0x17, 0 ; 23 1f990: 05 c0 rjmp .+10 ; 0x1f99c 1f992: 2f 3f cpi r18, 0xFF ; 255 1f994: 19 f0 breq .+6 ; 0x1f99c m++; 1f996: 01 96 adiw r24, 0x01 ; 1 1f998: a1 1d adc r26, r1 1f99a: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 1f99c: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 1f99e: ba 2f mov r27, r26 1f9a0: a9 2f mov r26, r25 1f9a2: 98 2f mov r25, r24 1f9a4: 88 27 eor r24, r24 1f9a6: bc 01 movw r22, r24 1f9a8: cd 01 movw r24, r26 1f9aa: 62 0f add r22, r18 1f9ac: 71 1d adc r23, r1 1f9ae: 81 1d adc r24, r1 1f9b0: 91 1d adc r25, r1 1f9b2: 42 e0 ldi r20, 0x02 ; 2 1f9b4: 66 0f add r22, r22 1f9b6: 77 1f adc r23, r23 1f9b8: 88 1f adc r24, r24 1f9ba: 99 1f adc r25, r25 1f9bc: 4a 95 dec r20 1f9be: d1 f7 brne .-12 ; 0x1f9b4 } 1f9c0: 08 95 ret 0001f9c2 : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 1f9c2: 2f 92 push r2 1f9c4: 3f 92 push r3 1f9c6: 4f 92 push r4 1f9c8: 5f 92 push r5 1f9ca: 6f 92 push r6 1f9cc: 7f 92 push r7 1f9ce: 8f 92 push r8 1f9d0: 9f 92 push r9 1f9d2: af 92 push r10 1f9d4: bf 92 push r11 1f9d6: cf 92 push r12 1f9d8: df 92 push r13 1f9da: ef 92 push r14 1f9dc: ff 92 push r15 1f9de: 0f 93 push r16 1f9e0: 1f 93 push r17 1f9e2: cf 93 push r28 1f9e4: df 93 push r29 1f9e6: cd b7 in r28, 0x3d ; 61 1f9e8: de b7 in r29, 0x3e ; 62 1f9ea: 2e 97 sbiw r28, 0x0e ; 14 1f9ec: 0f b6 in r0, 0x3f ; 63 1f9ee: f8 94 cli 1f9f0: de bf out 0x3e, r29 ; 62 1f9f2: 0f be out 0x3f, r0 ; 63 1f9f4: 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]); 1f9f6: 20 90 ef 05 lds r2, 0x05EF ; 0x8005ef 1f9fa: 30 90 f0 05 lds r3, 0x05F0 ; 0x8005f0 1f9fe: 40 90 f1 05 lds r4, 0x05F1 ; 0x8005f1 1fa02: 50 90 f2 05 lds r5, 0x05F2 ; 0x8005f2 1fa06: 60 90 f3 05 lds r6, 0x05F3 ; 0x8005f3 1fa0a: 70 90 f4 05 lds r7, 0x05F4 ; 0x8005f4 #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 1fa0e: 21 14 cp r2, r1 1fa10: 31 04 cpc r3, r1 1fa12: 39 f4 brne .+14 ; 0x1fa22 pid_output = 0; pid_reset[e] = true; 1fa14: 81 e0 ldi r24, 0x01 ; 1 1fa16: 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; 1fa1a: 81 2c mov r8, r1 1fa1c: 91 2c mov r9, r1 1fa1e: 54 01 movw r10, r8 1fa20: f9 c0 rjmp .+498 ; 0x1fc14 #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 1fa22: b1 01 movw r22, r2 1fa24: 03 2c mov r0, r3 1fa26: 00 0c add r0, r0 1fa28: 88 0b sbc r24, r24 1fa2a: 99 0b sbc r25, r25 1fa2c: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1fa30: a3 01 movw r20, r6 1fa32: 92 01 movw r18, r4 1fa34: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1fa38: 6b 01 movw r12, r22 1fa3a: 7c 01 movw r14, r24 if(pid_reset[e]) { 1fa3c: 80 91 c8 05 lds r24, 0x05C8 ; 0x8005c8 1fa40: 88 23 and r24, r24 1fa42: 91 f0 breq .+36 ; 0x1fa68 iState_sum[e] = 0.0; 1fa44: 10 92 c4 05 sts 0x05C4, r1 ; 0x8005c4 1fa48: 10 92 c5 05 sts 0x05C5, r1 ; 0x8005c5 1fa4c: 10 92 c6 05 sts 0x05C6, r1 ; 0x8005c6 1fa50: 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) 1fa54: 10 92 c0 05 sts 0x05C0, r1 ; 0x8005c0 1fa58: 10 92 c1 05 sts 0x05C1, r1 ; 0x8005c1 1fa5c: 10 92 c2 05 sts 0x05C2, r1 ; 0x8005c2 1fa60: 10 92 c3 05 sts 0x05C3, r1 ; 0x8005c3 pid_reset[e] = false; 1fa64: 10 92 c8 05 sts 0x05C8, r1 ; 0x8005c8 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 1fa68: 20 91 cf 0d lds r18, 0x0DCF ; 0x800dcf 1fa6c: 30 91 d0 0d lds r19, 0x0DD0 ; 0x800dd0 1fa70: 40 91 d1 0d lds r20, 0x0DD1 ; 0x800dd1 1fa74: 50 91 d2 0d lds r21, 0x0DD2 ; 0x800dd2 1fa78: c7 01 movw r24, r14 1fa7a: b6 01 movw r22, r12 1fa7c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1fa80: 69 83 std Y+1, r22 ; 0x01 1fa82: 7a 83 std Y+2, r23 ; 0x02 1fa84: 8b 83 std Y+3, r24 ; 0x03 1fa86: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 1fa88: 20 91 c4 05 lds r18, 0x05C4 ; 0x8005c4 1fa8c: 30 91 c5 05 lds r19, 0x05C5 ; 0x8005c5 1fa90: 40 91 c6 05 lds r20, 0x05C6 ; 0x8005c6 1fa94: 50 91 c7 05 lds r21, 0x05C7 ; 0x8005c7 1fa98: c7 01 movw r24, r14 1fa9a: b6 01 movw r22, r12 1fa9c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1faa0: 4b 01 movw r8, r22 1faa2: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 1faa4: 20 91 1c 04 lds r18, 0x041C ; 0x80041c <_ZL14iState_sum_min.lto_priv.433> 1faa8: 2d 87 std Y+13, r18 ; 0x0d 1faaa: 30 91 1d 04 lds r19, 0x041D ; 0x80041d <_ZL14iState_sum_min.lto_priv.433+0x1> 1faae: 39 87 std Y+9, r19 ; 0x09 1fab0: 10 91 1e 04 lds r17, 0x041E ; 0x80041e <_ZL14iState_sum_min.lto_priv.433+0x2> 1fab4: 00 91 1f 04 lds r16, 0x041F ; 0x80041f <_ZL14iState_sum_min.lto_priv.433+0x3> 1fab8: 41 2f mov r20, r17 1faba: 50 2f mov r21, r16 1fabc: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1fac0: 87 fd sbrc r24, 7 1fac2: 17 c0 rjmp .+46 ; 0x1faf2 1fac4: 80 91 18 04 lds r24, 0x0418 ; 0x800418 <_ZL14iState_sum_max.lto_priv.434> 1fac8: 8d 87 std Y+13, r24 ; 0x0d 1faca: 90 91 19 04 lds r25, 0x0419 ; 0x800419 <_ZL14iState_sum_max.lto_priv.434+0x1> 1face: 99 87 std Y+9, r25 ; 0x09 1fad0: 10 91 1a 04 lds r17, 0x041A ; 0x80041a <_ZL14iState_sum_max.lto_priv.434+0x2> 1fad4: 00 91 1b 04 lds r16, 0x041B ; 0x80041b <_ZL14iState_sum_max.lto_priv.434+0x3> 1fad8: 9c 01 movw r18, r24 1fada: 41 2f mov r20, r17 1fadc: 50 2f mov r21, r16 1fade: b4 01 movw r22, r8 1fae0: c5 01 movw r24, r10 1fae2: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1fae6: 18 16 cp r1, r24 1fae8: 24 f0 brlt .+8 ; 0x1faf2 1faea: 8d 86 std Y+13, r8 ; 0x0d 1faec: 99 86 std Y+9, r9 ; 0x09 1faee: 1a 2d mov r17, r10 1faf0: 0b 2d mov r16, r11 1faf2: 8d 85 ldd r24, Y+13 ; 0x0d 1faf4: 99 85 ldd r25, Y+9 ; 0x09 1faf6: a1 2f mov r26, r17 1faf8: b0 2f mov r27, r16 1fafa: 80 93 c4 05 sts 0x05C4, r24 ; 0x8005c4 1fafe: 90 93 c5 05 sts 0x05C5, r25 ; 0x8005c5 1fb02: a0 93 c6 05 sts 0x05C6, r26 ; 0x8005c6 1fb06: b0 93 c7 05 sts 0x05C7, r27 ; 0x8005c7 iTerm[e] = cs.Ki * iState_sum[e]; 1fb0a: 20 91 d3 0d lds r18, 0x0DD3 ; 0x800dd3 1fb0e: 30 91 d4 0d lds r19, 0x0DD4 ; 0x800dd4 1fb12: 40 91 d5 0d lds r20, 0x0DD5 ; 0x800dd5 1fb16: 50 91 d6 0d lds r21, 0x0DD6 ; 0x800dd6 1fb1a: bc 01 movw r22, r24 1fb1c: 81 2f mov r24, r17 1fb1e: 90 2f mov r25, r16 1fb20: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1fb24: 6d 83 std Y+5, r22 ; 0x05 1fb26: 7e 83 std Y+6, r23 ; 0x06 1fb28: 8f 83 std Y+7, r24 ; 0x07 1fb2a: 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 1fb2c: 20 91 bc 05 lds r18, 0x05BC ; 0x8005bc 1fb30: 30 91 bd 05 lds r19, 0x05BD ; 0x8005bd 1fb34: 40 91 be 05 lds r20, 0x05BE ; 0x8005be 1fb38: 50 91 bf 05 lds r21, 0x05BF ; 0x8005bf 1fb3c: c3 01 movw r24, r6 1fb3e: b2 01 movw r22, r4 1fb40: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1fb44: 20 91 d7 0d lds r18, 0x0DD7 ; 0x800dd7 1fb48: 30 91 d8 0d lds r19, 0x0DD8 ; 0x800dd8 1fb4c: 40 91 d9 0d lds r20, 0x0DD9 ; 0x800dd9 1fb50: 50 91 da 0d lds r21, 0x0DDA ; 0x800dda 1fb54: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1fb58: 20 ed ldi r18, 0xD0 ; 208 1fb5a: 3c ec ldi r19, 0xCC ; 204 1fb5c: 4c e4 ldi r20, 0x4C ; 76 1fb5e: 5d e3 ldi r21, 0x3D ; 61 1fb60: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1fb64: 4b 01 movw r8, r22 1fb66: 5c 01 movw r10, r24 1fb68: 23 e3 ldi r18, 0x33 ; 51 1fb6a: 33 e3 ldi r19, 0x33 ; 51 1fb6c: 43 e7 ldi r20, 0x73 ; 115 1fb6e: 5f e3 ldi r21, 0x3F ; 63 1fb70: 60 91 c0 05 lds r22, 0x05C0 ; 0x8005c0 1fb74: 70 91 c1 05 lds r23, 0x05C1 ; 0x8005c1 1fb78: 80 91 c2 05 lds r24, 0x05C2 ; 0x8005c2 1fb7c: 90 91 c3 05 lds r25, 0x05C3 ; 0x8005c3 1fb80: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1fb84: 9b 01 movw r18, r22 1fb86: ac 01 movw r20, r24 1fb88: c5 01 movw r24, r10 1fb8a: b4 01 movw r22, r8 1fb8c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1fb90: 4b 01 movw r8, r22 1fb92: 5c 01 movw r10, r24 1fb94: 80 92 c0 05 sts 0x05C0, r8 ; 0x8005c0 1fb98: 90 92 c1 05 sts 0x05C1, r9 ; 0x8005c1 1fb9c: a0 92 c2 05 sts 0x05C2, r10 ; 0x8005c2 1fba0: 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) 1fba4: 2d 81 ldd r18, Y+5 ; 0x05 1fba6: 3e 81 ldd r19, Y+6 ; 0x06 1fba8: 4f 81 ldd r20, Y+7 ; 0x07 1fbaa: 58 85 ldd r21, Y+8 ; 0x08 1fbac: 69 81 ldd r22, Y+1 ; 0x01 1fbae: 7a 81 ldd r23, Y+2 ; 0x02 1fbb0: 8b 81 ldd r24, Y+3 ; 0x03 1fbb2: 9c 81 ldd r25, Y+4 ; 0x04 1fbb4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1fbb8: a5 01 movw r20, r10 1fbba: 94 01 movw r18, r8 1fbbc: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1fbc0: 4b 01 movw r8, r22 1fbc2: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 1fbc4: 20 e0 ldi r18, 0x00 ; 0 1fbc6: 30 e0 ldi r19, 0x00 ; 0 1fbc8: 4f e7 ldi r20, 0x7F ; 127 1fbca: 53 e4 ldi r21, 0x43 ; 67 1fbcc: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1fbd0: 20 e0 ldi r18, 0x00 ; 0 1fbd2: 30 e0 ldi r19, 0x00 ; 0 1fbd4: 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) { 1fbd6: 18 16 cp r1, r24 1fbd8: 0c f0 brlt .+2 ; 0x1fbdc 1fbda: 6d c1 rjmp .+730 ; 0x1feb6 if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1fbdc: c7 01 movw r24, r14 1fbde: b6 01 movw r22, r12 1fbe0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1fbe4: 18 16 cp r1, r24 1fbe6: 84 f4 brge .+32 ; 0x1fc08 1fbe8: a7 01 movw r20, r14 1fbea: 96 01 movw r18, r12 1fbec: 6d 85 ldd r22, Y+13 ; 0x0d 1fbee: 79 85 ldd r23, Y+9 ; 0x09 1fbf0: 81 2f mov r24, r17 1fbf2: 90 2f mov r25, r16 1fbf4: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1fbf8: 60 93 c4 05 sts 0x05C4, r22 ; 0x8005c4 1fbfc: 70 93 c5 05 sts 0x05C5, r23 ; 0x8005c5 1fc00: 80 93 c6 05 sts 0x05C6, r24 ; 0x8005c6 1fc04: 90 93 c7 05 sts 0x05C7, r25 ; 0x8005c7 pid_output=PID_MAX; 1fc08: 81 2c mov r8, r1 1fc0a: 91 2c mov r9, r1 1fc0c: 3f e7 ldi r19, 0x7F ; 127 1fc0e: a3 2e mov r10, r19 1fc10: 33 e4 ldi r19, 0x43 ; 67 1fc12: 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; 1fc14: 40 92 bc 05 sts 0x05BC, r4 ; 0x8005bc 1fc18: 50 92 bd 05 sts 0x05BD, r5 ; 0x8005bd 1fc1c: 60 92 be 05 sts 0x05BE, r6 ; 0x8005be 1fc20: 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)) 1fc24: 60 91 54 02 lds r22, 0x0254 ; 0x800254 <_ZL8maxttemp.lto_priv.435> 1fc28: 70 91 55 02 lds r23, 0x0255 ; 0x800255 <_ZL8maxttemp.lto_priv.435+0x1> 1fc2c: 07 2e mov r0, r23 1fc2e: 00 0c add r0, r0 1fc30: 88 0b sbc r24, r24 1fc32: 99 0b sbc r25, r25 1fc34: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1fc38: 9b 01 movw r18, r22 1fc3a: ac 01 movw r20, r24 1fc3c: c3 01 movw r24, r6 1fc3e: b2 01 movw r22, r4 1fc40: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1fc44: 87 ff sbrs r24, 7 1fc46: 57 c1 rjmp .+686 ; 0x1fef6 1fc48: 23 28 or r2, r3 1fc4a: 09 f4 brne .+2 ; 0x1fc4e 1fc4c: 54 c1 rjmp .+680 ; 0x1fef6 soft_pwm[e] = (int)pid_output >> 1; 1fc4e: c5 01 movw r24, r10 1fc50: b4 01 movw r22, r8 1fc52: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1fc56: 75 95 asr r23 1fc58: 67 95 ror r22 1fc5a: 60 93 f5 05 sts 0x05F5, r22 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.502> 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); 1fc5e: 20 91 e8 05 lds r18, 0x05E8 ; 0x8005e8 1fc62: 30 91 e9 05 lds r19, 0x05E9 ; 0x8005e9 1fc66: 3a 83 std Y+2, r19 ; 0x02 1fc68: 29 83 std Y+1, r18 ; 0x01 1fc6a: 40 90 ea 05 lds r4, 0x05EA ; 0x8005ea 1fc6e: 50 90 eb 05 lds r5, 0x05EB ; 0x8005eb 1fc72: 60 90 ec 05 lds r6, 0x05EC ; 0x8005ec 1fc76: 70 90 ed 05 lds r7, 0x05ED ; 0x8005ed #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 1fc7a: b9 01 movw r22, r18 1fc7c: 33 0f add r19, r19 1fc7e: 88 0b sbc r24, r24 1fc80: 99 0b sbc r25, r25 1fc82: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 1fc86: a3 01 movw r20, r6 1fc88: 92 01 movw r18, r4 1fc8a: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1fc8e: 6b 01 movw r12, r22 1fc90: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 1fc92: 20 91 db 0d lds r18, 0x0DDB ; 0x800ddb 1fc96: 30 91 dc 0d lds r19, 0x0DDC ; 0x800ddc 1fc9a: 40 91 dd 0d lds r20, 0x0DDD ; 0x800ddd 1fc9e: 50 91 de 0d lds r21, 0x0DDE ; 0x800dde 1fca2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1fca6: 6d 83 std Y+5, r22 ; 0x05 1fca8: 7e 83 std Y+6, r23 ; 0x06 1fcaa: 8f 83 std Y+7, r24 ; 0x07 1fcac: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 1fcae: 20 91 d1 05 lds r18, 0x05D1 ; 0x8005d1 1fcb2: 30 91 d2 05 lds r19, 0x05D2 ; 0x8005d2 1fcb6: 40 91 d3 05 lds r20, 0x05D3 ; 0x8005d3 1fcba: 50 91 d4 05 lds r21, 0x05D4 ; 0x8005d4 1fcbe: c7 01 movw r24, r14 1fcc0: b6 01 movw r22, r12 1fcc2: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1fcc6: 5b 01 movw r10, r22 1fcc8: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 1fcca: 30 91 14 04 lds r19, 0x0414 ; 0x800414 <_ZL19temp_iState_min_bed.lto_priv.431> 1fcce: 3e 87 std Y+14, r19 ; 0x0e 1fcd0: 80 91 15 04 lds r24, 0x0415 ; 0x800415 <_ZL19temp_iState_min_bed.lto_priv.431+0x1> 1fcd4: 8d 87 std Y+13, r24 ; 0x0d 1fcd6: 30 90 16 04 lds r3, 0x0416 ; 0x800416 <_ZL19temp_iState_min_bed.lto_priv.431+0x2> 1fcda: 20 90 17 04 lds r2, 0x0417 ; 0x800417 <_ZL19temp_iState_min_bed.lto_priv.431+0x3> 1fcde: 23 2f mov r18, r19 1fce0: 38 2f mov r19, r24 1fce2: 43 2d mov r20, r3 1fce4: 52 2d mov r21, r2 1fce6: b5 01 movw r22, r10 1fce8: c8 01 movw r24, r16 1fcea: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1fcee: 87 fd sbrc r24, 7 1fcf0: 18 c0 rjmp .+48 ; 0x1fd22 1fcf2: 90 91 10 04 lds r25, 0x0410 ; 0x800410 <_ZL19temp_iState_max_bed.lto_priv.432> 1fcf6: 9e 87 std Y+14, r25 ; 0x0e 1fcf8: 20 91 11 04 lds r18, 0x0411 ; 0x800411 <_ZL19temp_iState_max_bed.lto_priv.432+0x1> 1fcfc: 2d 87 std Y+13, r18 ; 0x0d 1fcfe: 30 90 12 04 lds r3, 0x0412 ; 0x800412 <_ZL19temp_iState_max_bed.lto_priv.432+0x2> 1fd02: 20 90 13 04 lds r2, 0x0413 ; 0x800413 <_ZL19temp_iState_max_bed.lto_priv.432+0x3> 1fd06: 29 2f mov r18, r25 1fd08: 3d 85 ldd r19, Y+13 ; 0x0d 1fd0a: 43 2d mov r20, r3 1fd0c: 52 2d mov r21, r2 1fd0e: b5 01 movw r22, r10 1fd10: c8 01 movw r24, r16 1fd12: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1fd16: 18 16 cp r1, r24 1fd18: 24 f0 brlt .+8 ; 0x1fd22 1fd1a: ae 86 std Y+14, r10 ; 0x0e 1fd1c: bd 86 std Y+13, r11 ; 0x0d 1fd1e: 30 2e mov r3, r16 1fd20: 21 2e mov r2, r17 1fd22: 8e 85 ldd r24, Y+14 ; 0x0e 1fd24: 9d 85 ldd r25, Y+13 ; 0x0d 1fd26: a3 2d mov r26, r3 1fd28: b2 2d mov r27, r2 1fd2a: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 1fd2e: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 1fd32: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 1fd36: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 iTerm_bed = cs.bedKi * temp_iState_bed; 1fd3a: 20 91 df 0d lds r18, 0x0DDF ; 0x800ddf 1fd3e: 30 91 e0 0d lds r19, 0x0DE0 ; 0x800de0 1fd42: 40 91 e1 0d lds r20, 0x0DE1 ; 0x800de1 1fd46: 50 91 e2 0d lds r21, 0x0DE2 ; 0x800de2 1fd4a: bc 01 movw r22, r24 1fd4c: 83 2d mov r24, r3 1fd4e: 92 2d mov r25, r2 1fd50: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1fd54: 69 87 std Y+9, r22 ; 0x09 1fd56: 7a 87 std Y+10, r23 ; 0x0a 1fd58: 8b 87 std Y+11, r24 ; 0x0b 1fd5a: 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); 1fd5c: 20 91 cd 05 lds r18, 0x05CD ; 0x8005cd 1fd60: 30 91 ce 05 lds r19, 0x05CE ; 0x8005ce 1fd64: 40 91 cf 05 lds r20, 0x05CF ; 0x8005cf 1fd68: 50 91 d0 05 lds r21, 0x05D0 ; 0x8005d0 1fd6c: c3 01 movw r24, r6 1fd6e: b2 01 movw r22, r4 1fd70: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1fd74: 20 91 e3 0d lds r18, 0x0DE3 ; 0x800de3 1fd78: 30 91 e4 0d lds r19, 0x0DE4 ; 0x800de4 1fd7c: 40 91 e5 0d lds r20, 0x0DE5 ; 0x800de5 1fd80: 50 91 e6 0d lds r21, 0x0DE6 ; 0x800de6 1fd84: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1fd88: 20 ed ldi r18, 0xD0 ; 208 1fd8a: 3c ec ldi r19, 0xCC ; 204 1fd8c: 4c e4 ldi r20, 0x4C ; 76 1fd8e: 5d e3 ldi r21, 0x3D ; 61 1fd90: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1fd94: 4b 01 movw r8, r22 1fd96: 5c 01 movw r10, r24 1fd98: 23 e3 ldi r18, 0x33 ; 51 1fd9a: 33 e3 ldi r19, 0x33 ; 51 1fd9c: 43 e7 ldi r20, 0x73 ; 115 1fd9e: 5f e3 ldi r21, 0x3F ; 63 1fda0: 60 91 c9 05 lds r22, 0x05C9 ; 0x8005c9 1fda4: 70 91 ca 05 lds r23, 0x05CA ; 0x8005ca 1fda8: 80 91 cb 05 lds r24, 0x05CB ; 0x8005cb 1fdac: 90 91 cc 05 lds r25, 0x05CC ; 0x8005cc 1fdb0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 1fdb4: 9b 01 movw r18, r22 1fdb6: ac 01 movw r20, r24 1fdb8: c5 01 movw r24, r10 1fdba: b4 01 movw r22, r8 1fdbc: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1fdc0: 4b 01 movw r8, r22 1fdc2: 5c 01 movw r10, r24 1fdc4: 80 92 c9 05 sts 0x05C9, r8 ; 0x8005c9 1fdc8: 90 92 ca 05 sts 0x05CA, r9 ; 0x8005ca 1fdcc: a0 92 cb 05 sts 0x05CB, r10 ; 0x8005cb 1fdd0: b0 92 cc 05 sts 0x05CC, r11 ; 0x8005cc temp_dState_bed = pid_input; 1fdd4: 40 92 cd 05 sts 0x05CD, r4 ; 0x8005cd 1fdd8: 50 92 ce 05 sts 0x05CE, r5 ; 0x8005ce 1fddc: 60 92 cf 05 sts 0x05CF, r6 ; 0x8005cf 1fde0: 70 92 d0 05 sts 0x05D0, r7 ; 0x8005d0 pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 1fde4: 29 85 ldd r18, Y+9 ; 0x09 1fde6: 3a 85 ldd r19, Y+10 ; 0x0a 1fde8: 4b 85 ldd r20, Y+11 ; 0x0b 1fdea: 5c 85 ldd r21, Y+12 ; 0x0c 1fdec: 6d 81 ldd r22, Y+5 ; 0x05 1fdee: 7e 81 ldd r23, Y+6 ; 0x06 1fdf0: 8f 81 ldd r24, Y+7 ; 0x07 1fdf2: 98 85 ldd r25, Y+8 ; 0x08 1fdf4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 1fdf8: a5 01 movw r20, r10 1fdfa: 94 01 movw r18, r8 1fdfc: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1fe00: 4b 01 movw r8, r22 1fe02: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 1fe04: 20 e0 ldi r18, 0x00 ; 0 1fe06: 30 e0 ldi r19, 0x00 ; 0 1fe08: 4f e7 ldi r20, 0x7F ; 127 1fe0a: 53 e4 ldi r21, 0x43 ; 67 1fe0c: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1fe10: 20 e0 ldi r18, 0x00 ; 0 1fe12: 30 e0 ldi r19, 0x00 ; 0 1fe14: 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) { 1fe16: 18 16 cp r1, r24 1fe18: 0c f0 brlt .+2 ; 0x1fe1c 1fe1a: 70 c0 rjmp .+224 ; 0x1fefc if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1fe1c: c7 01 movw r24, r14 1fe1e: b6 01 movw r22, r12 1fe20: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 1fe24: 18 16 cp r1, r24 1fe26: 84 f4 brge .+32 ; 0x1fe48 1fe28: a7 01 movw r20, r14 1fe2a: 96 01 movw r18, r12 1fe2c: 6e 85 ldd r22, Y+14 ; 0x0e 1fe2e: 7d 85 ldd r23, Y+13 ; 0x0d 1fe30: 83 2d mov r24, r3 1fe32: 92 2d mov r25, r2 1fe34: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1fe38: 60 93 d1 05 sts 0x05D1, r22 ; 0x8005d1 1fe3c: 70 93 d2 05 sts 0x05D2, r23 ; 0x8005d2 1fe40: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 1fe44: 90 93 d4 05 sts 0x05D4, r25 ; 0x8005d4 pid_output=MAX_BED_POWER; 1fe48: 81 2c mov r8, r1 1fe4a: 91 2c mov r9, r1 1fe4c: 9f e7 ldi r25, 0x7F ; 127 1fe4e: a9 2e mov r10, r25 1fe50: 93 e4 ldi r25, 0x43 ; 67 1fe52: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 1fe54: 20 e0 ldi r18, 0x00 ; 0 1fe56: 30 e0 ldi r19, 0x00 ; 0 1fe58: 4a ef ldi r20, 0xFA ; 250 1fe5a: 52 e4 ldi r21, 0x42 ; 66 1fe5c: c3 01 movw r24, r6 1fe5e: b2 01 movw r22, r4 1fe60: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1fe64: 87 ff sbrs r24, 7 1fe66: 6d c0 rjmp .+218 ; 0x1ff42 { soft_pwm_bed = (int)pid_output >> 1; 1fe68: c5 01 movw r24, r10 1fe6a: b4 01 movw r22, r8 1fe6c: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 1fe70: 75 95 asr r23 1fe72: 67 95 ror r22 1fe74: 60 93 ee 05 sts 0x05EE, r22 ; 0x8005ee soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 1fe78: 89 81 ldd r24, Y+1 ; 0x01 1fe7a: 9a 81 ldd r25, Y+2 ; 0x02 1fe7c: 89 2b or r24, r25 1fe7e: 11 f4 brne .+4 ; 0x1fe84 { soft_pwm_bed = 0; 1fe80: 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); } 1fe84: 2e 96 adiw r28, 0x0e ; 14 1fe86: 0f b6 in r0, 0x3f ; 63 1fe88: f8 94 cli 1fe8a: de bf out 0x3e, r29 ; 62 1fe8c: 0f be out 0x3f, r0 ; 63 1fe8e: cd bf out 0x3d, r28 ; 61 1fe90: df 91 pop r29 1fe92: cf 91 pop r28 1fe94: 1f 91 pop r17 1fe96: 0f 91 pop r16 1fe98: ff 90 pop r15 1fe9a: ef 90 pop r14 1fe9c: df 90 pop r13 1fe9e: cf 90 pop r12 1fea0: bf 90 pop r11 1fea2: af 90 pop r10 1fea4: 9f 90 pop r9 1fea6: 8f 90 pop r8 1fea8: 7f 90 pop r7 1feaa: 6f 90 pop r6 1feac: 5f 90 pop r5 1feae: 4f 90 pop r4 1feb0: 3f 90 pop r3 1feb2: 2f 90 pop r2 1feb4: 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) { 1feb6: c5 01 movw r24, r10 1feb8: b4 01 movw r22, r8 1feba: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1febe: 87 ff sbrs r24, 7 1fec0: a9 ce rjmp .-686 ; 0x1fc14 if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1fec2: 20 e0 ldi r18, 0x00 ; 0 1fec4: 30 e0 ldi r19, 0x00 ; 0 1fec6: a9 01 movw r20, r18 1fec8: c7 01 movw r24, r14 1feca: b6 01 movw r22, r12 1fecc: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1fed0: 87 ff sbrs r24, 7 1fed2: a3 cd rjmp .-1210 ; 0x1fa1a 1fed4: a7 01 movw r20, r14 1fed6: 96 01 movw r18, r12 1fed8: 6d 85 ldd r22, Y+13 ; 0x0d 1feda: 79 85 ldd r23, Y+9 ; 0x09 1fedc: 81 2f mov r24, r17 1fede: 90 2f mov r25, r16 1fee0: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1fee4: 60 93 c4 05 sts 0x05C4, r22 ; 0x8005c4 1fee8: 70 93 c5 05 sts 0x05C5, r23 ; 0x8005c5 1feec: 80 93 c6 05 sts 0x05C6, r24 ; 0x8005c6 1fef0: 90 93 c7 05 sts 0x05C7, r25 ; 0x8005c7 1fef4: 92 cd rjmp .-1244 ; 0x1fa1a // 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; 1fef6: 10 92 f5 05 sts 0x05F5, r1 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.502> 1fefa: b1 ce rjmp .-670 ; 0x1fc5e 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){ 1fefc: c5 01 movw r24, r10 1fefe: b4 01 movw r22, r8 1ff00: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1ff04: 87 ff sbrs r24, 7 1ff06: a6 cf rjmp .-180 ; 0x1fe54 if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1ff08: 20 e0 ldi r18, 0x00 ; 0 1ff0a: 30 e0 ldi r19, 0x00 ; 0 1ff0c: a9 01 movw r20, r18 1ff0e: c7 01 movw r24, r14 1ff10: b6 01 movw r22, r12 1ff12: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 1ff16: 87 ff sbrs r24, 7 1ff18: 10 c0 rjmp .+32 ; 0x1ff3a 1ff1a: a7 01 movw r20, r14 1ff1c: 96 01 movw r18, r12 1ff1e: 6e 85 ldd r22, Y+14 ; 0x0e 1ff20: 7d 85 ldd r23, Y+13 ; 0x0d 1ff22: 83 2d mov r24, r3 1ff24: 92 2d mov r25, r2 1ff26: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 1ff2a: 60 93 d1 05 sts 0x05D1, r22 ; 0x8005d1 1ff2e: 70 93 d2 05 sts 0x05D2, r23 ; 0x8005d2 1ff32: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 1ff36: 90 93 d4 05 sts 0x05D4, r25 ; 0x8005d4 pid_output=0; 1ff3a: 81 2c mov r8, r1 1ff3c: 91 2c mov r9, r1 1ff3e: 54 01 movw r10, r8 1ff40: 89 cf rjmp .-238 ; 0x1fe54 { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 1ff42: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee 1ff46: 98 cf rjmp .-208 ; 0x1fe78 0001ff48 : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 1ff4c: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 1ff50: 90 93 f0 05 sts 0x05F0, r25 ; 0x8005f0 1ff54: 80 93 ef 05 sts 0x05EF, r24 ; 0x8005ef target_temperature_bed_isr = target_temperature_bed; 1ff58: 80 91 59 12 lds r24, 0x1259 ; 0x801259 1ff5c: 90 91 5a 12 lds r25, 0x125A ; 0x80125a 1ff60: 90 93 e9 05 sts 0x05E9, r25 ; 0x8005e9 1ff64: 80 93 e8 05 sts 0x05E8, r24 ; 0x8005e8 } 1ff68: 08 95 ret 0001ff6a : /* 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() { 1ff6a: cf 93 push r28 { bool temp_mgr_state; public: TempMgrGuard() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1ff6c: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1ff6e: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 1ff70: c0 91 71 00 lds r28, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1ff74: c2 70 andi r28, 0x02 ; 2 DISABLE_TEMP_MGR_INTERRUPT(); 1ff76: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1ff7a: 8d 7f andi r24, 0xFD ; 253 1ff7c: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1ff80: 9f bf out 0x3f, r25 ; 63 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 1ff86: 90 91 f2 05 lds r25, 0x05F2 ; 0x8005f2 1ff8a: a0 91 f3 05 lds r26, 0x05F3 ; 0x8005f3 1ff8e: b0 91 f4 05 lds r27, 0x05F4 ; 0x8005f4 1ff92: 80 93 5a 0d sts 0x0D5A, r24 ; 0x800d5a 1ff96: 90 93 5b 0d sts 0x0D5B, r25 ; 0x800d5b 1ff9a: a0 93 5c 0d sts 0x0D5C, r26 ; 0x800d5c 1ff9e: b0 93 5d 0d sts 0x0D5D, r27 ; 0x800d5d current_temperature_bed = current_temperature_bed_isr; 1ffa2: 80 91 ea 05 lds r24, 0x05EA ; 0x8005ea 1ffa6: 90 91 eb 05 lds r25, 0x05EB ; 0x8005eb 1ffaa: a0 91 ec 05 lds r26, 0x05EC ; 0x8005ec 1ffae: b0 91 ed 05 lds r27, 0x05ED ; 0x8005ed 1ffb2: 80 93 bc 03 sts 0x03BC, r24 ; 0x8003bc 1ffb6: 90 93 bd 03 sts 0x03BD, r25 ; 0x8003bd 1ffba: a0 93 be 03 sts 0x03BE, r26 ; 0x8003be 1ffbe: b0 93 bf 03 sts 0x03BF, r27 ; 0x8003bf #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 1ffc2: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 1ffc6: 90 91 d7 05 lds r25, 0x05D7 ; 0x8005d7 1ffca: a0 91 d8 05 lds r26, 0x05D8 ; 0x8005d8 1ffce: b0 91 d9 05 lds r27, 0x05D9 ; 0x8005d9 1ffd2: 80 93 85 03 sts 0x0385, r24 ; 0x800385 1ffd6: 90 93 86 03 sts 0x0386, r25 ; 0x800386 1ffda: a0 93 87 03 sts 0x0387, r26 ; 0x800387 1ffde: 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) { 1ffe2: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 1ffe6: 81 11 cpse r24, r1 1ffe8: 02 c0 rjmp .+4 ; 0x1ffee // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 1ffea: 0e 94 a4 ff call 0x1ff48 ; 0x1ff48 } temp_meas_ready = false; 1ffee: 10 92 d5 05 sts 0x05D5, r1 ; 0x8005d5 DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1fff2: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1fff4: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 1fff6: cc 23 and r28, r28 1fff8: 29 f0 breq .+10 ; 0x20004 1fffa: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1fffe: 82 60 ori r24, 0x02 ; 2 20000: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 20004: 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; } 20006: cf 91 pop r28 20008: 08 95 ret 0002000a : { // 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) 2000a: 81 30 cpi r24, 0x01 ; 1 2000c: 61 f1 breq .+88 ; 0x20066 2000e: 20 f0 brcs .+8 ; 0x20018 20010: 82 30 cpi r24, 0x02 ; 2 20012: 09 f4 brne .+2 ; 0x20016 20014: 4b c0 rjmp .+150 ; 0x200ac 20016: 08 95 ret { case X_AXIS: { enable_x(); 20018: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction. 2001a: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 2001e: 81 e0 ldi r24, 0x01 ; 1 20020: 29 2f mov r18, r25 20022: 22 70 andi r18, 0x02 ; 2 20024: 91 ff sbrs r25, 1 20026: 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) { 20028: 86 17 cp r24, r22 2002a: 59 f0 breq .+22 ; 0x20042 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 2002c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20030: 66 23 and r22, r22 20032: a9 f0 breq .+42 ; 0x2005e 20034: 82 60 ori r24, 0x02 ; 2 20036: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 2003a: 8b e8 ldi r24, 0x8B ; 139 2003c: 91 e0 ldi r25, 0x01 ; 1 2003e: 01 97 sbiw r24, 0x01 ; 1 20040: f1 f7 brne .-4 ; 0x2003e delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 20042: 40 9a sbi 0x08, 0 ; 8 20044: 83 e0 ldi r24, 0x03 ; 3 20046: 90 e0 ldi r25, 0x00 ; 0 20048: 01 97 sbiw r24, 0x01 ; 1 2004a: f1 f7 brne .-4 ; 0x20048 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_HI(X_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(X_AXIS); 2004c: 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); 2004e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20052: 22 23 and r18, r18 20054: 31 f0 breq .+12 ; 0x20062 20056: 82 60 ori r24, 0x02 ; 2 STEP_NC_LO(Z2_AXIS); #endif //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 20058: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 2005c: 08 95 ret uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction. 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); 2005e: 8d 7f andi r24, 0xFD ; 253 20060: ea cf rjmp .-44 ; 0x20036 #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); 20062: 8d 7f andi r24, 0xFD ; 253 20064: f9 cf rjmp .-14 ; 0x20058 } break; case Y_AXIS: { enable_y(); 20066: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction. 20068: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 2006c: 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) { 2006e: 86 17 cp r24, r22 20070: 59 f0 breq .+22 ; 0x20088 WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 20072: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20076: 66 23 and r22, r22 20078: 99 f0 breq .+38 ; 0x200a0 2007a: 91 60 ori r25, 0x01 ; 1 2007c: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20080: eb e8 ldi r30, 0x8B ; 139 20082: f1 e0 ldi r31, 0x01 ; 1 20084: 31 97 sbiw r30, 0x01 ; 1 20086: f1 f7 brne .-4 ; 0x20084 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 20088: 41 9a sbi 0x08, 1 ; 8 2008a: e3 e0 ldi r30, 0x03 ; 3 2008c: f0 e0 ldi r31, 0x00 ; 0 2008e: 31 97 sbiw r30, 0x01 ; 1 20090: f1 f7 brne .-4 ; 0x2008e #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_HI(Y_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(Y_AXIS); 20092: 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); 20094: 88 23 and r24, r24 20096: 31 f0 breq .+12 ; 0x200a4 20098: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2009c: 81 60 ori r24, 0x01 ; 1 2009e: dc cf rjmp .-72 ; 0x20058 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction. 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); 200a0: 9e 7f andi r25, 0xFE ; 254 200a2: ec cf rjmp .-40 ; 0x2007c #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); 200a4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 200a8: 8e 7f andi r24, 0xFE ; 254 200aa: d6 cf rjmp .-84 ; 0x20058 } break; case Z_AXIS: { enable_z(); 200ac: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction. 200ae: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 200b2: 81 e0 ldi r24, 0x01 ; 1 200b4: 29 2f mov r18, r25 200b6: 24 70 andi r18, 0x04 ; 4 200b8: 92 ff sbrs r25, 2 200ba: 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) { 200bc: 68 17 cp r22, r24 200be: 59 f0 breq .+22 ; 0x200d6 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 200c0: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 200c4: 66 23 and r22, r22 200c6: b1 f0 breq .+44 ; 0x200f4 200c8: 94 60 ori r25, 0x04 ; 4 200ca: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 200ce: eb e8 ldi r30, 0x8B ; 139 200d0: f1 e0 ldi r31, 0x01 ; 1 200d2: 31 97 sbiw r30, 0x01 ; 1 200d4: f1 f7 brne .-4 ; 0x200d2 #endif delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 200d6: 42 9a sbi 0x08, 2 ; 8 200d8: e3 e0 ldi r30, 0x03 ; 3 200da: f0 e0 ldi r31, 0x00 ; 0 200dc: 31 97 sbiw r30, 0x01 ; 1 200de: f1 f7 brne .-4 ; 0x200dc #ifdef Z_DUAL_STEPPER_DRIVERS STEP_NC_HI(Z2_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); 200e0: 42 98 cbi 0x08, 2 ; 8 #ifdef Z_DUAL_STEPPER_DRIVERS STEP_NC_LO(Z2_AXIS); #endif //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { 200e2: 68 17 cp r22, r24 200e4: 09 f4 brne .+2 ; 0x200e8 200e6: ba cf rjmp .-140 ; 0x2005c WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 200e8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 200ec: 22 23 and r18, r18 200ee: 21 f0 breq .+8 ; 0x200f8 200f0: 84 60 ori r24, 0x04 ; 4 200f2: b2 cf rjmp .-156 ; 0x20058 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction. 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); 200f4: 9b 7f andi r25, 0xFB ; 251 200f6: e9 cf rjmp .-46 ; 0x200ca STEP_NC_LO(Z2_AXIS); #endif //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 200f8: 8b 7f andi r24, 0xFB ; 251 200fa: ae cf rjmp .-164 ; 0x20058 000200fc : } } static void checkRx(void) { if (selectedSerialPort == 0) { 200fc: 80 91 1c 06 lds r24, 0x061C ; 0x80061c 20100: 81 11 cpse r24, r1 20102: 25 c0 rjmp .+74 ; 0x2014e if((M_UCSRxA & (1< 20108: 87 ff sbrs r24, 7 2010a: 3d c0 rjmp .+122 ; 0x20186 // Test for a framing error. if (M_UCSRxA & (1< 20110: 84 ff sbrs r24, 4 20112: 03 c0 rjmp .+6 ; 0x2011a // 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); 20114: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 20118: 08 95 ret } else { unsigned char c = M_UDRx; 2011a: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 2011e: 20 91 42 05 lds r18, 0x0542 ; 0x800542 20122: 30 91 43 05 lds r19, 0x0543 ; 0x800543 20126: c9 01 movw r24, r18 20128: 01 96 adiw r24, 0x01 ; 1 2012a: 8f 77 andi r24, 0x7F ; 127 2012c: 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) { 2012e: 60 91 44 05 lds r22, 0x0544 ; 0x800544 20132: 70 91 45 05 lds r23, 0x0545 ; 0x800545 20136: 86 17 cp r24, r22 20138: 97 07 cpc r25, r23 2013a: 29 f1 breq .+74 ; 0x20186 // 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; 2013c: 2e 53 subi r18, 0x3E ; 62 2013e: 3b 4f sbci r19, 0xFB ; 251 20140: f9 01 movw r30, r18 20142: 40 83 st Z, r20 rx_buffer.head = i; 20144: 90 93 43 05 sts 0x0543, r25 ; 0x800543 20148: 80 93 42 05 sts 0x0542, r24 ; 0x800542 2014c: 1c c0 rjmp .+56 ; 0x20186 UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 20152: 87 ff sbrs r24, 7 20154: 18 c0 rjmp .+48 ; 0x20186 // Test for a framing error. if (UCSR1A & (1< 2015a: 84 ff sbrs r24, 4 2015c: 03 c0 rjmp .+6 ; 0x20164 // 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); 2015e: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 20162: 08 95 ret } else { unsigned char c = UDR1; 20164: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 20168: 20 91 42 05 lds r18, 0x0542 ; 0x800542 2016c: 30 91 43 05 lds r19, 0x0543 ; 0x800543 20170: c9 01 movw r24, r18 20172: 01 96 adiw r24, 0x01 ; 1 20174: 8f 77 andi r24, 0x7F ; 127 20176: 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) { 20178: 60 91 44 05 lds r22, 0x0544 ; 0x800544 2017c: 70 91 45 05 lds r23, 0x0545 ; 0x800545 20180: 68 17 cp r22, r24 20182: 79 07 cpc r23, r25 20184: d9 f6 brne .-74 ; 0x2013c M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 20186: 08 95 ret 00020188 : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 20188: 93 e0 ldi r25, 0x03 ; 3 2018a: 81 11 cpse r24, r1 2018c: 91 e0 ldi r25, 0x01 ; 1 for(nI=0;nI delayMicroseconds(200); WRITE(BEEPER,LOW); 201a0: 72 98 cbi 0x0e, 2 ; 14 201a2: f9 01 movw r30, r18 201a4: 31 97 sbiw r30, 0x01 ; 1 201a6: f1 f7 brne .-4 ; 0x201a4 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); } } 201ae: 08 95 ret 000201b0 : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 201b0: 8a e0 ldi r24, 0x0A ; 10 201b2: 2b e8 ldi r18, 0x8B ; 139 201b4: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 201b6: 72 9a sbi 0x0e, 2 ; 14 201b8: f9 01 movw r30, r18 201ba: 31 97 sbiw r30, 0x01 ; 1 201bc: f1 f7 brne .-4 ; 0x201ba delayMicroseconds(100); WRITE(BEEPER,LOW); 201be: 72 98 cbi 0x0e, 2 ; 14 201c0: f9 01 movw r30, r18 201c2: 31 97 sbiw r30, 0x01 ; 1 201c4: f1 f7 brne .-4 ; 0x201c2 201c6: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 201c8: b1 f7 brne .-20 ; 0x201b6 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 201ca: 08 95 ret 000201cc : /// 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; 201cc: 86 27 eor r24, r22 201ce: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 201d0: 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) { 201d2: 38 2f mov r19, r24 201d4: 88 0f add r24, r24 201d6: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 201d8: 82 27 eor r24, r18 201da: 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++) { 201dc: d1 f7 brne .-12 ; 0x201d2 } else { data <<= 1U; } } return data; } 201de: 08 95 ret 000201e0 : #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){ 201e0: cf 93 push r28 201e2: df 93 push r29 201e4: cd b7 in r28, 0x3d ; 61 201e6: de b7 in r29, 0x3e ; 62 201e8: 2f 97 sbiw r28, 0x0f ; 15 201ea: 0f b6 in r0, 0x3f ; 63 201ec: f8 94 cli 201ee: de bf out 0x3e, r29 ; 62 201f0: 0f be out 0x3f, r0 ; 63 201f2: cd bf out 0x3d, r28 ; 61 201f4: fc 01 movw r30, r24 201f6: de 01 movw r26, r28 201f8: 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; 201fa: 90 e0 ldi r25, 0x00 ; 0 201fc: 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); 201fe: 84 91 lpm r24, Z 20200: 41 e0 ldi r20, 0x01 ; 1 20202: 49 0f add r20, r25 if( ! b ) 20204: 88 23 and r24, r24 20206: 29 f0 breq .+10 ; 0x20212 break; dst[i] = b; 20208: 8d 93 st X+, r24 2020a: 31 96 adiw r30, 0x01 ; 1 2020c: 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 2020e: 4d 30 cpi r20, 0x0D ; 13 20210: b1 f7 brne .-20 ; 0x201fe uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 20212: f9 01 movw r30, r18 20214: e9 0f add r30, r25 20216: f1 1d adc r31, r1 20218: 8a e3 ldi r24, 0x3A ; 58 2021a: 80 83 st Z, r24 ++i; 2021c: 9f 5f subi r25, 0xFF ; 255 2021e: f9 01 movw r30, r18 20220: e9 0f add r30, r25 20222: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 20224: 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 20226: 9e 30 cpi r25, 0x0E ; 14 20228: 19 f0 breq .+6 ; 0x20230 dst[i] = ' '; 2022a: 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 2022c: 9f 5f subi r25, 0xFF ; 255 2022e: fb cf rjmp .-10 ; 0x20226 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 20230: 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 20232: 7f 93 push r23 20234: 6f 93 push r22 20236: 3f 93 push r19 20238: 2f 93 push r18 2023a: 89 e1 ldi r24, 0x19 ; 25 2023c: 99 e9 ldi r25, 0x99 ; 153 2023e: 9f 93 push r25 20240: 8f 93 push r24 20242: 0e 94 66 6f call 0xdecc ; 0xdecc 20246: 0f 90 pop r0 20248: 0f 90 pop r0 2024a: 0f 90 pop r0 2024c: 0f 90 pop r0 2024e: 0f 90 pop r0 20250: 0f 90 pop r0 } 20252: 2f 96 adiw r28, 0x0f ; 15 20254: 0f b6 in r0, 0x3f ; 63 20256: f8 94 cli 20258: de bf out 0x3e, r29 ; 62 2025a: 0f be out 0x3f, r0 ; 63 2025c: cd bf out 0x3d, r28 ; 61 2025e: df 91 pop r29 20260: cf 91 pop r28 20262: 08 95 ret 00020264 : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 20264: df 92 push r13 20266: ef 92 push r14 20268: ff 92 push r15 2026a: 0f 93 push r16 2026c: 1f 93 push r17 2026e: cf 93 push r28 20270: df 93 push r29 20272: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 20276: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 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] ); 2027a: c7 eb ldi r28, 0xB7 ; 183 2027c: d3 e0 ldi r29, 0x03 ; 3 2027e: 8a 81 ldd r24, Y+2 ; 0x02 20280: 9b 81 ldd r25, Y+3 ; 0x03 20282: 2c e3 ldi r18, 0x3C ; 60 20284: f2 2e mov r15, r18 20286: f8 9e mul r15, r24 20288: 80 01 movw r16, r0 2028a: f9 9e mul r15, r25 2028c: 10 0d add r17, r0 2028e: 11 24 eor r1, r1 20290: 87 e2 ldi r24, 0x27 ; 39 20292: 9a e4 ldi r25, 0x4A ; 74 20294: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20298: e8 2e mov r14, r24 2029a: d9 2e mov r13, r25 2029c: 88 81 ld r24, Y 2029e: 99 81 ldd r25, Y+1 ; 0x01 202a0: f8 9e mul r15, r24 202a2: e0 01 movw r28, r0 202a4: f9 9e mul r15, r25 202a6: d0 0d add r29, r0 202a8: 11 24 eor r1, r1 202aa: 84 e3 ldi r24, 0x34 ; 52 202ac: 9a e4 ldi r25, 0x4A ; 74 202ae: 0e 94 95 75 call 0xeb2a ; 0xeb2a 202b2: 1f 93 push r17 202b4: 0f 93 push r16 202b6: df 92 push r13 202b8: ef 92 push r14 202ba: df 93 push r29 202bc: cf 93 push r28 202be: 9f 93 push r25 202c0: 8f 93 push r24 202c2: 8f e8 ldi r24, 0x8F ; 143 202c4: 98 e9 ldi r25, 0x98 ; 152 202c6: 9f 93 push r25 202c8: 8f 93 push r24 202ca: 0e 94 66 6f call 0xdecc ; 0xdecc menu_back_if_clicked(); 202ce: 8d b7 in r24, 0x3d ; 61 202d0: 9e b7 in r25, 0x3e ; 62 202d2: 0a 96 adiw r24, 0x0a ; 10 202d4: 0f b6 in r0, 0x3f ; 63 202d6: f8 94 cli 202d8: 9e bf out 0x3e, r25 ; 62 202da: 0f be out 0x3f, r0 ; 63 202dc: 8d bf out 0x3d, r24 ; 61 } 202de: df 91 pop r29 202e0: cf 91 pop r28 202e2: 1f 91 pop r17 202e4: 0f 91 pop r16 202e6: ff 90 pop r15 202e8: ef 90 pop r14 202ea: 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(); 202ec: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 000202f0 : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 202f0: cf 92 push r12 202f2: df 92 push r13 202f4: ef 92 push r14 202f6: ff 92 push r15 202f8: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 202fc: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 20300: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 20304: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 20308: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2030c: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 20310: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 20314: 6b 01 movw r12, r22 20316: 85 ee ldi r24, 0xE5 ; 229 20318: 94 e4 ldi r25, 0x44 ; 68 2031a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2031e: b6 01 movw r22, r12 20320: 0f 94 f0 00 call 0x201e0 ; 0x201e0 lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 20324: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 20328: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 2032c: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 20330: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 20334: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 20338: 6b 01 movw r12, r22 2033a: 8a ec ldi r24, 0xCA ; 202 2033c: 94 e4 ldi r25, 0x44 ; 68 2033e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20342: b6 01 movw r22, r12 20344: 0f 94 f0 00 call 0x201e0 ; 0x201e0 #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 20348: 60 91 85 03 lds r22, 0x0385 ; 0x800385 2034c: 70 91 86 03 lds r23, 0x0386 ; 0x800386 20350: 80 91 87 03 lds r24, 0x0387 ; 0x800387 20354: 90 91 88 03 lds r25, 0x0388 ; 0x800388 20358: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 2035c: 8a e7 ldi r24, 0x7A ; 122 2035e: 98 e6 ldi r25, 0x68 ; 104 20360: 0f 94 f0 00 call 0x201e0 ; 0x201e0 #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 20364: ff 90 pop r15 20366: ef 90 pop r14 20368: df 90 pop r13 2036a: 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(); 2036c: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 00020370 : } #ifdef FILAMENT_SENSOR static void lcd_menu_AutoLoadFilament() { lcd_display_message_fullscreen_nonBlocking_P(_T(MSG_AUTOLOADING_ENABLED)); 20370: 80 e1 ldi r24, 0x10 ; 16 20372: 99 e5 ldi r25, 0x59 ; 89 20374: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20378: 0e 94 09 de call 0x1bc12 ; 0x1bc12 menu_back_if_clicked(); 2037c: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 00020380 : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 20380: 87 ea ldi r24, 0xA7 ; 167 20382: 9c e0 ldi r25, 0x0C ; 12 20384: 0f 94 3e a4 call 0x3487c ; 0x3487c if (eeprom_setting != 0) 20388: 81 11 cpse r24, r1 2038a: 05 c0 rjmp .+10 ; 0x20396 return false; switch(eFilamentAction) { 2038c: 80 91 94 03 lds r24, 0x0394 ; 0x800394 20390: 81 50 subi r24, 0x01 ; 1 20392: 88 30 cpi r24, 0x08 ; 8 20394: 10 f0 brcs .+4 ; 0x2039a #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; 20396: 80 e0 ldi r24, 0x00 ; 0 20398: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 2039a: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 2039c: 08 95 ret 0002039e : //! | 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() { 2039e: cf 92 push r12 203a0: df 92 push r13 203a2: ef 92 push r14 203a4: ff 92 push r15 203a6: 0f 93 push r16 203a8: 1f 93 push r17 203aa: cf 93 push r28 203ac: df 93 push r29 203ae: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 203b2: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 " %-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) )); 203b6: 8f ec ldi r24, 0xCF ; 207 203b8: 9e e0 ldi r25, 0x0E ; 14 203ba: 0f 94 3e a4 call 0x3487c ; 0x3487c //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 203be: 90 e0 ldi r25, 0x00 ; 0 203c0: 0e 94 93 fc call 0x1f926 ; 0x1f926 203c4: d8 2e mov r13, r24 203c6: c9 2e mov r12, r25 203c8: 82 e6 ldi r24, 0x62 ; 98 203ca: 97 e5 ldi r25, 0x57 ; 87 203cc: 0e 94 95 75 call 0xeb2a ; 0xeb2a 203d0: f8 2e mov r15, r24 203d2: 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) ), 203d4: 82 ed ldi r24, 0xD2 ; 210 203d6: 9e e0 ldi r25, 0x0E ; 14 203d8: 0f 94 3e a4 call 0x3487c ; 0x3487c //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 203dc: 90 e0 ldi r25, 0x00 ; 0 203de: 0e 94 93 fc call 0x1f926 ; 0x1f926 203e2: 18 2f mov r17, r24 203e4: 09 2f mov r16, r25 203e6: 86 e5 ldi r24, 0x56 ; 86 203e8: 97 e5 ldi r25, 0x57 ; 87 203ea: 0e 94 95 75 call 0xeb2a ; 0xeb2a 203ee: ec 01 movw r28, r24 203f0: 88 e9 ldi r24, 0x98 ; 152 203f2: 97 e5 ldi r25, 0x57 ; 87 203f4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 203f8: cf 92 push r12 203fa: df 92 push r13 203fc: ef 92 push r14 203fe: ff 92 push r15 20400: 0f 93 push r16 20402: 1f 93 push r17 20404: df 93 push r29 20406: cf 93 push r28 20408: 9f 93 push r25 2040a: 8f 93 push r24 2040c: 8a ea ldi r24, 0xAA ; 170 2040e: 98 e9 ldi r25, 0x98 ; 152 20410: 9f 93 push r25 20412: 8f 93 push r24 20414: 0e 94 66 6f call 0xdecc ; 0xdecc " %-16.16S%-3d" ), _T(MSG_LAST_PRINT_FAILURES), _T(MSG_MMU_FAILS), clamp999( eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL) ), _T(MSG_MMU_LOAD_FAILS), clamp999( eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL) )); menu_back_if_clicked(); 20418: 8d b7 in r24, 0x3d ; 61 2041a: 9e b7 in r25, 0x3e ; 62 2041c: 0c 96 adiw r24, 0x0c ; 12 2041e: 0f b6 in r0, 0x3f ; 63 20420: f8 94 cli 20422: 9e bf out 0x3e, r25 ; 62 20424: 0f be out 0x3f, r0 ; 63 20426: 8d bf out 0x3d, r24 ; 61 } 20428: df 91 pop r29 2042a: cf 91 pop r28 2042c: 1f 91 pop r17 2042e: 0f 91 pop r16 20430: ff 90 pop r15 20432: ef 90 pop r14 20434: df 90 pop r13 20436: 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(); 20438: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 0002043c : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 2043c: 0e 94 67 74 call 0xe8ce ; 0xe8ce 20440: 10 92 60 04 sts 0x0460, r1 ; 0x800460 20444: 80 91 60 04 lds r24, 0x0460 ; 0x800460 20448: 84 30 cpi r24, 0x04 ; 4 2044a: 68 f5 brcc .+90 ; 0x204a6 2044c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 20450: 89 ef ldi r24, 0xF9 ; 249 20452: 98 e4 ldi r25, 0x48 ; 72 20454: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20458: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 2045c: 89 e4 ldi r24, 0x49 ; 73 2045e: 97 e5 ldi r25, 0x57 ; 87 20460: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20464: 6c eb ldi r22, 0xBC ; 188 20466: 77 e3 ldi r23, 0x37 ; 55 20468: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 2046c: 81 e4 ldi r24, 0x41 ; 65 2046e: 97 e5 ldi r25, 0x57 ; 87 20470: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20474: 64 ed ldi r22, 0xD4 ; 212 20476: 77 e3 ldi r23, 0x37 ; 55 20478: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 2047c: 85 e8 ldi r24, 0x85 ; 133 2047e: 97 e5 ldi r25, 0x57 ; 87 20480: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20484: 62 ed ldi r22, 0xD2 ; 210 20486: 77 e3 ldi r23, 0x37 ; 55 20488: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_END(); 2048c: 0e 94 de 62 call 0xc5bc ; 0xc5bc //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 20490: 80 91 60 04 lds r24, 0x0460 ; 0x800460 20494: 8f 5f subi r24, 0xFF ; 255 20496: 80 93 60 04 sts 0x0460, r24 ; 0x800460 2049a: 80 91 62 04 lds r24, 0x0462 ; 0x800462 2049e: 8f 5f subi r24, 0xFF ; 255 204a0: 80 93 62 04 sts 0x0462, r24 ; 0x800462 204a4: cf cf rjmp .-98 ; 0x20444 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(); } 204a6: 08 95 ret 000204a8 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 204a8: 80 91 15 06 lds r24, 0x0615 ; 0x800615 204ac: 81 11 cpse r24, r1 204ae: 03 c0 rjmp .+6 ; 0x204b6 204b0: 82 e0 ldi r24, 0x02 ; 2 204b2: 0c 94 5a 63 jmp 0xc6b4 ; 0xc6b4 204b6: 81 e0 ldi r24, 0x01 ; 1 204b8: fc cf rjmp .-8 ; 0x204b2 000204ba : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 204ba: 8e ec ldi r24, 0xCE ; 206 204bc: 9e e0 ldi r25, 0x0E ; 14 204be: 0f 94 3e a4 call 0x3487c ; 0x3487c 204c2: 60 e0 ldi r22, 0x00 ; 0 204c4: 81 30 cpi r24, 0x01 ; 1 204c6: 09 f0 breq .+2 ; 0x204ca 204c8: 61 e0 ldi r22, 0x01 ; 1 204ca: 8e ec ldi r24, 0xCE ; 206 204cc: 9e e0 ldi r25, 0x0E ; 14 204ce: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 000204d2 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 204d2: 60 91 40 02 lds r22, 0x0240 ; 0x800240 204d6: 81 e0 ldi r24, 0x01 ; 1 204d8: 68 27 eor r22, r24 204da: 60 93 40 02 sts 0x0240, r22 ; 0x800240 204de: 87 e8 ldi r24, 0x87 ; 135 204e0: 9f e0 ldi r25, 0x0F ; 15 204e2: 0f 94 62 a4 call 0x348c4 ; 0x348c4 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. 204e6: 80 91 40 02 lds r24, 0x0240 ; 0x800240 204ea: 81 11 cpse r24, r1 204ec: 02 c0 rjmp .+4 ; 0x204f2 204ee: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce #endif //FANCHECK } 204f2: 08 95 ret 000204f4 : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 204f4: 86 ed ldi r24, 0xD6 ; 214 204f6: 9e e0 ldi r25, 0x0E ; 14 204f8: 0f 94 3e a4 call 0x3487c ; 0x3487c 204fc: 61 e0 ldi r22, 0x01 ; 1 204fe: 82 30 cpi r24, 0x02 ; 2 20500: 09 f0 breq .+2 ; 0x20504 20502: 62 e0 ldi r22, 0x02 ; 2 20504: 86 ed ldi r24, 0xD6 ; 214 20506: 9e e0 ldi r25, 0x0E ; 14 20508: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 0002050c : #ifdef MENU_SERIAL_DUMP #include "Dcodes.h" static void lcd_serial_dump() { serial_dump_and_reset(dump_crash_reason::manual); 2050c: 80 e0 ldi r24, 0x00 ; 0 2050e: 0c 94 fc 84 jmp 0x109f8 ; 0x109f8 00020512 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 20512: ef 92 push r14 20514: ff 92 push r15 20516: 0f 93 push r16 20518: 1f 93 push r17 2051a: cf 93 push r28 2051c: 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) 2051e: 80 91 96 03 lds r24, 0x0396 ; 0x800396 20522: 88 23 and r24, r24 20524: 29 f0 breq .+10 ; 0x20530 20526: 90 91 59 02 lds r25, 0x0259 ; 0x800259 2052a: 92 30 cpi r25, 0x02 ; 2 2052c: 09 f0 breq .+2 ; 0x20530 2052e: 74 c1 rjmp .+744 ; 0x20818 { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 20530: 81 e0 ldi r24, 0x01 ; 1 20532: 80 93 96 03 sts 0x0396, r24 ; 0x800396 20536: 80 91 48 16 lds r24, 0x1648 ; 0x801648 _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 2053a: 80 93 97 03 sts 0x0397, r24 ; 0x800397 if (_md->is_flash_air) { 2053e: 88 23 and r24, r24 20540: 21 f0 breq .+8 ; 0x2054a card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 20542: 88 e9 ldi r24, 0x98 ; 152 20544: 93 e0 ldi r25, 0x03 ; 3 20546: 0f 94 d2 77 call 0x2efa4 ; 0x2efa4 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 2054a: 0e 94 67 74 call 0xe8ce ; 0xe8ce 2054e: 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); 20552: 84 e5 ldi r24, 0x54 ; 84 20554: e8 2e mov r14, r24 20556: 89 e9 ldi r24, 0x99 ; 153 20558: 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]); 2055a: c3 e2 ldi r28, 0x23 ; 35 2055c: d9 e9 ldi r29, 0x99 ; 153 2055e: 0c e9 ldi r16, 0x9C ; 156 20560: 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(); 20562: 80 91 60 04 lds r24, 0x0460 ; 0x800460 20566: 84 30 cpi r24, 0x04 ; 4 20568: 08 f0 brcs .+2 ; 0x2056c 2056a: 7d c1 rjmp .+762 ; 0x20866 2056c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 20570: 89 ef ldi r24, 0xF9 ; 249 20572: 98 e4 ldi r25, 0x48 ; 72 20574: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20578: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR("Firmware:")); 2057c: 87 eb ldi r24, 0xB7 ; 183 2057e: 99 e9 ldi r25, 0x99 ; 153 20580: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 20584: 8a ea ldi r24, 0xAA ; 170 20586: 99 e9 ldi r25, 0x99 ; 153 20588: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 2058c: 8c e9 ldi r24, 0x9C ; 156 2058e: 99 e9 ldi r25, 0x99 ; 153 20590: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 20594: 8c e8 ldi r24, 0x8C ; 140 20596: 99 e9 ldi r25, 0x99 ; 153 20598: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 2059c: 80 eb ldi r24, 0xB0 ; 176 2059e: 9b e6 ldi r25, 0x6B ; 107 205a0: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 205a4: 8e e9 ldi r24, 0x9E ; 158 205a6: 9b e6 ldi r25, 0x6B ; 107 205a8: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 205ac: 8d e8 ldi r24, 0x8D ; 141 205ae: 9b e6 ldi r25, 0x6B ; 107 205b0: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(STR_SEPARATOR); 205b4: 84 ec ldi r24, 0xC4 ; 196 205b6: 94 e8 ldi r25, 0x84 ; 132 205b8: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 205bc: 80 e8 ldi r24, 0x80 ; 128 205be: 99 e9 ldi r25, 0x99 ; 153 205c0: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 205c4: 87 e7 ldi r24, 0x77 ; 119 205c6: 99 e9 ldi r25, 0x99 ; 153 205c8: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 205cc: 8d e6 ldi r24, 0x6D ; 109 205ce: 99 e9 ldi r25, 0x99 ; 153 205d0: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(STR_SEPARATOR); 205d4: 84 ec ldi r24, 0xC4 ; 196 205d6: 94 e8 ldi r25, 0x84 ; 132 205d8: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(_T(MSG_DATE)); 205dc: 8b e3 ldi r24, 0x3B ; 59 205de: 98 e5 ldi r25, 0x58 ; 88 205e0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 205e4: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 205e8: 82 e6 ldi r24, 0x62 ; 98 205ea: 99 e9 ldi r25, 0x99 ; 153 205ec: 0e 94 29 73 call 0xe652 ; 0xe652 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); 205f0: 84 ec ldi r24, 0xC4 ; 196 205f2: 94 e8 ldi r25, 0x84 ; 132 205f4: 0e 94 29 73 call 0xe652 ; 0xe652 if (MMU2::mmu2.Enabled()) 205f8: 80 91 01 13 lds r24, 0x1301 ; 0x801301 205fc: 81 30 cpi r24, 0x01 ; 1 205fe: 09 f0 breq .+2 ; 0x20602 20600: 2d c1 rjmp .+602 ; 0x2085c { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 20602: 8b e2 ldi r24, 0x2B ; 43 20604: 98 e5 ldi r25, 0x58 ; 88 20606: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2060a: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 2060e: 8d e5 ldi r24, 0x5D ; 93 20610: 99 e9 ldi r25, 0x99 ; 153 20612: 0e 94 29 73 call 0xe652 ; 0xe652 if (((menu_item - 1) == menu_line) && lcd_draw_update) 20616: 80 91 63 04 lds r24, 0x0463 ; 0x800463 2061a: 81 50 subi r24, 0x01 ; 1 2061c: 99 0b sbc r25, r25 2061e: 20 91 62 04 lds r18, 0x0462 ; 0x800462 20622: 28 17 cp r18, r24 20624: 19 06 cpc r1, r25 20626: 49 f5 brne .+82 ; 0x2067a 20628: 80 91 59 02 lds r24, 0x0259 ; 0x800259 2062c: 88 23 and r24, r24 2062e: 29 f1 breq .+74 ; 0x2067a { lcd_set_cursor(6, menu_row); 20630: 60 91 60 04 lds r22, 0x0460 ; 0x800460 20634: 86 e0 ldi r24, 0x06 ; 6 20636: 0e 94 b5 6f call 0xdf6a ; 0xdf6a 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) { 2063a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 2063e: 81 30 cpi r24, 0x01 ; 1 20640: 09 f0 breq .+2 ; 0x20644 20642: 05 c1 rjmp .+522 ; 0x2084e 20644: 80 91 e1 12 lds r24, 0x12E1 ; 0x8012e1 20648: 90 91 e2 12 lds r25, 0x12E2 ; 0x8012e2 2064c: 20 91 e3 12 lds r18, 0x12E3 ; 0x8012e3 MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 20650: 88 23 and r24, r24 20652: 09 f4 brne .+2 ; 0x20656 20654: fc c0 rjmp .+504 ; 0x2084e lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 20656: 1f 92 push r1 20658: 2f 93 push r18 2065a: 1f 92 push r1 2065c: 9f 93 push r25 2065e: 1f 92 push r1 20660: 8f 93 push r24 20662: ff 92 push r15 20664: ef 92 push r14 20666: 0e 94 66 6f call 0xdecc ; 0xdecc 2066a: 8d b7 in r24, 0x3d ; 61 2066c: 9e b7 in r25, 0x3e ; 62 2066e: 08 96 adiw r24, 0x08 ; 8 20670: 0f b6 in r0, 0x3f ; 63 20672: f8 94 cli 20674: 9e bf out 0x3e, r25 ; 62 20676: 0f be out 0x3f, r0 ; 63 20678: 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) { 2067a: 80 91 97 03 lds r24, 0x0397 ; 0x800397 2067e: 88 23 and r24, r24 20680: 09 f4 brne .+2 ; 0x20684 20682: 40 c0 rjmp .+128 ; 0x20704 MENU_ITEM_BACK_P(STR_SEPARATOR); 20684: 84 ec ldi r24, 0xC4 ; 196 20686: 94 e8 ldi r25, 0x84 ; 132 20688: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 2068c: 83 e3 ldi r24, 0x33 ; 51 2068e: 99 e9 ldi r25, 0x99 ; 153 20690: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR(" ")); 20694: 81 e3 ldi r24, 0x31 ; 49 20696: 99 e9 ldi r25, 0x99 ; 153 20698: 0e 94 29 73 call 0xe652 ; 0xe652 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 2069c: 80 91 63 04 lds r24, 0x0463 ; 0x800463 206a0: 81 50 subi r24, 0x01 ; 1 206a2: 99 0b sbc r25, r25 206a4: 20 91 62 04 lds r18, 0x0462 ; 0x800462 206a8: 28 17 cp r18, r24 206aa: 19 06 cpc r1, r25 206ac: 59 f5 brne .+86 ; 0x20704 206ae: 80 91 59 02 lds r24, 0x0259 ; 0x800259 206b2: 88 23 and r24, r24 206b4: 39 f1 breq .+78 ; 0x20704 lcd_set_cursor(2, menu_row); 206b6: 60 91 60 04 lds r22, 0x0460 ; 0x800460 206ba: 82 e0 ldi r24, 0x02 ; 2 206bc: 0e 94 b5 6f call 0xdf6a ; 0xdf6a 206c0: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 206c4: 1f 92 push r1 206c6: 8f 93 push r24 206c8: 80 91 9a 03 lds r24, 0x039A ; 0x80039a 206cc: 1f 92 push r1 206ce: 8f 93 push r24 206d0: 80 91 99 03 lds r24, 0x0399 ; 0x800399 206d4: 1f 92 push r1 206d6: 8f 93 push r24 206d8: 80 91 98 03 lds r24, 0x0398 ; 0x800398 206dc: 1f 92 push r1 206de: 8f 93 push r24 206e0: df 93 push r29 206e2: cf 93 push r28 206e4: 1f 93 push r17 206e6: 0f 93 push r16 206e8: 0f 94 55 a3 call 0x346aa ; 0x346aa ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 206ec: 8c e9 ldi r24, 0x9C ; 156 206ee: 93 e0 ldi r25, 0x03 ; 3 206f0: 0e 94 ba 73 call 0xe774 ; 0xe774 206f4: 8d b7 in r24, 0x3d ; 61 206f6: 9e b7 in r25, 0x3e ; 62 206f8: 0c 96 adiw r24, 0x0c ; 12 206fa: 0f b6 in r0, 0x3f ; 63 206fc: f8 94 cli 206fe: 9e bf out 0x3e, r25 ; 62 20700: 0f be out 0x3f, r0 ; 63 20702: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 20704: 80 91 10 06 lds r24, 0x0610 ; 0x800610 20708: 90 91 11 06 lds r25, 0x0611 ; 0x800611 2070c: a0 91 12 06 lds r26, 0x0612 ; 0x800612 20710: b0 91 13 06 lds r27, 0x0613 ; 0x800613 20714: 89 2b or r24, r25 20716: 8a 2b or r24, r26 20718: 8b 2b or r24, r27 2071a: 09 f4 brne .+2 ; 0x2071e 2071c: 42 c0 rjmp .+132 ; 0x207a2 MENU_ITEM_BACK_P(STR_SEPARATOR); 2071e: 84 ec ldi r24, 0xC4 ; 196 20720: 94 e8 ldi r25, 0x84 ; 132 20722: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 20726: 8e e0 ldi r24, 0x0E ; 14 20728: 98 e5 ldi r25, 0x58 ; 88 2072a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2072e: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_BACK_P(PSTR(" ")); 20732: 8f e2 ldi r24, 0x2F ; 47 20734: 99 e9 ldi r25, 0x99 ; 153 20736: 0e 94 29 73 call 0xe652 ; 0xe652 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 2073a: 80 91 63 04 lds r24, 0x0463 ; 0x800463 2073e: 81 50 subi r24, 0x01 ; 1 20740: 99 0b sbc r25, r25 20742: 20 91 62 04 lds r18, 0x0462 ; 0x800462 20746: 28 17 cp r18, r24 20748: 19 06 cpc r1, r25 2074a: 59 f5 brne .+86 ; 0x207a2 2074c: 80 91 59 02 lds r24, 0x0259 ; 0x800259 20750: 88 23 and r24, r24 20752: 39 f1 breq .+78 ; 0x207a2 lcd_set_cursor(2, menu_row); 20754: 60 91 60 04 lds r22, 0x0460 ; 0x800460 20758: 82 e0 ldi r24, 0x02 ; 2 2075a: 0e 94 b5 6f call 0xdf6a ; 0xdf6a 2075e: 80 91 13 06 lds r24, 0x0613 ; 0x800613 20762: 1f 92 push r1 20764: 8f 93 push r24 20766: 80 91 12 06 lds r24, 0x0612 ; 0x800612 2076a: 1f 92 push r1 2076c: 8f 93 push r24 2076e: 80 91 11 06 lds r24, 0x0611 ; 0x800611 20772: 1f 92 push r1 20774: 8f 93 push r24 20776: 80 91 10 06 lds r24, 0x0610 ; 0x800610 2077a: 1f 92 push r1 2077c: 8f 93 push r24 2077e: df 93 push r29 20780: cf 93 push r28 20782: 1f 93 push r17 20784: 0f 93 push r16 20786: 0f 94 55 a3 call 0x346aa ; 0x346aa ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 2078a: 8c e9 ldi r24, 0x9C ; 156 2078c: 93 e0 ldi r25, 0x03 ; 3 2078e: 0e 94 ba 73 call 0xe774 ; 0xe774 20792: 8d b7 in r24, 0x3d ; 61 20794: 9e b7 in r25, 0x3e ; 62 20796: 0c 96 adiw r24, 0x0c ; 12 20798: 0f b6 in r0, 0x3f ; 63 2079a: f8 94 cli 2079c: 9e bf out 0x3e, r25 ; 62 2079e: 0f be out 0x3f, r0 ; 63 207a0: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 207a2: 84 ec ldi r24, 0xC4 ; 196 207a4: 94 e8 ldi r25, 0x84 ; 132 207a6: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 207aa: 8b ef ldi r24, 0xFB ; 251 207ac: 97 e5 ldi r25, 0x57 ; 87 207ae: 0e 94 95 75 call 0xeb2a ; 0xeb2a 207b2: 6e e7 ldi r22, 0x7E ; 126 207b4: 74 ec ldi r23, 0xC4 ; 196 207b6: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 207ba: 8b ee ldi r24, 0xEB ; 235 207bc: 97 e5 ldi r25, 0x57 ; 87 207be: 0e 94 95 75 call 0xeb2a ; 0xeb2a 207c2: 68 e4 ldi r22, 0x48 ; 72 207c4: 78 e3 ldi r23, 0x38 ; 56 207c6: 0e 94 4e 73 call 0xe69c ; 0xe69c MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 207ca: 8d ed ldi r24, 0xDD ; 221 207cc: 97 e5 ldi r25, 0x57 ; 87 207ce: 0e 94 95 75 call 0xeb2a ; 0xeb2a 207d2: 6b e7 ldi r22, 0x7B ; 123 207d4: 72 ec ldi r23, 0xC2 ; 194 207d6: 0e 94 4e 73 call 0xe69c ; 0xe69c #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); 207da: 8e ec ldi r24, 0xCE ; 206 207dc: 97 e5 ldi r25, 0x57 ; 87 207de: 0e 94 95 75 call 0xeb2a ; 0xeb2a 207e2: 6c ed ldi r22, 0xDC ; 220 207e4: 77 e3 ldi r23, 0x37 ; 55 207e6: 0e 94 4e 73 call 0xe69c ; 0xe69c #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); #endif //MENU_DUMP #ifdef MENU_SERIAL_DUMP if (emergency_serial_dump) 207ea: 80 91 0f 06 lds r24, 0x060F ; 0x80060f 207ee: 88 23 and r24, r24 207f0: 31 f0 breq .+12 ; 0x207fe MENU_ITEM_FUNCTION_P(_n("Dump to serial"), lcd_serial_dump); 207f2: 60 e8 ldi r22, 0x80 ; 128 207f4: 78 e3 ldi r23, 0x38 ; 56 207f6: 8e e7 ldi r24, 0x7E ; 126 207f8: 9b e6 ldi r25, 0x6B ; 107 207fa: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 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(); 207fe: 0e 94 de 62 call 0xc5bc ; 0xc5bc { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 20802: 80 91 60 04 lds r24, 0x0460 ; 0x800460 20806: 8f 5f subi r24, 0xFF ; 255 20808: 80 93 60 04 sts 0x0460, r24 ; 0x800460 2080c: 80 91 62 04 lds r24, 0x0462 ; 0x800462 20810: 8f 5f subi r24, 0xFF ; 255 20812: 80 93 62 04 sts 0x0462, r24 ; 0x800462 20816: a5 ce rjmp .-694 ; 0x20562 _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) 20818: 90 91 97 03 lds r25, 0x0397 ; 0x800397 2081c: 99 23 and r25, r25 2081e: 09 f4 brne .+2 ; 0x20822 20820: 94 ce rjmp .-728 ; 0x2054a 20822: 40 91 98 03 lds r20, 0x0398 ; 0x800398 20826: 50 91 99 03 lds r21, 0x0399 ; 0x800399 2082a: 60 91 9a 03 lds r22, 0x039A ; 0x80039a 2082e: 70 91 9b 03 lds r23, 0x039B ; 0x80039b 20832: 45 2b or r20, r21 20834: 46 2b or r20, r22 20836: 47 2b or r20, r23 20838: 09 f0 breq .+2 ; 0x2083c 2083a: 87 ce rjmp .-754 ; 0x2054a 2083c: 8f 5f subi r24, 0xFF ; 255 2083e: 80 31 cpi r24, 0x10 ; 16 20840: 19 f0 breq .+6 ; 0x20848 20842: 80 93 96 03 sts 0x0396, r24 ; 0x800396 20846: 81 ce rjmp .-766 ; 0x2054a { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 20848: 10 92 96 03 sts 0x0396, r1 ; 0x800396 2084c: 7e ce rjmp .-772 ; 0x2054a 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)); 2084e: 81 e2 ldi r24, 0x21 ; 33 20850: 98 e5 ldi r25, 0x58 ; 88 20852: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20856: 0e 94 78 6f call 0xdef0 ; 0xdef0 2085a: 0f cf rjmp .-482 ; 0x2067a } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 2085c: 85 e4 ldi r24, 0x45 ; 69 2085e: 99 e9 ldi r25, 0x99 ; 153 20860: 0e 94 29 73 call 0xe652 ; 0xe652 20864: 0a cf rjmp .-492 ; 0x2067a #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 20866: df 91 pop r29 20868: cf 91 pop r28 2086a: 1f 91 pop r17 2086c: 0f 91 pop r16 2086e: ff 90 pop r15 20870: ef 90 pop r14 20872: 08 95 ret 00020874 : //! |Total failures | MSG_TOTAL_FAILURES c=20 //! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { 20874: bf 92 push r11 20876: cf 92 push r12 20878: df 92 push r13 2087a: ef 92 push r14 2087c: ff 92 push r15 2087e: 0f 93 push r16 20880: 1f 93 push r17 20882: cf 93 push r28 20884: df 93 push r29 20886: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 2088a: 85 e6 ldi r24, 0x65 ; 101 2088c: 9f e0 ldi r25, 0x0F ; 15 2088e: 0f 94 3e a4 call 0x3487c ; 0x3487c 20892: 18 2f mov r17, r24 uint16_t filamentTotal = clamp999( eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) ); 20894: 81 e0 ldi r24, 0x01 ; 1 20896: 9f e0 ldi r25, 0x0F ; 15 20898: 0f 94 4c a4 call 0x34898 ; 0x34898 2089c: 0e 94 93 fc call 0x1f926 ; 0x1f926 208a0: c8 2e mov r12, r24 208a2: b9 2e mov r11, r25 lcd_home(); 208a4: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 lcd_printf_P(failStatsFmt, 208a8: 8f eb ldi r24, 0xBF ; 191 208aa: 97 e5 ldi r25, 0x57 ; 87 208ac: 0e 94 95 75 call 0xeb2a ; 0xeb2a 208b0: e8 2e mov r14, r24 208b2: d9 2e mov r13, r25 208b4: 8e ea ldi r24, 0xAE ; 174 208b6: 97 e5 ldi r25, 0x57 ; 87 208b8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 208bc: 08 2f mov r16, r24 208be: f9 2e mov r15, r25 208c0: 8f eb ldi r24, 0xBF ; 191 208c2: 97 e5 ldi r25, 0x57 ; 87 208c4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 208c8: ec 01 movw r28, r24 208ca: 88 e9 ldi r24, 0x98 ; 152 208cc: 97 e5 ldi r25, 0x57 ; 87 208ce: 0e 94 95 75 call 0xeb2a ; 0xeb2a 208d2: bf 92 push r11 208d4: cf 92 push r12 208d6: df 92 push r13 208d8: ef 92 push r14 208da: ff 92 push r15 208dc: 0f 93 push r16 208de: 1f 92 push r1 208e0: 1f 93 push r17 208e2: df 93 push r29 208e4: cf 93 push r28 208e6: 9f 93 push r25 208e8: 8f 93 push r24 208ea: 86 ef ldi r24, 0xF6 ; 246 208ec: 98 e9 ldi r25, 0x98 ; 152 208ee: 9f 93 push r25 208f0: 8f 93 push r24 208f2: 0e 94 66 6f call 0xdecc ; 0xdecc _T(MSG_LAST_PRINT_FAILURES), _T(MSG_FIL_RUNOUTS), filamentLast, _T(MSG_TOTAL_FAILURES), _T(MSG_FIL_RUNOUTS), filamentTotal); menu_back_if_clicked(); 208f6: 8d b7 in r24, 0x3d ; 61 208f8: 9e b7 in r25, 0x3e ; 62 208fa: 0e 96 adiw r24, 0x0e ; 14 208fc: 0f b6 in r0, 0x3f ; 63 208fe: f8 94 cli 20900: 9e bf out 0x3e, r25 ; 62 20902: 0f be out 0x3f, r0 ; 63 20904: 8d bf out 0x3d, r24 ; 61 } 20906: df 91 pop r29 20908: cf 91 pop r28 2090a: 1f 91 pop r17 2090c: 0f 91 pop r16 2090e: ff 90 pop r15 20910: ef 90 pop r14 20912: df 90 pop r13 20914: cf 90 pop r12 20916: 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(); 20918: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 0002091c : //! | 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() { 2091c: 8f 92 push r8 2091e: 9f 92 push r9 20920: af 92 push r10 20922: bf 92 push r11 20924: cf 92 push r12 20926: df 92 push r13 20928: ef 92 push r14 2092a: ff 92 push r15 2092c: 0f 93 push r16 2092e: 1f 93 push r17 20930: cf 93 push r28 20932: df 93 push r29 20934: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 20938: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 lcd_printf_P( 2093c: 80 91 07 13 lds r24, 0x1307 ; 0x801307 20940: 90 91 08 13 lds r25, 0x1308 ; 0x801308 20944: 0e 94 93 fc call 0x1f926 ; 0x1f926 20948: 98 2e mov r9, r24 2094a: 89 2e mov r8, r25 2094c: 83 e7 ldi r24, 0x73 ; 115 2094e: 97 e5 ldi r25, 0x57 ; 87 20950: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20954: b8 2e mov r11, r24 20956: a9 2e mov r10, r25 20958: 80 ed ldi r24, 0xD0 ; 208 2095a: 9e e0 ldi r25, 0x0E ; 14 2095c: 0f 94 4c a4 call 0x34898 ; 0x34898 20960: 0e 94 93 fc call 0x1f926 ; 0x1f926 20964: d8 2e mov r13, r24 20966: c9 2e mov r12, r25 20968: 82 e6 ldi r24, 0x62 ; 98 2096a: 97 e5 ldi r25, 0x57 ; 87 2096c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20970: f8 2e mov r15, r24 20972: e9 2e mov r14, r25 20974: 83 ed ldi r24, 0xD3 ; 211 20976: 9e e0 ldi r25, 0x0E ; 14 20978: 0f 94 4c a4 call 0x34898 ; 0x34898 2097c: 0e 94 93 fc call 0x1f926 ; 0x1f926 20980: 18 2f mov r17, r24 20982: 09 2f mov r16, r25 20984: 86 e5 ldi r24, 0x56 ; 86 20986: 97 e5 ldi r25, 0x57 ; 87 20988: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2098c: ec 01 movw r28, r24 2098e: 8e ea ldi r24, 0xAE ; 174 20990: 97 e5 ldi r25, 0x57 ; 87 20992: 0e 94 95 75 call 0xeb2a ; 0xeb2a 20996: 8f 92 push r8 20998: 9f 92 push r9 2099a: af 92 push r10 2099c: bf 92 push r11 2099e: cf 92 push r12 209a0: df 92 push r13 209a2: ef 92 push r14 209a4: ff 92 push r15 209a6: 0f 93 push r16 209a8: 1f 93 push r17 209aa: df 93 push r29 209ac: cf 93 push r28 209ae: 9f 93 push r25 209b0: 8f 93 push r24 209b2: 89 ec ldi r24, 0xC9 ; 201 209b4: 98 e9 ldi r25, 0x98 ; 152 209b6: 9f 93 push r25 209b8: 8f 93 push r24 209ba: 0e 94 66 6f call 0xdecc ; 0xdecc ), _T(MSG_TOTAL_FAILURES), _T(MSG_MMU_FAILS), clamp999( eeprom_read_word((uint16_t*)EEPROM_MMU_FAIL_TOT) ), _T(MSG_MMU_LOAD_FAILS), clamp999( eeprom_read_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT) ), _T(MSG_MMU_POWER_FAILS), clamp999( MMU2::mmu2.TMCFailures() )); menu_back_if_clicked(); 209be: 8d b7 in r24, 0x3d ; 61 209c0: 9e b7 in r25, 0x3e ; 62 209c2: 40 96 adiw r24, 0x10 ; 16 209c4: 0f b6 in r0, 0x3f ; 63 209c6: f8 94 cli 209c8: 9e bf out 0x3e, r25 ; 62 209ca: 0f be out 0x3f, r0 ; 63 209cc: 8d bf out 0x3d, r24 ; 61 } 209ce: df 91 pop r29 209d0: cf 91 pop r28 209d2: 1f 91 pop r17 209d4: 0f 91 pop r16 209d6: ff 90 pop r15 209d8: ef 90 pop r14 209da: df 90 pop r13 209dc: cf 90 pop r12 209de: bf 90 pop r11 209e0: af 90 pop r10 209e2: 9f 90 pop r9 209e4: 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(); 209e6: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 000209ea : { 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) { 209ea: 80 91 96 03 lds r24, 0x0396 ; 0x800396 209ee: 81 11 cpse r24, r1 209f0: 19 c0 rjmp .+50 ; 0x20a24 lcd_clear(); 209f2: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 209f6: 85 e8 ldi r24, 0x85 ; 133 209f8: 97 e5 ldi r25, 0x57 ; 87 209fa: 0e 94 95 75 call 0xeb2a ; 0xeb2a 209fe: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_putc(':'); 20a02: 8a e3 ldi r24, 0x3A ; 58 20a04: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_set_cursor(10, 1); 20a08: 61 e0 ldi r22, 0x01 ; 1 20a0a: 8a e0 ldi r24, 0x0A ; 10 20a0c: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 20a10: 88 ea ldi r24, 0xA8 ; 168 20a12: 9c e0 ldi r25, 0x0C ; 12 20a14: 0f 94 46 a4 call 0x3488c ; 0x3488c else lcd_printNumber(n, base); 20a18: 4a e0 ldi r20, 0x0A ; 10 20a1a: 0e 94 d1 71 call 0xe3a2 ; 0xe3a2 _md->initialized = true; 20a1e: 81 e0 ldi r24, 0x01 ; 1 20a20: 80 93 96 03 sts 0x0396, r24 ; 0x800396 } menu_back_if_clicked(); 20a24: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 00020a28 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 20a28: 8f e6 ldi r24, 0x6F ; 111 20a2a: 9b e6 ldi r25, 0x6B ; 107 20a2c: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 00020a30 : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 20a30: 0e 94 fa 70 call 0xe1f4 ; 0xe1f4 lcd_status_message_idx = 0; // Re-draw message from beginning 20a34: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.418> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 20a38: 20 e0 ldi r18, 0x00 ; 0 20a3a: 41 e0 ldi r20, 0x01 ; 1 20a3c: 70 e0 ldi r23, 0x00 ; 0 20a3e: 60 e0 ldi r22, 0x00 ; 0 20a40: 8e e9 ldi r24, 0x9E ; 158 20a42: 97 e3 ldi r25, 0x37 ; 55 20a44: 0e 94 12 63 call 0xc624 ; 0xc624 menu_depth = 0; 20a48: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 20a4c: 10 92 94 03 sts 0x0394, r1 ; 0x800394 } 20a50: 08 95 ret 00020a52 : // 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); 20a52: 81 e0 ldi r24, 0x01 ; 1 20a54: 0e 94 83 6f call 0xdf06 ; 0xdf06 if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 20a58: 0f 94 1d 65 call 0x2ca3a ; 0x2ca3a 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; 20a5c: 90 91 e9 12 lds r25, 0x12E9 ; 0x8012e9 20a60: 93 36 cpi r25, 0x63 ; 99 20a62: 09 f4 brne .+2 ; 0x20a66 20a64: 9f ef ldi r25, 0xFF ; 255 20a66: 89 13 cpse r24, r25 20a68: 0e c0 rjmp .+28 ; 0x20a86 lcd_putc('F'); 20a6a: 86 e4 ldi r24, 0x46 ; 70 20a6c: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 20a70: 0f 94 1d 65 call 0x2ca3a ; 0x2ca3a 20a74: 8f 3f cpi r24, 0xFF ; 255 20a76: 29 f0 breq .+10 ; 0x20a82 20a78: 8f 5c subi r24, 0xCF ; 207 20a7a: 0e 94 7c 6f call 0xdef8 ; 0xdef8 20a7e: 83 e0 ldi r24, 0x03 ; 3 20a80: 08 95 ret 20a82: 8f e3 ldi r24, 0x3F ; 63 20a84: fa cf rjmp .-12 ; 0x20a7a chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 20a86: 8f 3f cpi r24, 0xFF ; 255 20a88: 89 f0 breq .+34 ; 0x20aac 20a8a: 8f 5c subi r24, 0xCF ; 207 20a8c: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_putc('>'); 20a90: 8e e3 ldi r24, 0x3E ; 62 20a92: 0e 94 7c 6f call 0xdef8 ; 0xdef8 20a96: 80 91 e9 12 lds r24, 0x12E9 ; 0x8012e9 20a9a: 83 36 cpi r24, 0x63 ; 99 20a9c: 49 f0 breq .+18 ; 0x20ab0 lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 20a9e: 8f 3f cpi r24, 0xFF ; 255 20aa0: 39 f0 breq .+14 ; 0x20ab0 20aa2: 8f 5c subi r24, 0xCF ; 207 20aa4: 0e 94 7c 6f call 0xdef8 ; 0xdef8 chars += 3; 20aa8: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 20aaa: 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'); 20aac: 8f e3 ldi r24, 0x3F ; 63 20aae: ee cf rjmp .-36 ; 0x20a8c lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 20ab0: 8f e3 ldi r24, 0x3F ; 63 20ab2: f8 cf rjmp .-16 ; 0x20aa4 00020ab4 : } 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){ 20ab4: 0f 93 push r16 20ab6: 1f 93 push r17 20ab8: cf 93 push r28 20aba: df 93 push r29 20abc: ec 01 movw r28, r24 20abe: cb 01 movw r24, r22 20ac0: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 20ac2: 4a 81 ldd r20, Y+2 ; 0x02 20ac4: 41 30 cpi r20, 0x01 ; 1 20ac6: 29 f0 breq .+10 ; 0x20ad2 20ac8: 88 f0 brcs .+34 ; 0x20aec 20aca: 42 30 cpi r20, 0x02 ; 2 20acc: 09 f1 breq .+66 ; 0x20b10 20ace: 43 30 cpi r20, 0x03 ; 3 20ad0: d1 f4 brne .+52 ; 0x20b06 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 ){ 20ad2: 8b 81 ldd r24, Y+3 ; 0x03 20ad4: 81 11 cpse r24, r1 20ad6: 25 c0 rjmp .+74 ; 0x20b22 state = next_state; // advance to the next state 20ad8: 82 e0 ldi r24, 0x02 ; 2 20ada: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 20adc: 63 e0 ldi r22, 0x03 ; 3 20ade: 87 e4 ldi r24, 0x47 ; 71 20ae0: 98 e9 ldi r25, 0x98 ; 152 20ae2: 0e 94 17 d8 call 0x1b02e ; 0x1b02e repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 20ae6: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 20ae8: 8b 83 std Y+3, r24 ; 0x03 20aea: 0d c0 rjmp .+26 ; 0x20b06 //! @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 ){ 20aec: a9 01 movw r20, r18 20aee: 98 01 movw r18, r16 20af0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 20af4: 18 16 cp r1, r24 20af6: 3c f4 brge .+14 ; 0x20b06 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 20af8: 63 e0 ldi r22, 0x03 ; 3 20afa: 88 81 ld r24, Y 20afc: 99 81 ldd r25, Y+1 ; 0x01 20afe: 0e 94 17 d8 call 0x1b02e ; 0x1b02e state = States::TempAboveMintemp; 20b02: 81 e0 ldi r24, 0x01 ; 1 20b04: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 20b06: df 91 pop r29 20b08: cf 91 pop r28 20b0a: 1f 91 pop r17 20b0c: 0f 91 pop r16 20b0e: 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 ){ 20b10: 8b 81 ldd r24, Y+3 ; 0x03 20b12: 81 11 cpse r24, r1 20b14: 06 c0 rjmp .+12 ; 0x20b22 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); 20b16: 88 81 ld r24, Y 20b18: 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 20b1a: 23 e0 ldi r18, 0x03 ; 3 20b1c: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 20b1e: 63 e0 ldi r22, 0x03 ; 3 20b20: e0 cf rjmp .-64 ; 0x20ae2 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 20b22: 81 50 subi r24, 0x01 ; 1 20b24: e1 cf rjmp .-62 ; 0x20ae8 00020b26 : SERIAL_ECHO(_status); SERIAL_ECHO(']'); } static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); 20b26: 85 e2 ldi r24, 0x25 ; 37 20b28: 9a e8 ldi r25, 0x8A ; 138 20b2a: 0c 94 1f 7b jmp 0xf63e ; 0xf63e 00020b2e : static void Sound_DoSound_Prompt(void) { backlight_wake(2); WRITE(BEEPER,HIGH); 20b2e: 72 9a sbi 0x0e, 2 ; 14 20b30: 2f ef ldi r18, 0xFF ; 255 20b32: 89 e6 ldi r24, 0x69 ; 105 20b34: 98 e1 ldi r25, 0x18 ; 24 20b36: 21 50 subi r18, 0x01 ; 1 20b38: 80 40 sbci r24, 0x00 ; 0 20b3a: 90 40 sbci r25, 0x00 ; 0 20b3c: e1 f7 brne .-8 ; 0x20b36 20b3e: 00 c0 rjmp .+0 ; 0x20b40 20b40: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 20b42: 72 98 cbi 0x0e, 2 ; 14 } 20b44: 08 95 ret 00020b46 : SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); SERIAL_ECHO(']'); } static void prusa_stat_temperatures() { SERIAL_ECHOPGM("[ST0:"); 20b46: 88 e4 ldi r24, 0x48 ; 72 20b48: 9a e8 ldi r25, 0x8A ; 138 20b4a: 0e 94 1f 7b call 0xf63e ; 0xf63e 20b4e: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 20b52: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 20b56: 07 2e mov r0, r23 20b58: 00 0c add r0, r0 20b5a: 88 0b sbc r24, r24 20b5c: 99 0b sbc r25, r25 20b5e: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_ECHO(target_temperature[0]); SERIAL_ECHOPGM("][STB:"); 20b62: 81 e4 ldi r24, 0x41 ; 65 20b64: 9a e8 ldi r25, 0x8A ; 138 20b66: 0e 94 1f 7b call 0xf63e ; 0xf63e 20b6a: 60 91 59 12 lds r22, 0x1259 ; 0x801259 20b6e: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 20b72: 07 2e mov r0, r23 20b74: 00 0c add r0, r0 20b76: 88 0b sbc r24, r24 20b78: 99 0b sbc r25, r25 20b7a: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_ECHO(target_temperature_bed); SERIAL_ECHOPGM("][AT0:"); 20b7e: 8a e3 ldi r24, 0x3A ; 58 20b80: 9a e8 ldi r25, 0x8A ; 138 20b82: 0e 94 1f 7b call 0xf63e ; 0xf63e else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 20b86: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 20b8a: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 20b8e: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 20b92: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 20b96: 42 e0 ldi r20, 0x02 ; 2 20b98: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_ECHO(current_temperature[0]); SERIAL_ECHOPGM("][ATB:"); 20b9c: 83 e3 ldi r24, 0x33 ; 51 20b9e: 9a e8 ldi r25, 0x8A ; 138 20ba0: 0e 94 1f 7b call 0xf63e ; 0xf63e 20ba4: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 20ba8: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 20bac: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 20bb0: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 20bb4: 42 e0 ldi r20, 0x02 ; 2 20bb6: 0e 94 a1 7a call 0xf542 ; 0xf542 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 20bba: 8d e5 ldi r24, 0x5D ; 93 20bbc: 0c 94 0c 7a jmp 0xf418 ; 0xf418 00020bc0 : prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } static void prusa_stat_printerstatus(uint8_t _status) { 20bc0: cf 93 push r28 20bc2: c8 2f mov r28, r24 SERIAL_ECHOPGM("[PRN:"); 20bc4: 8f e1 ldi r24, 0x1F ; 31 20bc6: 9a e8 ldi r25, 0x8A ; 138 20bc8: 0e 94 1f 7b call 0xf63e ; 0xf63e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 20bcc: 8c 2f mov r24, r28 20bce: 0e 94 0c 7a call 0xf418 ; 0xf418 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 20bd2: 8d e5 ldi r24, 0x5D ; 93 SERIAL_ECHO(_status); SERIAL_ECHO(']'); } 20bd4: cf 91 pop r28 20bd6: 0c 94 0c 7a jmp 0xf418 ; 0xf418 00020bda : #ifdef PRUSA_M28 static void trace(); #endif static void prusa_statistics_err(char c) { 20bda: cf 93 push r28 20bdc: c8 2f mov r28, r24 SERIAL_ECHOPGM("{[ERR:"); 20bde: 88 ee ldi r24, 0xE8 ; 232 20be0: 99 e8 ldi r25, 0x89 ; 137 20be2: 0e 94 1f 7b call 0xf63e ; 0xf63e 20be6: 8c 2f mov r24, r28 20be8: 0e 94 0c 7a call 0xf418 ; 0xf418 20bec: 8d e5 ldi r24, 0x5D ; 93 20bee: 0e 94 0c 7a call 0xf418 ; 0xf418 SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } 20bf2: cf 91 pop r28 static void prusa_statistics_err(char c) { SERIAL_ECHOPGM("{[ERR:"); SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); 20bf4: 0d 94 93 05 jmp 0x20b26 ; 0x20b26 00020bf8 : static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); } static void prusa_stat_diameter() { SERIAL_ECHOPGM("[DIA:"); 20bf8: 8d e2 ldi r24, 0x2D ; 45 20bfa: 9a e8 ldi r25, 0x8A ; 138 20bfc: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); 20c00: 85 ea ldi r24, 0xA5 ; 165 20c02: 9d e0 ldi r25, 0x0D ; 13 20c04: 0f 94 4c a4 call 0x34898 ; 0x34898 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 20c08: bc 01 movw r22, r24 20c0a: 90 e0 ldi r25, 0x00 ; 0 20c0c: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 20c0e: 4a e0 ldi r20, 0x0A ; 10 20c10: 0e 94 20 7a call 0xf440 ; 0xf440 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 20c14: 8d e5 ldi r24, 0x5D ; 93 20c16: 0c 94 0c 7a jmp 0xf418 ; 0xf418 00020c1a : // 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) { 20c1a: 2f 92 push r2 20c1c: 3f 92 push r3 20c1e: 4f 92 push r4 20c20: 5f 92 push r5 20c22: 6f 92 push r6 20c24: 7f 92 push r7 20c26: 8f 92 push r8 20c28: 9f 92 push r9 20c2a: af 92 push r10 20c2c: bf 92 push r11 20c2e: cf 92 push r12 20c30: df 92 push r13 20c32: ef 92 push r14 20c34: ff 92 push r15 20c36: 0f 93 push r16 20c38: 1f 93 push r17 20c3a: cf 93 push r28 20c3c: df 93 push r29 20c3e: cd b7 in r28, 0x3d ; 61 20c40: de b7 in r29, 0x3e ; 62 20c42: a1 97 sbiw r28, 0x21 ; 33 20c44: 0f b6 in r0, 0x3f ; 63 20c46: f8 94 cli 20c48: de bf out 0x3e, r29 ; 62 20c4a: 0f be out 0x3f, r0 ; 63 20c4c: cd bf out 0x3d, r28 ; 61 20c4e: 1c 01 movw r2, r24 20c50: 48 01 movw r8, r16 20c52: 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) 20c54: fc 01 movw r30, r24 20c56: e8 5b subi r30, 0xB8 ; 184 20c58: ff 4f sbci r31, 0xFF ; 255 20c5a: c0 80 ld r12, Z 20c5c: d1 80 ldd r13, Z+1 ; 0x01 20c5e: e2 80 ldd r14, Z+2 ; 0x02 20c60: f3 80 ldd r15, Z+3 ; 0x03 20c62: 9a 01 movw r18, r20 20c64: ab 01 movw r20, r22 20c66: c7 01 movw r24, r14 20c68: b6 01 movw r22, r12 20c6a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 20c6e: 0f 94 44 a6 call 0x34c88 ; 0x34c88 20c72: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 20c76: 8b 01 movw r16, r22 20c78: 8d 83 std Y+5, r24 ; 0x05 20c7a: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 20c7c: a5 01 movw r20, r10 20c7e: 94 01 movw r18, r8 20c80: c7 01 movw r24, r14 20c82: b6 01 movw r22, r12 20c84: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 20c88: 0f 94 44 a6 call 0x34c88 ; 0x34c88 20c8c: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 20c90: 36 2f mov r19, r22 20c92: 27 2f mov r18, r23 20c94: a8 01 movw r20, r16 20c96: 6d 81 ldd r22, Y+5 ; 0x05 20c98: 79 81 ldd r23, Y+1 ; 0x01 20c9a: 48 37 cpi r20, 0x78 ; 120 20c9c: 51 05 cpc r21, r1 20c9e: 61 05 cpc r22, r1 20ca0: 71 05 cpc r23, r1 20ca2: 20 f4 brcc .+8 ; 0x20cac 20ca4: 48 e7 ldi r20, 0x78 ; 120 20ca6: 50 e0 ldi r21, 0x00 ; 0 20ca8: 60 e0 ldi r22, 0x00 ; 0 20caa: 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) 20cac: d1 01 movw r26, r2 20cae: d6 96 adiw r26, 0x36 ; 54 20cb0: 8d 90 ld r8, X+ 20cb2: 9d 90 ld r9, X+ 20cb4: ad 90 ld r10, X+ 20cb6: bc 90 ld r11, X 20cb8: d9 97 sbiw r26, 0x39 ; 57 20cba: 8f 8a std Y+23, r8 ; 0x17 20cbc: 98 8e std Y+24, r9 ; 0x18 20cbe: a9 8e std Y+25, r10 ; 0x19 20cc0: ba 8e std Y+26, r11 ; 0x1a 20cc2: 48 15 cp r20, r8 20cc4: 59 05 cpc r21, r9 20cc6: 6a 05 cpc r22, r10 20cc8: 7b 05 cpc r23, r11 20cca: 20 f4 brcc .+8 ; 0x20cd4 20ccc: 4f 8b std Y+23, r20 ; 0x17 20cce: 58 8f std Y+24, r21 ; 0x18 20cd0: 69 8f std Y+25, r22 ; 0x19 20cd2: 7a 8f std Y+26, r23 ; 0x1a 20cd4: 43 2f mov r20, r19 20cd6: 52 2f mov r21, r18 20cd8: bc 01 movw r22, r24 20cda: 48 37 cpi r20, 0x78 ; 120 20cdc: 51 05 cpc r21, r1 20cde: 61 05 cpc r22, r1 20ce0: 71 05 cpc r23, r1 20ce2: 20 f4 brcc .+8 ; 0x20cec 20ce4: 48 e7 ldi r20, 0x78 ; 120 20ce6: 50 e0 ldi r21, 0x00 ; 0 20ce8: 60 e0 ldi r22, 0x00 ; 0 20cea: 70 e0 ldi r23, 0x00 ; 0 20cec: 18 2d mov r17, r8 20cee: 09 2d mov r16, r9 20cf0: a9 a2 std Y+33, r10 ; 0x21 20cf2: b8 a2 std Y+32, r11 ; 0x20 20cf4: 48 15 cp r20, r8 20cf6: 59 05 cpc r21, r9 20cf8: 6a 05 cpc r22, r10 20cfa: 7b 05 cpc r23, r11 20cfc: 20 f4 brcc .+8 ; 0x20d06 20cfe: 14 2f mov r17, r20 20d00: 05 2f mov r16, r21 20d02: 69 a3 std Y+33, r22 ; 0x21 20d04: 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; 20d06: f1 01 movw r30, r2 20d08: ee 5b subi r30, 0xBE ; 190 20d0a: ff 4f sbci r31, 0xFF ; 255 20d0c: c0 80 ld r12, Z 20d0e: d1 80 ldd r13, Z+1 ; 0x01 20d10: e2 80 ldd r14, Z+2 ; 0x02 20d12: f3 80 ldd r15, Z+3 ; 0x03 20d14: cd 82 std Y+5, r12 ; 0x05 20d16: de 82 std Y+6, r13 ; 0x06 20d18: ef 82 std Y+7, r14 ; 0x07 20d1a: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 20d1c: cd 28 or r12, r13 20d1e: ce 28 or r12, r14 20d20: cf 28 or r12, r15 20d22: 41 f4 brne .+16 ; 0x20d34 // Don't allow zero acceleration. acceleration = 1; 20d24: c1 2c mov r12, r1 20d26: d1 2c mov r13, r1 20d28: 76 01 movw r14, r12 20d2a: c3 94 inc r12 20d2c: cd 82 std Y+5, r12 ; 0x05 20d2e: de 82 std Y+6, r13 ; 0x06 20d30: ef 82 std Y+7, r14 ; 0x07 20d32: 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; 20d34: 2f 89 ldd r18, Y+23 ; 0x17 20d36: 38 8d ldd r19, Y+24 ; 0x18 20d38: 49 8d ldd r20, Y+25 ; 0x19 20d3a: 5a 8d ldd r21, Y+26 ; 0x1a 20d3c: b9 01 movw r22, r18 20d3e: ca 01 movw r24, r20 20d40: 0f 94 a1 a4 call 0x34942 ; 0x34942 <__mulsi3> 20d44: 6d 87 std Y+13, r22 ; 0x0d 20d46: 7e 87 std Y+14, r23 ; 0x0e 20d48: 8f 87 std Y+15, r24 ; 0x0f 20d4a: 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; 20d4c: a5 01 movw r20, r10 20d4e: 94 01 movw r18, r8 20d50: c5 01 movw r24, r10 20d52: b4 01 movw r22, r8 20d54: 0f 94 a1 a4 call 0x34942 ; 0x34942 <__mulsi3> 20d58: 2b 01 movw r4, r22 20d5a: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 20d5c: 21 2f mov r18, r17 20d5e: 30 2f mov r19, r16 20d60: 49 a1 ldd r20, Y+33 ; 0x21 20d62: 58 a1 ldd r21, Y+32 ; 0x20 20d64: 61 2f mov r22, r17 20d66: 70 2f mov r23, r16 20d68: ca 01 movw r24, r20 20d6a: 0f 94 a1 a4 call 0x34942 ; 0x34942 <__mulsi3> 20d6e: 69 8b std Y+17, r22 ; 0x11 20d70: 7a 8b std Y+18, r23 ; 0x12 20d72: 8b 8b std Y+19, r24 ; 0x13 20d74: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 20d76: cd 80 ldd r12, Y+5 ; 0x05 20d78: de 80 ldd r13, Y+6 ; 0x06 20d7a: ef 80 ldd r14, Y+7 ; 0x07 20d7c: f8 84 ldd r15, Y+8 ; 0x08 20d7e: cc 0c add r12, r12 20d80: dd 1c adc r13, r13 20d82: ee 1c adc r14, r14 20d84: ff 1c adc r15, r15 20d86: c9 86 std Y+9, r12 ; 0x09 20d88: da 86 std Y+10, r13 ; 0x0a 20d8a: eb 86 std Y+11, r14 ; 0x0b 20d8c: 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; 20d8e: c3 01 movw r24, r6 20d90: b2 01 movw r22, r4 20d92: 61 50 subi r22, 0x01 ; 1 20d94: 71 09 sbc r23, r1 20d96: 81 09 sbc r24, r1 20d98: 91 09 sbc r25, r1 20d9a: cd 84 ldd r12, Y+13 ; 0x0d 20d9c: de 84 ldd r13, Y+14 ; 0x0e 20d9e: ef 84 ldd r14, Y+15 ; 0x0f 20da0: f8 88 ldd r15, Y+16 ; 0x10 20da2: 6c 19 sub r22, r12 20da4: 7d 09 sbc r23, r13 20da6: 8e 09 sbc r24, r14 20da8: 9f 09 sbc r25, r15 20daa: c9 84 ldd r12, Y+9 ; 0x09 20dac: da 84 ldd r13, Y+10 ; 0x0a 20dae: eb 84 ldd r14, Y+11 ; 0x0b 20db0: fc 84 ldd r15, Y+12 ; 0x0c 20db2: 6c 0d add r22, r12 20db4: 7d 1d adc r23, r13 20db6: 8e 1d adc r24, r14 20db8: 9f 1d adc r25, r15 20dba: a7 01 movw r20, r14 20dbc: 96 01 movw r18, r12 20dbe: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 20dc2: 69 01 movw r12, r18 20dc4: 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; 20dc6: c3 01 movw r24, r6 20dc8: b2 01 movw r22, r4 20dca: 29 89 ldd r18, Y+17 ; 0x11 20dcc: 3a 89 ldd r19, Y+18 ; 0x12 20dce: 4b 89 ldd r20, Y+19 ; 0x13 20dd0: 5c 89 ldd r21, Y+20 ; 0x14 20dd2: 62 1b sub r22, r18 20dd4: 73 0b sbc r23, r19 20dd6: 84 0b sbc r24, r20 20dd8: 95 0b sbc r25, r21 20dda: 29 85 ldd r18, Y+9 ; 0x09 20ddc: 3a 85 ldd r19, Y+10 ; 0x0a 20dde: 4b 85 ldd r20, Y+11 ; 0x0b 20de0: 5c 85 ldd r21, Y+12 ; 0x0c 20de2: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 20de6: 29 01 movw r4, r18 20de8: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 20dea: d7 01 movw r26, r14 20dec: c6 01 movw r24, r12 20dee: 84 0d add r24, r4 20df0: 95 1d adc r25, r5 20df2: a6 1d adc r26, r6 20df4: b7 1d adc r27, r7 20df6: 8c 8f std Y+28, r24 ; 0x1c 20df8: 9d 8f std Y+29, r25 ; 0x1d 20dfa: ae 8f std Y+30, r26 ; 0x1e 20dfc: 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) { 20dfe: f1 01 movw r30, r2 20e00: e4 5b subi r30, 0xB4 ; 180 20e02: ff 4f sbci r31, 0xFF ; 255 20e04: 90 81 ld r25, Z 20e06: 9b 8f std Y+27, r25 ; 0x1b 20e08: 99 23 and r25, r25 20e0a: 09 f4 brne .+2 ; 0x20e0e 20e0c: 8d c0 rjmp .+282 ; 0x20f28 final_adv_steps = final_rate * block->adv_comp; 20e0e: 61 2f mov r22, r17 20e10: 70 2f mov r23, r16 20e12: 89 a1 ldd r24, Y+33 ; 0x21 20e14: 98 a1 ldd r25, Y+32 ; 0x20 20e16: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 20e1a: f1 01 movw r30, r2 20e1c: ec 5a subi r30, 0xAC ; 172 20e1e: ff 4f sbci r31, 0xFF ; 255 20e20: 20 81 ld r18, Z 20e22: 31 81 ldd r19, Z+1 ; 0x01 20e24: 42 81 ldd r20, Z+2 ; 0x02 20e26: 53 81 ldd r21, Z+3 ; 0x03 20e28: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 20e2c: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 20e30: 6d 8b std Y+21, r22 ; 0x15 20e32: 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) { 20e34: d1 01 movw r26, r2 20e36: 50 96 adiw r26, 0x10 ; 16 20e38: 2d 91 ld r18, X+ 20e3a: 3d 91 ld r19, X+ 20e3c: 4d 91 ld r20, X+ 20e3e: 5c 91 ld r21, X 20e40: 53 97 sbiw r26, 0x13 ; 19 20e42: 29 83 std Y+1, r18 ; 0x01 20e44: 3a 83 std Y+2, r19 ; 0x02 20e46: 4b 83 std Y+3, r20 ; 0x03 20e48: 5c 83 std Y+4, r21 ; 0x04 20e4a: 8c 8d ldd r24, Y+28 ; 0x1c 20e4c: 9d 8d ldd r25, Y+29 ; 0x1d 20e4e: ae 8d ldd r26, Y+30 ; 0x1e 20e50: bf 8d ldd r27, Y+31 ; 0x1f 20e52: 82 17 cp r24, r18 20e54: 93 07 cpc r25, r19 20e56: a4 07 cpc r26, r20 20e58: b5 07 cpc r27, r21 20e5a: 08 f0 brcs .+2 ; 0x20e5e 20e5c: 68 c0 rjmp .+208 ; 0x20f2e plateau_steps = block->step_event_count.wide - accel_decel_steps; 20e5e: 29 01 movw r4, r18 20e60: 3a 01 movw r6, r20 20e62: 48 1a sub r4, r24 20e64: 59 0a sbc r5, r25 20e66: 6a 0a sbc r6, r26 20e68: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 20e6a: 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; 20e6c: 40 e0 ldi r20, 0x00 ; 0 20e6e: 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) 20e70: 99 23 and r25, r25 20e72: 89 f0 breq .+34 ; 0x20e96 max_adv_steps = block->nominal_rate * block->adv_comp; 20e74: c5 01 movw r24, r10 20e76: b4 01 movw r22, r8 20e78: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 20e7c: f1 01 movw r30, r2 20e7e: ec 5a subi r30, 0xAC ; 172 20e80: ff 4f sbci r31, 0xFF ; 255 20e82: 20 81 ld r18, Z 20e84: 31 81 ldd r19, Z+1 ; 0x01 20e86: 42 81 ldd r20, Z+2 ; 0x02 20e88: 53 81 ldd r21, Z+3 ; 0x03 20e8a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 20e8e: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 20e92: 46 2f mov r20, r22 20e94: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 20e96: 3f b7 in r19, 0x3f ; 63 20e98: 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. 20e9a: f1 01 movw r30, r2 20e9c: e9 5b subi r30, 0xB9 ; 185 20e9e: ff 4f sbci r31, 0xFF ; 255 20ea0: 20 81 ld r18, Z 20ea2: 21 11 cpse r18, r1 20ea4: 27 c0 rjmp .+78 ; 0x20ef4 block->accelerate_until = accelerate_steps; 20ea6: d1 01 movw r26, r2 20ea8: 59 96 adiw r26, 0x19 ; 25 20eaa: cd 92 st X+, r12 20eac: dd 92 st X+, r13 20eae: ed 92 st X+, r14 20eb0: fc 92 st X, r15 20eb2: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 20eb4: c4 0c add r12, r4 20eb6: d5 1c adc r13, r5 20eb8: e6 1c adc r14, r6 20eba: f7 1c adc r15, r7 20ebc: f1 01 movw r30, r2 20ebe: c5 8e std Z+29, r12 ; 0x1d 20ec0: d6 8e std Z+30, r13 ; 0x1e 20ec2: e7 8e std Z+31, r14 ; 0x1f 20ec4: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 20ec6: cf 88 ldd r12, Y+23 ; 0x17 20ec8: c2 ae std Z+58, r12 ; 0x3a 20eca: d8 8c ldd r13, Y+24 ; 0x18 20ecc: d3 ae std Z+59, r13 ; 0x3b 20ece: e9 8c ldd r14, Y+25 ; 0x19 20ed0: e4 ae std Z+60, r14 ; 0x3c 20ed2: fa 8c ldd r15, Y+26 ; 0x1a 20ed4: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 20ed6: fe 96 adiw r30, 0x3e ; 62 20ed8: 10 83 st Z, r17 20eda: 01 83 std Z+1, r16 ; 0x01 20edc: c9 a0 ldd r12, Y+33 ; 0x21 20ede: c2 82 std Z+2, r12 ; 0x02 20ee0: d8 a0 ldd r13, Y+32 ; 0x20 20ee2: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 20ee4: 73 96 adiw r30, 0x13 ; 19 20ee6: ed 88 ldd r14, Y+21 ; 0x15 20ee8: e0 82 st Z, r14 20eea: fe 88 ldd r15, Y+22 ; 0x16 20eec: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 20eee: 32 97 sbiw r30, 0x02 ; 2 20ef0: 40 83 st Z, r20 20ef2: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 20ef4: 3f bf out 0x3f, r19 ; 63 } 20ef6: a1 96 adiw r28, 0x21 ; 33 20ef8: 0f b6 in r0, 0x3f ; 63 20efa: f8 94 cli 20efc: de bf out 0x3e, r29 ; 62 20efe: 0f be out 0x3f, r0 ; 63 20f00: cd bf out 0x3d, r28 ; 61 20f02: df 91 pop r29 20f04: cf 91 pop r28 20f06: 1f 91 pop r17 20f08: 0f 91 pop r16 20f0a: ff 90 pop r15 20f0c: ef 90 pop r14 20f0e: df 90 pop r13 20f10: cf 90 pop r12 20f12: bf 90 pop r11 20f14: af 90 pop r10 20f16: 9f 90 pop r9 20f18: 8f 90 pop r8 20f1a: 7f 90 pop r7 20f1c: 6f 90 pop r6 20f1e: 5f 90 pop r5 20f20: 4f 90 pop r4 20f22: 3f 90 pop r3 20f24: 2f 90 pop r2 20f26: 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; 20f28: 1d 8a std Y+21, r1 ; 0x15 20f2a: 1e 8a std Y+22, r1 ; 0x16 20f2c: 83 cf rjmp .-250 ; 0x20e34 #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; 20f2e: 2d 81 ldd r18, Y+5 ; 0x05 20f30: 3e 81 ldd r19, Y+6 ; 0x06 20f32: 4f 81 ldd r20, Y+7 ; 0x07 20f34: 58 85 ldd r21, Y+8 ; 0x08 20f36: 82 e0 ldi r24, 0x02 ; 2 20f38: 22 0f add r18, r18 20f3a: 33 1f adc r19, r19 20f3c: 44 1f adc r20, r20 20f3e: 55 1f adc r21, r21 20f40: 8a 95 dec r24 20f42: d1 f7 brne .-12 ; 0x20f38 20f44: 89 81 ldd r24, Y+1 ; 0x01 20f46: 9a 81 ldd r25, Y+2 ; 0x02 20f48: ab 81 ldd r26, Y+3 ; 0x03 20f4a: bc 81 ldd r27, Y+4 ; 0x04 20f4c: 81 70 andi r24, 0x01 ; 1 20f4e: 99 27 eor r25, r25 20f50: aa 27 eor r26, r26 20f52: bb 27 eor r27, r27 20f54: 8d 83 std Y+5, r24 ; 0x05 20f56: 9e 83 std Y+6, r25 ; 0x06 20f58: af 83 std Y+7, r26 ; 0x07 20f5a: b8 87 std Y+8, r27 ; 0x08 20f5c: 89 80 ldd r8, Y+1 ; 0x01 20f5e: 9a 80 ldd r9, Y+2 ; 0x02 20f60: ab 80 ldd r10, Y+3 ; 0x03 20f62: bc 80 ldd r11, Y+4 ; 0x04 20f64: b6 94 lsr r11 20f66: a7 94 ror r10 20f68: 97 94 ror r9 20f6a: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 20f6c: cd 84 ldd r12, Y+13 ; 0x0d 20f6e: de 84 ldd r13, Y+14 ; 0x0e 20f70: ef 84 ldd r14, Y+15 ; 0x0f 20f72: f8 88 ldd r15, Y+16 ; 0x10 20f74: 89 89 ldd r24, Y+17 ; 0x11 20f76: 9a 89 ldd r25, Y+18 ; 0x12 20f78: ab 89 ldd r26, Y+19 ; 0x13 20f7a: bc 89 ldd r27, Y+20 ; 0x14 20f7c: 8c 15 cp r24, r12 20f7e: 9d 05 cpc r25, r13 20f80: ae 05 cpc r26, r14 20f82: bf 05 cpc r27, r15 20f84: 08 f4 brcc .+2 ; 0x20f88 20f86: 6f c0 rjmp .+222 ; 0x21066 // 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; 20f88: 6c 01 movw r12, r24 20f8a: 7d 01 movw r14, r26 20f8c: 91 e0 ldi r25, 0x01 ; 1 20f8e: c9 1a sub r12, r25 20f90: d1 08 sbc r13, r1 20f92: e1 08 sbc r14, r1 20f94: f1 08 sbc r15, r1 20f96: 8d 85 ldd r24, Y+13 ; 0x0d 20f98: 9e 85 ldd r25, Y+14 ; 0x0e 20f9a: af 85 ldd r26, Y+15 ; 0x0f 20f9c: b8 89 ldd r27, Y+16 ; 0x10 20f9e: c8 1a sub r12, r24 20fa0: d9 0a sbc r13, r25 20fa2: ea 0a sbc r14, r26 20fa4: fb 0a sbc r15, r27 20fa6: c7 01 movw r24, r14 20fa8: b6 01 movw r22, r12 20faa: 62 0f add r22, r18 20fac: 73 1f adc r23, r19 20fae: 84 1f adc r24, r20 20fb0: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 20fb2: cd 80 ldd r12, Y+5 ; 0x05 20fb4: de 80 ldd r13, Y+6 ; 0x06 20fb6: ef 80 ldd r14, Y+7 ; 0x07 20fb8: f8 84 ldd r15, Y+8 ; 0x08 20fba: cd 28 or r12, r13 20fbc: ce 28 or r12, r14 20fbe: cf 28 or r12, r15 20fc0: 41 f0 breq .+16 ; 0x20fd2 accelerate_steps += acceleration_x2; 20fc2: c9 84 ldd r12, Y+9 ; 0x09 20fc4: da 84 ldd r13, Y+10 ; 0x0a 20fc6: eb 84 ldd r14, Y+11 ; 0x0b 20fc8: fc 84 ldd r15, Y+12 ; 0x0c 20fca: 6c 0d add r22, r12 20fcc: 7d 1d adc r23, r13 20fce: 8e 1d adc r24, r14 20fd0: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 20fd2: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 20fd6: 75 01 movw r14, r10 20fd8: 64 01 movw r12, r8 20fda: c2 0e add r12, r18 20fdc: d3 1e adc r13, r19 20fde: e4 1e adc r14, r20 20fe0: f5 1e adc r15, r21 20fe2: 29 81 ldd r18, Y+1 ; 0x01 20fe4: 3a 81 ldd r19, Y+2 ; 0x02 20fe6: 4b 81 ldd r20, Y+3 ; 0x03 20fe8: 5c 81 ldd r21, Y+4 ; 0x04 20fea: 2c 15 cp r18, r12 20fec: 3d 05 cpc r19, r13 20fee: 4e 05 cpc r20, r14 20ff0: 5f 05 cpc r21, r15 20ff2: 10 f4 brcc .+4 ; 0x20ff8 20ff4: 69 01 movw r12, r18 20ff6: 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) { 20ff8: 2b 8d ldd r18, Y+27 ; 0x1b 20ffa: 22 23 and r18, r18 20ffc: 09 f4 brne .+2 ; 0x21000 20ffe: 69 c0 rjmp .+210 ; 0x210d2 if(!accelerate_steps || !decelerate_steps) { 21000: c1 14 cp r12, r1 21002: d1 04 cpc r13, r1 21004: e1 04 cpc r14, r1 21006: f1 04 cpc r15, r1 21008: 09 f4 brne .+2 ; 0x2100c 2100a: 66 c0 rjmp .+204 ; 0x210d8 // 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; 2100c: 4d 89 ldd r20, Y+21 ; 0x15 2100e: 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) { 21010: 41 14 cp r4, r1 21012: 51 04 cpc r5, r1 21014: 61 04 cpc r6, r1 21016: 71 04 cpc r7, r1 21018: 09 f4 brne .+2 ; 0x2101c 2101a: 3d cf rjmp .-390 ; 0x20e96 // 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); 2101c: a7 01 movw r20, r14 2101e: 96 01 movw r18, r12 21020: 69 85 ldd r22, Y+9 ; 0x09 21022: 7a 85 ldd r23, Y+10 ; 0x0a 21024: 8b 85 ldd r24, Y+11 ; 0x0b 21026: 9c 85 ldd r25, Y+12 ; 0x0c 21028: 0f 94 a1 a4 call 0x34942 ; 0x34942 <__mulsi3> 2102c: 2d 85 ldd r18, Y+13 ; 0x0d 2102e: 3e 85 ldd r19, Y+14 ; 0x0e 21030: 4f 85 ldd r20, Y+15 ; 0x0f 21032: 58 89 ldd r21, Y+16 ; 0x10 21034: 62 0f add r22, r18 21036: 73 1f adc r23, r19 21038: 84 1f adc r24, r20 2103a: 95 1f adc r25, r21 2103c: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 21040: 0f 94 34 a9 call 0x35268 ; 0x35268 max_adv_steps = max_rate * block->adv_comp; 21044: f1 01 movw r30, r2 21046: ec 5a subi r30, 0xAC ; 172 21048: ff 4f sbci r31, 0xFF ; 255 2104a: 20 81 ld r18, Z 2104c: 31 81 ldd r19, Z+1 ; 0x01 2104e: 42 81 ldd r20, Z+2 ; 0x02 21050: 53 81 ldd r21, Z+3 ; 0x03 21052: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 21056: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 2105a: 46 2f mov r20, r22 2105c: 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; 2105e: 41 2c mov r4, r1 21060: 51 2c mov r5, r1 21062: 32 01 movw r6, r4 21064: 18 cf rjmp .-464 ; 0x20e96 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; 21066: 6d 85 ldd r22, Y+13 ; 0x0d 21068: 7e 85 ldd r23, Y+14 ; 0x0e 2106a: 8f 85 ldd r24, Y+15 ; 0x0f 2106c: 98 89 ldd r25, Y+16 ; 0x10 2106e: c9 88 ldd r12, Y+17 ; 0x11 21070: da 88 ldd r13, Y+18 ; 0x12 21072: eb 88 ldd r14, Y+19 ; 0x13 21074: fc 88 ldd r15, Y+20 ; 0x14 21076: 6c 19 sub r22, r12 21078: 7d 09 sbc r23, r13 2107a: 8e 09 sbc r24, r14 2107c: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 2107e: cd 80 ldd r12, Y+5 ; 0x05 21080: de 80 ldd r13, Y+6 ; 0x06 21082: ef 80 ldd r14, Y+7 ; 0x07 21084: f8 84 ldd r15, Y+8 ; 0x08 21086: cd 28 or r12, r13 21088: ce 28 or r12, r14 2108a: cf 28 or r12, r15 2108c: 41 f0 breq .+16 ; 0x2109e decelerate_steps += acceleration_x2; 2108e: c9 84 ldd r12, Y+9 ; 0x09 21090: da 84 ldd r13, Y+10 ; 0x0a 21092: eb 84 ldd r14, Y+11 ; 0x0b 21094: fc 84 ldd r15, Y+12 ; 0x0c 21096: 6c 0d add r22, r12 21098: 7d 1d adc r23, r13 2109a: 8e 1d adc r24, r14 2109c: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 2109e: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 210a2: 82 0e add r8, r18 210a4: 93 1e adc r9, r19 210a6: a4 1e adc r10, r20 210a8: b5 1e adc r11, r21 210aa: 49 80 ldd r4, Y+1 ; 0x01 210ac: 5a 80 ldd r5, Y+2 ; 0x02 210ae: 6b 80 ldd r6, Y+3 ; 0x03 210b0: 7c 80 ldd r7, Y+4 ; 0x04 210b2: 84 14 cp r8, r4 210b4: 95 04 cpc r9, r5 210b6: a6 04 cpc r10, r6 210b8: b7 04 cpc r11, r7 210ba: 10 f4 brcc .+4 ; 0x210c0 210bc: 24 01 movw r4, r8 210be: 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; 210c0: c9 80 ldd r12, Y+1 ; 0x01 210c2: da 80 ldd r13, Y+2 ; 0x02 210c4: eb 80 ldd r14, Y+3 ; 0x03 210c6: fc 80 ldd r15, Y+4 ; 0x04 210c8: c4 18 sub r12, r4 210ca: d5 08 sbc r13, r5 210cc: e6 08 sbc r14, r6 210ce: f7 08 sbc r15, r7 210d0: 93 cf rjmp .-218 ; 0x20ff8 // 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; 210d2: 40 e0 ldi r20, 0x00 ; 0 210d4: 80 e0 ldi r24, 0x00 ; 0 210d6: c3 cf rjmp .-122 ; 0x2105e #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; 210d8: 4d 89 ldd r20, Y+21 ; 0x15 210da: 8e 89 ldd r24, Y+22 ; 0x16 210dc: c0 cf rjmp .-128 ; 0x2105e 000210de : }; 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() { 210de: ef 92 push r14 210e0: ff 92 push r15 210e2: 0f 93 push r16 210e4: 1f 93 push r17 210e6: cf 93 push r28 210e8: df 93 push r29 210ea: 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) 210ee: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 210f2: 81 11 cpse r24, r1 210f4: 23 c0 rjmp .+70 ; 0x2113c { _md->status = 1; // Menu entered for the first time 210f6: 81 e0 ldi r24, 0x01 ; 1 210f8: 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; 210fc: 81 e0 ldi r24, 0x01 ; 1 210fe: 90 e0 ldi r25, 0x00 ; 0 21100: 20 91 d2 12 lds r18, 0x12D2 ; 0x8012d2 21104: 30 91 d3 12 lds r19, 0x12D3 ; 0x8012d3 21108: 27 30 cpi r18, 0x07 ; 7 2110a: 31 48 sbci r19, 0x81 ; 129 2110c: 11 f0 breq .+4 ; 0x21112 2110e: 90 e0 ldi r25, 0x00 ; 0 21110: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 21112: bc 01 movw r22, r24 21114: 66 0f add r22, r22 21116: 77 1f adc r23, r23 21118: 68 0f add r22, r24 2111a: 79 1f adc r23, r25 2111c: 66 52 subi r22, 0x26 ; 38 2111e: 77 47 sbci r23, 0x77 ; 119 21120: 43 e0 ldi r20, 0x03 ; 3 21122: 50 e0 ldi r21, 0x00 ; 0 21124: 85 ea ldi r24, 0xA5 ; 165 21126: 93 e0 ldi r25, 0x03 ; 3 21128: 0f 94 d8 a1 call 0x343b0 ; 0x343b0 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 2112c: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 21130: 0e 94 62 fc call 0x1f8c4 ; 0x1f8c4 _md->currentValue = mmu2.GetLastReadRegisterValue(); 21134: 80 91 fd 12 lds r24, 0x12FD ; 0x8012fd 21138: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 } MENU_BEGIN(); 2113c: 0e 94 67 74 call 0xe8ce ; 0xe8ce 21140: 10 92 60 04 sts 0x0460, r1 ; 0x800460 21144: 80 91 60 04 lds r24, 0x0460 ; 0x800460 21148: 84 30 cpi r24, 0x04 ; 4 2114a: e0 f5 brcc .+120 ; 0x211c4 2114c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 21150: 0e 94 a7 62 call 0xc54e ; 0xc54e 21154: 88 23 and r24, r24 21156: 89 f0 breq .+34 ; 0x2117a 21158: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 2115c: 70 e0 ldi r23, 0x00 ; 0 2115e: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 21162: 0e 94 87 d0 call 0x1a10e ; 0x1a10e 21166: 10 92 43 0d sts 0x0D43, r1 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.450> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 2116a: df 91 pop r29 2116c: cf 91 pop r28 2116e: 1f 91 pop r17 21170: 0f 91 pop r16 21172: ff 90 pop r15 21174: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 21176: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 2117a: 83 ec ldi r24, 0xC3 ; 195 2117c: 96 e5 ldi r25, 0x56 ; 86 2117e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 21182: 0e 94 29 73 call 0xe652 ; 0xe652 MENU_ITEM_EDIT_int3_P( 21186: 00 91 a7 03 lds r16, 0x03A7 ; 0x8003a7 2118a: 10 e0 ldi r17, 0x00 ; 0 2118c: c0 91 a6 03 lds r28, 0x03A6 ; 0x8003a6 21190: d0 e0 ldi r29, 0x00 ; 0 21192: 85 eb ldi r24, 0xB5 ; 181 21194: 96 e5 ldi r25, 0x56 ; 86 21196: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2119a: f1 2c mov r15, r1 2119c: e1 2c mov r14, r1 2119e: 9e 01 movw r18, r28 211a0: 48 e0 ldi r20, 0x08 ; 8 211a2: 64 ea ldi r22, 0xA4 ; 164 211a4: 73 e0 ldi r23, 0x03 ; 3 211a6: 0e 94 c9 6f call 0xdf92 ; 0xdf92 _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 211aa: 0e 94 de 62 call 0xc5bc ; 0xc5bc // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 211ae: 80 91 60 04 lds r24, 0x0460 ; 0x800460 211b2: 8f 5f subi r24, 0xFF ; 255 211b4: 80 93 60 04 sts 0x0460, r24 ; 0x800460 211b8: 80 91 62 04 lds r24, 0x0462 ; 0x800462 211bc: 8f 5f subi r24, 0xFF ; 255 211be: 80 93 62 04 sts 0x0462, r24 ; 0x800462 211c2: c0 cf rjmp .-128 ; 0x21144 &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 211c4: df 91 pop r29 211c6: cf 91 pop r28 211c8: 1f 91 pop r17 211ca: 0f 91 pop r16 211cc: ff 90 pop r15 211ce: ef 90 pop r14 211d0: 08 95 ret 000211d2 : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 211d2: 1f 93 push r17 211d4: cf 93 push r28 211d6: 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); 211d8: 64 e6 ldi r22, 0x64 ; 100 211da: 70 e0 ldi r23, 0x00 ; 0 211dc: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__udivmodhi4> 211e0: 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++) { 211e2: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 211e4: 4e e2 ldi r20, 0x2E ; 46 211e6: 63 e0 ldi r22, 0x03 ; 3 211e8: 81 2f mov r24, r17 211ea: 0e 94 6e 70 call 0xe0dc ; 0xe0dc //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 211ee: ce 01 movw r24, r28 211f0: 0e 94 0a 8d call 0x11a14 ; 0x11a14 211f4: ce 01 movw r24, r28 211f6: 0e 94 0a 8d call 0x11a14 ; 0x11a14 211fa: ce 01 movw r24, r28 211fc: 0e 94 0a 8d call 0x11a14 ; 0x11a14 21200: ce 01 movw r24, r28 21202: 0e 94 0a 8d call 0x11a14 ; 0x11a14 21206: ce 01 movw r24, r28 21208: 0e 94 0a 8d call 0x11a14 ; 0x11a14 } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 2120c: 1f 5f subi r17, 0xFF ; 255 2120e: 14 31 cpi r17, 0x14 ; 20 21210: 49 f7 brne .-46 ; 0x211e4 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 21212: df 91 pop r29 21214: cf 91 pop r28 21216: 1f 91 pop r17 21218: 08 95 ret 0002121a : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2121a: 10 92 94 03 sts 0x0394, r1 ; 0x800394 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 2121e: 08 95 ret 00021220 : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 21220: cf 93 push r28 MENU_BEGIN(); 21222: 0e 94 67 74 call 0xe8ce ; 0xe8ce 21226: 10 92 60 04 sts 0x0460, r1 ; 0x800460 2122a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 2122e: 84 30 cpi r24, 0x04 ; 4 21230: 08 f0 brcs .+2 ; 0x21234 21232: b1 c0 rjmp .+354 ; 0x21396 21234: 10 92 63 04 sts 0x0463, r1 ; 0x800463 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 21238: 8f e5 ldi r24, 0x5F ; 95 2123a: 9f e0 ldi r25, 0x0F ; 15 2123c: 0f 94 3e a4 call 0x3487c ; 0x3487c 21240: 81 11 cpse r24, r1 21242: 0f c0 rjmp .+30 ; 0x21262 { ON_MENU_LEAVE( 21244: 0e 94 a7 62 call 0xc54e ; 0xc54e 21248: 81 11 cpse r24, r1 2124a: 0f 94 0d 09 call 0x2121a ; 0x2121a clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 2124e: 80 91 94 03 lds r24, 0x0394 ; 0x800394 21252: 8a 30 cpi r24, 0x0A ; 10 21254: a9 f1 breq .+106 ; 0x212c0 21256: 89 ef ldi r24, 0xF9 ; 249 21258: 98 e4 ldi r25, 0x48 ; 72 2125a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2125e: 0e 94 29 73 call 0xe652 ; 0xe652 } if (farm_mode) 21262: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 21266: 88 23 and r24, r24 21268: 71 f1 breq .+92 ; 0x212c6 { MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), mFilamentItem_farm); 2126a: 6e e2 ldi r22, 0x2E ; 46 2126c: 78 e3 ldi r23, 0x38 ; 56 2126e: 84 ee ldi r24, 0xE4 ; 228 21270: 9a e9 ldi r25, 0x9A ; 154 21272: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), mFilamentItem_farm_nozzle); 21276: 6c e5 ldi r22, 0x5C ; 92 21278: 78 e3 ldi r23, 0x38 ; 56 2127a: 84 ed ldi r24, 0xD4 ; 212 2127c: 9a e9 ldi r25, 0x9A ; 154 2127e: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 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); 21282: 8f e5 ldi r24, 0x5F ; 95 21284: 9f e0 ldi r25, 0x0F ; 15 21286: 0f 94 3e a4 call 0x3487c ; 0x3487c 2128a: 81 11 cpse r24, r1 2128c: 0c c0 rjmp .+24 ; 0x212a6 2128e: 80 91 94 03 lds r24, 0x0394 ; 0x800394 21292: 89 30 cpi r24, 0x09 ; 9 21294: 41 f4 brne .+16 ; 0x212a6 21296: 82 ed ldi r24, 0xD2 ; 210 21298: 98 e5 ldi r25, 0x58 ; 88 2129a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2129e: 6a ea ldi r22, 0xAA ; 170 212a0: 78 e3 ldi r23, 0x38 ; 56 212a2: 0e 94 f8 72 call 0xe5f0 ; 0xe5f0 MENU_END(); 212a6: 0e 94 de 62 call 0xc5bc ; 0xc5bc mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 212aa: 80 91 60 04 lds r24, 0x0460 ; 0x800460 212ae: 8f 5f subi r24, 0xFF ; 255 212b0: 80 93 60 04 sts 0x0460, r24 ; 0x800460 212b4: 80 91 62 04 lds r24, 0x0462 ; 0x800462 212b8: 8f 5f subi r24, 0xFF ; 255 212ba: 80 93 62 04 sts 0x0462, r24 ; 0x800462 212be: b5 cf rjmp .-150 ; 0x2122a 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)); 212c0: 82 e0 ldi r24, 0x02 ; 2 212c2: 9b e4 ldi r25, 0x4B ; 75 212c4: ca cf rjmp .-108 ; 0x2125a 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(); 212c6: 0f 94 c0 01 call 0x20380 ; 0x20380 212ca: 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); 212cc: 89 eb ldi r24, 0xB9 ; 185 212ce: 9a e9 ldi r25, 0x9A ; 154 212d0: cc 23 and r28, r28 212d2: 11 f0 breq .+4 ; 0x212d8 212d4: 88 ec ldi r24, 0xC8 ; 200 212d6: 9a e9 ldi r25, 0x9A ; 154 212d8: 62 e4 ldi r22, 0x42 ; 66 212da: 78 e3 ldi r23, 0x38 ; 56 212dc: 0e 94 4e 73 call 0xe69c ; 0xe69c 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); 212e0: 8e e9 ldi r24, 0x9E ; 158 212e2: 9a e9 ldi r25, 0x9A ; 154 212e4: cc 23 and r28, r28 212e6: 11 f0 breq .+4 ; 0x212ec 212e8: 8d ea ldi r24, 0xAD ; 173 212ea: 9a e9 ldi r25, 0x9A ; 154 212ec: 64 e5 ldi r22, 0x54 ; 84 212ee: 77 e3 ldi r23, 0x37 ; 55 212f0: 0e 94 4e 73 call 0xe69c ; 0xe69c 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); 212f4: 82 e8 ldi r24, 0x82 ; 130 212f6: 9a e9 ldi r25, 0x9A ; 154 212f8: cc 23 and r28, r28 212fa: 11 f0 breq .+4 ; 0x21300 212fc: 82 e9 ldi r24, 0x92 ; 146 212fe: 9a e9 ldi r25, 0x9A ; 154 21300: 66 ef ldi r22, 0xF6 ; 246 21302: 78 e3 ldi r23, 0x38 ; 56 21304: 0e 94 4e 73 call 0xe69c ; 0xe69c 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); 21308: 86 e6 ldi r24, 0x66 ; 102 2130a: 9a e9 ldi r25, 0x9A ; 154 2130c: cc 23 and r28, r28 2130e: 11 f0 breq .+4 ; 0x21314 21310: 86 e7 ldi r24, 0x76 ; 118 21312: 9a e9 ldi r25, 0x9A ; 154 21314: 62 e0 ldi r22, 0x02 ; 2 21316: 79 e3 ldi r23, 0x39 ; 57 21318: 0e 94 4e 73 call 0xe69c ; 0xe69c 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); 2131c: 8b e4 ldi r24, 0x4B ; 75 2131e: 9a e9 ldi r25, 0x9A ; 154 21320: cc 23 and r28, r28 21322: 11 f0 breq .+4 ; 0x21328 21324: 8a e5 ldi r24, 0x5A ; 90 21326: 9a e9 ldi r25, 0x9A ; 154 21328: 6c ed ldi r22, 0xDC ; 220 2132a: 78 e3 ldi r23, 0x38 ; 56 2132c: 0e 94 4e 73 call 0xe69c ; 0xe69c 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); 21330: 80 e3 ldi r24, 0x30 ; 48 21332: 9a e9 ldi r25, 0x9A ; 154 21334: cc 23 and r28, r28 21336: 11 f0 breq .+4 ; 0x2133c 21338: 8f e3 ldi r24, 0x3F ; 63 2133a: 9a e9 ldi r25, 0x9A ; 154 2133c: 68 e0 ldi r22, 0x08 ; 8 2133e: 78 e3 ldi r23, 0x38 ; 56 21340: 0e 94 4e 73 call 0xe69c ; 0xe69c 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); 21344: 84 e1 ldi r24, 0x14 ; 20 21346: 9a e9 ldi r25, 0x9A ; 154 21348: cc 23 and r28, r28 2134a: 11 f0 breq .+4 ; 0x21350 2134c: 84 e2 ldi r24, 0x24 ; 36 2134e: 9a e9 ldi r25, 0x9A ; 154 21350: 60 ea ldi r22, 0xA0 ; 160 21352: 78 e3 ldi r23, 0x38 ; 56 21354: 0e 94 4e 73 call 0xe69c ; 0xe69c 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); 21358: 88 ef ldi r24, 0xF8 ; 248 2135a: 99 e9 ldi r25, 0x99 ; 153 2135c: cc 23 and r28, r28 2135e: 11 f0 breq .+4 ; 0x21364 21360: 88 e0 ldi r24, 0x08 ; 8 21362: 9a e9 ldi r25, 0x9A ; 154 21364: 64 e6 ldi r22, 0x64 ; 100 21366: 77 e3 ldi r23, 0x37 ; 55 21368: 0e 94 4e 73 call 0xe69c ; 0xe69c 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); 2136c: 8c ed ldi r24, 0xDC ; 220 2136e: 99 e9 ldi r25, 0x99 ; 153 21370: cc 23 and r28, r28 21372: 11 f0 breq .+4 ; 0x21378 21374: 8c ee ldi r24, 0xEC ; 236 21376: 99 e9 ldi r25, 0x99 ; 153 21378: 62 e3 ldi r22, 0x32 ; 50 2137a: 77 e3 ldi r23, 0x37 ; 55 2137c: 0e 94 4e 73 call 0xe69c ; 0xe69c 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); 21380: 81 ec ldi r24, 0xC1 ; 193 21382: 99 e9 ldi r25, 0x99 ; 153 21384: cc 23 and r28, r28 21386: 11 f0 breq .+4 ; 0x2138c 21388: 80 ed ldi r24, 0xD0 ; 208 2138a: 99 e9 ldi r25, 0x99 ; 153 2138c: 66 ec ldi r22, 0xC6 ; 198 2138e: 77 e3 ldi r23, 0x37 ; 55 21390: 0e 94 4e 73 call 0xe69c ; 0xe69c 21394: 76 cf rjmp .-276 ; 0x21282 } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); MENU_END(); } 21396: cf 91 pop r28 21398: 08 95 ret 0002139a : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 2139a: 89 e0 ldi r24, 0x09 ; 9 2139c: 80 93 94 03 sts 0x0394, r24 ; 0x800394 lcd_generic_preheat_menu(); 213a0: 0d 94 10 09 jmp 0x21220 ; 0x21220 000213a4 : } // 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); 213a4: 5f 93 push r21 213a6: 4f 93 push r20 213a8: 7f 93 push r23 213aa: 6f 93 push r22 213ac: 28 2f mov r18, r24 213ae: 08 2e mov r0, r24 213b0: 00 0c add r0, r0 213b2: 33 0b sbc r19, r19 213b4: 3f 93 push r19 213b6: 8f 93 push r24 213b8: 8b ef ldi r24, 0xFB ; 251 213ba: 9a e6 ldi r25, 0x6A ; 106 213bc: 9f 93 push r25 213be: 8f 93 push r24 213c0: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_space(9 - chars); 213c4: 2d b7 in r18, 0x3d ; 61 213c6: 3e b7 in r19, 0x3e ; 62 213c8: 28 5f subi r18, 0xF8 ; 248 213ca: 3f 4f sbci r19, 0xFF ; 255 213cc: 0f b6 in r0, 0x3f ; 63 213ce: f8 94 cli 213d0: 3e bf out 0x3e, r19 ; 62 213d2: 0f be out 0x3f, r0 ; 63 213d4: 2d bf out 0x3d, r18 ; 61 213d6: 99 e0 ldi r25, 0x09 ; 9 213d8: 98 1b sub r25, r24 213da: 89 2f mov r24, r25 213dc: 0c 94 83 6f jmp 0xdf06 ; 0xdf06 000213e0 : default: return false; } } void lcd_print_target_temps_first_line() { 213e0: cf 93 push r28 213e2: df 93 push r29 lcd_home(); 213e4: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 213e8: c0 91 5d 12 lds r28, 0x125D ; 0x80125d 213ec: d0 91 5e 12 lds r29, 0x125E ; 0x80125e 213f0: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 213f4: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 213f8: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 213fc: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 21400: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 21404: ae 01 movw r20, r28 21406: 82 e8 ldi r24, 0x82 ; 130 21408: 0f 94 d2 09 call 0x213a4 ; 0x213a4 lcd_set_cursor(10, 0); 2140c: 60 e0 ldi r22, 0x00 ; 0 2140e: 8a e0 ldi r24, 0x0A ; 10 21410: 0e 94 b5 6f call 0xdf6a ; 0xdf6a FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 21414: c0 91 59 12 lds r28, 0x1259 ; 0x801259 21418: d0 91 5a 12 lds r29, 0x125A ; 0x80125a int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 2141c: 20 97 sbiw r28, 0x00 ; 0 2141e: 81 f0 breq .+32 ; 0x21440 lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 21420: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 21424: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 21428: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 2142c: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 21430: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 21434: ae 01 movw r20, r28 21436: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 21438: df 91 pop r29 2143a: 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); 2143c: 0d 94 d2 09 jmp 0x213a4 ; 0x213a4 } else { lcd_space(10); 21440: 8a e0 ldi r24, 0x0A ; 10 } } 21442: df 91 pop r29 21444: 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); 21446: 0c 94 83 6f jmp 0xdf06 ; 0xdf06 0002144a : 2144a: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 2144e: 0f 94 f0 09 call 0x213e0 ; 0x213e0 lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 21452: 8b e6 ldi r24, 0x6B ; 107 21454: 98 e5 ldi r25, 0x58 ; 88 21456: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2145a: ac 01 movw r20, r24 2145c: 61 e0 ldi r22, 0x01 ; 1 2145e: 80 e0 ldi r24, 0x00 ; 0 21460: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(0,2); 21464: 62 e0 ldi r22, 0x02 ; 2 21466: 80 e0 ldi r24, 0x00 ; 0 21468: 0e 94 b5 6f call 0xdf6a ; 0xdf6a switch(eFilamentAction) { 2146c: 80 91 94 03 lds r24, 0x0394 ; 0x800394 21470: 83 30 cpi r24, 0x03 ; 3 21472: 81 f1 breq .+96 ; 0x214d4 21474: 48 f4 brcc .+18 ; 0x21488 21476: 81 30 cpi r24, 0x01 ; 1 21478: 60 f0 brcs .+24 ; 0x21492 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 2147a: 88 e5 ldi r24, 0x58 ; 88 2147c: 98 e5 ldi r25, 0x58 ; 88 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 2147e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 21482: 0e 94 78 6f call 0xdef0 ; 0xdef0 21486: 05 c0 rjmp .+10 ; 0x21492 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) { 21488: 85 30 cpi r24, 0x05 ; 5 2148a: 21 f1 breq .+72 ; 0x214d4 2148c: b0 f3 brcs .-20 ; 0x2147a 2148e: 88 30 cpi r24, 0x08 ; 8 21490: a1 f3 breq .-24 ; 0x2147a case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 21492: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 21496: 81 11 cpse r24, r1 21498: 09 c0 rjmp .+18 ; 0x214ac 2149a: 80 91 94 03 lds r24, 0x0394 ; 0x800394 2149e: 81 50 subi r24, 0x01 ; 1 214a0: 82 30 cpi r24, 0x02 ; 2 214a2: 28 f5 brcc .+74 ; 0x214ee 214a4: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 214a8: 88 23 and r24, r24 214aa: 09 f1 breq .+66 ; 0x214ee #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 214ac: 80 91 15 06 lds r24, 0x0615 ; 0x800615 214b0: 81 11 cpse r24, r1 214b2: 13 c0 rjmp .+38 ; 0x214da 214b4: 83 e0 ldi r24, 0x03 ; 3 214b6: 0e 94 5a 63 call 0xc6b4 ; 0xc6b4 switch(eFilamentAction) { 214ba: 80 91 94 03 lds r24, 0x0394 ; 0x800394 214be: 82 30 cpi r24, 0x02 ; 2 214c0: 71 f0 breq .+28 ; 0x214de 214c2: 83 30 cpi r24, 0x03 ; 3 214c4: 81 f0 breq .+32 ; 0x214e6 214c6: 81 30 cpi r24, 0x01 ; 1 214c8: 91 f4 brne .+36 ; 0x214ee case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 214ca: 61 e0 ldi r22, 0x01 ; 1 214cc: 8c eb ldi r24, 0xBC ; 188 214ce: 9b e6 ldi r25, 0x6B ; 107 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 214d0: 0c 94 65 8d jmp 0x11aca ; 0x11aca 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)); 214d4: 83 e4 ldi r24, 0x43 ; 67 214d6: 98 e5 ldi r25, 0x58 ; 88 214d8: d2 cf rjmp .-92 ; 0x2147e #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); 214da: 82 e0 ldi r24, 0x02 ; 2 214dc: ec cf rjmp .-40 ; 0x214b6 switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 214de: 81 e0 ldi r24, 0x01 ; 1 214e0: 80 93 94 03 sts 0x0394, r24 ; 0x800394 214e4: f2 cf rjmp .-28 ; 0x214ca [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 214e6: 61 e0 ldi r22, 0x01 ; 1 214e8: 8c e6 ldi r24, 0x6C ; 108 214ea: 99 e6 ldi r25, 0x69 ; 105 214ec: f1 cf rjmp .-30 ; 0x214d0 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 214ee: 08 95 ret 000214f0 <__vector_51>: } return 1; //all characters match - return 1 } ISR(USART2_RX_vect) { 214f0: 1f 92 push r1 214f2: 0f 92 push r0 214f4: 0f b6 in r0, 0x3f ; 63 214f6: 0f 92 push r0 214f8: 11 24 eor r1, r1 214fa: 0b b6 in r0, 0x3b ; 59 214fc: 0f 92 push r0 214fe: 2f 93 push r18 21500: 3f 93 push r19 21502: 4f 93 push r20 21504: 5f 93 push r21 21506: 6f 93 push r22 21508: 7f 93 push r23 2150a: 8f 93 push r24 2150c: 9f 93 push r25 2150e: af 93 push r26 21510: bf 93 push r27 21512: ef 93 push r30 21514: ff 93 push r31 //printf_P(PSTR("USART2_RX_vect \n") ); if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 21516: 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 2151a: 80 91 46 0d lds r24, 0x0D46 ; 0x800d46 uint8_t buf_r = ptr[2]; //get read index 2151e: 90 91 47 0d lds r25, 0x0D47 ; 0x800d47 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 21522: e8 2f mov r30, r24 21524: f0 e0 ldi r31, 0x00 ; 0 21526: e7 5b subi r30, 0xB7 ; 183 21528: f2 4f sbci r31, 0xF2 ; 242 2152a: 20 83 st Z, r18 buf_w++; //incerment write index 2152c: 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 2152e: 20 91 45 0d lds r18, 0x0D45 ; 0x800d45 21532: 82 17 cp r24, r18 21534: 08 f0 brcs .+2 ; 0x21538 <__vector_51+0x48> 21536: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 21538: 98 13 cpse r25, r24 2153a: 17 c0 rjmp .+46 ; 0x2156a <__vector_51+0x7a> { //rx buffer full //uart2_rx_clr(); //for sure, clear input buffer puts_P(PSTR("USART2 rx Full!!!")); 2153c: 86 e5 ldi r24, 0x56 ; 86 2153e: 98 e9 ldi r25, 0x98 ; 152 21540: 0f 94 27 a3 call 0x3464e ; 0x3464e } } 21544: ff 91 pop r31 21546: ef 91 pop r30 21548: bf 91 pop r27 2154a: af 91 pop r26 2154c: 9f 91 pop r25 2154e: 8f 91 pop r24 21550: 7f 91 pop r23 21552: 6f 91 pop r22 21554: 5f 91 pop r21 21556: 4f 91 pop r20 21558: 3f 91 pop r19 2155a: 2f 91 pop r18 2155c: 0f 90 pop r0 2155e: 0b be out 0x3b, r0 ; 59 21560: 0f 90 pop r0 21562: 0f be out 0x3f, r0 ; 63 21564: 0f 90 pop r0 21566: 1f 90 pop r1 21568: 18 95 reti ptr[1] = buf_w; //store write index 2156a: 80 93 46 0d sts 0x0D46, r24 ; 0x800d46 2156e: ea cf rjmp .-44 ; 0x21544 <__vector_51+0x54> 00021570 <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 21570: 1f 92 push r1 21572: 0f 92 push r0 21574: 0f b6 in r0, 0x3f ; 63 21576: 0f 92 push r0 21578: 11 24 eor r1, r1 WRITE(BEEPER, 0); 2157a: 72 98 cbi 0x0e, 2 ; 14 } 2157c: 0f 90 pop r0 2157e: 0f be out 0x3f, r0 ; 63 21580: 0f 90 pop r0 21582: 1f 90 pop r1 21584: 18 95 reti 00021586 <__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) { 21586: 1f 92 push r1 21588: 0f 92 push r0 2158a: 0f b6 in r0, 0x3f ; 63 2158c: 0f 92 push r0 2158e: 11 24 eor r1, r1 WRITE(BEEPER, 1); 21590: 72 9a sbi 0x0e, 2 ; 14 } 21592: 0f 90 pop r0 21594: 0f be out 0x3f, r0 ; 63 21596: 0f 90 pop r0 21598: 1f 90 pop r1 2159a: 18 95 reti 0002159c : void delay2(unsigned long ms) { 2159c: 8f 92 push r8 2159e: 9f 92 push r9 215a0: af 92 push r10 215a2: bf 92 push r11 215a4: cf 92 push r12 215a6: df 92 push r13 215a8: ef 92 push r14 215aa: ff 92 push r15 215ac: 6b 01 movw r12, r22 215ae: 7c 01 movw r14, r24 uint32_t start = micros2(); 215b0: 0e 94 bb fc call 0x1f976 ; 0x1f976 215b4: 4b 01 movw r8, r22 215b6: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 215b8: c1 14 cp r12, r1 215ba: d1 04 cpc r13, r1 215bc: e1 04 cpc r14, r1 215be: f1 04 cpc r15, r1 215c0: b9 f0 breq .+46 ; 0x215f0 215c2: 0e 94 bb fc call 0x1f976 ; 0x1f976 215c6: 68 19 sub r22, r8 215c8: 79 09 sbc r23, r9 215ca: 8a 09 sbc r24, r10 215cc: 9b 09 sbc r25, r11 215ce: 68 3e cpi r22, 0xE8 ; 232 215d0: 73 40 sbci r23, 0x03 ; 3 215d2: 81 05 cpc r24, r1 215d4: 91 05 cpc r25, r1 215d6: 80 f3 brcs .-32 ; 0x215b8 { ms--; 215d8: 21 e0 ldi r18, 0x01 ; 1 215da: c2 1a sub r12, r18 215dc: d1 08 sbc r13, r1 215de: e1 08 sbc r14, r1 215e0: f1 08 sbc r15, r1 start += 1000; 215e2: 88 ee ldi r24, 0xE8 ; 232 215e4: 88 0e add r8, r24 215e6: 83 e0 ldi r24, 0x03 ; 3 215e8: 98 1e adc r9, r24 215ea: a1 1c adc r10, r1 215ec: b1 1c adc r11, r1 215ee: e4 cf rjmp .-56 ; 0x215b8 } } } 215f0: ff 90 pop r15 215f2: ef 90 pop r14 215f4: df 90 pop r13 215f6: cf 90 pop r12 215f8: bf 90 pop r11 215fa: af 90 pop r10 215fc: 9f 90 pop r9 215fe: 8f 90 pop r8 21600: 08 95 ret 00021602 : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 21602: 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(); 21604: f8 94 cli m = timer2_millis; 21606: 60 91 f8 05 lds r22, 0x05F8 ; 0x8005f8 2160a: 70 91 f9 05 lds r23, 0x05F9 ; 0x8005f9 2160e: 80 91 fa 05 lds r24, 0x05FA ; 0x8005fa 21612: 90 91 fb 05 lds r25, 0x05FB ; 0x8005fb SREG = oldSREG; 21616: 2f bf out 0x3f, r18 ; 63 return m; } 21618: 08 95 ret 0002161a : } //! @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); 2161a: 60 e0 ldi r22, 0x00 ; 0 2161c: 70 e0 ldi r23, 0x00 ; 0 2161e: 80 e8 ldi r24, 0x80 ; 128 21620: 9f eb ldi r25, 0xBF ; 191 21622: 0f 94 7c 65 call 0x2caf8 ; 0x2caf8 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 21626: 8f e5 ldi r24, 0x5F ; 95 21628: 9b e6 ldi r25, 0x6B ; 107 2162a: 0e 94 18 7d call 0xfa30 ; 0xfa30 // Indicate that the printer is paused did_pause_print = true; 2162e: 81 e0 ldi r24, 0x01 ; 1 21630: 80 93 cd 03 sts 0x03CD, r24 ; 0x8003cd } else return false; } bool Stopwatch::pause() { if (isRunning()) { 21634: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 21638: 81 30 cpi r24, 0x01 ; 1 2163a: 69 f4 brne .+26 ; 0x21656 state = PAUSED; 2163c: 82 e0 ldi r24, 0x02 ; 2 2163e: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b stopTimestamp = _millis(); 21642: 0f 94 01 0b call 0x21602 ; 0x21602 21646: 60 93 0b 06 sts 0x060B, r22 ; 0x80060b 2164a: 70 93 0c 06 sts 0x060C, r23 ; 0x80060c 2164e: 80 93 0d 06 sts 0x060D, r24 ; 0x80060d 21652: 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; 21656: 82 e0 ldi r24, 0x02 ; 2 21658: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e lcd_return_to_status(); 2165c: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 00021660 ::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) 21660: ff 92 push r15 21662: 0f 93 push r16 21664: 1f 93 push r17 21666: cf 93 push r28 21668: df 93 push r29 { if (!m_isRunning) return false; 2166a: fc 01 movw r30, r24 2166c: f0 80 ld r15, Z 2166e: f1 10 cpse r15, r1 21670: 08 c0 rjmp .+16 ; 0x21682 ::expired(unsigned short)+0x22> 21672: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 21674: 8f 2d mov r24, r15 21676: df 91 pop r29 21678: cf 91 pop r28 2167a: 1f 91 pop r17 2167c: 0f 91 pop r16 2167e: ff 90 pop r15 21680: 08 95 ret 21682: 8b 01 movw r16, r22 21684: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 21686: 0f 94 01 0b call 0x21602 ; 0x21602 if (m_started <= m_started + msPeriod) 2168a: 89 81 ldd r24, Y+1 ; 0x01 2168c: 9a 81 ldd r25, Y+2 ; 0x02 2168e: 08 0f add r16, r24 21690: 19 1f adc r17, r25 21692: 08 17 cp r16, r24 21694: 19 07 cpc r17, r25 21696: 40 f0 brcs .+16 ; 0x216a8 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 21698: 60 17 cp r22, r16 2169a: 71 07 cpc r23, r17 2169c: 18 f4 brcc .+6 ; 0x216a4 ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 2169e: 68 17 cp r22, r24 216a0: 79 07 cpc r23, r25 216a2: 38 f7 brcc .-50 ; 0x21672 ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 216a4: 18 82 st Y, r1 216a6: e6 cf rjmp .-52 ; 0x21674 ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 216a8: 60 17 cp r22, r16 216aa: 71 07 cpc r23, r17 216ac: c0 f7 brcc .-16 ; 0x2169e ::expired(unsigned short)+0x3e> 216ae: e1 cf rjmp .-62 ; 0x21672 ::expired(unsigned short)+0x12> 000216b0 ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 216b0: fc 01 movw r30, r24 216b2: 20 81 ld r18, Z 216b4: 21 11 cpse r18, r1 216b6: 0d 94 30 0b jmp 0x21660 ; 0x21660 ::expired(unsigned short)> } 216ba: 81 e0 ldi r24, 0x01 ; 1 216bc: 08 95 ret 000216be ::start()>: /** * @brief Start timer */ template void Timer::start() 216be: cf 93 push r28 216c0: df 93 push r29 216c2: ec 01 movw r28, r24 { m_started = _millis(); 216c4: 0f 94 01 0b call 0x21602 ; 0x21602 216c8: 7a 83 std Y+2, r23 ; 0x02 216ca: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 216cc: 81 e0 ldi r24, 0x01 ; 1 216ce: 88 83 st Y, r24 } 216d0: df 91 pop r29 216d2: cf 91 pop r28 216d4: 08 95 ret 000216d6 ::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) 216d6: 8f 92 push r8 216d8: 9f 92 push r9 216da: af 92 push r10 216dc: bf 92 push r11 216de: cf 92 push r12 216e0: df 92 push r13 216e2: ef 92 push r14 216e4: ff 92 push r15 216e6: 1f 93 push r17 216e8: cf 93 push r28 216ea: df 93 push r29 { if (!m_isRunning) return false; 216ec: fc 01 movw r30, r24 216ee: 10 81 ld r17, Z 216f0: 11 11 cpse r17, r1 216f2: 0e c0 rjmp .+28 ; 0x21710 ::expired(unsigned long)+0x3a> 216f4: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 216f6: 81 2f mov r24, r17 216f8: df 91 pop r29 216fa: cf 91 pop r28 216fc: 1f 91 pop r17 216fe: ff 90 pop r15 21700: ef 90 pop r14 21702: df 90 pop r13 21704: cf 90 pop r12 21706: bf 90 pop r11 21708: af 90 pop r10 2170a: 9f 90 pop r9 2170c: 8f 90 pop r8 2170e: 08 95 ret 21710: 6a 01 movw r12, r20 21712: 7b 01 movw r14, r22 21714: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 21716: 0f 94 01 0b call 0x21602 ; 0x21602 2171a: 4b 01 movw r8, r22 2171c: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 2171e: 89 81 ldd r24, Y+1 ; 0x01 21720: 9a 81 ldd r25, Y+2 ; 0x02 21722: ab 81 ldd r26, Y+3 ; 0x03 21724: bc 81 ldd r27, Y+4 ; 0x04 21726: c8 0e add r12, r24 21728: d9 1e adc r13, r25 2172a: ea 1e adc r14, r26 2172c: fb 1e adc r15, r27 2172e: c8 16 cp r12, r24 21730: d9 06 cpc r13, r25 21732: ea 06 cpc r14, r26 21734: fb 06 cpc r15, r27 21736: 60 f0 brcs .+24 ; 0x21750 ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 21738: 8c 14 cp r8, r12 2173a: 9d 04 cpc r9, r13 2173c: ae 04 cpc r10, r14 2173e: bf 04 cpc r11, r15 21740: 28 f4 brcc .+10 ; 0x2174c ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 21742: 88 16 cp r8, r24 21744: 99 06 cpc r9, r25 21746: aa 06 cpc r10, r26 21748: bb 06 cpc r11, r27 2174a: a0 f6 brcc .-88 ; 0x216f4 ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 2174c: 18 82 st Y, r1 2174e: d3 cf rjmp .-90 ; 0x216f6 ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 21750: 8c 14 cp r8, r12 21752: 9d 04 cpc r9, r13 21754: ae 04 cpc r10, r14 21756: bf 04 cpc r11, r15 21758: a0 f7 brcc .-24 ; 0x21742 ::expired(unsigned long)+0x6c> 2175a: cc cf rjmp .-104 ; 0x216f4 ::expired(unsigned long)+0x1e> 0002175c : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 2175c: 0f 93 push r16 2175e: 1f 93 push r17 21760: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 21762: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 21766: 88 23 and r24, r24 21768: 09 f4 brne .+2 ; 0x2176c 2176a: 4d c0 rjmp .+154 ; 0x21806 heating_status_counter++; 2176c: 80 91 04 06 lds r24, 0x0604 ; 0x800604 21770: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 21772: 8e 30 cpi r24, 0x0E ; 14 21774: b0 f4 brcc .+44 ; 0x217a2 //! @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++; 21776: 80 93 04 06 sts 0x0604, r24 ; 0x800604 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 2177a: 63 e0 ldi r22, 0x03 ; 3 2177c: 87 e0 ldi r24, 0x07 ; 7 2177e: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_space(13); 21782: 8d e0 ldi r24, 0x0D ; 13 21784: 0e 94 83 6f call 0xdf06 ; 0xdf06 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 21788: c0 e0 ldi r28, 0x00 ; 0 2178a: 80 91 04 06 lds r24, 0x0604 ; 0x800604 2178e: c8 17 cp r28, r24 21790: 58 f4 brcc .+22 ; 0x217a8 lcd_putc_at(7 + dots, 3, '.'); 21792: 4e e2 ldi r20, 0x2E ; 46 21794: 63 e0 ldi r22, 0x03 ; 3 21796: 87 e0 ldi r24, 0x07 ; 7 21798: 8c 0f add r24, r28 2179a: 0e 94 6e 70 call 0xe0dc ; 0xe0dc heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 2179e: cf 5f subi r28, 0xFF ; 255 217a0: f4 cf rjmp .-24 ; 0x2178a 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; 217a2: 10 92 04 06 sts 0x0604, r1 ; 0x800604 217a6: e9 cf rjmp .-46 ; 0x2177a lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 217a8: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 217ac: 82 30 cpi r24, 0x02 ; 2 217ae: d1 f0 breq .+52 ; 0x217e4 217b0: 30 f4 brcc .+12 ; 0x217be 217b2: 81 30 cpi r24, 0x01 ; 1 217b4: 59 f0 breq .+22 ; 0x217cc case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 217b6: cf 91 pop r28 217b8: 1f 91 pop r17 217ba: 0f 91 pop r16 217bc: 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) { 217be: 83 30 cpi r24, 0x03 ; 3 217c0: f9 f0 breq .+62 ; 0x21800 217c2: 84 30 cpi r24, 0x04 ; 4 217c4: c1 f7 brne .-16 ; 0x217b6 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)); 217c6: 8e e0 ldi r24, 0x0E ; 14 217c8: 97 e5 ldi r25, 0x57 ; 87 217ca: 0e c0 rjmp .+28 ; 0x217e8 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)); 217cc: 87 e3 ldi r24, 0x37 ; 55 217ce: 97 e5 ldi r25, 0x57 ; 87 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 217d0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 217d4: ac 01 movw r20, r24 217d6: 63 e0 ldi r22, 0x03 ; 3 217d8: 80 e0 ldi r24, 0x00 ; 0 break; } } } 217da: cf 91 pop r28 217dc: 1f 91 pop r17 217de: 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)); 217e0: 0c 94 62 70 jmp 0xe0c4 ; 0xe0c4 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)); 217e4: 87 e2 ldi r24, 0x27 ; 39 217e6: 97 e5 ldi r25, 0x57 ; 87 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)); 217e8: 0e 94 95 75 call 0xeb2a ; 0xeb2a 217ec: ac 01 movw r20, r24 217ee: 63 e0 ldi r22, 0x03 ; 3 217f0: 80 e0 ldi r24, 0x00 ; 0 217f2: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 heating_status = HeatingStatus::NO_HEATING; 217f6: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb heating_status_counter = 0; 217fa: 10 92 04 06 sts 0x0604, r1 ; 0x800604 217fe: db cf rjmp .-74 ; 0x217b6 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)); 21800: 89 e1 ldi r24, 0x19 ; 25 21802: 97 e5 ldi r25, 0x57 ; 87 21804: e5 cf rjmp .-54 ; 0x217d0 break; } } else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && 21806: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 2180a: 88 23 and r24, r24 2180c: 61 f1 breq .+88 ; 0x21866 break; default: break; } } else if ((IS_SD_PRINTING) && 2180e: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 21812: 81 11 cpse r24, r1 21814: 28 c0 rjmp .+80 ; 0x21866 (custom_message_type == CustomMsg::Status) && 21816: 80 91 c0 03 lds r24, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.421> 2181a: 82 30 cpi r24, 0x02 ; 2 2181c: 20 f5 brcc .+72 ; 0x21866 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 2181e: 80 91 7a 04 lds r24, 0x047A ; 0x80047a <_ZL26lcd_status_message_timeout.lto_priv.422> 21822: 81 11 cpse r24, r1 21824: 16 c0 rjmp .+44 ; 0x21852 (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); 21826: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2182a: 88 23 and r24, r24 2182c: 09 f4 brne .+2 ; 0x21830 2182e: 35 c0 rjmp .+106 ; 0x2189a 21830: 8e ee ldi r24, 0xEE ; 238 21832: 93 e1 ldi r25, 0x13 ; 19 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 21834: 20 91 62 0d lds r18, 0x0D62 ; 0x800d62 21838: 64 e1 ldi r22, 0x14 ; 20 2183a: 82 0f add r24, r18 2183c: 91 1d adc r25, r1 2183e: 0e 94 a2 73 call 0xe744 ; 0xe744 21842: 81 11 cpse r24, r1 21844: 2d c0 rjmp .+90 ; 0x218a0 { scrollstuff++; 21846: 80 91 62 0d lds r24, 0x0D62 ; 0x800d62 2184a: 8f 5f subi r24, 0xFF ; 255 2184c: 80 93 62 0d sts 0x0D62, r24 ; 0x800d62 21850: b2 cf rjmp .-156 ; 0x217b6 21852: 40 e2 ldi r20, 0x20 ; 32 21854: 5e e4 ldi r21, 0x4E ; 78 21856: 60 e0 ldi r22, 0x00 ; 0 21858: 70 e0 ldi r23, 0x00 ; 0 2185a: 8a e7 ldi r24, 0x7A ; 122 2185c: 94 e0 ldi r25, 0x04 ; 4 2185e: 0f 94 6b 0b call 0x216d6 ; 0x216d6 ::expired(unsigned long)> 21862: 81 11 cpse r24, r1 21864: e0 cf rjmp .-64 ; 0x21826 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) 21866: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 2186a: 81 11 cpse r24, r1 2186c: 1c c0 rjmp .+56 ; 0x218a6 { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 2186e: e0 91 5d 06 lds r30, 0x065D ; 0x80065d 21872: ea 30 cpi r30, 0x0A ; 10 21874: 08 f0 brcs .+2 ; 0x21878 21876: 9f cf rjmp .-194 ; 0x217b6 21878: f0 e0 ldi r31, 0x00 ; 0 2187a: 88 27 eor r24, r24 2187c: ed 5b subi r30, 0xBD ; 189 2187e: f3 4f sbci r31, 0xF3 ; 243 21880: 8e 4f sbci r24, 0xFE ; 254 21882: 0d 94 4e a5 jmp 0x34a9c ; 0x34a9c <__tablejump2__> 21886: e4 37 cpi r30, 0x74 ; 116 21888: 04 39 cpi r16, 0x94 ; 148 2188a: e4 37 cpi r30, 0x74 ; 116 2188c: be 37 cpi r27, 0x7E ; 126 2188e: fe 38 cpi r31, 0x8E ; 142 21890: 4e 37 cpi r20, 0x7E ; 126 21892: e4 37 cpi r30, 0x74 ; 116 21894: e4 37 cpi r30, 0x74 ; 116 21896: b8 38 cpi r27, 0x88 ; 136 21898: e4 37 cpi r30, 0x74 ; 116 (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); 2189a: 89 ed ldi r24, 0xD9 ; 217 2189c: 93 e1 ldi r25, 0x13 ; 19 2189e: ca cf rjmp .-108 ; 0x21834 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 218a0: 10 92 62 0d sts 0x0D62, r1 ; 0x800d62 218a4: 88 cf rjmp .-240 ; 0x217b6 } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 218a6: 80 91 7a 04 lds r24, 0x047A ; 0x80047a <_ZL26lcd_status_message_timeout.lto_priv.422> 218aa: 88 23 and r24, r24 218ac: 01 f3 breq .-64 ; 0x2186e * 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; 218ae: 0f 94 01 0b call 0x21602 ; 0x21602 218b2: 00 91 7b 04 lds r16, 0x047B ; 0x80047b <_ZL26lcd_status_message_timeout.lto_priv.422+0x1> 218b6: 10 91 7c 04 lds r17, 0x047C ; 0x80047c <_ZL26lcd_status_message_timeout.lto_priv.422+0x2> 218ba: 20 91 7d 04 lds r18, 0x047D ; 0x80047d <_ZL26lcd_status_message_timeout.lto_priv.422+0x3> 218be: 30 91 7e 04 lds r19, 0x047E ; 0x80047e <_ZL26lcd_status_message_timeout.lto_priv.422+0x4> 218c2: 60 1b sub r22, r16 218c4: 71 0b sbc r23, r17 218c6: 82 0b sbc r24, r18 218c8: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 218ca: 60 3a cpi r22, 0xA0 ; 160 218cc: 7f 40 sbci r23, 0x0F ; 15 218ce: 81 05 cpc r24, r1 218d0: 91 05 cpc r25, r1 218d2: 68 f6 brcc .-102 ; 0x2186e 218d4: 70 cf rjmp .-288 ; 0x217b6 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); 218d6: 63 e0 ldi r22, 0x03 ; 3 218d8: 80 91 64 04 lds r24, 0x0464 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.418> 218dc: 0e 94 b5 6f call 0xdf6a ; 0xdf6a const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 218e0: 80 91 64 04 lds r24, 0x0464 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.418> 218e4: c4 e1 ldi r28, 0x14 ; 20 218e6: 6c 2f mov r22, r28 218e8: 68 1b sub r22, r24 218ea: 90 e0 ldi r25, 0x00 ; 0 218ec: 8b 59 subi r24, 0x9B ; 155 218ee: 9b 4f sbci r25, 0xFB ; 251 218f0: 0e 94 a2 73 call 0xe744 ; 0xe744 lcd_status_message_idx = LCD_WIDTH - padding; 218f4: c8 1b sub r28, r24 218f6: c0 93 64 04 sts 0x0464, r28 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.418> 218fa: 5d cf rjmp .-326 ; 0x217b6 } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 218fc: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21900: 8b 30 cpi r24, 0x0B ; 11 21902: 08 f1 brcs .+66 ; 0x21946 lcd_set_cursor(0, 3); 21904: 63 e0 ldi r22, 0x03 ; 3 21906: 80 e0 ldi r24, 0x00 ; 0 21908: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_space(LCD_WIDTH); 2190c: 84 e1 ldi r24, 0x14 ; 20 2190e: 0e 94 83 6f call 0xdf06 ; 0xdf06 lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 21912: 8e ef ldi r24, 0xFE ; 254 21914: 96 e5 ldi r25, 0x56 ; 86 21916: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2191a: ac 01 movw r20, r24 2191c: 63 e0 ldi r22, 0x03 ; 3 2191e: 80 e0 ldi r24, 0x00 ; 0 21920: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_puts_P(PSTR(" : ")); 21924: 82 e8 ldi r24, 0x82 ; 130 21926: 98 e9 ldi r25, 0x98 ; 152 21928: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_print(custom_message_state - 10); 2192c: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 21930: 6a 50 subi r22, 0x0A ; 10 21932: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 21934: 07 2e mov r0, r23 21936: 00 0c add r0, r0 21938: 88 0b sbc r24, r24 2193a: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 2193c: cf 91 pop r28 2193e: 1f 91 pop r17 21940: 0f 91 pop r16 21942: 0c 94 36 72 jmp 0xe46c ; 0xe46c 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) { 21946: 83 30 cpi r24, 0x03 ; 3 21948: 31 f4 brne .+12 ; 0x21956 lcd_setstatuspgm(MSG_WELCOME); 2194a: 8a e8 ldi r24, 0x8A ; 138 2194c: 9c e6 ldi r25, 0x6C ; 108 2194e: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe custom_message_type = CustomMsg::Status; 21952: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d } if (custom_message_state > 3 && custom_message_state <= 10) { 21956: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 2195a: 84 50 subi r24, 0x04 ; 4 2195c: 87 30 cpi r24, 0x07 ; 7 2195e: 08 f0 brcs .+2 ; 0x21962 21960: 2a cf rjmp .-428 ; 0x217b6 lcd_set_cursor(0, 3); 21962: 63 e0 ldi r22, 0x03 ; 3 21964: 80 e0 ldi r24, 0x00 ; 0 21966: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_space(19); 2196a: 83 e1 ldi r24, 0x13 ; 19 2196c: 0e 94 83 6f call 0xdf06 ; 0xdf06 lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 21970: 8b ee ldi r24, 0xEB ; 235 21972: 96 e5 ldi r25, 0x56 ; 86 21974: 0e 94 95 75 call 0xeb2a ; 0xeb2a 21978: ac 01 movw r20, r24 2197a: 63 e0 ldi r22, 0x03 ; 3 2197c: 80 e0 ldi r24, 0x00 ; 0 2197e: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 custom_message_state--; 21982: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21986: 81 50 subi r24, 0x01 ; 1 21988: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de 2198c: 14 cf rjmp .-472 ; 0x217b6 } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 2198e: 64 e1 ldi r22, 0x14 ; 20 21990: 85 e6 ldi r24, 0x65 ; 101 21992: 94 e0 ldi r25, 0x04 ; 4 21994: 0e 94 a2 73 call 0xe744 ; 0xe744 if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 21998: 20 91 02 06 lds r18, 0x0602 ; 0x800602 2199c: 30 91 03 06 lds r19, 0x0603 ; 0x800603 219a0: 80 91 00 06 lds r24, 0x0600 ; 0x800600 219a4: 90 91 01 06 lds r25, 0x0601 ; 0x800601 219a8: 82 17 cp r24, r18 219aa: 93 07 cpc r25, r19 219ac: 0c f4 brge .+2 ; 0x219b0 219ae: 03 cf rjmp .-506 ; 0x217b6 219b0: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 219b4: 88 23 and r24, r24 219b6: 09 f4 brne .+2 ; 0x219ba 219b8: fe ce rjmp .-516 ; 0x217b6 lcd_set_cursor(10, 3); 219ba: 63 e0 ldi r22, 0x03 ; 3 219bc: 8a e0 ldi r24, 0x0A ; 10 219be: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 219c2: 80 91 01 06 lds r24, 0x0601 ; 0x800601 219c6: 8f 93 push r24 219c8: 80 91 00 06 lds r24, 0x0600 ; 0x800600 219cc: 8f 93 push r24 219ce: 80 91 03 06 lds r24, 0x0603 ; 0x800603 219d2: 8f 93 push r24 219d4: 80 91 02 06 lds r24, 0x0602 ; 0x800602 219d8: 8f 93 push r24 219da: 89 e7 ldi r24, 0x79 ; 121 219dc: 98 e9 ldi r25, 0x98 ; 152 } 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); 219de: 9f 93 push r25 219e0: 8f 93 push r24 219e2: 0e 94 66 6f call 0xdecc ; 0xdecc 219e6: 0f 90 pop r0 219e8: 0f 90 pop r0 219ea: 0f 90 pop r0 219ec: 0f 90 pop r0 219ee: 0f 90 pop r0 219f0: 0f 90 pop r0 219f2: e1 ce rjmp .-574 ; 0x217b6 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); 219f4: 63 e0 ldi r22, 0x03 ; 3 219f6: 80 e0 ldi r24, 0x00 ; 0 219f8: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 219fc: c0 91 de 03 lds r28, 0x03DE ; 0x8003de 21a00: 85 ed ldi r24, 0xD5 ; 213 21a02: 95 e4 ldi r25, 0x45 ; 69 21a04: 0e 94 95 75 call 0xeb2a ; 0xeb2a 21a08: 1f 92 push r1 21a0a: cf 93 push r28 21a0c: 9f 93 push r25 21a0e: 8f 93 push r24 21a10: 8b e6 ldi r24, 0x6B ; 107 21a12: 98 e9 ldi r25, 0x98 ; 152 21a14: e4 cf rjmp .-56 ; 0x219de break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 21a16: 8b ed ldi r24, 0xDB ; 219 21a18: 96 e5 ldi r25, 0x56 ; 86 21a1a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 21a1e: ac 01 movw r20, r24 21a20: 63 e0 ldi r22, 0x03 ; 3 21a22: 80 e0 ldi r24, 0x00 ; 0 21a24: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 if (custom_message_state <= PINDA_HEAT_T) { 21a28: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21a2c: 89 37 cpi r24, 0x79 ; 121 21a2e: 08 f0 brcs .+2 ; 0x21a32 21a30: c2 ce rjmp .-636 ; 0x217b6 lcd_puts_P(PSTR(": ")); 21a32: 88 e6 ldi r24, 0x68 ; 104 21a34: 98 e9 ldi r25, 0x98 ; 152 21a36: 0e 94 78 6f call 0xdef0 ; 0xdef0 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 21a3a: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21a3e: 0e 94 fd 70 call 0xe1fa ; 0xe1fa } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 21a42: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 21a44: cf 91 pop r28 21a46: 1f 91 pop r17 21a48: 0f 91 pop r16 21a4a: 0c 94 fd 70 jmp 0xe1fa ; 0xe1fa lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 21a4e: 8a ec ldi r24, 0xCA ; 202 21a50: 96 e5 ldi r25, 0x56 ; 86 21a52: be ce rjmp .-644 ; 0x217d0 00021a54 ::start()>: /** * @brief Start timer */ template void Timer::start() 21a54: cf 93 push r28 21a56: df 93 push r29 21a58: ec 01 movw r28, r24 { m_started = _millis(); 21a5a: 0f 94 01 0b call 0x21602 ; 0x21602 21a5e: 69 83 std Y+1, r22 ; 0x01 21a60: 7a 83 std Y+2, r23 ; 0x02 21a62: 8b 83 std Y+3, r24 ; 0x03 21a64: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 21a66: 81 e0 ldi r24, 0x01 ; 1 21a68: 88 83 st Y, r24 } 21a6a: df 91 pop r29 21a6c: cf 91 pop r28 21a6e: 08 95 ret 00021a70 : //! 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) { 21a70: cf 92 push r12 21a72: df 92 push r13 21a74: ef 92 push r14 21a76: ff 92 push r15 21a78: 1f 93 push r17 21a7a: cf 93 push r28 21a7c: df 93 push r29 21a7e: cd b7 in r28, 0x3d ; 61 21a80: de b7 in r29, 0x3e ; 62 21a82: 64 97 sbiw r28, 0x14 ; 20 21a84: 0f b6 in r0, 0x3f ; 63 21a86: f8 94 cli 21a88: de bf out 0x3e, r29 ; 62 21a8a: 0f be out 0x3f, r0 ; 63 21a8c: cd bf out 0x3d, r28 ; 61 21a8e: 7c 01 movw r14, r24 21a90: 16 2f mov r17, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 21a92: 61 e3 ldi r22, 0x31 ; 49 21a94: 78 e9 ldi r23, 0x98 ; 152 21a96: ce 01 movw r24, r28 21a98: 01 96 adiw r24, 0x01 ; 1 21a9a: 0f 94 f5 a1 call 0x343ea ; 0x343ea strcat_P(msg, type); 21a9e: b7 01 movw r22, r14 21aa0: ce 01 movw r24, r28 21aa2: 01 96 adiw r24, 0x01 ; 1 21aa4: 0f 94 e1 a1 call 0x343c2 ; 0x343c2 lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 21aa8: 83 e0 ldi r24, 0x03 ; 3 21aaa: 0e 94 01 d8 call 0x1b002 ; 0x1b002 21aae: 88 23 and r24, r24 21ab0: e1 f0 breq .+56 ; 0x21aea bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 21ab2: be 01 movw r22, r28 21ab4: 6f 5f subi r22, 0xFF ; 255 21ab6: 7f 4f sbci r23, 0xFF ; 255 21ab8: 85 e6 ldi r24, 0x65 ; 101 21aba: 94 e0 ldi r25, 0x04 ; 4 21abc: 0f 94 a0 aa call 0x35540 ; 0x35540 21ac0: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 21ac2: 8a e7 ldi r24, 0x7A ; 122 21ac4: 94 e0 ldi r25, 0x04 ; 4 21ac6: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> lcd_status_message_level = severity; 21aca: 83 e0 ldi r24, 0x03 ; 3 21acc: 80 93 c0 03 sts 0x03C0, r24 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.421> custom_message_type = CustomMsg::Status; 21ad0: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d custom_message_state = 0; 21ad4: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de if (!same) { 21ad8: cd 28 or r12, r13 21ada: 39 f0 breq .+14 ; 0x21aea // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 21adc: 60 e0 ldi r22, 0x00 ; 0 21ade: ce 01 movw r24, r28 21ae0: 01 96 adiw r24, 0x01 ; 1 21ae2: 0e 94 e6 d7 call 0x1afcc ; 0x1afcc lcd_return_to_status(); 21ae6: 0f 94 18 05 call 0x20a30 ; 0x20a30 lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 21aea: 87 ec ldi r24, 0xC7 ; 199 21aec: 92 ea ldi r25, 0xA2 ; 162 21aee: 0e 94 1f 7b call 0xf63e ; 0xf63e if(e != EXTRUDERS) { 21af2: 11 30 cpi r17, 0x01 ; 1 21af4: 51 f0 breq .+20 ; 0x21b0a print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 21af6: 61 2f mov r22, r17 21af8: 70 e0 ldi r23, 0x00 ; 0 21afa: 90 e0 ldi r25, 0x00 ; 0 21afc: 80 e0 ldi r24, 0x00 ; 0 21afe: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 21b02: 8e e2 ldi r24, 0x2E ; 46 21b04: 98 e9 ldi r25, 0x98 ; 152 21b06: 0e 94 1f 7b call 0xf63e ; 0xf63e } SERIAL_ERRORPGM("Heaters switched off. "); 21b0a: 87 e1 ldi r24, 0x17 ; 23 21b0c: 98 e9 ldi r25, 0x98 ; 152 21b0e: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ERRORRPGM(type); 21b12: c7 01 movw r24, r14 21b14: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ERRORLNPGM(" triggered!"); 21b18: 8b e0 ldi r24, 0x0B ; 11 21b1a: 98 e9 ldi r25, 0x98 ; 152 21b1c: 0e 94 18 7d call 0xfa30 ; 0xfa30 } 21b20: 64 96 adiw r28, 0x14 ; 20 21b22: 0f b6 in r0, 0x3f ; 63 21b24: f8 94 cli 21b26: de bf out 0x3e, r29 ; 62 21b28: 0f be out 0x3f, r0 ; 63 21b2a: cd bf out 0x3d, r28 ; 61 21b2c: df 91 pop r29 21b2e: cf 91 pop r28 21b30: 1f 91 pop r17 21b32: ff 90 pop r15 21b34: ef 90 pop r14 21b36: df 90 pop r13 21b38: cf 90 pop r12 21b3a: 08 95 ret 00021b3c <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 21b3c: 1f 92 push r1 21b3e: 0f 92 push r0 21b40: 0f b6 in r0, 0x3f ; 63 21b42: 0f 92 push r0 21b44: 11 24 eor r1, r1 21b46: 2f 93 push r18 21b48: 3f 93 push r19 21b4a: 8f 93 push r24 21b4c: 9f 93 push r25 21b4e: af 93 push r26 21b50: 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; 21b52: 80 91 f8 05 lds r24, 0x05F8 ; 0x8005f8 21b56: 90 91 f9 05 lds r25, 0x05F9 ; 0x8005f9 21b5a: a0 91 fa 05 lds r26, 0x05FA ; 0x8005fa 21b5e: b0 91 fb 05 lds r27, 0x05FB ; 0x8005fb unsigned char f = timer2_fract; 21b62: 30 91 f7 05 lds r19, 0x05F7 ; 0x8005f7 m += MILLIS_INC; f += FRACT_INC; 21b66: 23 e0 ldi r18, 0x03 ; 3 21b68: 23 0f add r18, r19 if (f >= FRACT_MAX) 21b6a: 2d 37 cpi r18, 0x7D ; 125 21b6c: 58 f5 brcc .+86 ; 0x21bc4 <__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; 21b6e: 01 96 adiw r24, 0x01 ; 1 21b70: a1 1d adc r26, r1 21b72: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 21b74: 20 93 f7 05 sts 0x05F7, r18 ; 0x8005f7 timer2_millis = m; 21b78: 80 93 f8 05 sts 0x05F8, r24 ; 0x8005f8 21b7c: 90 93 f9 05 sts 0x05F9, r25 ; 0x8005f9 21b80: a0 93 fa 05 sts 0x05FA, r26 ; 0x8005fa 21b84: b0 93 fb 05 sts 0x05FB, r27 ; 0x8005fb timer2_overflow_count++; 21b88: 80 91 fc 05 lds r24, 0x05FC ; 0x8005fc 21b8c: 90 91 fd 05 lds r25, 0x05FD ; 0x8005fd 21b90: a0 91 fe 05 lds r26, 0x05FE ; 0x8005fe 21b94: b0 91 ff 05 lds r27, 0x05FF ; 0x8005ff 21b98: 01 96 adiw r24, 0x01 ; 1 21b9a: a1 1d adc r26, r1 21b9c: b1 1d adc r27, r1 21b9e: 80 93 fc 05 sts 0x05FC, r24 ; 0x8005fc 21ba2: 90 93 fd 05 sts 0x05FD, r25 ; 0x8005fd 21ba6: a0 93 fe 05 sts 0x05FE, r26 ; 0x8005fe 21baa: b0 93 ff 05 sts 0x05FF, r27 ; 0x8005ff } 21bae: bf 91 pop r27 21bb0: af 91 pop r26 21bb2: 9f 91 pop r25 21bb4: 8f 91 pop r24 21bb6: 3f 91 pop r19 21bb8: 2f 91 pop r18 21bba: 0f 90 pop r0 21bbc: 0f be out 0x3f, r0 ; 63 21bbe: 0f 90 pop r0 21bc0: 1f 90 pop r1 21bc2: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 21bc4: 26 e8 ldi r18, 0x86 ; 134 21bc6: 23 0f add r18, r19 m += 1; 21bc8: 02 96 adiw r24, 0x02 ; 2 21bca: a1 1d adc r26, r1 21bcc: b1 1d adc r27, r1 21bce: d2 cf rjmp .-92 ; 0x21b74 <__vector_15+0x38> 00021bd0 : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 21bd0: cf 93 push r28 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 21bd2: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 21bd6: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 21bda: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 21bde: 10 92 59 12 sts 0x1259, r1 ; 0x801259 setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 21be2: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 21be4: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 21be6: 0e 94 a4 ff call 0x1ff48 ; 0x1ff48 temp_mgr_pid(); 21bea: 0e 94 e1 fc call 0x1f9c2 ; 0x1f9c2 // 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); 21bee: 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; 21bf0: 10 92 28 06 sts 0x0628, r1 ; 0x800628 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 21bf4: cf bf out 0x3f, r28 ; 63 #endif } } 21bf6: cf 91 pop r28 21bf8: 08 95 ret 00021bfa : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 21bfa: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 fanSpeed = 0; 21bfe: 10 92 55 12 sts 0x1255, r1 ; 0x801255 lcd_return_to_status(); 21c02: 0d 94 18 05 jmp 0x20a30 ; 0x20a30 00021c06 : // 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) { 21c06: 1f 93 push r17 21c08: cf 93 push r28 21c0a: df 93 push r29 21c0c: c8 2f mov r28, r24 21c0e: 16 2f mov r17, r22 21c10: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 21c12: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 21c16: 80 fd sbrc r24, 0 21c18: 18 c0 rjmp .+48 ; 0x21c4a 21c1a: 80 91 73 12 lds r24, 0x1273 ; 0x801273 21c1e: 81 11 cpse r24, r1 21c20: 14 c0 rjmp .+40 ; 0x21c4a saved_bed_temperature = target_temperature_bed; 21c22: 80 91 59 12 lds r24, 0x1259 ; 0x801259 21c26: 80 93 58 12 sts 0x1258, r24 ; 0x801258 saved_extruder_temperature = target_temperature[index]; 21c2a: e6 2f mov r30, r22 21c2c: f0 e0 ldi r31, 0x00 ; 0 21c2e: ee 0f add r30, r30 21c30: ff 1f adc r31, r31 21c32: e3 5a subi r30, 0xA3 ; 163 21c34: fd 4e sbci r31, 0xED ; 237 21c36: 80 81 ld r24, Z 21c38: 91 81 ldd r25, Z+1 ; 0x01 21c3a: 90 93 5c 12 sts 0x125C, r25 ; 0x80125c 21c3e: 80 93 5b 12 sts 0x125B, r24 ; 0x80125b saved_fan_speed = fanSpeed; 21c42: 80 91 55 12 lds r24, 0x1255 ; 0x801255 21c46: 80 93 54 12 sts 0x1254, r24 ; 0x801254 } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 21c4a: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 21c4e: 0e 94 fd 77 call 0xeffa ; 0xeffa setExtruderAutoFanState(3); 21c52: 83 e0 ldi r24, 0x03 ; 3 21c54: 0e 94 0a 78 call 0xf014 ; 0xf014 SET_OUTPUT(FAN_PIN); 21c58: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 21c5c: 88 60 ori r24, 0x08 ; 8 21c5e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 21c62: 8f ef ldi r24, 0xFF ; 255 21c64: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 21c68: 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) { 21c6c: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 21c70: 80 ff sbrs r24, 0 21c72: 07 c0 rjmp .+14 ; 0x21c82 21c74: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 21c78: 82 95 swap r24 21c7a: 86 95 lsr r24 21c7c: 87 70 andi r24, 0x07 ; 7 21c7e: d8 17 cp r29, r24 21c80: c0 f4 brcc .+48 ; 0x21cb2 temp_error_state.source = (uint8_t)source; 21c82: c3 70 andi r28, 0x03 ; 3 21c84: cc 0f add r28, r28 21c86: cc 0f add r28, r28 21c88: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 21c8c: 83 7f andi r24, 0xF3 ; 243 21c8e: 8c 2b or r24, r28 21c90: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> temp_error_state.index = index; 21c94: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 21c98: 10 fb bst r17, 0 21c9a: 84 f9 bld r24, 4 21c9c: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> temp_error_state.type = (uint8_t)type; 21ca0: d2 95 swap r29 21ca2: dd 0f add r29, r29 21ca4: d0 7e andi r29, 0xE0 ; 224 21ca6: 40 91 cc 03 lds r20, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 21caa: 4f 71 andi r20, 0x1F ; 31 21cac: 4d 2b or r20, r29 21cae: 40 93 cc 03 sts 0x03CC, r20 ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> } // always set the error state temp_error_state.error = true; 21cb2: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 21cb6: 81 60 ori r24, 0x01 ; 1 21cb8: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> temp_error_state.assert = true; 21cbc: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 21cc0: 82 60 ori r24, 0x02 ; 2 21cc2: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> } 21cc6: df 91 pop r29 21cc8: cf 91 pop r28 21cca: 1f 91 pop r17 21ccc: 08 95 ret 00021cce : 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) { 21cce: 2f 92 push r2 21cd0: 3f 92 push r3 21cd2: 4f 92 push r4 21cd4: 5f 92 push r5 21cd6: 6f 92 push r6 21cd8: 7f 92 push r7 21cda: 8f 92 push r8 21cdc: 9f 92 push r9 21cde: af 92 push r10 21ce0: bf 92 push r11 21ce2: cf 92 push r12 21ce4: df 92 push r13 21ce6: ef 92 push r14 21ce8: ff 92 push r15 21cea: 0f 93 push r16 21cec: 1f 93 push r17 21cee: cf 93 push r28 21cf0: df 93 push r29 21cf2: cd b7 in r28, 0x3d ; 61 21cf4: de b7 in r29, 0x3e ; 62 21cf6: 2c 97 sbiw r28, 0x0c ; 12 21cf8: 0f b6 in r0, 0x3f ; 63 21cfa: f8 94 cli 21cfc: de bf out 0x3e, r29 ; 62 21cfe: 0f be out 0x3f, r0 ; 63 21d00: cd bf out 0x3d, r28 ; 61 21d02: 28 2e mov r2, r24 21d04: 49 83 std Y+1, r20 ; 0x01 21d06: 5a 83 std Y+2, r21 ; 0x02 21d08: 6b 83 std Y+3, r22 ; 0x03 21d0a: 7c 83 std Y+4, r23 ; 0x04 21d0c: 28 01 movw r4, r16 21d0e: 39 01 movw r6, r18 21d10: 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) 21d12: 0f 94 01 0b call 0x21602 ; 0x21602 21d16: 02 2d mov r16, r2 21d18: 10 e0 ldi r17, 0x00 ; 0 21d1a: 98 01 movw r18, r16 21d1c: 22 0f add r18, r18 21d1e: 33 1f adc r19, r19 21d20: 22 0f add r18, r18 21d22: 33 1f adc r19, r19 21d24: 3c 87 std Y+12, r19 ; 0x0c 21d26: 2b 87 std Y+11, r18 ; 0x0b 21d28: f9 01 movw r30, r18 21d2a: e4 56 subi r30, 0x64 ; 100 21d2c: fa 4f sbci r31, 0xFA ; 250 21d2e: 80 80 ld r8, Z 21d30: 91 80 ldd r9, Z+1 ; 0x01 21d32: a2 80 ldd r10, Z+2 ; 0x02 21d34: b3 80 ldd r11, Z+3 ; 0x03 21d36: 68 19 sub r22, r8 21d38: 79 09 sbc r23, r9 21d3a: 8a 09 sbc r24, r10 21d3c: 9b 09 sbc r25, r11 21d3e: 61 3d cpi r22, 0xD1 ; 209 21d40: 77 40 sbci r23, 0x07 ; 7 21d42: 81 05 cpc r24, r1 21d44: 91 05 cpc r25, r1 21d46: 08 f4 brcc .+2 ; 0x21d4a 21d48: ea c0 rjmp .+468 ; 0x21f1e { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 21d4a: 33 20 and r3, r3 21d4c: 09 f4 brne .+2 ; 0x21d50 21d4e: 75 c0 rjmp .+234 ; 0x21e3a { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 21d50: 88 e6 ldi r24, 0x68 ; 104 21d52: 91 e0 ldi r25, 0x01 ; 1 21d54: 9a 87 std Y+10, r25 ; 0x0a 21d56: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 21d58: 80 e0 ldi r24, 0x00 ; 0 21d5a: 90 e0 ldi r25, 0x00 ; 0 21d5c: a0 ea ldi r26, 0xA0 ; 160 21d5e: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 21d60: 8d 83 std Y+5, r24 ; 0x05 21d62: 9e 83 std Y+6, r25 ; 0x06 21d64: af 83 std Y+7, r26 ; 0x07 21d66: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 21d68: 0f 94 01 0b call 0x21602 ; 0x21602 21d6c: eb 85 ldd r30, Y+11 ; 0x0b 21d6e: fc 85 ldd r31, Y+12 ; 0x0c 21d70: e4 56 subi r30, 0x64 ; 100 21d72: fa 4f sbci r31, 0xFA ; 250 21d74: 60 83 st Z, r22 21d76: 71 83 std Z+1, r23 ; 0x01 21d78: 82 83 std Z+2, r24 ; 0x02 21d7a: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 21d7c: 20 e0 ldi r18, 0x00 ; 0 21d7e: 30 e0 ldi r19, 0x00 ; 0 21d80: a9 01 movw r20, r18 21d82: c7 01 movw r24, r14 21d84: b6 01 movw r22, r12 21d86: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 21d8a: 81 11 cpse r24, r1 21d8c: 07 c0 rjmp .+14 ; 0x21d9c { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 21d8e: f8 01 movw r30, r16 21d90: ee 0f add r30, r30 21d92: ff 1f adc r31, r31 21d94: e8 56 subi r30, 0x68 ; 104 21d96: fa 4f sbci r31, 0xFA ; 250 21d98: 11 82 std Z+1, r1 ; 0x01 21d9a: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 21d9c: ab 85 ldd r26, Y+11 ; 0x0b 21d9e: bc 85 ldd r27, Y+12 ; 0x0c 21da0: a0 57 subi r26, 0x70 ; 112 21da2: ba 4f sbci r27, 0xFA ; 250 21da4: 5d 01 movw r10, r26 21da6: 29 81 ldd r18, Y+1 ; 0x01 21da8: 3a 81 ldd r19, Y+2 ; 0x02 21daa: 4b 81 ldd r20, Y+3 ; 0x03 21dac: 5c 81 ldd r21, Y+4 ; 0x04 21dae: 6d 91 ld r22, X+ 21db0: 7d 91 ld r23, X+ 21db2: 8d 91 ld r24, X+ 21db4: 9c 91 ld r25, X 21db6: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 21dba: 88 23 and r24, r24 21dbc: 09 f4 brne .+2 ; 0x21dc0 21dbe: 91 c0 rjmp .+290 ; 0x21ee2 { if (_target_temperature > 0) 21dc0: 20 e0 ldi r18, 0x00 ; 0 21dc2: 30 e0 ldi r19, 0x00 ; 0 21dc4: a9 01 movw r20, r18 21dc6: 69 81 ldd r22, Y+1 ; 0x01 21dc8: 7a 81 ldd r23, Y+2 ; 0x02 21dca: 8b 81 ldd r24, Y+3 ; 0x03 21dcc: 9c 81 ldd r25, Y+4 ; 0x04 21dce: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 21dd2: f8 01 movw r30, r16 21dd4: e2 57 subi r30, 0x72 ; 114 21dd6: fa 4f sbci r31, 0xFA ; 250 21dd8: 18 16 cp r1, r24 21dda: c4 f5 brge .+112 ; 0x21e4c { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 21ddc: 81 e0 ldi r24, 0x01 ; 1 21dde: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 21de0: 89 81 ldd r24, Y+1 ; 0x01 21de2: 9a 81 ldd r25, Y+2 ; 0x02 21de4: ab 81 ldd r26, Y+3 ; 0x03 21de6: bc 81 ldd r27, Y+4 ; 0x04 21de8: f5 01 movw r30, r10 21dea: 80 83 st Z, r24 21dec: 91 83 std Z+1, r25 ; 0x01 21dee: a2 83 std Z+2, r26 ; 0x02 21df0: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 21df2: eb 85 ldd r30, Y+11 ; 0x0b 21df4: fc 85 ldd r31, Y+12 ; 0x0c 21df6: ea 57 subi r30, 0x7A ; 122 21df8: fa 4f sbci r31, 0xFA ; 250 21dfa: 40 82 st Z, r4 21dfc: 51 82 std Z+1, r5 ; 0x01 21dfe: 62 82 std Z+2, r6 ; 0x02 21e00: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 21e02: f8 01 movw r30, r16 21e04: ec 57 subi r30, 0x7C ; 124 21e06: fa 4f sbci r31, 0xFA ; 250 21e08: 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)) 21e0a: a3 01 movw r20, r6 21e0c: 92 01 movw r18, r4 21e0e: bc 01 movw r22, r24 21e10: cd 01 movw r24, r26 21e12: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 21e16: 18 16 cp r1, r24 21e18: 1c f5 brge .+70 ; 0x21e60 { __preheat_counter[_heater_id]++; 21e1a: f8 01 movw r30, r16 21e1c: ec 57 subi r30, 0x7C ; 124 21e1e: fa 4f sbci r31, 0xFA ; 250 21e20: 80 81 ld r24, Z 21e22: 8f 5f subi r24, 0xFF ; 255 21e24: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 21e26: 31 10 cpse r3, r1 21e28: c7 c0 rjmp .+398 ; 0x21fb8 21e2a: 89 30 cpi r24, 0x09 ; 9 21e2c: c8 f0 brcs .+50 ; 0x21e60 { __delta=2.0; 21e2e: 81 2c mov r8, r1 21e30: 91 2c mov r9, r1 21e32: a1 2c mov r10, r1 21e34: 50 e4 ldi r21, 0x40 ; 64 21e36: b5 2e mov r11, r21 21e38: e8 c0 rjmp .+464 ; 0x2200a #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 21e3a: ad e2 ldi r26, 0x2D ; 45 21e3c: b0 e0 ldi r27, 0x00 ; 0 21e3e: ba 87 std Y+10, r27 ; 0x0a 21e40: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 21e42: 80 e0 ldi r24, 0x00 ; 0 21e44: 90 e0 ldi r25, 0x00 ; 0 21e46: a0 e7 ldi r26, 0x70 ; 112 21e48: b1 e4 ldi r27, 0x41 ; 65 21e4a: 8a cf rjmp .-236 ; 0x21d60 __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 21e4c: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 21e4e: 89 81 ldd r24, Y+1 ; 0x01 21e50: 9a 81 ldd r25, Y+2 ; 0x02 21e52: ab 81 ldd r26, Y+3 ; 0x03 21e54: bc 81 ldd r27, Y+4 ; 0x04 21e56: f5 01 movw r30, r10 21e58: 80 83 st Z, r24 21e5a: 91 83 std Z+1, r25 ; 0x01 21e5c: a2 83 std Z+2, r26 ; 0x02 21e5e: 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) 21e60: 2d 81 ldd r18, Y+5 ; 0x05 21e62: 3e 81 ldd r19, Y+6 ; 0x06 21e64: 4f 81 ldd r20, Y+7 ; 0x07 21e66: 58 85 ldd r21, Y+8 ; 0x08 21e68: 69 81 ldd r22, Y+1 ; 0x01 21e6a: 7a 81 ldd r23, Y+2 ; 0x02 21e6c: 8b 81 ldd r24, Y+3 ; 0x03 21e6e: 9c 81 ldd r25, Y+4 ; 0x04 21e70: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 21e74: a3 01 movw r20, r6 21e76: 92 01 movw r18, r4 21e78: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 21e7c: 87 ff sbrs r24, 7 21e7e: 46 c0 rjmp .+140 ; 0x21f0c 21e80: f8 01 movw r30, r16 21e82: e2 57 subi r30, 0x72 ; 114 21e84: fa 4f sbci r31, 0xFA ; 250 21e86: 80 81 ld r24, Z 21e88: 81 30 cpi r24, 0x01 ; 1 21e8a: 49 f4 brne .+18 ; 0x21e9e { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 21e8c: 82 e0 ldi r24, 0x02 ; 2 21e8e: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 21e90: f8 01 movw r30, r16 21e92: ee 0f add r30, r30 21e94: ff 1f adc r31, r31 21e96: e8 56 subi r30, 0x68 ; 104 21e98: fa 4f sbci r31, 0xFA ; 250 21e9a: 11 82 std Z+1, r1 ; 0x01 21e9c: 10 82 st Z, r1 } if (_output > 0) 21e9e: 20 e0 ldi r18, 0x00 ; 0 21ea0: 30 e0 ldi r19, 0x00 ; 0 21ea2: a9 01 movw r20, r18 21ea4: c7 01 movw r24, r14 21ea6: b6 01 movw r22, r12 21ea8: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 21eac: 18 16 cp r1, r24 21eae: bc f5 brge .+110 ; 0x21f1e if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 21eb0: 29 81 ldd r18, Y+1 ; 0x01 21eb2: 3a 81 ldd r19, Y+2 ; 0x02 21eb4: 4b 81 ldd r20, Y+3 ; 0x03 21eb6: 5c 81 ldd r21, Y+4 ; 0x04 21eb8: 6d 81 ldd r22, Y+5 ; 0x05 21eba: 7e 81 ldd r23, Y+6 ; 0x06 21ebc: 8f 81 ldd r24, Y+7 ; 0x07 21ebe: 98 85 ldd r25, Y+8 ; 0x08 21ec0: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 21ec4: a3 01 movw r20, r6 21ec6: 92 01 movw r18, r4 21ec8: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 21ecc: 18 16 cp r1, r24 21ece: 0c f0 brlt .+2 ; 0x21ed2 21ed0: 3f c0 rjmp .+126 ; 0x21f50 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 21ed2: 00 0f add r16, r16 21ed4: 11 1f adc r17, r17 21ed6: f8 01 movw r30, r16 21ed8: e8 56 subi r30, 0x68 ; 104 21eda: fa 4f sbci r31, 0xFA ; 250 21edc: 11 82 std Z+1, r1 ; 0x01 21ede: 10 82 st Z, r1 21ee0: 1e c0 rjmp .+60 ; 0x21f1e 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)) 21ee2: a3 01 movw r20, r6 21ee4: 92 01 movw r18, r4 21ee6: 69 81 ldd r22, Y+1 ; 0x01 21ee8: 7a 81 ldd r23, Y+2 ; 0x02 21eea: 8b 81 ldd r24, Y+3 ; 0x03 21eec: 9c 81 ldd r25, Y+4 ; 0x04 21eee: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 21ef2: 18 16 cp r1, r24 21ef4: 0c f0 brlt .+2 ; 0x21ef8 21ef6: b4 cf rjmp .-152 ; 0x21e60 21ef8: f8 01 movw r30, r16 21efa: e2 57 subi r30, 0x72 ; 114 21efc: fa 4f sbci r31, 0xFA ; 250 21efe: 80 81 ld r24, Z 21f00: 81 30 cpi r24, 0x01 ; 1 21f02: 09 f0 breq .+2 ; 0x21f06 21f04: ad cf rjmp .-166 ; 0x21e60 21f06: 89 cf rjmp .-238 ; 0x21e1a 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; 21f08: 10 82 st Z, r1 21f0a: 97 c0 rjmp .+302 ; 0x2203a temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 21f0c: 20 e0 ldi r18, 0x00 ; 0 21f0e: 30 e0 ldi r19, 0x00 ; 0 21f10: a9 01 movw r20, r18 21f12: c7 01 movw r24, r14 21f14: b6 01 movw r22, r12 21f16: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 21f1a: 18 16 cp r1, r24 21f1c: cc f0 brlt .+50 ; 0x21f50 } } } } } 21f1e: 2c 96 adiw r28, 0x0c ; 12 21f20: 0f b6 in r0, 0x3f ; 63 21f22: f8 94 cli 21f24: de bf out 0x3e, r29 ; 62 21f26: 0f be out 0x3f, r0 ; 63 21f28: cd bf out 0x3d, r28 ; 61 21f2a: df 91 pop r29 21f2c: cf 91 pop r28 21f2e: 1f 91 pop r17 21f30: 0f 91 pop r16 21f32: ff 90 pop r15 21f34: ef 90 pop r14 21f36: df 90 pop r13 21f38: cf 90 pop r12 21f3a: bf 90 pop r11 21f3c: af 90 pop r10 21f3e: 9f 90 pop r9 21f40: 8f 90 pop r8 21f42: 7f 90 pop r7 21f44: 6f 90 pop r6 21f46: 5f 90 pop r5 21f48: 4f 90 pop r4 21f4a: 3f 90 pop r3 21f4c: 2f 90 pop r2 21f4e: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 21f50: f8 01 movw r30, r16 21f52: e2 57 subi r30, 0x72 ; 114 21f54: fa 4f sbci r31, 0xFA ; 250 21f56: 80 81 ld r24, Z 21f58: 82 30 cpi r24, 0x02 ; 2 21f5a: 08 f3 brcs .-62 ; 0x21f1e { temp_runaway_error_counter[_heater_id]++; 21f5c: 00 0f add r16, r16 21f5e: 11 1f adc r17, r17 21f60: f8 01 movw r30, r16 21f62: e8 56 subi r30, 0x68 ; 104 21f64: fa 4f sbci r31, 0xFA ; 250 21f66: 80 81 ld r24, Z 21f68: 91 81 ldd r25, Z+1 ; 0x01 21f6a: 01 96 adiw r24, 0x01 ; 1 21f6c: 91 83 std Z+1, r25 ; 0x01 21f6e: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 21f70: 88 0f add r24, r24 21f72: 99 1f adc r25, r25 21f74: e9 85 ldd r30, Y+9 ; 0x09 21f76: fa 85 ldd r31, Y+10 ; 0x0a 21f78: e8 17 cp r30, r24 21f7a: f9 07 cpc r31, r25 21f7c: 80 f6 brcc .-96 ; 0x21f1e set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 21f7e: 43 e0 ldi r20, 0x03 ; 3 21f80: 62 2d mov r22, r2 21f82: 83 2d mov r24, r3 } } } } } 21f84: 2c 96 adiw r28, 0x0c ; 12 21f86: 0f b6 in r0, 0x3f ; 63 21f88: f8 94 cli 21f8a: de bf out 0x3e, r29 ; 62 21f8c: 0f be out 0x3f, r0 ; 63 21f8e: cd bf out 0x3d, r28 ; 61 21f90: df 91 pop r29 21f92: cf 91 pop r28 21f94: 1f 91 pop r17 21f96: 0f 91 pop r16 21f98: ff 90 pop r15 21f9a: ef 90 pop r14 21f9c: df 90 pop r13 21f9e: cf 90 pop r12 21fa0: bf 90 pop r11 21fa2: af 90 pop r10 21fa4: 9f 90 pop r9 21fa6: 8f 90 pop r8 21fa8: 7f 90 pop r7 21faa: 6f 90 pop r6 21fac: 5f 90 pop r5 21fae: 4f 90 pop r4 21fb0: 3f 90 pop r3 21fb2: 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); 21fb4: 0d 94 03 0e jmp 0x21c06 ; 0x21c06 } 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 21fb8: 81 31 cpi r24, 0x11 ; 17 21fba: 08 f4 brcc .+2 ; 0x21fbe 21fbc: 51 cf rjmp .-350 ; 0x21e60 { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 21fbe: 20 e0 ldi r18, 0x00 ; 0 21fc0: 30 e0 ldi r19, 0x00 ; 0 21fc2: 44 eb ldi r20, 0xB4 ; 180 21fc4: 52 e4 ldi r21, 0x42 ; 66 21fc6: c3 01 movw r24, r6 21fc8: b2 01 movw r22, r4 21fca: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 21fce: 81 2c mov r8, r1 21fd0: 91 2c mov r9, r1 21fd2: e0 e4 ldi r30, 0x40 ; 64 21fd4: ae 2e mov r10, r30 21fd6: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 21fd8: 18 16 cp r1, r24 21fda: 2c f4 brge .+10 ; 0x21fe6 21fdc: 81 2c mov r8, r1 21fde: 91 2c mov r9, r1 21fe0: a1 2c mov r10, r1 21fe2: 70 e4 ldi r23, 0x40 ; 64 21fe4: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 21fe6: 20 e0 ldi r18, 0x00 ; 0 21fe8: 30 e0 ldi r19, 0x00 ; 0 21fea: 42 ed ldi r20, 0xD2 ; 210 21fec: 52 e4 ldi r21, 0x42 ; 66 21fee: c3 01 movw r24, r6 21ff0: b2 01 movw r22, r4 21ff2: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 21ff6: 18 16 cp r1, r24 21ff8: 44 f4 brge .+16 ; 0x2200a 21ffa: 6a e9 ldi r22, 0x9A ; 154 21ffc: 86 2e mov r8, r22 21ffe: 69 e9 ldi r22, 0x99 ; 153 22000: 96 2e mov r9, r22 22002: 69 e1 ldi r22, 0x19 ; 25 22004: a6 2e mov r10, r22 22006: 6f e3 ldi r22, 0x3F ; 63 22008: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 2200a: eb 85 ldd r30, Y+11 ; 0x0b 2200c: fc 85 ldd r31, Y+12 ; 0x0c 2200e: ea 57 subi r30, 0x7A ; 122 22010: fa 4f sbci r31, 0xFA ; 250 22012: 20 81 ld r18, Z 22014: 31 81 ldd r19, Z+1 ; 0x01 22016: 42 81 ldd r20, Z+2 ; 0x02 22018: 53 81 ldd r21, Z+3 ; 0x03 2201a: c3 01 movw r24, r6 2201c: b2 01 movw r22, r4 2201e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 22022: a5 01 movw r20, r10 22024: 94 01 movw r18, r8 22026: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2202a: f8 01 movw r30, r16 2202c: ee 57 subi r30, 0x7E ; 126 2202e: fa 4f sbci r31, 0xFA ; 250 22030: 87 ff sbrs r24, 7 22032: 6a cf rjmp .-300 ; 0x21f08 __preheat_errors[_heater_id]++; 22034: 80 81 ld r24, Z 22036: 8f 5f subi r24, 0xFF ; 255 22038: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 2203a: 80 81 ld r24, Z 2203c: 90 e0 ldi r25, 0x00 ; 0 2203e: 31 10 cpse r3, r1 22040: 04 c0 rjmp .+8 ; 0x2204a 22042: 06 97 sbiw r24, 0x06 ; 6 22044: 4c f0 brlt .+18 ; 0x22058 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 22046: 80 e0 ldi r24, 0x00 ; 0 22048: 03 c0 rjmp .+6 ; 0x22050 __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 2204a: 04 97 sbiw r24, 0x04 ; 4 2204c: 2c f0 brlt .+10 ; 0x22058 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 2204e: 81 e0 ldi r24, 0x01 ; 1 22050: 42 e0 ldi r20, 0x02 ; 2 22052: 62 2d mov r22, r2 22054: 0f 94 03 0e call 0x21c06 ; 0x21c06 __preheat_start[_heater_id] = _current_temperature; 22058: 2b 85 ldd r18, Y+11 ; 0x0b 2205a: 3c 85 ldd r19, Y+12 ; 0x0c 2205c: 2a 57 subi r18, 0x7A ; 122 2205e: 3a 4f sbci r19, 0xFA ; 250 22060: d9 01 movw r26, r18 22062: 4d 92 st X+, r4 22064: 5d 92 st X+, r5 22066: 6d 92 st X+, r6 22068: 7c 92 st X, r7 2206a: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 2206c: f8 01 movw r30, r16 2206e: ec 57 subi r30, 0x7C ; 124 22070: fa 4f sbci r31, 0xFA ; 250 22072: 10 82 st Z, r1 22074: f5 ce rjmp .-534 ; 0x21e60 00022076 : //! @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() { 22076: 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); 22078: 89 e2 ldi r24, 0x29 ; 41 2207a: 9d e0 ldi r25, 0x0D ; 13 2207c: 0f 94 3e a4 call 0x3487c ; 0x3487c 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; 22080: 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. 22082: 8f 3f cpi r24, 0xFF ; 255 22084: 91 f4 brne .+36 ; 0x220aa { #endif //PINDA_TEMP_COMP return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false; 22086: 20 e0 ldi r18, 0x00 ; 0 22088: 30 e0 ldi r19, 0x00 ; 0 2208a: 40 ef ldi r20, 0xF0 ; 240 2208c: 51 e4 ldi r21, 0x41 ; 65 2208e: 60 91 85 03 lds r22, 0x0385 ; 0x800385 22092: 70 91 86 03 lds r23, 0x0386 ; 0x800386 22096: 80 91 87 03 lds r24, 0x0387 ; 0x800387 2209a: 90 91 88 03 lds r25, 0x0388 ; 0x800388 2209e: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 220a2: 87 ff sbrs r24, 7 220a4: 04 c0 rjmp .+8 ; 0x220ae #ifdef PINDA_TEMP_COMP } else if (pinda_temp_compensation == 0) return true; //Overwritten via LCD menu SuperPINDA [No] 220a6: c0 e0 ldi r28, 0x00 ; 0 220a8: 02 c0 rjmp .+4 ; 0x220ae 220aa: 81 11 cpse r24, r1 220ac: fc cf rjmp .-8 ; 0x220a6 else return false; //Overwritten via LCD menu SuperPINDA [YES] #endif //PINDA_TEMP_COMP #else return true; #endif } 220ae: 8c 2f mov r24, r28 220b0: cf 91 pop r28 220b2: 08 95 ret 000220b4 <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 220b4: 1f 92 push r1 220b6: 0f 92 push r0 220b8: 0f b6 in r0, 0x3f ; 63 220ba: 0f 92 push r0 220bc: 11 24 eor r1, r1 220be: 0b b6 in r0, 0x3b ; 59 220c0: 0f 92 push r0 220c2: ff 92 push r15 220c4: 0f 93 push r16 220c6: 1f 93 push r17 220c8: 2f 93 push r18 220ca: 3f 93 push r19 220cc: 4f 93 push r20 220ce: 5f 93 push r21 220d0: 6f 93 push r22 220d2: 7f 93 push r23 220d4: 8f 93 push r24 220d6: 9f 93 push r25 220d8: af 93 push r26 220da: bf 93 push r27 220dc: cf 93 push r28 220de: df 93 push r29 220e0: ef 93 push r30 220e2: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 220e4: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 220e8: 8b 7f andi r24, 0xFB ; 251 220ea: 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(); 220ee: 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) 220f0: 48 99 sbic 0x09, 0 ; 9 220f2: c6 c0 rjmp .+396 ; 0x22280 <__vector_14+0x1cc> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 220f4: 68 ec ldi r22, 0xC8 ; 200 220f6: 70 e0 ldi r23, 0x00 ; 0 220f8: 82 eb ldi r24, 0xB2 ; 178 220fa: 95 e0 ldi r25, 0x05 ; 5 220fc: 0f 94 58 0b call 0x216b0 ; 0x216b0 ::expired_cont(unsigned short)> 22100: 88 23 and r24, r24 22102: b9 f0 breq .+46 ; 0x22132 <__vector_14+0x7e> buttonBlanking.start(); 22104: 82 eb ldi r24, 0xB2 ; 178 22106: 95 e0 ldi r25, 0x05 ; 5 22108: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> safetyTimer.start(); 2210c: 8d ea ldi r24, 0xAD ; 173 2210e: 95 e0 ldi r25, 0x05 ; 5 22110: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 22114: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 22118: 81 11 cpse r24, r1 2211a: a3 c0 rjmp .+326 ; 0x22262 <__vector_14+0x1ae> 2211c: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab 22120: 81 11 cpse r24, r1 22122: 9f c0 rjmp .+318 ; 0x22262 <__vector_14+0x1ae> { longPressTimer.start(); 22124: 88 ea ldi r24, 0xA8 ; 168 22126: 95 e0 ldi r25, 0x05 ; 5 22128: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> lcd_button_pressed = 1; 2212c: 81 e0 ldi r24, 0x01 ; 1 2212e: 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); 22132: 8c b1 in r24, 0x0c ; 12 22134: 80 95 com r24 22136: 88 1f adc r24, r24 22138: 88 27 eor r24, r24 2213a: 88 1f adc r24, r24 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 2213c: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 22140: 93 ff sbrs r25, 3 22142: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 22144: e0 91 a5 05 lds r30, 0x05A5 ; 0x8005a5 22148: e8 17 cp r30, r24 2214a: e1 f0 breq .+56 ; 0x22184 <__vector_14+0xd0> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 2214c: 24 e0 ldi r18, 0x04 ; 4 2214e: e2 9f mul r30, r18 22150: f0 01 movw r30, r0 22152: 11 24 eor r1, r1 22154: e8 2b or r30, r24 22156: e9 5c subi r30, 0xC9 ; 201 22158: f7 46 sbci r31, 0x67 ; 103 2215a: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 2215c: 90 91 a4 05 lds r25, 0x05A4 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.500> 22160: e9 0f add r30, r25 22162: e0 93 a4 05 sts 0x05A4, r30 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.500> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 22166: 0e 2e mov r0, r30 22168: 00 0c add r0, r0 2216a: ff 0b sbc r31, r31 2216c: f7 ff sbrs r31, 7 2216e: 03 c0 rjmp .+6 ; 0x22176 <__vector_14+0xc2> 22170: f1 95 neg r31 22172: e1 95 neg r30 22174: f1 09 sbc r31, r1 22176: 34 97 sbiw r30, 0x04 ; 4 22178: 1c f0 brlt .+6 ; 0x22180 <__vector_14+0xcc> lcd_backlight_wake_trigger = true; // flag event, knob rotated 2217a: 91 e0 ldi r25, 0x01 ; 1 2217c: 90 93 a6 05 sts 0x05A6, r25 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.499> } enc_bits_old = enc_bits; 22180: 80 93 a5 05 sts 0x05A5, r24 ; 0x8005a5 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 22184: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 22188: 81 11 cpse r24, r1 2218a: 08 c0 rjmp .+16 ; 0x2219c <__vector_14+0xe8> { soft_pwm_0 = soft_pwm[0]; 2218c: 80 91 f5 05 lds r24, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.502> 22190: 80 93 bb 05 sts 0x05BB, r24 ; 0x8005bb if(soft_pwm_0 > 0) 22194: 88 23 and r24, r24 22196: 09 f4 brne .+2 ; 0x2219a <__vector_14+0xe6> 22198: 87 c0 rjmp .+270 ; 0x222a8 <__vector_14+0x1f4> { WRITE(HEATER_0_PIN,1); 2219a: 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) 2219c: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 221a0: 8f 70 andi r24, 0x0F ; 15 221a2: a9 f4 brne .+42 ; 0x221ce <__vector_14+0x11a> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 221a4: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 221a8: 90 e0 ldi r25, 0x00 ; 0 221aa: 24 e0 ldi r18, 0x04 ; 4 221ac: 95 95 asr r25 221ae: 87 95 ror r24 221b0: 2a 95 dec r18 221b2: e1 f7 brne .-8 ; 0x221ac <__vector_14+0xf8> 221b4: 80 93 0f 04 sts 0x040F, r24 ; 0x80040f <_ZL12soft_pwm_fan.lto_priv.436> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 221b8: 89 2b or r24, r25 221ba: 09 f4 brne .+2 ; 0x221be <__vector_14+0x10a> 221bc: 77 c0 rjmp .+238 ; 0x222ac <__vector_14+0x1f8> 221be: 9f b7 in r25, 0x3f ; 63 221c0: f8 94 cli 221c2: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 221c6: 88 60 ori r24, 0x08 ; 8 221c8: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 221cc: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 221ce: 90 91 bb 05 lds r25, 0x05BB ; 0x8005bb 221d2: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 221d6: 98 17 cp r25, r24 221d8: 08 f4 brcc .+2 ; 0x221dc <__vector_14+0x128> { WRITE(HEATER_0_PIN,0); 221da: 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); 221dc: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 221e0: 8f 70 andi r24, 0x0F ; 15 221e2: 90 91 0f 04 lds r25, 0x040F ; 0x80040f <_ZL12soft_pwm_fan.lto_priv.436> 221e6: 98 17 cp r25, r24 221e8: 40 f4 brcc .+16 ; 0x221fa <__vector_14+0x146> 221ea: 9f b7 in r25, 0x3f ; 63 221ec: f8 94 cli 221ee: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 221f2: 87 7f andi r24, 0xF7 ; 247 221f4: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 221f8: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 221fa: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 221fe: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 22200: 8f 77 andi r24, 0x7F ; 127 22202: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 22206: 10 e0 ldi r17, 0x00 ; 0 22208: 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 2220a: e8 01 movw r28, r16 2220c: cc 0f add r28, r28 2220e: dd 1f adc r29, r29 22210: c1 58 subi r28, 0x81 ; 129 22212: dc 4f sbci r29, 0xFC ; 252 22214: 88 81 ld r24, Y 22216: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 22218: 18 16 cp r1, r24 2221a: 19 06 cpc r1, r25 2221c: 0c f0 brlt .+2 ; 0x22220 <__vector_14+0x16c> 2221e: 4c c0 rjmp .+152 ; 0x222b8 <__vector_14+0x204> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22220: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22222: f8 94 cli babystep(axis,/*fwd*/true); 22224: 61 e0 ldi r22, 0x01 ; 1 22226: 80 2f mov r24, r16 22228: 0f 94 05 00 call 0x2000a ; 0x2000a babystepsTodo[axis]--; //less to do next time 2222c: 88 81 ld r24, Y 2222e: 99 81 ldd r25, Y+1 ; 0x01 22230: 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 22232: 99 83 std Y+1, r25 ; 0x01 22234: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 22236: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 22238: 0f 5f subi r16, 0xFF ; 255 2223a: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 2223c: 03 30 cpi r16, 0x03 ; 3 2223e: 11 05 cpc r17, r1 22240: 21 f7 brne .-56 ; 0x2220a <__vector_14+0x156> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 22242: 80 91 37 17 lds r24, 0x1737 ; 0x801737 <__bss_end+0x20> 22246: 90 91 38 17 lds r25, 0x1738 ; 0x801738 <__bss_end+0x21> 2224a: a0 91 39 17 lds r26, 0x1739 ; 0x801739 <__bss_end+0x22> 2224e: b0 91 3a 17 lds r27, 0x173A ; 0x80173a <__bss_end+0x23> 22252: 82 3a cpi r24, 0xA2 ; 162 22254: 92 4a sbci r25, 0xA2 ; 162 22256: a1 05 cpc r26, r1 22258: b1 05 cpc r27, r1 2225a: d9 f1 breq .+118 ; 0x222d2 <__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); 2225c: 81 e0 ldi r24, 0x01 ; 1 2225e: 0e 94 4a 85 call 0x10a94 ; 0x10a94 if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 22262: 68 ee ldi r22, 0xE8 ; 232 22264: 73 e0 ldi r23, 0x03 ; 3 22266: 88 ea ldi r24, 0xA8 ; 168 22268: 95 e0 ldi r25, 0x05 ; 5 2226a: 0f 94 30 0b call 0x21660 ; 0x21660 ::expired(unsigned short)> 2226e: 88 23 and r24, r24 22270: 09 f4 brne .+2 ; 0x22274 <__vector_14+0x1c0> 22272: 5f cf rjmp .-322 ; 0x22132 <__vector_14+0x7e> { lcd_long_press_active = 1; 22274: 81 e0 ldi r24, 0x01 ; 1 22276: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab lcd_longpress_trigger = 1; 2227a: 80 93 a7 05 sts 0x05A7, r24 ; 0x8005a7 2227e: 59 cf rjmp .-334 ; 0x22132 <__vector_14+0x7e> } } } else { //button not pressed if (lcd_button_pressed) 22280: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 22284: 88 23 and r24, r24 22286: 09 f4 brne .+2 ; 0x2228a <__vector_14+0x1d6> 22288: 54 cf rjmp .-344 ; 0x22132 <__vector_14+0x7e> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 2228a: 10 92 ac 05 sts 0x05AC, r1 ; 0x8005ac if (!lcd_long_press_active) 2228e: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab 22292: 81 11 cpse r24, r1 22294: 03 c0 rjmp .+6 ; 0x2229c <__vector_14+0x1e8> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 22296: 81 e0 ldi r24, 0x01 ; 1 22298: 80 93 95 03 sts 0x0395, r24 ; 0x800395 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 2229c: 81 e0 ldi r24, 0x01 ; 1 2229e: 80 93 a6 05 sts 0x05A6, r24 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.499> lcd_long_press_active = 0; 222a2: 10 92 ab 05 sts 0x05AB, r1 ; 0x8005ab 222a6: 45 cf rjmp .-374 ; 0x22132 <__vector_14+0x7e> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 222a8: 75 98 cbi 0x0e, 5 ; 14 222aa: 78 cf rjmp .-272 ; 0x2219c <__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); 222ac: 9f b7 in r25, 0x3f ; 63 222ae: f8 94 cli 222b0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 222b4: 87 7f andi r24, 0xF7 ; 247 222b6: 88 cf rjmp .-240 ; 0x221c8 <__vector_14+0x114> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 222b8: 89 2b or r24, r25 222ba: 09 f4 brne .+2 ; 0x222be <__vector_14+0x20a> 222bc: bd cf rjmp .-134 ; 0x22238 <__vector_14+0x184> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 222be: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 222c0: f8 94 cli babystep(axis,/*fwd*/false); 222c2: 60 e0 ldi r22, 0x00 ; 0 222c4: 80 2f mov r24, r16 222c6: 0f 94 05 00 call 0x2000a ; 0x2000a babystepsTodo[axis]++; //less to do next time 222ca: 88 81 ld r24, Y 222cc: 99 81 ldd r25, Y+1 ; 0x01 222ce: 01 96 adiw r24, 0x01 ; 1 222d0: b0 cf rjmp .-160 ; 0x22232 <__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]) { 222d2: 96 b1 in r25, 0x06 ; 6 222d4: 80 91 b9 05 lds r24, 0x05B9 ; 0x8005b9 222d8: 99 1f adc r25, r25 222da: 99 27 eor r25, r25 222dc: 99 1f adc r25, r25 222de: 98 17 cp r25, r24 222e0: 91 f0 breq .+36 ; 0x22306 <__vector_14+0x252> if(fan_measuring) fan_edge_counter[0] ++; 222e2: 90 91 b6 03 lds r25, 0x03B6 ; 0x8003b6 222e6: 99 23 and r25, r25 222e8: 51 f0 breq .+20 ; 0x222fe <__vector_14+0x24a> 222ea: 20 91 b5 05 lds r18, 0x05B5 ; 0x8005b5 222ee: 30 91 b6 05 lds r19, 0x05B6 ; 0x8005b6 222f2: 2f 5f subi r18, 0xFF ; 255 222f4: 3f 4f sbci r19, 0xFF ; 255 222f6: 30 93 b6 05 sts 0x05B6, r19 ; 0x8005b6 222fa: 20 93 b5 05 sts 0x05B5, r18 ; 0x8005b5 fan_state[0] = !fan_state[0]; 222fe: 91 e0 ldi r25, 0x01 ; 1 22300: 89 27 eor r24, r25 22302: 80 93 b9 05 sts 0x05B9, r24 ; 0x8005b9 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 22306: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 22308: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 2230c: 84 60 ori r24, 0x04 ; 4 2230e: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 22312: ff 91 pop r31 22314: ef 91 pop r30 22316: df 91 pop r29 22318: cf 91 pop r28 2231a: bf 91 pop r27 2231c: af 91 pop r26 2231e: 9f 91 pop r25 22320: 8f 91 pop r24 22322: 7f 91 pop r23 22324: 6f 91 pop r22 22326: 5f 91 pop r21 22328: 4f 91 pop r20 2232a: 3f 91 pop r19 2232c: 2f 91 pop r18 2232e: 1f 91 pop r17 22330: 0f 91 pop r16 22332: ff 90 pop r15 22334: 0f 90 pop r0 22336: 0b be out 0x3b, r0 ; 59 22338: 0f 90 pop r0 2233a: 0f be out 0x3f, r0 ; 63 2233c: 0f 90 pop r0 2233e: 1f 90 pop r1 22340: 18 95 reti 00022342 : 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) { 22342: 4f 92 push r4 22344: 5f 92 push r5 22346: 6f 92 push r6 22348: 7f 92 push r7 2234a: af 92 push r10 2234c: bf 92 push r11 2234e: cf 92 push r12 22350: df 92 push r13 22352: ef 92 push r14 22354: ff 92 push r15 22356: 0f 93 push r16 22358: 1f 93 push r17 2235a: cf 93 push r28 2235c: df 93 push r29 2235e: 24 e0 ldi r18, 0x04 ; 4 22360: 30 e0 ldi r19, 0x00 ; 0 22362: 41 e0 ldi r20, 0x01 ; 1 22364: 50 e0 ldi r21, 0x00 ; 0 22366: d9 01 movw r26, r18 22368: a3 5a subi r26, 0xA3 ; 163 2236a: b9 46 sbci r27, 0x69 ; 105 float celsius = 0; byte i; for (i=1; i raw) 2236c: fd 01 movw r30, r26 2236e: 65 91 lpm r22, Z+ 22370: 74 91 lpm r23, Z 22372: 86 17 cp r24, r22 22374: 97 07 cpc r25, r23 22376: 0c f0 brlt .+2 ; 0x2237a 22378: 80 c0 rjmp .+256 ; 0x2247a { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 2237a: 41 50 subi r20, 0x01 ; 1 2237c: 51 09 sbc r21, r1 2237e: 44 0f add r20, r20 22380: 55 1f adc r21, r21 22382: 44 0f add r20, r20 22384: 55 1f adc r21, r21 22386: 8a 01 movw r16, r20 22388: 01 5a subi r16, 0xA1 ; 161 2238a: 19 46 sbci r17, 0x69 ; 105 2238c: f8 01 movw r30, r16 2238e: c5 90 lpm r12, Z+ 22390: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 22392: 43 5a subi r20, 0xA3 ; 163 22394: 59 46 sbci r21, 0x69 ; 105 22396: fa 01 movw r30, r20 22398: 65 91 lpm r22, Z+ 2239a: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 2239c: f9 01 movw r30, r18 2239e: e1 5a subi r30, 0xA1 ; 161 223a0: f9 46 sbci r31, 0x69 ; 105 223a2: c5 91 lpm r28, Z+ 223a4: d4 91 lpm r29, Z 223a6: f8 01 movw r30, r16 223a8: 05 91 lpm r16, Z+ 223aa: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 223ac: fd 01 movw r30, r26 223ae: e5 90 lpm r14, Z+ 223b0: f4 90 lpm r15, Z 223b2: fa 01 movw r30, r20 223b4: a5 90 lpm r10, Z+ 223b6: 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])) * 223b8: 86 1b sub r24, r22 223ba: 97 0b sbc r25, r23 223bc: bc 01 movw r22, r24 223be: 99 0f add r25, r25 223c0: 88 0b sbc r24, r24 223c2: 99 0b sbc r25, r25 223c4: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 223c8: 2b 01 movw r4, r22 223ca: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 223cc: be 01 movw r22, r28 223ce: 60 1b sub r22, r16 223d0: 71 0b sbc r23, r17 223d2: 07 2e mov r0, r23 223d4: 00 0c add r0, r0 223d6: 88 0b sbc r24, r24 223d8: 99 0b sbc r25, r25 223da: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 223de: 9b 01 movw r18, r22 223e0: 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])) * 223e2: c3 01 movw r24, r6 223e4: b2 01 movw r22, r4 223e6: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 223ea: 2b 01 movw r4, r22 223ec: 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])); 223ee: b7 01 movw r22, r14 223f0: 6a 19 sub r22, r10 223f2: 7b 09 sbc r23, r11 223f4: 07 2e mov r0, r23 223f6: 00 0c add r0, r0 223f8: 88 0b sbc r24, r24 223fa: 99 0b sbc r25, r25 223fc: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 22400: 9b 01 movw r18, r22 22402: 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])) / 22404: c3 01 movw r24, r6 22406: b2 01 movw r22, r4 22408: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 2240c: 2b 01 movw r4, r22 2240e: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 22410: b6 01 movw r22, r12 22412: dd 0c add r13, r13 22414: 88 0b sbc r24, r24 22416: 99 0b sbc r25, r25 22418: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2241c: 9b 01 movw r18, r22 2241e: ac 01 movw r20, r24 22420: c3 01 movw r24, r6 22422: b2 01 movw r22, r4 22424: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 22428: 6b 01 movw r12, r22 2242a: 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) 2242c: 20 e0 ldi r18, 0x00 ; 0 2242e: 30 e0 ldi r19, 0x00 ; 0 22430: 40 e2 ldi r20, 0x20 ; 32 22432: 52 e4 ldi r21, 0x42 ; 66 22434: c7 01 movw r24, r14 22436: b6 01 movw r22, r12 22438: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2243c: 87 fd sbrc r24, 7 2243e: 30 c0 rjmp .+96 ; 0x224a0 22440: 20 e0 ldi r18, 0x00 ; 0 22442: 30 e0 ldi r19, 0x00 ; 0 22444: 48 e4 ldi r20, 0x48 ; 72 22446: 52 e4 ldi r21, 0x42 ; 66 22448: c7 01 movw r24, r14 2244a: b6 01 movw r22, r12 2244c: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 22450: 18 16 cp r1, r24 22452: 34 f1 brlt .+76 ; 0x224a0 { celsius = celsius + (_first_koef * (celsius - _offset_start)); 22454: 20 e0 ldi r18, 0x00 ; 0 22456: 30 e0 ldi r19, 0x00 ; 0 22458: 40 e2 ldi r20, 0x20 ; 32 2245a: 52 e4 ldi r21, 0x42 ; 66 2245c: c7 01 movw r24, r14 2245e: b6 01 movw r22, r12 22460: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 22464: 20 e0 ldi r18, 0x00 ; 0 22466: 30 e0 ldi r19, 0x00 ; 0 22468: 40 e0 ldi r20, 0x00 ; 0 2246a: 5f e3 ldi r21, 0x3F ; 63 2246c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 22470: 9b 01 movw r18, r22 22472: 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; 22474: c7 01 movw r24, r14 22476: b6 01 movw r22, r12 22478: 43 c0 rjmp .+134 ; 0x22500 2247a: 4f 5f subi r20, 0xFF ; 255 2247c: 5f 4f sbci r21, 0xFF ; 255 2247e: 2c 5f subi r18, 0xFC ; 252 22480: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 22488: 6e cf rjmp .-292 ; 0x22366 break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 2248a: ef e4 ldi r30, 0x4F ; 79 2248c: f7 e9 ldi r31, 0x97 ; 151 2248e: 65 91 lpm r22, Z+ 22490: 74 91 lpm r23, Z 22492: 07 2e mov r0, r23 22494: 00 0c add r0, r0 22496: 88 0b sbc r24, r24 22498: 99 0b sbc r25, r25 2249a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2249e: c4 cf rjmp .-120 ; 0x22428 if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 224a0: 20 e0 ldi r18, 0x00 ; 0 224a2: 30 e0 ldi r19, 0x00 ; 0 224a4: 48 e4 ldi r20, 0x48 ; 72 224a6: 52 e4 ldi r21, 0x42 ; 66 224a8: c7 01 movw r24, r14 224aa: b6 01 movw r22, r12 224ac: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 224b0: 18 16 cp r1, r24 224b2: dc f5 brge .+118 ; 0x2252a 224b4: 20 e0 ldi r18, 0x00 ; 0 224b6: 30 e0 ldi r19, 0x00 ; 0 224b8: 48 ec ldi r20, 0xC8 ; 200 224ba: 52 e4 ldi r21, 0x42 ; 66 224bc: c7 01 movw r24, r14 224be: b6 01 movw r22, r12 224c0: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 224c4: 18 16 cp r1, r24 224c6: 8c f1 brlt .+98 ; 0x2252a { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 224c8: 20 e0 ldi r18, 0x00 ; 0 224ca: 30 e0 ldi r19, 0x00 ; 0 224cc: 40 ea ldi r20, 0xA0 ; 160 224ce: 50 e4 ldi r21, 0x40 ; 64 224d0: c7 01 movw r24, r14 224d2: b6 01 movw r22, r12 224d4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 224d8: 2b 01 movw r4, r22 224da: 3c 01 movw r6, r24 224dc: 20 e0 ldi r18, 0x00 ; 0 224de: 30 e0 ldi r19, 0x00 ; 0 224e0: 48 e4 ldi r20, 0x48 ; 72 224e2: 52 e4 ldi r21, 0x42 ; 66 224e4: c7 01 movw r24, r14 224e6: b6 01 movw r22, r12 224e8: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 224ec: 2d ec ldi r18, 0xCD ; 205 224ee: 3c ec ldi r19, 0xCC ; 204 224f0: 4c ec ldi r20, 0xCC ; 204 224f2: 5d e3 ldi r21, 0x3D ; 61 224f4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 224f8: 9b 01 movw r18, r22 224fa: ac 01 movw r20, r24 224fc: c3 01 movw r24, r6 224fe: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 22500: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 22504: 6b 01 movw r12, r22 22506: 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 } 22508: c7 01 movw r24, r14 2250a: b6 01 movw r22, r12 2250c: df 91 pop r29 2250e: cf 91 pop r28 22510: 1f 91 pop r17 22512: 0f 91 pop r16 22514: ff 90 pop r15 22516: ef 90 pop r14 22518: df 90 pop r13 2251a: cf 90 pop r12 2251c: bf 90 pop r11 2251e: af 90 pop r10 22520: 7f 90 pop r7 22522: 6f 90 pop r6 22524: 5f 90 pop r5 22526: 4f 90 pop r4 22528: 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) 2252a: 20 e0 ldi r18, 0x00 ; 0 2252c: 30 e0 ldi r19, 0x00 ; 0 2252e: 48 ec ldi r20, 0xC8 ; 200 22530: 52 e4 ldi r21, 0x42 ; 66 22532: c7 01 movw r24, r14 22534: b6 01 movw r22, r12 22536: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2253a: 18 16 cp r1, r24 2253c: 2c f7 brge .-54 ; 0x22508 { celsius = celsius + _offset; 2253e: 20 e0 ldi r18, 0x00 ; 0 22540: 30 e0 ldi r19, 0x00 ; 0 22542: 40 e2 ldi r20, 0x20 ; 32 22544: 51 e4 ldi r21, 0x41 ; 65 22546: 96 cf rjmp .-212 ; 0x22474 00022548 <__vector_32>: if (pid_tuning_finished) temp_mgr_pid(); } ISR(TIMERx_COMPA_vect) { 22548: 1f 92 push r1 2254a: 0f 92 push r0 2254c: 0f b6 in r0, 0x3f ; 63 2254e: 0f 92 push r0 22550: 11 24 eor r1, r1 22552: 0b b6 in r0, 0x3b ; 59 22554: 0f 92 push r0 22556: 4f 92 push r4 22558: 5f 92 push r5 2255a: 6f 92 push r6 2255c: 7f 92 push r7 2255e: 8f 92 push r8 22560: 9f 92 push r9 22562: af 92 push r10 22564: bf 92 push r11 22566: cf 92 push r12 22568: df 92 push r13 2256a: ef 92 push r14 2256c: ff 92 push r15 2256e: 0f 93 push r16 22570: 1f 93 push r17 22572: 2f 93 push r18 22574: 3f 93 push r19 22576: 4f 93 push r20 22578: 5f 93 push r21 2257a: 6f 93 push r22 2257c: 7f 93 push r23 2257e: 8f 93 push r24 22580: 9f 93 push r25 22582: af 93 push r26 22584: bf 93 push r27 22586: cf 93 push r28 22588: df 93 push r29 2258a: ef 93 push r30 2258c: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 2258e: 80 91 f6 05 lds r24, 0x05F6 ; 0x8005f6 <_ZL16adc_values_ready.lto_priv.515> 22592: 88 23 and r24, r24 22594: 09 f4 brne .+2 ; 0x22598 <__vector_32+0x50> 22596: 22 c1 rjmp .+580 ; 0x227dc <__vector_32+0x294> adc_values_ready = false; 22598: 10 92 f6 05 sts 0x05F6, r1 ; 0x8005f6 <_ZL16adc_values_ready.lto_priv.515> adc_start_cycle(); 2259c: 0e 94 bb ba call 0x17576 ; 0x17576 // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 225a0: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 225a4: 8d 7f andi r24, 0xFD ; 253 225a6: 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(); 225aa: 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 225b0: 90 91 dd 05 lds r25, 0x05DD ; 0x8005dd 225b4: 0f 94 c4 8f call 0x31f88 ; 0x31f88 225b8: 4b 01 movw r8, r22 225ba: 5c 01 movw r10, r24 225bc: 80 92 f1 05 sts 0x05F1, r8 ; 0x8005f1 225c0: 90 92 f2 05 sts 0x05F2, r9 ; 0x8005f2 225c4: a0 92 f3 05 sts 0x05F3, r10 ; 0x8005f3 225c8: b0 92 f4 05 sts 0x05F4, r11 ; 0x8005f4 current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 225cc: 00 91 de 05 lds r16, 0x05DE ; 0x8005de 225d0: 10 91 df 05 lds r17, 0x05DF ; 0x8005df 225d4: c8 01 movw r24, r16 225d6: 0f 94 a1 11 call 0x22342 ; 0x22342 225da: 6b 01 movw r12, r22 225dc: 7c 01 movw r14, r24 225de: c0 92 ea 05 sts 0x05EA, r12 ; 0x8005ea 225e2: d0 92 eb 05 sts 0x05EB, r13 ; 0x8005eb 225e6: e0 92 ec 05 sts 0x05EC, r14 ; 0x8005ec 225ea: f0 92 ed 05 sts 0x05ED, r15 ; 0x8005ed #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 225ee: 80 91 da 05 lds r24, 0x05DA ; 0x8005da 225f2: 90 91 db 05 lds r25, 0x05DB ; 0x8005db 225f6: 0f 94 a1 11 call 0x22342 ; 0x22342 225fa: 60 93 d6 05 sts 0x05D6, r22 ; 0x8005d6 225fe: 70 93 d7 05 sts 0x05D7, r23 ; 0x8005d7 22602: 80 93 d8 05 sts 0x05D8, r24 ; 0x8005d8 22606: 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; 2260a: 81 e0 ldi r24, 0x01 ; 1 2260c: 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; 22610: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 22614: 8d 7f andi r24, 0xFD ; 253 22616: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 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]) { 2261a: c0 91 dc 05 lds r28, 0x05DC ; 0x8005dc 2261e: d0 91 dd 05 lds r29, 0x05DD ; 0x8005dd 22622: 80 91 0b 04 lds r24, 0x040B ; 0x80040b <_ZL12maxttemp_raw.lto_priv.429> 22626: 90 91 0c 04 lds r25, 0x040C ; 0x80040c <_ZL12maxttemp_raw.lto_priv.429+0x1> 2262a: 8c 17 cp r24, r28 2262c: 9d 07 cpc r25, r29 2262e: 2c f0 brlt .+10 ; 0x2263a <__vector_32+0xf2> #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 22630: 40 e0 ldi r20, 0x00 ; 0 22632: 60 e0 ldi r22, 0x00 ; 0 22634: 80 e0 ldi r24, 0x00 ; 0 22636: 0f 94 03 0e call 0x21c06 ; 0x21c06 } //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) { 2263a: 80 91 09 04 lds r24, 0x0409 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.430> 2263e: 90 91 0a 04 lds r25, 0x040A ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.430+0x1> 22642: 80 17 cp r24, r16 22644: 91 07 cpc r25, r17 22646: 2c f0 brlt .+10 ; 0x22652 <__vector_32+0x10a> #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 22648: 40 e0 ldi r20, 0x00 ; 0 2264a: 60 e0 ldi r22, 0x00 ; 0 2264c: 81 e0 ldi r24, 0x01 ; 1 2264e: 0f 94 03 0e call 0x21c06 ; 0x21c06 { // 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]) { 22652: 60 91 0d 04 lds r22, 0x040D ; 0x80040d <_ZL8minttemp.lto_priv.426> 22656: 70 91 0e 04 lds r23, 0x040E ; 0x80040e <_ZL8minttemp.lto_priv.426+0x1> 2265a: 80 91 ef 05 lds r24, 0x05EF ; 0x8005ef 2265e: 90 91 f0 05 lds r25, 0x05F0 ; 0x8005f0 22662: 68 17 cp r22, r24 22664: 79 07 cpc r23, r25 22666: 0c f0 brlt .+2 ; 0x2266a <__vector_32+0x122> 22668: dc c0 rjmp .+440 ; 0x22822 <__vector_32+0x2da> // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 2266a: 10 91 e7 05 lds r17, 0x05E7 ; 0x8005e7 2266e: 11 11 cpse r17, r1 22670: 12 c0 rjmp .+36 ; 0x22696 <__vector_32+0x14e> 22672: 6b 5f subi r22, 0xFB ; 251 22674: 7f 4f sbci r23, 0xFF ; 255 22676: 07 2e mov r0, r23 22678: 00 0c add r0, r0 2267a: 88 0b sbc r24, r24 2267c: 99 0b sbc r25, r25 2267e: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 22682: 9b 01 movw r18, r22 22684: ac 01 movw r20, r24 22686: 11 e0 ldi r17, 0x01 ; 1 22688: c5 01 movw r24, r10 2268a: b4 01 movw r22, r8 2268c: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 22690: 18 16 cp r1, r24 22692: 0c f0 brlt .+2 ; 0x22696 <__vector_32+0x14e> 22694: 10 e0 ldi r17, 0x00 ; 0 22696: 10 93 e7 05 sts 0x05E7, r17 ; 0x8005e7 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 2269a: 68 e9 ldi r22, 0x98 ; 152 2269c: 7a e3 ldi r23, 0x3A ; 58 2269e: 84 ee ldi r24, 0xE4 ; 228 226a0: 95 e0 ldi r25, 0x05 ; 5 226a2: 0f 94 58 0b call 0x216b0 ; 0x216b0 ::expired_cont(unsigned short)> 226a6: 81 11 cpse r24, r1 226a8: 02 c0 rjmp .+4 ; 0x226ae <__vector_32+0x166> 226aa: 11 23 and r17, r17 226ac: 79 f0 breq .+30 ; 0x226cc <__vector_32+0x184> bCheckingOnHeater=true; // not necessary 226ae: 81 e0 ldi r24, 0x01 ; 1 226b0: 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]) { 226b4: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.428> 226b8: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.428+0x1> 226bc: c8 17 cp r28, r24 226be: d9 07 cpc r29, r25 226c0: 2c f0 brlt .+10 ; 0x226cc <__vector_32+0x184> #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 226c2: 41 e0 ldi r20, 0x01 ; 1 226c4: 60 e0 ldi r22, 0x00 ; 0 226c6: 80 e0 ldi r24, 0x00 ; 0 226c8: 0f 94 03 0e call 0x21c06 ; 0x21c06 // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 226cc: 80 91 e8 05 lds r24, 0x05E8 ; 0x8005e8 226d0: 90 91 e9 05 lds r25, 0x05E9 ; 0x8005e9 226d4: 4f 97 sbiw r24, 0x1f ; 31 226d6: 0c f4 brge .+2 ; 0x226da <__vector_32+0x192> 226d8: ab c0 rjmp .+342 ; 0x22830 <__vector_32+0x2e8> // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 226da: c0 91 e3 05 lds r28, 0x05E3 ; 0x8005e3 226de: c1 11 cpse r28, r1 226e0: 0c c0 rjmp .+24 ; 0x226fa <__vector_32+0x1b2> 226e2: c1 e0 ldi r28, 0x01 ; 1 226e4: 20 e0 ldi r18, 0x00 ; 0 226e6: 30 e0 ldi r19, 0x00 ; 0 226e8: 4c e0 ldi r20, 0x0C ; 12 226ea: 52 e4 ldi r21, 0x42 ; 66 226ec: c7 01 movw r24, r14 226ee: b6 01 movw r22, r12 226f0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 226f4: 18 16 cp r1, r24 226f6: 0c f0 brlt .+2 ; 0x226fa <__vector_32+0x1b2> 226f8: c0 e0 ldi r28, 0x00 ; 0 226fa: c0 93 e3 05 sts 0x05E3, r28 ; 0x8005e3 if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 226fe: 60 e5 ldi r22, 0x50 ; 80 22700: 73 ec ldi r23, 0xC3 ; 195 22702: 80 ee ldi r24, 0xE0 ; 224 22704: 95 e0 ldi r25, 0x05 ; 5 22706: 0f 94 58 0b call 0x216b0 ; 0x216b0 ::expired_cont(unsigned short)> 2270a: 81 11 cpse r24, r1 2270c: 02 c0 rjmp .+4 ; 0x22712 <__vector_32+0x1ca> 2270e: cc 23 and r28, r28 22710: 99 f0 breq .+38 ; 0x22738 <__vector_32+0x1f0> bCheckingOnBed=true; // not necessary 22712: 81 e0 ldi r24, 0x01 ; 1 22714: 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) { 22718: 20 91 de 05 lds r18, 0x05DE ; 0x8005de 2271c: 30 91 df 05 lds r19, 0x05DF ; 0x8005df 22720: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.427> 22724: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.427+0x1> 22728: 28 17 cp r18, r24 2272a: 39 07 cpc r19, r25 2272c: 2c f0 brlt .+10 ; 0x22738 <__vector_32+0x1f0> #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 2272e: 41 e0 ldi r20, 0x01 ; 1 22730: 60 e0 ldi r22, 0x00 ; 0 22732: 81 e0 ldi r24, 0x01 ; 1 22734: 0f 94 03 0e call 0x21c06 ; 0x21c06 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); 22738: 60 91 f5 05 lds r22, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.502> 2273c: 70 e0 ldi r23, 0x00 ; 0 2273e: 90 e0 ldi r25, 0x00 ; 0 22740: 80 e0 ldi r24, 0x00 ; 0 22742: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 22746: 6b 01 movw r12, r22 22748: 7c 01 movw r14, r24 2274a: 40 90 f1 05 lds r4, 0x05F1 ; 0x8005f1 2274e: 50 90 f2 05 lds r5, 0x05F2 ; 0x8005f2 22752: 60 90 f3 05 lds r6, 0x05F3 ; 0x8005f3 22756: 70 90 f4 05 lds r7, 0x05F4 ; 0x8005f4 2275a: 60 91 ef 05 lds r22, 0x05EF ; 0x8005ef 2275e: 70 91 f0 05 lds r23, 0x05F0 ; 0x8005f0 22762: 07 2e mov r0, r23 22764: 00 0c add r0, r0 22766: 88 0b sbc r24, r24 22768: 99 0b sbc r25, r25 2276a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2276e: ab 01 movw r20, r22 22770: bc 01 movw r22, r24 22772: a1 2c mov r10, r1 22774: 93 01 movw r18, r6 22776: 82 01 movw r16, r4 22778: 81 e0 ldi r24, 0x01 ; 1 2277a: 0f 94 67 0e call 0x21cce ; 0x21cce #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 2277e: 60 91 ee 05 lds r22, 0x05EE ; 0x8005ee 22782: 70 e0 ldi r23, 0x00 ; 0 22784: 90 e0 ldi r25, 0x00 ; 0 22786: 80 e0 ldi r24, 0x00 ; 0 22788: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 2278c: 6b 01 movw r12, r22 2278e: 7c 01 movw r14, r24 22790: 40 90 ea 05 lds r4, 0x05EA ; 0x8005ea 22794: 50 90 eb 05 lds r5, 0x05EB ; 0x8005eb 22798: 60 90 ec 05 lds r6, 0x05EC ; 0x8005ec 2279c: 70 90 ed 05 lds r7, 0x05ED ; 0x8005ed 227a0: 60 91 e8 05 lds r22, 0x05E8 ; 0x8005e8 227a4: 70 91 e9 05 lds r23, 0x05E9 ; 0x8005e9 227a8: 07 2e mov r0, r23 227aa: 00 0c add r0, r0 227ac: 88 0b sbc r24, r24 227ae: 99 0b sbc r25, r25 227b0: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 227b4: ab 01 movw r20, r22 227b6: bc 01 movw r22, r24 227b8: aa 24 eor r10, r10 227ba: a3 94 inc r10 227bc: 93 01 movw r18, r6 227be: 82 01 movw r16, r4 227c0: 80 e0 ldi r24, 0x00 ; 0 227c2: 0f 94 67 0e call 0x21cce ; 0x21cce thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 227c6: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.425> 227ca: 81 11 cpse r24, r1 temp_mgr_pid(); 227cc: 0e 94 e1 fc call 0x1f9c2 ; 0x1f9c2 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 227d0: 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(); 227d2: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 227d6: 82 60 ori r24, 0x02 ; 2 227d8: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> } 227dc: ff 91 pop r31 227de: ef 91 pop r30 227e0: df 91 pop r29 227e2: cf 91 pop r28 227e4: bf 91 pop r27 227e6: af 91 pop r26 227e8: 9f 91 pop r25 227ea: 8f 91 pop r24 227ec: 7f 91 pop r23 227ee: 6f 91 pop r22 227f0: 5f 91 pop r21 227f2: 4f 91 pop r20 227f4: 3f 91 pop r19 227f6: 2f 91 pop r18 227f8: 1f 91 pop r17 227fa: 0f 91 pop r16 227fc: ff 90 pop r15 227fe: ef 90 pop r14 22800: df 90 pop r13 22802: cf 90 pop r12 22804: bf 90 pop r11 22806: af 90 pop r10 22808: 9f 90 pop r9 2280a: 8f 90 pop r8 2280c: 7f 90 pop r7 2280e: 6f 90 pop r6 22810: 5f 90 pop r5 22812: 4f 90 pop r4 22814: 0f 90 pop r0 22816: 0b be out 0x3b, r0 ; 59 22818: 0f 90 pop r0 2281a: 0f be out 0x3f, r0 ; 63 2281c: 0f 90 pop r0 2281e: 1f 90 pop r1 22820: 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(); 22822: 84 ee ldi r24, 0xE4 ; 228 22824: 95 e0 ldi r25, 0x05 ; 5 22826: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> bCheckingOnHeater=false; 2282a: 10 92 e7 05 sts 0x05E7, r1 ; 0x8005e7 2282e: 4e cf rjmp .-356 ; 0x226cc <__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(); 22830: 80 ee ldi r24, 0xE0 ; 224 22832: 95 e0 ldi r25, 0x05 ; 5 22834: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> bCheckingOnBed=false; 22838: 10 92 e3 05 sts 0x05E3, r1 ; 0x8005e3 2283c: 7d cf rjmp .-262 ; 0x22738 <__vector_32+0x1f0> 0002283e : 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; 2283e: 20 91 d3 0d lds r18, 0x0DD3 ; 0x800dd3 22842: 30 91 d4 0d lds r19, 0x0DD4 ; 0x800dd4 22846: 40 91 d5 0d lds r20, 0x0DD5 ; 0x800dd5 2284a: 50 91 d6 0d lds r21, 0x0DD6 ; 0x800dd6 2284e: 60 e0 ldi r22, 0x00 ; 0 22850: 70 e0 ldi r23, 0x00 ; 0 22852: 8f e7 ldi r24, 0x7F ; 127 22854: 93 e4 ldi r25, 0x43 ; 67 22856: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 2285a: 60 93 18 04 sts 0x0418, r22 ; 0x800418 <_ZL14iState_sum_max.lto_priv.434> 2285e: 70 93 19 04 sts 0x0419, r23 ; 0x800419 <_ZL14iState_sum_max.lto_priv.434+0x1> 22862: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14iState_sum_max.lto_priv.434+0x2> 22866: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14iState_sum_max.lto_priv.434+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 2286a: 20 91 df 0d lds r18, 0x0DDF ; 0x800ddf 2286e: 30 91 e0 0d lds r19, 0x0DE0 ; 0x800de0 22872: 40 91 e1 0d lds r20, 0x0DE1 ; 0x800de1 22876: 50 91 e2 0d lds r21, 0x0DE2 ; 0x800de2 2287a: 60 e0 ldi r22, 0x00 ; 0 2287c: 70 e0 ldi r23, 0x00 ; 0 2287e: 8f e7 ldi r24, 0x7F ; 127 22880: 93 e4 ldi r25, 0x43 ; 67 22882: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 22886: 60 93 10 04 sts 0x0410, r22 ; 0x800410 <_ZL19temp_iState_max_bed.lto_priv.432> 2288a: 70 93 11 04 sts 0x0411, r23 ; 0x800411 <_ZL19temp_iState_max_bed.lto_priv.432+0x1> 2288e: 80 93 12 04 sts 0x0412, r24 ; 0x800412 <_ZL19temp_iState_max_bed.lto_priv.432+0x2> 22892: 90 93 13 04 sts 0x0413, r25 ; 0x800413 <_ZL19temp_iState_max_bed.lto_priv.432+0x3> #endif } 22896: 08 95 ret 00022898 : return data; } static void swi2c_write(uint8_t data) { for (uint8_t bit = 8; bit-- > 0;) 22898: 98 e0 ldi r25, 0x08 ; 8 { WRITE(SWI2C_SDA, data & _BV(bit)); 2289a: 28 2f mov r18, r24 2289c: 30 e0 ldi r19, 0x00 ; 0 return data; } static void swi2c_write(uint8_t data) { for (uint8_t bit = 8; bit-- > 0;) 2289e: 91 50 subi r25, 0x01 ; 1 228a0: 08 f4 brcc .+2 ; 0x228a4 WRITE(SWI2C_SCL, 1); __delay(); WRITE(SWI2C_SCL, 0); __delay(); } } 228a2: 08 95 ret static void swi2c_write(uint8_t data) { for (uint8_t bit = 8; bit-- > 0;) { WRITE(SWI2C_SDA, data & _BV(bit)); 228a4: a9 01 movw r20, r18 228a6: 09 2e mov r0, r25 228a8: 02 c0 rjmp .+4 ; 0x228ae 228aa: 55 95 asr r21 228ac: 47 95 ror r20 228ae: 0a 94 dec r0 228b0: e2 f7 brpl .-8 ; 0x228aa 228b2: 40 ff sbrs r20, 0 228b4: 1b c0 rjmp .+54 ; 0x228ec 228b6: 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); 228b8: 88 e0 ldi r24, 0x08 ; 8 228ba: 8a 95 dec r24 228bc: f1 f7 brne .-4 ; 0x228ba __delay(); WRITE(SWI2C_SCL, 1); 228be: 4f b7 in r20, 0x3f ; 63 228c0: f8 94 cli 228c2: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228c6: 84 60 ori r24, 0x04 ; 4 228c8: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228cc: 4f bf out 0x3f, r20 ; 63 228ce: 88 e0 ldi r24, 0x08 ; 8 228d0: 8a 95 dec r24 228d2: f1 f7 brne .-4 ; 0x228d0 __delay(); WRITE(SWI2C_SCL, 0); 228d4: 4f b7 in r20, 0x3f ; 63 228d6: f8 94 cli 228d8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228dc: 8b 7f andi r24, 0xFB ; 251 228de: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228e2: 4f bf out 0x3f, r20 ; 63 228e4: 88 e0 ldi r24, 0x08 ; 8 228e6: 8a 95 dec r24 228e8: f1 f7 brne .-4 ; 0x228e6 228ea: d9 cf rjmp .-78 ; 0x2289e static void swi2c_write(uint8_t data) { for (uint8_t bit = 8; bit-- > 0;) { WRITE(SWI2C_SDA, data & _BV(bit)); 228ec: 59 98 cbi 0x0b, 1 ; 11 228ee: e4 cf rjmp .-56 ; 0x228b8 000228f0 : __delay(); } static uint8_t swi2c_wait_ack() { SET_INPUT(SWI2C_SDA); 228f0: 51 98 cbi 0x0a, 1 ; 10 228f2: 28 e0 ldi r18, 0x08 ; 8 228f4: 2a 95 dec r18 228f6: f1 f7 brne .-4 ; 0x228f4 228f8: 88 e0 ldi r24, 0x08 ; 8 228fa: 8a 95 dec r24 228fc: f1 f7 brne .-4 ; 0x228fa __delay(); // WRITE(SWI2C_SDA, 1); __delay(); WRITE(SWI2C_SCL, 1); 228fe: 9f b7 in r25, 0x3f ; 63 22900: f8 94 cli 22902: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22906: 84 60 ori r24, 0x04 ; 4 22908: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2290c: 9f bf out 0x3f, r25 ; 63 2290e: 81 e0 ldi r24, 0x01 ; 1 22910: 98 e0 ldi r25, 0x08 ; 8 // __delay(); uint8_t ack = 0; uint16_t ackto = SWI2C_TMO; while (!(ack = (!READ(SWI2C_SDA))) && ackto--) __delay(); 22912: 29 b1 in r18, 0x09 ; 9 22914: 32 2f mov r19, r18 22916: 32 70 andi r19, 0x02 ; 2 22918: 21 fd sbrc r18, 1 2291a: 18 c0 rjmp .+48 ; 0x2294c WRITE(SWI2C_SCL, 0); 2291c: 9f b7 in r25, 0x3f ; 63 2291e: f8 94 cli 22920: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22924: 8b 7f andi r24, 0xFB ; 251 22926: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2292a: 9f bf out 0x3f, r25 ; 63 2292c: 88 e0 ldi r24, 0x08 ; 8 2292e: 8a 95 dec r24 22930: f1 f7 brne .-4 ; 0x2292e __delay(); SET_OUTPUT(SWI2C_SDA); 22932: 51 9a sbi 0x0a, 1 ; 10 22934: 28 e0 ldi r18, 0x08 ; 8 22936: 2a 95 dec r18 22938: f1 f7 brne .-4 ; 0x22936 __delay(); WRITE(SWI2C_SDA, 0); 2293a: 59 98 cbi 0x0b, 1 ; 11 2293c: 88 e0 ldi r24, 0x08 ; 8 2293e: 8a 95 dec r24 22940: f1 f7 brne .-4 ; 0x2293e __delay(); WRITE(SWI2C_SCL, 1); // __delay(); uint8_t ack = 0; uint16_t ackto = SWI2C_TMO; while (!(ack = (!READ(SWI2C_SDA))) && ackto--) __delay(); 22942: 81 e0 ldi r24, 0x01 ; 1 22944: 33 23 and r19, r19 22946: 41 f0 breq .+16 ; 0x22958 22948: 80 e0 ldi r24, 0x00 ; 0 2294a: 08 95 ret 2294c: 01 97 sbiw r24, 0x01 ; 1 2294e: 31 f3 breq .-52 ; 0x2291c 22950: 28 e0 ldi r18, 0x08 ; 8 22952: 2a 95 dec r18 22954: f1 f7 brne .-4 ; 0x22952 22956: dd cf rjmp .-70 ; 0x22912 SET_OUTPUT(SWI2C_SDA); __delay(); WRITE(SWI2C_SDA, 0); __delay(); return ack; } 22958: 08 95 ret 0002295a : __delay(); } static void swi2c_stop(void) { WRITE(SWI2C_SCL, 1); 2295a: 9f b7 in r25, 0x3f ; 63 2295c: f8 94 cli 2295e: e2 e0 ldi r30, 0x02 ; 2 22960: f1 e0 ldi r31, 0x01 ; 1 22962: 80 81 ld r24, Z 22964: 84 60 ori r24, 0x04 ; 4 22966: 80 83 st Z, r24 22968: 9f bf out 0x3f, r25 ; 63 2296a: 88 e0 ldi r24, 0x08 ; 8 2296c: 8a 95 dec r24 2296e: f1 f7 brne .-4 ; 0x2296c __delay(); WRITE(SWI2C_SDA, 1); 22970: 59 9a sbi 0x0b, 1 ; 11 22972: 88 e0 ldi r24, 0x08 ; 8 22974: 8a 95 dec r24 22976: f1 f7 brne .-4 ; 0x22974 __delay(); } 22978: 08 95 ret 0002297a : _delay_us(1.5); } static void swi2c_start(void) { WRITE(SWI2C_SDA, 0); 2297a: 59 98 cbi 0x0b, 1 ; 11 2297c: 88 e0 ldi r24, 0x08 ; 8 2297e: 8a 95 dec r24 22980: f1 f7 brne .-4 ; 0x2297e __delay(); WRITE(SWI2C_SCL, 0); 22982: 9f b7 in r25, 0x3f ; 63 22984: f8 94 cli 22986: e2 e0 ldi r30, 0x02 ; 2 22988: f1 e0 ldi r31, 0x01 ; 1 2298a: 80 81 ld r24, Z 2298c: 8b 7f andi r24, 0xFB ; 251 2298e: 80 83 st Z, r24 22990: 9f bf out 0x3f, r25 ; 63 22992: 88 e0 ldi r24, 0x08 ; 8 22994: 8a 95 dec r24 22996: f1 f7 brne .-4 ; 0x22994 __delay(); } 22998: 08 95 ret 0002299a : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 2299a: 0f 93 push r16 2299c: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2299e: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 229a2: 81 30 cpi r24, 0x01 ; 1 229a4: 19 f5 brne .+70 ; 0x229ec 229a6: 0f 94 01 0b call 0x21602 ; 0x21602 229aa: 00 91 7c 05 lds r16, 0x057C ; 0x80057c 229ae: 10 91 7d 05 lds r17, 0x057D ; 0x80057d 229b2: 20 91 7e 05 lds r18, 0x057E ; 0x80057e 229b6: 30 91 7f 05 lds r19, 0x057F ; 0x80057f 229ba: 60 1b sub r22, r16 229bc: 71 0b sbc r23, r17 229be: 82 0b sbc r24, r18 229c0: 93 0b sbc r25, r19 229c2: 28 ee ldi r18, 0xE8 ; 232 229c4: 33 e0 ldi r19, 0x03 ; 3 229c6: 40 e0 ldi r20, 0x00 ; 0 229c8: 50 e0 ldi r21, 0x00 ; 0 229ca: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 229ce: 60 91 78 05 lds r22, 0x0578 ; 0x800578 229d2: 70 91 79 05 lds r23, 0x0579 ; 0x800579 229d6: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 229da: 90 91 7b 05 lds r25, 0x057B ; 0x80057b 229de: 62 0f add r22, r18 229e0: 73 1f adc r23, r19 229e2: 84 1f adc r24, r20 229e4: 95 1f adc r25, r21 } 229e6: 1f 91 pop r17 229e8: 0f 91 pop r16 229ea: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 229ec: 60 91 0b 06 lds r22, 0x060B ; 0x80060b 229f0: 70 91 0c 06 lds r23, 0x060C ; 0x80060c 229f4: 80 91 0d 06 lds r24, 0x060D ; 0x80060d 229f8: 90 91 0e 06 lds r25, 0x060E ; 0x80060e 229fc: d6 cf rjmp .-84 ; 0x229aa 000229fe : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 229fe: 4f 92 push r4 22a00: 5f 92 push r5 22a02: 6f 92 push r6 22a04: 7f 92 push r7 22a06: 8f 92 push r8 22a08: 9f 92 push r9 22a0a: af 92 push r10 22a0c: bf 92 push r11 22a0e: cf 92 push r12 22a10: df 92 push r13 22a12: ef 92 push r14 22a14: ff 92 push r15 22a16: 0f 93 push r16 22a18: 1f 93 push r17 22a1a: cf 93 push r28 22a1c: df 93 push r29 22a1e: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 22a22: 0e 94 9b 66 call 0xcd36 ; 0xcd36 22a26: 88 23 and r24, r24 22a28: 09 f4 brne .+2 ; 0x22a2c 22a2a: 6e c0 rjmp .+220 ; 0x22b08 { const float _met = ((float)total_filament_used) / (100000.f); 22a2c: 60 91 17 06 lds r22, 0x0617 ; 0x800617 22a30: 70 91 18 06 lds r23, 0x0618 ; 0x800618 22a34: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22a38: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 22a3c: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 22a40: 20 e0 ldi r18, 0x00 ; 0 22a42: 30 e5 ldi r19, 0x50 ; 80 22a44: 43 ec ldi r20, 0xC3 ; 195 22a46: 57 e4 ldi r21, 0x47 ; 71 22a48: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 22a4c: 56 2e mov r5, r22 22a4e: 47 2e mov r4, r23 22a50: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 22a52: 0f 94 cd 14 call 0x2299a ; 0x2299a 22a56: 6b 01 movw r12, r22 22a58: 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(); 22a5a: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 lcd_printf_P(_N( 22a5e: 81 e9 ldi r24, 0x91 ; 145 22a60: 99 e5 ldi r25, 0x59 ; 89 22a62: 0e 94 95 75 call 0xeb2a ; 0xeb2a 22a66: 18 2f mov r17, r24 22a68: 09 2f mov r16, r25 22a6a: 81 e8 ldi r24, 0x81 ; 129 22a6c: 99 e5 ldi r25, 0x59 ; 89 22a6e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 22a72: 78 2e mov r7, r24 22a74: 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; 22a76: 8c e3 ldi r24, 0x3C ; 60 22a78: 88 2e mov r8, r24 22a7a: 91 2c mov r9, r1 22a7c: a1 2c mov r10, r1 22a7e: b1 2c mov r11, r1 22a80: c7 01 movw r24, r14 22a82: b6 01 movw r22, r12 22a84: a5 01 movw r20, r10 22a86: 94 01 movw r18, r8 22a88: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 22a8c: 7f 93 push r23 22a8e: 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; 22a90: ca 01 movw r24, r20 22a92: b9 01 movw r22, r18 22a94: a5 01 movw r20, r10 22a96: 94 01 movw r18, r8 22a98: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 22a9c: 7f 93 push r23 22a9e: 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; 22aa0: c7 01 movw r24, r14 22aa2: b6 01 movw r22, r12 22aa4: 20 e1 ldi r18, 0x10 ; 16 22aa6: 3e e0 ldi r19, 0x0E ; 14 22aa8: 40 e0 ldi r20, 0x00 ; 0 22aaa: 50 e0 ldi r21, 0x00 ; 0 22aac: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 22ab0: 5f 93 push r21 22ab2: 4f 93 push r20 22ab4: 3f 93 push r19 22ab6: 2f 93 push r18 22ab8: 0f 93 push r16 22aba: 1f 93 push r17 22abc: df 93 push r29 22abe: cf 93 push r28 22ac0: 4f 92 push r4 22ac2: 5f 92 push r5 22ac4: 6f 92 push r6 22ac6: 7f 92 push r7 22ac8: 85 ee ldi r24, 0xE5 ; 229 22aca: 9b e6 ldi r25, 0x6B ; 107 22acc: 9f 93 push r25 22ace: 8f 93 push r24 22ad0: 0e 94 66 6f call 0xdecc ; 0xdecc "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 22ad4: 8d b7 in r24, 0x3d ; 61 22ad6: 9e b7 in r25, 0x3e ; 62 22ad8: 42 96 adiw r24, 0x12 ; 18 22ada: 0f b6 in r0, 0x3f ; 63 22adc: f8 94 cli 22ade: 9e bf out 0x3e, r25 ; 62 22ae0: 0f be out 0x3f, r0 ; 63 22ae2: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 22ae4: df 91 pop r29 22ae6: cf 91 pop r28 22ae8: 1f 91 pop r17 22aea: 0f 91 pop r16 22aec: ff 90 pop r15 22aee: ef 90 pop r14 22af0: df 90 pop r13 22af2: cf 90 pop r12 22af4: bf 90 pop r11 22af6: af 90 pop r10 22af8: 9f 90 pop r9 22afa: 8f 90 pop r8 22afc: 7f 90 pop r7 22afe: 6f 90 pop r6 22b00: 5f 90 pop r5 22b02: 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(); 22b04: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 22b08: 81 ef ldi r24, 0xF1 ; 241 22b0a: 9f e0 ldi r25, 0x0F ; 15 22b0c: 0f 94 46 a4 call 0x3488c ; 0x3488c 22b10: 2b 01 movw r4, r22 22b12: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 22b14: 8d ee ldi r24, 0xED ; 237 22b16: 9f e0 ldi r25, 0x0F ; 15 22b18: 0f 94 46 a4 call 0x3488c ; 0x3488c 22b1c: 6b 01 movw r12, r22 22b1e: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 22b20: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 lcd_printf_P(_N( 22b24: 8e e6 ldi r24, 0x6E ; 110 22b26: 99 e5 ldi r25, 0x59 ; 89 22b28: 0e 94 95 75 call 0xeb2a ; 0xeb2a 22b2c: 98 2e mov r9, r24 22b2e: 89 2e mov r8, r25 22b30: 8d e5 ldi r24, 0x5D ; 93 22b32: 99 e5 ldi r25, 0x59 ; 89 22b34: 0e 94 95 75 call 0xeb2a ; 0xeb2a 22b38: b8 2e mov r11, r24 22b3a: 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; 22b3c: c7 01 movw r24, r14 22b3e: b6 01 movw r22, r12 22b40: 2c e3 ldi r18, 0x3C ; 60 22b42: 30 e0 ldi r19, 0x00 ; 0 22b44: 40 e0 ldi r20, 0x00 ; 0 22b46: 50 e0 ldi r21, 0x00 ; 0 22b48: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 22b4c: 7f 93 push r23 22b4e: 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; 22b50: ca 01 movw r24, r20 22b52: b9 01 movw r22, r18 22b54: 28 e1 ldi r18, 0x18 ; 24 22b56: 30 e0 ldi r19, 0x00 ; 0 22b58: 40 e0 ldi r20, 0x00 ; 0 22b5a: 50 e0 ldi r21, 0x00 ; 0 22b5c: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 22b60: 7f 93 push r23 22b62: 6f 93 push r22 uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 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; 22b64: c7 01 movw r24, r14 22b66: b6 01 movw r22, r12 22b68: 20 ea ldi r18, 0xA0 ; 160 22b6a: 35 e0 ldi r19, 0x05 ; 5 22b6c: 40 e0 ldi r20, 0x00 ; 0 22b6e: 50 e0 ldi r21, 0x00 ; 0 22b70: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 22b74: 5f 93 push r21 22b76: 4f 93 push r20 22b78: 3f 93 push r19 22b7a: 2f 93 push r18 22b7c: 8f 92 push r8 22b7e: 9f 92 push r9 { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 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; 22b80: c3 01 movw r24, r6 22b82: b2 01 movw r22, r4 22b84: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 22b88: 20 e0 ldi r18, 0x00 ; 0 22b8a: 30 e0 ldi r19, 0x00 ; 0 22b8c: 48 ec ldi r20, 0xC8 ; 200 22b8e: 52 e4 ldi r21, 0x42 ; 66 22b90: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 22b94: 9f 93 push r25 22b96: 8f 93 push r24 22b98: 7f 93 push r23 22b9a: 6f 93 push r22 22b9c: af 92 push r10 22b9e: bf 92 push r11 22ba0: 81 ec ldi r24, 0xC1 ; 193 22ba2: 9b e6 ldi r25, 0x6B ; 107 22ba4: 9f 93 push r25 22ba6: 8f 93 push r24 22ba8: 0e 94 66 6f call 0xdecc ; 0xdecc "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 22bac: 8d b7 in r24, 0x3d ; 61 22bae: 9e b7 in r25, 0x3e ; 62 22bb0: 42 96 adiw r24, 0x12 ; 18 22bb2: 0f b6 in r0, 0x3f ; 63 22bb4: f8 94 cli 22bb6: 9e bf out 0x3e, r25 ; 62 22bb8: 0f be out 0x3f, r0 ; 63 22bba: 8d bf out 0x3d, r24 ; 61 22bbc: 93 cf rjmp .-218 ; 0x22ae4 00022bbe : SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } static void prusa_statistics_case0(uint8_t statnr) { 22bbe: cf 93 push r28 22bc0: c8 2f mov r28, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 22bc2: 8b e7 ldi r24, 0x7B ; 123 22bc4: 0e 94 0c 7a call 0xf418 ; 0xf418 SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); 22bc8: 8c 2f mov r24, r28 22bca: 0f 94 e0 05 call 0x20bc0 ; 0x20bc0 prusa_stat_farm_number(); 22bce: 0f 94 93 05 call 0x20b26 ; 0x20b26 SERIAL_ECHO(current_temperature_bed); SERIAL_ECHO(']'); } static void prusa_stat_printinfo() { SERIAL_ECHOPGM("[TFU:"); 22bd2: 89 e1 ldi r24, 0x19 ; 25 22bd4: 9a e8 ldi r25, 0x8A ; 138 22bd6: 0e 94 1f 7b call 0xf63e ; 0xf63e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 22bda: 60 91 17 06 lds r22, 0x0617 ; 0x800617 22bde: 70 91 18 06 lds r23, 0x0618 ; 0x800618 22be2: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22be6: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 22bea: 4a e0 ldi r20, 0x0A ; 10 22bec: 0e 94 20 7a call 0xf440 ; 0xf440 SERIAL_ECHO(total_filament_used); SERIAL_ECHOPGM("][PCD:"); 22bf0: 82 e1 ldi r24, 0x12 ; 18 22bf2: 9a e8 ldi r25, 0x8A ; 138 22bf4: 0e 94 1f 7b call 0xf63e ; 0xf63e 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;}; 22bf8: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 22bfc: 88 23 and r24, r24 22bfe: 09 f4 brne .+2 ; 0x22c02 22c00: 5e c0 rjmp .+188 ; 0x22cbe 22c02: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 22c06: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 22c0a: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 22c0e: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 22c12: 00 97 sbiw r24, 0x00 ; 0 22c14: a1 05 cpc r26, r1 22c16: b1 05 cpc r27, r1 22c18: 09 f4 brne .+2 ; 0x22c1c 22c1a: 51 c0 rjmp .+162 ; 0x22cbe 22c1c: bc 01 movw r22, r24 22c1e: cd 01 movw r24, r26 22c20: 6d 59 subi r22, 0x9D ; 157 22c22: 7f 4f sbci r23, 0xFF ; 255 22c24: 8f 4f sbci r24, 0xFF ; 255 22c26: 9f 4f sbci r25, 0xFF ; 255 22c28: 24 e6 ldi r18, 0x64 ; 100 22c2a: 30 e0 ldi r19, 0x00 ; 0 22c2c: 40 e0 ldi r20, 0x00 ; 0 22c2e: 50 e0 ldi r21, 0x00 ; 0 22c30: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 22c34: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 22c38: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 22c3c: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 22c40: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 22c44: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 22c48: 62 2f mov r22, r18 22c4a: 70 e0 ldi r23, 0x00 ; 0 22c4c: 90 e0 ldi r25, 0x00 ; 0 22c4e: 80 e0 ldi r24, 0x00 ; 0 22c50: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_ECHO((int)card.percentDone()); SERIAL_ECHOPGM("][FEM:"); 22c54: 8b e0 ldi r24, 0x0B ; 11 22c56: 9a e8 ldi r25, 0x8A ; 138 22c58: 0e 94 1f 7b call 0xf63e ; 0xf63e 22c5c: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 22c60: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 22c64: 07 2e mov r0, r23 22c66: 00 0c add r0, r0 22c68: 88 0b sbc r24, r24 22c6a: 99 0b sbc r25, r25 22c6c: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_ECHO(feedmultiply); SERIAL_ECHOPGM("][FNM:"); 22c70: 84 e0 ldi r24, 0x04 ; 4 22c72: 9a e8 ldi r25, 0x8A ; 138 22c74: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHO(card.longFilename[0] ? card.longFilename : card.filename); 22c78: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 22c7c: 81 11 cpse r24, r1 22c7e: 21 c0 rjmp .+66 ; 0x22cc2 22c80: 89 ed ldi r24, 0xD9 ; 217 22c82: 93 e1 ldi r25, 0x13 ; 19 } }*/ static FORCE_INLINE void print(const char *str) { write(str); 22c84: 0e 94 11 86 call 0x10c22 ; 0x10c22 SERIAL_ECHOPGM("][TIM:"); 22c88: 8d ef ldi r24, 0xFD ; 253 22c8a: 99 e8 ldi r25, 0x89 ; 137 22c8c: 0e 94 1f 7b call 0xf63e ; 0xf63e if (print_job_timer.isRunning()) { 22c90: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 22c94: 81 30 cpi r24, 0x01 ; 1 22c96: c1 f4 brne .+48 ; 0x22cc8 SERIAL_ECHO(print_job_timer.duration()); 22c98: 0f 94 cd 14 call 0x2299a ; 0x2299a } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 22c9c: 4a e0 ldi r20, 0x0A ; 10 22c9e: 0e 94 20 7a call 0xf440 ; 0xf440 } else { SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); 22ca2: 86 ef ldi r24, 0xF6 ; 246 22ca4: 99 e8 ldi r25, 0x89 ; 137 22ca6: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(FW_VERSION_STR_P()); 22caa: 8f ee ldi r24, 0xEF ; 239 22cac: 99 e8 ldi r25, 0x89 ; 137 22cae: 0e 94 1f 7b call 0xf63e ; 0xf63e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 22cb2: 8d e5 ldi r24, 0x5D ; 93 22cb4: 0e 94 0c 7a call 0xf418 ; 0xf418 static void prusa_statistics_case0(uint8_t statnr) { SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } 22cb8: cf 91 pop r28 SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); SERIAL_ECHORPGM(FW_VERSION_STR_P()); SERIAL_ECHO(']'); prusa_stat_diameter(); 22cba: 0d 94 fc 05 jmp 0x20bf8 ; 0x20bf8 22cbe: 20 e0 ldi r18, 0x00 ; 0 22cc0: c3 cf rjmp .-122 ; 0x22c48 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); 22cc2: 8e ee ldi r24, 0xEE ; 238 22cc4: 93 e1 ldi r25, 0x13 ; 19 22cc6: de cf rjmp .-68 ; 0x22c84 22cc8: 60 e0 ldi r22, 0x00 ; 0 22cca: 70 e0 ldi r23, 0x00 ; 0 22ccc: cb 01 movw r24, r22 22cce: 0e 94 85 7a call 0xf50a ; 0xf50a 22cd2: e7 cf rjmp .-50 ; 0x22ca2 00022cd4 : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 22cd4: 10 92 8b 03 sts 0x038B, r1 ; 0x80038b startTimestamp = 0; 22cd8: 10 92 7c 05 sts 0x057C, r1 ; 0x80057c 22cdc: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d 22ce0: 10 92 7e 05 sts 0x057E, r1 ; 0x80057e 22ce4: 10 92 7f 05 sts 0x057F, r1 ; 0x80057f stopTimestamp = 0; 22ce8: 10 92 0b 06 sts 0x060B, r1 ; 0x80060b 22cec: 10 92 0c 06 sts 0x060C, r1 ; 0x80060c 22cf0: 10 92 0d 06 sts 0x060D, r1 ; 0x80060d 22cf4: 10 92 0e 06 sts 0x060E, r1 ; 0x80060e accumulator = 0; 22cf8: 10 92 78 05 sts 0x0578, r1 ; 0x800578 22cfc: 10 92 79 05 sts 0x0579, r1 ; 0x800579 22d00: 10 92 7a 05 sts 0x057A, r1 ; 0x80057a 22d04: 10 92 7b 05 sts 0x057B, r1 ; 0x80057b } 22d08: 08 95 ret 00022d0a : /** * @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; } 22d0a: 80 91 8b 03 lds r24, 0x038B ; 0x80038b } else return false; } bool Stopwatch::start() { if (!isRunning()) { 22d0e: 81 30 cpi r24, 0x01 ; 1 22d10: f1 f0 breq .+60 ; 0x22d4e if (isPaused()) accumulator = duration(); 22d12: 82 30 cpi r24, 0x02 ; 2 22d14: c9 f4 brne .+50 ; 0x22d48 22d16: 0f 94 cd 14 call 0x2299a ; 0x2299a 22d1a: 60 93 78 05 sts 0x0578, r22 ; 0x800578 22d1e: 70 93 79 05 sts 0x0579, r23 ; 0x800579 22d22: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a 22d26: 90 93 7b 05 sts 0x057B, r25 ; 0x80057b else reset(); state = RUNNING; 22d2a: 81 e0 ldi r24, 0x01 ; 1 22d2c: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b startTimestamp = _millis(); 22d30: 0f 94 01 0b call 0x21602 ; 0x21602 22d34: 60 93 7c 05 sts 0x057C, r22 ; 0x80057c 22d38: 70 93 7d 05 sts 0x057D, r23 ; 0x80057d 22d3c: 80 93 7e 05 sts 0x057E, r24 ; 0x80057e 22d40: 90 93 7f 05 sts 0x057F, r25 ; 0x80057f 22d44: 81 e0 ldi r24, 0x01 ; 1 22d46: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 22d48: 0f 94 6a 16 call 0x22cd4 ; 0x22cd4 22d4c: ee cf rjmp .-36 ; 0x22d2a state = RUNNING; startTimestamp = _millis(); return true; } else return false; 22d4e: 80 e0 ldi r24, 0x00 ; 0 } 22d50: 08 95 ret 00022d52 : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 22d52: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 22d56: 81 50 subi r24, 0x01 ; 1 22d58: 82 30 cpi r24, 0x02 ; 2 22d5a: 70 f4 brcc .+28 ; 0x22d78 state = STOPPED; 22d5c: 10 92 8b 03 sts 0x038B, r1 ; 0x80038b stopTimestamp = _millis(); 22d60: 0f 94 01 0b call 0x21602 ; 0x21602 22d64: 60 93 0b 06 sts 0x060B, r22 ; 0x80060b 22d68: 70 93 0c 06 sts 0x060C, r23 ; 0x80060c 22d6c: 80 93 0d 06 sts 0x060D, r24 ; 0x80060d 22d70: 90 93 0e 06 sts 0x060E, r25 ; 0x80060e 22d74: 81 e0 ldi r24, 0x01 ; 1 22d76: 08 95 ret return true; } else return false; 22d78: 80 e0 ldi r24, 0x00 ; 0 } 22d7a: 08 95 ret 00022d7c : #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); 22d7c: 2f ef ldi r18, 0xFF ; 255 22d7e: 30 e0 ldi r19, 0x00 ; 0 22d80: dc 01 movw r26, r24 22d82: 0f 94 5e a5 call 0x34abc ; 0x34abc <__usmulhisi3> 22d86: 20 ed ldi r18, 0xD0 ; 208 22d88: 37 e0 ldi r19, 0x07 ; 7 22d8a: 40 e0 ldi r20, 0x00 ; 0 22d8c: 50 e0 ldi r21, 0x00 ; 0 22d8e: 0f 94 2f a5 call 0x34a5e ; 0x34a5e <__divmodsi4> 22d92: b9 01 movw r22, r18 22d94: 8c e2 ldi r24, 0x2C ; 44 22d96: 0c 94 59 d1 jmp 0x1a2b2 ; 0x1a2b2 00022d9a : case 16: microstep_ms(driver,MICROSTEP16); break; } } void microstep_readings() { 22d9a: cf 93 push r28 22d9c: df 93 push r29 SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); 22d9e: 88 ea ldi r24, 0xA8 ; 168 22da0: 94 e9 ldi r25, 0x94 ; 148 22da2: 0e 94 18 7d call 0xfa30 ; 0xfa30 SERIAL_PROTOCOLPGM("X: "); 22da6: 84 ea ldi r24, 0xA4 ; 164 22da8: 94 e9 ldi r25, 0x94 ; 148 22daa: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOL( READ(X_MS1_PIN)); 22dae: 62 b3 in r22, 0x12 ; 18 22db0: 66 95 lsr r22 22db2: 61 70 andi r22, 0x01 ; 1 22db4: 70 e0 ldi r23, 0x00 ; 0 22db6: 90 e0 ldi r25, 0x00 ; 0 22db8: 80 e0 ldi r24, 0x00 ; 0 22dba: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOLLN( READ(X_MS2_PIN)); 22dbe: 82 b3 in r24, 0x12 ; 18 22dc0: 81 70 andi r24, 0x01 ; 1 22dc2: 90 e0 ldi r25, 0x00 ; 0 22dc4: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a SERIAL_PROTOCOLPGM("Y: "); 22dc8: 80 ea ldi r24, 0xA0 ; 160 22dca: 94 e9 ldi r25, 0x94 ; 148 22dcc: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOL( READ(Y_MS1_PIN)); 22dd0: c6 e0 ldi r28, 0x06 ; 6 22dd2: d1 e0 ldi r29, 0x01 ; 1 22dd4: 68 81 ld r22, Y 22dd6: 06 2e mov r0, r22 22dd8: 00 0c add r0, r0 22dda: 77 0b sbc r23, r23 22ddc: 88 0b sbc r24, r24 22dde: 99 0b sbc r25, r25 22de0: 66 27 eor r22, r22 22de2: 97 fd sbrc r25, 7 22de4: 63 95 inc r22 22de6: 77 27 eor r23, r23 22de8: 88 27 eor r24, r24 22dea: 99 27 eor r25, r25 22dec: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOLLN( READ(Y_MS2_PIN)); 22df0: 82 b3 in r24, 0x12 ; 18 22df2: 82 fb bst r24, 2 22df4: 88 27 eor r24, r24 22df6: 80 f9 bld r24, 0 22df8: 90 e0 ldi r25, 0x00 ; 0 22dfa: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a SERIAL_PROTOCOLPGM("Z: "); 22dfe: 8c e9 ldi r24, 0x9C ; 156 22e00: 94 e9 ldi r25, 0x94 ; 148 22e02: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOL( READ(Z_MS1_PIN)); 22e06: 68 81 ld r22, Y 22e08: 66 fb bst r22, 6 22e0a: 66 27 eor r22, r22 22e0c: 60 f9 bld r22, 0 22e0e: 70 e0 ldi r23, 0x00 ; 0 22e10: 90 e0 ldi r25, 0x00 ; 0 22e12: 80 e0 ldi r24, 0x00 ; 0 22e14: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOLLN( READ(Z_MS2_PIN)); 22e18: 88 81 ld r24, Y 22e1a: 85 fb bst r24, 5 22e1c: 88 27 eor r24, r24 22e1e: 80 f9 bld r24, 0 22e20: 90 e0 ldi r25, 0x00 ; 0 22e22: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a SERIAL_PROTOCOLPGM("E0: "); 22e26: 87 e9 ldi r24, 0x97 ; 151 22e28: 94 e9 ldi r25, 0x94 ; 148 22e2a: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOL( READ(E0_MS1_PIN)); 22e2e: 68 81 ld r22, Y 22e30: 63 fb bst r22, 3 22e32: 66 27 eor r22, r22 22e34: 60 f9 bld r22, 0 22e36: 70 e0 ldi r23, 0x00 ; 0 22e38: 90 e0 ldi r25, 0x00 ; 0 22e3a: 80 e0 ldi r24, 0x00 ; 0 22e3c: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOLLN( READ(E0_MS2_PIN)); 22e40: 88 81 ld r24, Y 22e42: 82 95 swap r24 22e44: 81 70 andi r24, 0x01 ; 1 22e46: 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 } 22e48: df 91 pop r29 22e4a: 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)); 22e4c: 0d 94 35 65 jmp 0x2ca6a ; 0x2ca6a 00022e50 : #endif } void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) 22e50: 67 fd sbrc r22, 7 22e52: 08 c0 rjmp .+16 ; 0x22e64 22e54: 81 30 cpi r24, 0x01 ; 1 22e56: 21 f1 breq .+72 ; 0x22ea0 22e58: d8 f0 brcs .+54 ; 0x22e90 22e5a: 82 30 cpi r24, 0x02 ; 2 22e5c: 99 f1 breq .+102 ; 0x22ec4 22e5e: 83 30 cpi r24, 0x03 ; 3 22e60: 09 f4 brne .+2 ; 0x22e64 22e62: 42 c0 rjmp .+132 ; 0x22ee8 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) 22e64: 47 fd sbrc r20, 7 22e66: 4c c0 rjmp .+152 ; 0x22f00 22e68: 81 30 cpi r24, 0x01 ; 1 22e6a: 09 f4 brne .+2 ; 0x22e6e 22e6c: 55 c0 rjmp .+170 ; 0x22f18 22e6e: 08 f4 brcc .+2 ; 0x22e72 22e70: 4d c0 rjmp .+154 ; 0x22f0c 22e72: 82 30 cpi r24, 0x02 ; 2 22e74: 09 f4 brne .+2 ; 0x22e78 22e76: 56 c0 rjmp .+172 ; 0x22f24 22e78: 83 30 cpi r24, 0x03 ; 3 22e7a: 09 f0 breq .+2 ; 0x22e7e 22e7c: 41 c0 rjmp .+130 ; 0x22f00 { 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; 22e7e: 9f b7 in r25, 0x3f ; 63 22e80: 44 23 and r20, r20 22e82: 09 f4 brne .+2 ; 0x22e86 22e84: 5f c0 rjmp .+190 ; 0x22f44 22e86: f8 94 cli 22e88: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22e8c: 80 61 ori r24, 0x10 ; 16 22e8e: 51 c0 rjmp .+162 ; 0x22f32 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; 22e90: 66 23 and r22, r22 22e92: 21 f0 breq .+8 ; 0x22e9c 22e94: 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) 22e96: 47 ff sbrs r20, 7 22e98: 39 c0 rjmp .+114 ; 0x22f0c 22e9a: 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; 22e9c: a1 98 cbi 0x14, 1 ; 20 22e9e: fb cf rjmp .-10 ; 0x22e96 case 1: WRITE( Y_MS1_PIN,ms1); break; 22ea0: 9f b7 in r25, 0x3f ; 63 22ea2: 66 23 and r22, r22 22ea4: 51 f0 breq .+20 ; 0x22eba 22ea6: f8 94 cli 22ea8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22eac: 80 68 ori r24, 0x80 ; 128 22eae: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22eb2: 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) 22eb4: 47 ff sbrs r20, 7 22eb6: 30 c0 rjmp .+96 ; 0x22f18 22eb8: 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; 22eba: f8 94 cli 22ebc: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22ec0: 8f 77 andi r24, 0x7F ; 127 22ec2: f5 cf rjmp .-22 ; 0x22eae case 2: WRITE( Z_MS1_PIN,ms1); break; 22ec4: 9f b7 in r25, 0x3f ; 63 22ec6: 66 23 and r22, r22 22ec8: 51 f0 breq .+20 ; 0x22ede 22eca: f8 94 cli 22ecc: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22ed0: 80 64 ori r24, 0x40 ; 64 22ed2: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22ed6: 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) 22ed8: 47 ff sbrs r20, 7 22eda: 24 c0 rjmp .+72 ; 0x22f24 22edc: 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; 22ede: f8 94 cli 22ee0: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22ee4: 8f 7b andi r24, 0xBF ; 191 22ee6: f5 cf rjmp .-22 ; 0x22ed2 case 3: WRITE(E0_MS1_PIN,ms1); break; 22ee8: 9f b7 in r25, 0x3f ; 63 22eea: 66 23 and r22, r22 22eec: 51 f0 breq .+20 ; 0x22f02 22eee: f8 94 cli 22ef0: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22ef4: 88 60 ori r24, 0x08 ; 8 22ef6: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22efa: 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) 22efc: 47 ff sbrs r20, 7 22efe: bf cf rjmp .-130 ; 0x22e7e 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 } } 22f00: 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; 22f02: f8 94 cli 22f04: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f08: 87 7f andi r24, 0xF7 ; 247 22f0a: f5 cf rjmp .-22 ; 0x22ef6 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) { case 0: WRITE( X_MS2_PIN,ms2); break; 22f0c: 44 23 and r20, r20 22f0e: 11 f0 breq .+4 ; 0x22f14 22f10: a0 9a sbi 0x14, 0 ; 20 22f12: 08 95 ret 22f14: a0 98 cbi 0x14, 0 ; 20 22f16: 08 95 ret case 1: WRITE( Y_MS2_PIN,ms2); break; 22f18: 44 23 and r20, r20 22f1a: 11 f0 breq .+4 ; 0x22f20 22f1c: a2 9a sbi 0x14, 2 ; 20 22f1e: 08 95 ret 22f20: a2 98 cbi 0x14, 2 ; 20 22f22: 08 95 ret case 2: WRITE( Z_MS2_PIN,ms2); break; 22f24: 9f b7 in r25, 0x3f ; 63 22f26: 44 23 and r20, r20 22f28: 41 f0 breq .+16 ; 0x22f3a 22f2a: f8 94 cli 22f2c: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f30: 80 62 ori r24, 0x20 ; 32 22f32: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f36: 9f bf out 0x3f, r25 ; 63 22f38: 08 95 ret 22f3a: f8 94 cli 22f3c: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f40: 8f 7d andi r24, 0xDF ; 223 22f42: f7 cf rjmp .-18 ; 0x22f32 case 3: WRITE(E0_MS2_PIN,ms2); break; 22f44: f8 94 cli 22f46: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f4a: 8f 7e andi r24, 0xEF ; 239 22f4c: f2 cf rjmp .-28 ; 0x22f32 00022f4e : } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 22f4e: 64 30 cpi r22, 0x04 ; 4 22f50: 81 f0 breq .+32 ; 0x22f72 22f52: 30 f4 brcc .+12 ; 0x22f60 22f54: 61 30 cpi r22, 0x01 ; 1 22f56: 49 f0 breq .+18 ; 0x22f6a { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; 22f58: 40 e0 ldi r20, 0x00 ; 0 } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 22f5a: 62 30 cpi r22, 0x02 ; 2 22f5c: 69 f0 breq .+26 ; 0x22f78 22f5e: 08 95 ret 22f60: 68 30 cpi r22, 0x08 ; 8 22f62: 49 f0 breq .+18 ; 0x22f76 22f64: 60 31 cpi r22, 0x10 ; 16 22f66: 39 f0 breq .+14 ; 0x22f76 22f68: 08 95 ret { case 1: microstep_ms(driver,MICROSTEP1); break; 22f6a: 40 e0 ldi r20, 0x00 ; 0 case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 22f6c: 60 e0 ldi r22, 0x00 ; 0 case 8: microstep_ms(driver,MICROSTEP8); break; 22f6e: 0d 94 28 17 jmp 0x22e50 ; 0x22e50 { switch(stepping_mode) { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 22f72: 41 e0 ldi r20, 0x01 ; 1 22f74: fb cf rjmp .-10 ; 0x22f6c case 8: microstep_ms(driver,MICROSTEP8); break; 22f76: 41 e0 ldi r20, 0x01 ; 1 22f78: 61 e0 ldi r22, 0x01 ; 1 22f7a: f9 cf rjmp .-14 ; 0x22f6e 00022f7c : #endif } #ifdef MOTOR_CURRENT_PWM_XY_PIN void st_current_set(uint8_t driver, int current) { 22f7c: db 01 movw r26, r22 if (driver == 0) analogWrite(MOTOR_CURRENT_PWM_XY_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 22f7e: 81 11 cpse r24, r1 22f80: 0e c0 rjmp .+28 ; 0x22f9e 22f82: 2f ef ldi r18, 0xFF ; 255 22f84: 30 e0 ldi r19, 0x00 ; 0 22f86: 0f 94 5e a5 call 0x34abc ; 0x34abc <__usmulhisi3> 22f8a: 20 ed ldi r18, 0xD0 ; 208 22f8c: 37 e0 ldi r19, 0x07 ; 7 22f8e: 40 e0 ldi r20, 0x00 ; 0 22f90: 50 e0 ldi r21, 0x00 ; 0 22f92: 0f 94 2f a5 call 0x34a5e ; 0x34a5e <__divmodsi4> 22f96: b9 01 movw r22, r18 22f98: 8e e2 ldi r24, 0x2E ; 46 if (driver == 1) analogWrite(MOTOR_CURRENT_PWM_Z_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 22f9a: 0c 94 59 d1 jmp 0x1a2b2 ; 0x1a2b2 22f9e: 81 30 cpi r24, 0x01 ; 1 22fa0: 69 f4 brne .+26 ; 0x22fbc 22fa2: 2f ef ldi r18, 0xFF ; 255 22fa4: 30 e0 ldi r19, 0x00 ; 0 22fa6: 0f 94 5e a5 call 0x34abc ; 0x34abc <__usmulhisi3> 22faa: 20 ed ldi r18, 0xD0 ; 208 22fac: 37 e0 ldi r19, 0x07 ; 7 22fae: 40 e0 ldi r20, 0x00 ; 0 22fb0: 50 e0 ldi r21, 0x00 ; 0 22fb2: 0f 94 2f a5 call 0x34a5e ; 0x34a5e <__divmodsi4> 22fb6: b9 01 movw r22, r18 22fb8: 8d e2 ldi r24, 0x2D ; 45 22fba: ef cf rjmp .-34 ; 0x22f9a if (driver == 2) analogWrite(MOTOR_CURRENT_PWM_E_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 22fbc: 82 30 cpi r24, 0x02 ; 2 22fbe: 19 f4 brne .+6 ; 0x22fc6 22fc0: cb 01 movw r24, r22 22fc2: 0d 94 be 16 jmp 0x22d7c ; 0x22d7c } 22fc6: 08 95 ret 00022fc8 : #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); 22fc8: 8f ef ldi r24, 0xFF ; 255 22fca: 9f e0 ldi r25, 0x0F ; 15 22fcc: 0f 94 3e a4 call 0x3487c ; 0x3487c SilentModeMenu = SilentMode; 22fd0: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN); 22fd4: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 22fd8: 98 60 ori r25, 0x08 ; 8 22fda: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_Z_PIN); 22fde: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 22fe2: 90 61 ori r25, 0x10 ; 16 22fe4: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN); 22fe8: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 22fec: 90 62 ori r25, 0x20 ; 32 22fee: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> if((SilentMode == SILENT_MODE_OFF) || (farm_mode) ){ 22ff2: 88 23 and r24, r24 22ff4: 21 f0 breq .+8 ; 0x22ffe 22ff6: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 22ffa: 88 23 and r24, r24 22ffc: 59 f1 breq .+86 ; 0x23054 motor_current_setting[0] = motor_current_setting_loud[0]; 22ffe: 8c e1 ldi r24, 0x1C ; 28 23000: 92 e0 ldi r25, 0x02 ; 2 23002: 90 93 60 02 sts 0x0260, r25 ; 0x800260 23006: 80 93 5f 02 sts 0x025F, r24 ; 0x80025f motor_current_setting[1] = motor_current_setting_loud[1]; 2300a: 8e e3 ldi r24, 0x3E ; 62 2300c: 93 e0 ldi r25, 0x03 ; 3 2300e: 90 93 62 02 sts 0x0262, r25 ; 0x800262 23012: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[2] = motor_current_setting_loud[2]; 23016: 84 ef ldi r24, 0xF4 ; 244 23018: 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]; 2301a: 90 93 64 02 sts 0x0264, r25 ; 0x800264 2301e: 80 93 63 02 sts 0x0263, r24 ; 0x800263 } st_current_set(0, motor_current_setting[0]); 23022: 60 91 5f 02 lds r22, 0x025F ; 0x80025f 23026: 70 91 60 02 lds r23, 0x0260 ; 0x800260 2302a: 80 e0 ldi r24, 0x00 ; 0 2302c: 0f 94 be 17 call 0x22f7c ; 0x22f7c st_current_set(1, motor_current_setting[1]); 23030: 6e e3 ldi r22, 0x3E ; 62 23032: 73 e0 ldi r23, 0x03 ; 3 23034: 81 e0 ldi r24, 0x01 ; 1 23036: 0f 94 be 17 call 0x22f7c ; 0x22f7c 2303a: 80 91 63 02 lds r24, 0x0263 ; 0x800263 2303e: 90 91 64 02 lds r25, 0x0264 ; 0x800264 23042: 0f 94 be 16 call 0x22d7c ; 0x22d7c 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); 23046: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 2304a: 88 7f andi r24, 0xF8 ; 248 2304c: 81 60 ori r24, 0x01 ; 1 2304e: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> #endif } 23052: 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]; 23054: 8e e0 ldi r24, 0x0E ; 14 23056: 91 e0 ldi r25, 0x01 ; 1 23058: 90 93 60 02 sts 0x0260, r25 ; 0x800260 2305c: 80 93 5f 02 sts 0x025F, r24 ; 0x80025f motor_current_setting[1] = motor_current_setting_silent[1]; 23060: 8e e3 ldi r24, 0x3E ; 62 23062: 93 e0 ldi r25, 0x03 ; 3 23064: 90 93 62 02 sts 0x0262, r25 ; 0x800262 23068: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[2] = motor_current_setting_silent[2]; 2306c: 82 ec ldi r24, 0xC2 ; 194 2306e: 91 e0 ldi r25, 0x01 ; 1 23070: d4 cf rjmp .-88 ; 0x2301a 00023072 : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 23072: 2f b7 in r18, 0x3f ; 63 23074: f8 94 cli count_pos = count_position[axis]; 23076: 94 e0 ldi r25, 0x04 ; 4 23078: 89 9f mul r24, r25 2307a: f0 01 movw r30, r0 2307c: 11 24 eor r1, r1 2307e: e4 5b subi r30, 0xB4 ; 180 23080: f9 4f sbci r31, 0xF9 ; 249 23082: 60 81 ld r22, Z 23084: 71 81 ldd r23, Z+1 ; 0x01 23086: 82 81 ldd r24, Z+2 ; 0x02 23088: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 2308a: 2f bf out 0x3f, r18 ; 63 return count_pos; } 2308c: 08 95 ret 0002308e : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 2308e: cf 93 push r28 23090: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 23092: 0f 94 39 18 call 0x23072 ; 0x23072 23096: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 2309a: 24 e0 ldi r18, 0x04 ; 4 2309c: c2 9f mul r28, r18 2309e: f0 01 movw r30, r0 230a0: 11 24 eor r1, r1 230a2: e5 59 subi r30, 0x95 ; 149 230a4: f2 4f sbci r31, 0xF2 ; 242 230a6: 20 81 ld r18, Z 230a8: 31 81 ldd r19, Z+1 ; 0x01 230aa: 42 81 ldd r20, Z+2 ; 0x02 230ac: 53 81 ldd r21, Z+3 ; 0x03 230ae: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> } 230b2: cf 91 pop r28 230b4: 08 95 ret 000230b6 : 230b6: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 230ba: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f // Block until all buffered steps are executed void st_synchronize() { while(blocks_queued()) 230be: 98 17 cp r25, r24 230c0: 29 f0 breq .+10 ; 0x230cc manage_inactivity(true); lcd_update(0); } #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); 230c2: 90 e0 ldi r25, 0x00 ; 0 230c4: 80 e0 ldi r24, 0x00 ; 0 230c6: 0e 94 0a 8d call 0x11a14 ; 0x11a14 230ca: f5 cf rjmp .-22 ; 0x230b6 #endif //TMC2130 } } 230cc: 08 95 ret 000230ce : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 230ce: cf 92 push r12 230d0: ef 92 push r14 230d2: ff 92 push r15 230d4: 0f 93 push r16 230d6: 1f 93 push r17 230d8: cf 93 push r28 230da: df 93 push r29 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), 8); 230dc: 88 e0 ldi r24, 0x08 ; 8 230de: 99 e5 ldi r25, 0x59 ; 89 230e0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 230e4: 7c 01 movw r14, r24 230e6: 88 ea ldi r24, 0xA8 ; 168 230e8: 98 e4 ldi r25, 0x48 ; 72 230ea: 0e 94 95 75 call 0xeb2a ; 0xeb2a 230ee: 8c 01 movw r16, r24 230f0: 82 ea ldi r24, 0xA2 ; 162 230f2: 98 e4 ldi r25, 0x48 ; 72 230f4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 230f8: ec 01 movw r28, r24 230fa: 8d ed ldi r24, 0xDD ; 221 230fc: 98 e5 ldi r25, 0x58 ; 88 230fe: 0e 94 95 75 call 0xeb2a ; 0xeb2a 23102: 28 e0 ldi r18, 0x08 ; 8 23104: c2 2e mov r12, r18 23106: 9e 01 movw r18, r28 23108: 40 e0 ldi r20, 0x00 ; 0 2310a: 60 e0 ldi r22, 0x00 ; 0 2310c: 0e 94 8f e2 call 0x1c51e ; 0x1c51e while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 23110: 81 30 cpi r24, 0x01 ; 1 23112: 29 f4 brne .+10 ; 0x2311e load_filament_final_feed(); 23114: 0e 94 48 64 call 0xc890 ; 0xc890 st_synchronize(); 23118: 0f 94 5b 18 call 0x230b6 ; 0x230b6 2311c: df cf rjmp .-66 ; 0x230dc 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), 8); } if (clean == LCD_RIGHT_BUTTON_CHOICE) { 2311e: 82 30 cpi r24, 0x02 ; 2 23120: 61 f4 brne .+24 ; 0x2313a unload_filament(FILAMENTCHANGE_FINALRETRACT); 23122: 60 e0 ldi r22, 0x00 ; 0 23124: 70 e0 ldi r23, 0x00 ; 0 23126: cb 01 movw r24, r22 } } 23128: df 91 pop r29 2312a: cf 91 pop r28 2312c: 1f 91 pop r17 2312e: 0f 91 pop r16 23130: ff 90 pop r15 23132: ef 90 pop r14 23134: 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), 8); } if (clean == LCD_RIGHT_BUTTON_CHOICE) { unload_filament(FILAMENTCHANGE_FINALRETRACT); 23136: 0c 94 69 e1 jmp 0x1c2d2 ; 0x1c2d2 } } 2313a: df 91 pop r29 2313c: cf 91 pop r28 2313e: 1f 91 pop r17 23140: 0f 91 pop r16 23142: ff 90 pop r15 23144: ef 90 pop r14 23146: cf 90 pop r12 23148: 08 95 ret 0002314a : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 2314a: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 2314c: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 23150: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 23154: 80 ed ldi r24, 0xD0 ; 208 23156: 97 e0 ldi r25, 0x07 ; 7 23158: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2315c: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 23160: 10 92 4f 04 sts 0x044F, r1 ; 0x80044f <_ZL11nextMainISR.lto_priv.437+0x1> 23164: 10 92 4e 04 sts 0x044E, r1 ; 0x80044e <_ZL11nextMainISR.lto_priv.437> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 23168: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> 2316c: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 23170: 01 97 sbiw r24, 0x01 ; 1 23172: 8e 3f cpi r24, 0xFE ; 254 23174: 9f 4f sbci r25, 0xFF ; 255 23176: 20 f4 brcc .+8 ; 0x23180 nextAdvanceISR = 0; 23178: 10 92 4d 04 sts 0x044D, r1 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 2317c: 10 92 4c 04 sts 0x044C, r1 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> #endif } 23180: 08 95 ret 00023182 <__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) { 23182: 1f 92 push r1 23184: 0f 92 push r0 23186: 0f b6 in r0, 0x3f ; 63 23188: 0f 92 push r0 2318a: 11 24 eor r1, r1 2318c: 0b b6 in r0, 0x3b ; 59 2318e: 0f 92 push r0 23190: 4f 92 push r4 23192: 5f 92 push r5 23194: 6f 92 push r6 23196: 7f 92 push r7 23198: 8f 92 push r8 2319a: cf 92 push r12 2319c: df 92 push r13 2319e: ef 92 push r14 231a0: ff 92 push r15 231a2: 1f 93 push r17 231a4: 2f 93 push r18 231a6: 3f 93 push r19 231a8: 4f 93 push r20 231aa: 5f 93 push r21 231ac: 6f 93 push r22 231ae: 7f 93 push r23 231b0: 8f 93 push r24 231b2: 9f 93 push r25 231b4: af 93 push r26 231b6: bf 93 push r27 231b8: cf 93 push r28 231ba: df 93 push r29 231bc: ef 93 push r30 231be: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 231c0: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> 231c4: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 231c8: 9c 01 movw r18, r24 231ca: 21 50 subi r18, 0x01 ; 1 231cc: 31 09 sbc r19, r1 231ce: 2e 3f cpi r18, 0xFE ; 254 231d0: 3f 4f sbci r19, 0xFF ; 255 231d2: 90 f4 brcc .+36 ; 0x231f8 <__vector_17+0x76> { if(nextAdvanceISR > OCR1A) 231d4: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 231d8: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 231dc: 28 17 cp r18, r24 231de: 39 07 cpc r19, r25 231e0: 08 f0 brcs .+2 ; 0x231e4 <__vector_17+0x62> 231e2: f9 c0 rjmp .+498 ; 0x233d6 <__vector_17+0x254> nextAdvanceISR -= OCR1A; 231e4: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 231e8: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 231ec: 82 1b sub r24, r18 231ee: 93 0b sbc r25, r19 231f0: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 231f4: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 231f8: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 231fc: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 23200: 80 91 4e 04 lds r24, 0x044E ; 0x80044e <_ZL11nextMainISR.lto_priv.437> 23204: 90 91 4f 04 lds r25, 0x044F ; 0x80044f <_ZL11nextMainISR.lto_priv.437+0x1> 23208: 28 17 cp r18, r24 2320a: 39 07 cpc r19, r25 2320c: 08 f0 brcs .+2 ; 0x23210 <__vector_17+0x8e> 2320e: e8 c0 rjmp .+464 ; 0x233e0 <__vector_17+0x25e> nextMainISR -= OCR1A; 23210: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 23214: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 23218: 82 1b sub r24, r18 2321a: 93 0b sbc r25, r19 2321c: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.437+0x1> 23220: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.437> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 23224: 80 91 4e 04 lds r24, 0x044E ; 0x80044e <_ZL11nextMainISR.lto_priv.437> 23228: 90 91 4f 04 lds r25, 0x044F ; 0x80044f <_ZL11nextMainISR.lto_priv.437+0x1> 2322c: 89 2b or r24, r25 2322e: 11 f0 breq .+4 ; 0x23234 <__vector_17+0xb2> 23230: 0d 94 ac 21 jmp 0x24358 ; 0x24358 <__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) 23234: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23238: f0 91 52 12 lds r31, 0x1252 ; 0x801252 2323c: 30 97 sbiw r30, 0x00 ; 0 2323e: 09 f0 breq .+2 ; 0x23242 <__vector_17+0xc0> 23240: 82 c1 rjmp .+772 ; 0x23546 <__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) { 23242: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 23246: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 2324a: 98 17 cp r25, r24 2324c: 09 f4 brne .+2 ; 0x23250 <__vector_17+0xce> 2324e: 35 c3 rjmp .+1642 ; 0x238ba <__vector_17+0x738> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 23250: c0 91 3f 0d lds r28, 0x0D3F ; 0x800d3f 23254: 2c 2f mov r18, r28 23256: 30 e0 ldi r19, 0x00 ; 0 23258: 5e e6 ldi r21, 0x6E ; 110 2325a: c5 9f mul r28, r21 2325c: e0 01 movw r28, r0 2325e: 11 24 eor r1, r1 23260: c2 5a subi r28, 0xA2 ; 162 23262: d9 4f sbci r29, 0xF9 ; 249 block->busy = true; 23264: fe 01 movw r30, r28 23266: e9 5b subi r30, 0xB9 ; 185 23268: ff 4f sbci r31, 0xFF ; 255 2326a: 41 e0 ldi r20, 0x01 ; 1 2326c: 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(); 2326e: d0 93 52 12 sts 0x1252, r29 ; 0x801252 23272: c0 93 51 12 sts 0x1251, r28 ; 0x801251 if (current_block != NULL) { 23276: 20 97 sbiw r28, 0x00 ; 0 23278: 09 f4 brne .+2 ; 0x2327c <__vector_17+0xfa> 2327a: 1f c3 rjmp .+1598 ; 0x238ba <__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; 2327c: 10 92 74 05 sts 0x0574, r1 ; 0x800574 23280: 10 92 75 05 sts 0x0575, r1 ; 0x800575 23284: 10 92 76 05 sts 0x0576, r1 ; 0x800576 23288: 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; 2328c: 10 92 73 05 sts 0x0573, r1 ; 0x800573 acc_step_rate = uint16_t(current_block->initial_rate); 23290: 8a ad ldd r24, Y+58 ; 0x3a 23292: 9b ad ldd r25, Y+59 ; 0x3b 23294: 90 93 72 05 sts 0x0572, r25 ; 0x800572 23298: 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; 2329c: 81 34 cpi r24, 0x41 ; 65 2329e: ac e9 ldi r26, 0x9C ; 156 232a0: 9a 07 cpc r25, r26 232a2: 08 f0 brcs .+2 ; 0x232a6 <__vector_17+0x124> 232a4: a2 c0 rjmp .+324 ; 0x233ea <__vector_17+0x268> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 232a6: 81 32 cpi r24, 0x21 ; 33 232a8: be e4 ldi r27, 0x4E ; 78 232aa: 9b 07 cpc r25, r27 232ac: 08 f4 brcc .+2 ; 0x232b0 <__vector_17+0x12e> 232ae: a0 c0 rjmp .+320 ; 0x233f0 <__vector_17+0x26e> step_rate = (step_rate >> 2)&0x3fff; 232b0: 96 95 lsr r25 232b2: 87 95 ror r24 232b4: 96 95 lsr r25 232b6: 87 95 ror r24 step_loops = 4; 232b8: 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; 232ba: 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 232be: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 232c0: 81 15 cp r24, r1 232c2: f8 e0 ldi r31, 0x08 ; 8 232c4: 9f 07 cpc r25, r31 232c6: 08 f4 brcc .+2 ; 0x232ca <__vector_17+0x148> 232c8: a4 c0 rjmp .+328 ; 0x23412 <__vector_17+0x290> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 232ca: e9 2f mov r30, r25 232cc: ff 27 eor r31, r31 232ce: ee 0f add r30, r30 232d0: ff 1f adc r31, r31 232d2: ee 0f add r30, r30 232d4: ff 1f adc r31, r31 232d6: af 01 movw r20, r30 232d8: 49 56 subi r20, 0x69 ; 105 232da: 5f 46 sbci r21, 0x6F ; 111 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 232dc: fa 01 movw r30, r20 232de: 32 96 adiw r30, 0x02 ; 2 232e0: a5 91 lpm r26, Z+ 232e2: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 232e4: fa 01 movw r30, r20 232e6: 45 91 lpm r20, Z+ 232e8: 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. ); 232ea: b8 9f mul r27, r24 232ec: b0 01 movw r22, r0 232ee: a8 9f mul r26, r24 232f0: 00 0c add r0, r0 232f2: 61 1d adc r22, r1 232f4: 11 24 eor r1, r1 232f6: 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); 232f8: 46 1b sub r20, r22 232fa: 57 0b sbc r21, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 232fc: ca 01 movw r24, r20 232fe: 44 36 cpi r20, 0x64 ; 100 23300: 51 05 cpc r21, r1 23302: 10 f4 brcc .+4 ; 0x23308 <__vector_17+0x186> 23304: 84 e6 ldi r24, 0x64 ; 100 23306: 90 e0 ldi r25, 0x00 ; 0 23308: b0 e0 ldi r27, 0x00 ; 0 2330a: a0 e0 ldi r26, 0x00 ; 0 2330c: 80 93 6c 05 sts 0x056C, r24 ; 0x80056c 23310: 90 93 6d 05 sts 0x056D, r25 ; 0x80056d 23314: a0 93 6e 05 sts 0x056E, r26 ; 0x80056e 23318: b0 93 6f 05 sts 0x056F, r27 ; 0x80056f #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2331c: 4e e6 ldi r20, 0x6E ; 110 2331e: 42 9f mul r20, r18 23320: c0 01 movw r24, r0 23322: 43 9f mul r20, r19 23324: 90 0d add r25, r0 23326: 11 24 eor r1, r1 23328: 82 5a subi r24, 0xA2 ; 162 2332a: 99 4f sbci r25, 0xF9 ; 249 2332c: fc 01 movw r30, r24 2332e: e4 5b subi r30, 0xB4 ; 180 23330: ff 4f sbci r31, 0xFF ; 255 23332: 40 81 ld r20, Z 23334: 44 23 and r20, r20 23336: 49 f0 breq .+18 ; 0x2334a <__vector_17+0x1c8> target_adv_steps = current_block->max_adv_steps; 23338: 81 5b subi r24, 0xB1 ; 177 2333a: 9f 4f sbci r25, 0xFF ; 255 2333c: dc 01 movw r26, r24 2333e: 8d 91 ld r24, X+ 23340: 9c 91 ld r25, X 23342: 90 93 6b 05 sts 0x056B, r25 ; 0x80056b 23346: 80 93 6a 05 sts 0x056A, r24 ; 0x80056a } e_steps = 0; 2334a: 10 92 69 05 sts 0x0569, r1 ; 0x800569 nextAdvanceISR = ADV_NEVER; 2334e: 8f ef ldi r24, 0xFF ; 255 23350: 9f ef ldi r25, 0xFF ; 255 23352: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 23356: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> LA_phase = -1; 2335a: 80 93 68 05 sts 0x0568, r24 ; 0x800568 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 2335e: 8e e6 ldi r24, 0x6E ; 110 23360: 82 9f mul r24, r18 23362: f0 01 movw r30, r0 23364: 83 9f mul r24, r19 23366: f0 0d add r31, r0 23368: 11 24 eor r1, r1 2336a: e2 5a subi r30, 0xA2 ; 162 2336c: f9 4f sbci r31, 0xF9 ; 249 2336e: 85 a9 ldd r24, Z+53 ; 0x35 23370: 84 ff sbrs r24, 4 23372: 08 c0 rjmp .+16 ; 0x23384 <__vector_17+0x202> count_position[E_AXIS] = 0; 23374: 10 92 58 06 sts 0x0658, r1 ; 0x800658 23378: 10 92 59 06 sts 0x0659, r1 ; 0x800659 2337c: 10 92 5a 06 sts 0x065A, r1 ; 0x80065a 23380: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 23384: 83 ff sbrs r24, 3 23386: 61 c0 rjmp .+194 ; 0x2344a <__vector_17+0x2c8> const int16_t value = -(current_block->step_event_count.lo >> 1); 23388: 8e e6 ldi r24, 0x6E ; 110 2338a: 82 9f mul r24, r18 2338c: f0 01 movw r30, r0 2338e: 83 9f mul r24, r19 23390: f0 0d add r31, r0 23392: 11 24 eor r1, r1 23394: e2 5a subi r30, 0xA2 ; 162 23396: f9 4f sbci r31, 0xF9 ; 249 23398: 80 89 ldd r24, Z+16 ; 0x10 2339a: 91 89 ldd r25, Z+17 ; 0x11 2339c: 96 95 lsr r25 2339e: 87 95 ror r24 233a0: 91 95 neg r25 233a2: 81 95 neg r24 233a4: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 233a6: 90 93 59 05 sts 0x0559, r25 ; 0x800559 233aa: 80 93 58 05 sts 0x0558, r24 ; 0x800558 233ae: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 233b2: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 233b6: 90 93 61 05 sts 0x0561, r25 ; 0x800561 233ba: 80 93 60 05 sts 0x0560, r24 ; 0x800560 233be: 90 93 65 05 sts 0x0565, r25 ; 0x800565 233c2: 80 93 64 05 sts 0x0564, r24 ; 0x800564 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 233c6: 81 e0 ldi r24, 0x01 ; 1 233c8: 24 85 ldd r18, Z+12 ; 0x0c 233ca: 35 85 ldd r19, Z+13 ; 0x0d 233cc: 23 2b or r18, r19 233ce: 09 f0 breq .+2 ; 0x233d2 <__vector_17+0x250> 233d0: 7d c0 rjmp .+250 ; 0x234cc <__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; 233d2: 80 e0 ldi r24, 0x00 ; 0 233d4: 7b c0 rjmp .+246 ; 0x234cc <__vector_17+0x34a> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 233d6: 10 92 4d 04 sts 0x044D, r1 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 233da: 10 92 4c 04 sts 0x044C, r1 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> 233de: 0c cf rjmp .-488 ; 0x231f8 <__vector_17+0x76> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 233e0: 10 92 4f 04 sts 0x044F, r1 ; 0x80044f <_ZL11nextMainISR.lto_priv.437+0x1> 233e4: 10 92 4e 04 sts 0x044E, r1 ; 0x80044e <_ZL11nextMainISR.lto_priv.437> 233e8: 1d cf rjmp .-454 ; 0x23224 <__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; 233ea: 80 e4 ldi r24, 0x40 ; 64 233ec: 9c e9 ldi r25, 0x9C ; 156 233ee: 60 cf rjmp .-320 ; 0x232b0 <__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 233f0: 81 31 cpi r24, 0x11 ; 17 233f2: e7 e2 ldi r30, 0x27 ; 39 233f4: 9e 07 cpc r25, r30 233f6: 20 f0 brcs .+8 ; 0x23400 <__vector_17+0x27e> step_rate = (step_rate >> 1)&0x7fff; 233f8: 96 95 lsr r25 233fa: 87 95 ror r24 step_loops = 2; 233fc: 42 e0 ldi r20, 0x02 ; 2 233fe: 5d cf rjmp .-326 ; 0x232ba <__vector_17+0x138> } else { step_loops = 1; 23400: 40 93 70 05 sts 0x0570, r20 ; 0x800570 23404: 80 32 cpi r24, 0x20 ; 32 23406: 91 05 cpc r25, r1 23408: 08 f0 brcs .+2 ; 0x2340c <__vector_17+0x28a> 2340a: 59 cf rjmp .-334 ; 0x232be <__vector_17+0x13c> 2340c: 80 e2 ldi r24, 0x20 ; 32 2340e: 90 e0 ldi r25, 0x00 ; 0 23410: 56 cf rjmp .-340 ; 0x232be <__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; 23412: bc 01 movw r22, r24 23414: 76 95 lsr r23 23416: 67 95 ror r22 23418: 6c 7f andi r22, 0xFC ; 252 2341a: 69 56 subi r22, 0x69 ; 105 2341c: 73 47 sbci r23, 0x73 ; 115 timer = (unsigned short)pgm_read_word_near(table_address); 2341e: fb 01 movw r30, r22 23420: 45 91 lpm r20, Z+ 23422: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 23424: fb 01 movw r30, r22 23426: 32 96 adiw r30, 0x02 ; 2 23428: a5 91 lpm r26, Z+ 2342a: b4 91 lpm r27, Z 2342c: 87 70 andi r24, 0x07 ; 7 2342e: 99 27 eor r25, r25 23430: 8a 9f mul r24, r26 23432: b0 01 movw r22, r0 23434: 8b 9f mul r24, r27 23436: 70 0d add r23, r0 23438: 9a 9f mul r25, r26 2343a: 70 0d add r23, r0 2343c: 11 24 eor r1, r1 2343e: e3 e0 ldi r30, 0x03 ; 3 23440: 76 95 lsr r23 23442: 67 95 ror r22 23444: ea 95 dec r30 23446: e1 f7 brne .-8 ; 0x23440 <__vector_17+0x2be> 23448: 57 cf rjmp .-338 ; 0x232f8 <__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); 2344a: 8e e6 ldi r24, 0x6E ; 110 2344c: 82 9f mul r24, r18 2344e: f0 01 movw r30, r0 23450: 83 9f mul r24, r19 23452: f0 0d add r31, r0 23454: 11 24 eor r1, r1 23456: e2 5a subi r30, 0xA2 ; 162 23458: f9 4f sbci r31, 0xF9 ; 249 2345a: 80 89 ldd r24, Z+16 ; 0x10 2345c: 91 89 ldd r25, Z+17 ; 0x11 2345e: a2 89 ldd r26, Z+18 ; 0x12 23460: b3 89 ldd r27, Z+19 ; 0x13 23462: b6 95 lsr r27 23464: a7 95 ror r26 23466: 97 95 ror r25 23468: 87 95 ror r24 2346a: b0 95 com r27 2346c: a0 95 com r26 2346e: 90 95 com r25 23470: 81 95 neg r24 23472: 9f 4f sbci r25, 0xFF ; 255 23474: af 4f sbci r26, 0xFF ; 255 23476: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 23478: 80 93 58 05 sts 0x0558, r24 ; 0x800558 2347c: 90 93 59 05 sts 0x0559, r25 ; 0x800559 23480: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a 23484: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b 23488: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 2348c: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23490: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e 23494: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f 23498: 80 93 60 05 sts 0x0560, r24 ; 0x800560 2349c: 90 93 61 05 sts 0x0561, r25 ; 0x800561 234a0: a0 93 62 05 sts 0x0562, r26 ; 0x800562 234a4: b0 93 63 05 sts 0x0563, r27 ; 0x800563 234a8: 80 93 64 05 sts 0x0564, r24 ; 0x800564 234ac: 90 93 65 05 sts 0x0565, r25 ; 0x800565 234b0: a0 93 66 05 sts 0x0566, r26 ; 0x800566 234b4: b0 93 67 05 sts 0x0567, r27 ; 0x800567 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 234b8: 81 e0 ldi r24, 0x01 ; 1 234ba: 44 85 ldd r20, Z+12 ; 0x0c 234bc: 55 85 ldd r21, Z+13 ; 0x0d 234be: 66 85 ldd r22, Z+14 ; 0x0e 234c0: 77 85 ldd r23, Z+15 ; 0x0f 234c2: 45 2b or r20, r21 234c4: 46 2b or r20, r22 234c6: 47 2b or r20, r23 234c8: 09 f4 brne .+2 ; 0x234cc <__vector_17+0x34a> 234ca: 83 cf rjmp .-250 ; 0x233d2 <__vector_17+0x250> 234cc: 80 93 57 05 sts 0x0557, r24 ; 0x800557 #endif } step_events_completed.wide = 0; 234d0: 10 92 53 05 sts 0x0553, r1 ; 0x800553 234d4: 10 92 54 05 sts 0x0554, r1 ; 0x800554 234d8: 10 92 55 05 sts 0x0555, r1 ; 0x800555 234dc: 10 92 56 05 sts 0x0556, r1 ; 0x800556 // Set directions. out_bits = current_block->direction_bits; 234e0: 88 8d ldd r24, Y+24 ; 0x18 234e2: 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); 234ea: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 234ee: 8d 7f andi r24, 0xFD ; 253 234f0: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 234f4: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 234f6: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if((out_bits & (1< 234fe: 81 ff sbrs r24, 1 23500: cc c1 rjmp .+920 ; 0x2389a <__vector_17+0x718> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 23502: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 23506: 8e 7f andi r24, 0xFE ; 254 23508: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 2350c: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 2350e: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c } if ((out_bits & (1< 23516: 82 ff sbrs r24, 2 23518: c7 c1 rjmp .+910 ; 0x238a8 <__vector_17+0x726> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 2351a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2351e: 8b 7f andi r24, 0xFB ; 251 23520: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 23524: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 23526: 80 93 5d 02 sts 0x025D, r24 ; 0x80025d } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 2352a: 80 91 52 05 lds r24, 0x0552 ; 0x800552 2352e: 83 ff sbrs r24, 3 23530: c2 c1 rjmp .+900 ; 0x238b6 <__vector_17+0x734> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 23532: 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; 23534: 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) 23538: e0 91 51 12 lds r30, 0x1251 ; 0x801251 2353c: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23540: 30 97 sbiw r30, 0x00 ; 0 23542: 09 f4 brne .+2 ; 0x23546 <__vector_17+0x3c4> 23544: 09 c7 rjmp .+3602 ; 0x24358 <__vector_17+0x11d6> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 23546: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.386> 2354a: 50 91 4f 05 lds r21, 0x054F ; 0x80054f 2354e: 88 23 and r24, r24 23550: 09 f4 brne .+2 ; 0x23554 <__vector_17+0x3d2> 23552: 6c c0 rjmp .+216 ; 0x2362c <__vector_17+0x4aa> { uint8_t _endstop_hit = endstop_hit; 23554: 20 91 5e 04 lds r18, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.441> uint8_t _endstop = endstop; 23558: 80 91 51 05 lds r24, 0x0551 ; 0x800551 uint8_t _old_endstop = old_endstop; 2355c: 90 91 50 05 lds r25, 0x0550 ; 0x800550 #ifndef COREXY if ((out_bits & (1< 23564: 30 ff sbrs r19, 0 23566: 1d c0 rjmp .+58 ; 0x235a2 <__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)); 23568: 1e 9b sbis 0x03, 6 ; 3 2356a: c6 c1 rjmp .+908 ; 0x238f8 <__vector_17+0x776> 2356c: 81 60 ori r24, 0x01 ; 1 #endif if((_endstop & _old_endstop & _BV(X_AXIS)) && (current_block->steps[X_AXIS].wide > 0)) { 2356e: 49 2f mov r20, r25 23570: 41 70 andi r20, 0x01 ; 1 23572: 48 23 and r20, r24 23574: b1 f0 breq .+44 ; 0x235a2 <__vector_17+0x420> 23576: c0 80 ld r12, Z 23578: d1 80 ldd r13, Z+1 ; 0x01 2357a: e2 80 ldd r14, Z+2 ; 0x02 2357c: f3 80 ldd r15, Z+3 ; 0x03 2357e: 1c 14 cp r1, r12 23580: 1d 04 cpc r1, r13 23582: 1e 04 cpc r1, r14 23584: 1f 04 cpc r1, r15 23586: 6c f4 brge .+26 ; 0x235a2 <__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); 23588: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 2358a: c0 88 ldd r12, Z+16 ; 0x10 2358c: d1 88 ldd r13, Z+17 ; 0x11 2358e: e2 88 ldd r14, Z+18 ; 0x12 23590: f3 88 ldd r15, Z+19 ; 0x13 23592: c0 92 53 05 sts 0x0553, r12 ; 0x800553 23596: d0 92 54 05 sts 0x0554, r13 ; 0x800554 2359a: e0 92 55 05 sts 0x0555, r14 ; 0x800555 2359e: 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)); 235a6: 1d 9b sbis 0x03, 5 ; 3 235a8: a9 c1 rjmp .+850 ; 0x238fc <__vector_17+0x77a> 235aa: 82 60 ori r24, 0x02 ; 2 #endif if((_endstop & _old_endstop & _BV(Y_AXIS)) && (current_block->steps[Y_AXIS].wide > 0)) { 235ac: 49 2f mov r20, r25 235ae: 42 70 andi r20, 0x02 ; 2 235b0: 48 23 and r20, r24 235b2: b1 f0 breq .+44 ; 0x235e0 <__vector_17+0x45e> 235b4: c4 80 ldd r12, Z+4 ; 0x04 235b6: d5 80 ldd r13, Z+5 ; 0x05 235b8: e6 80 ldd r14, Z+6 ; 0x06 235ba: f7 80 ldd r15, Z+7 ; 0x07 235bc: 1c 14 cp r1, r12 235be: 1d 04 cpc r1, r13 235c0: 1e 04 cpc r1, r14 235c2: 1f 04 cpc r1, r15 235c4: 6c f4 brge .+26 ; 0x235e0 <__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); 235c6: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 235c8: c0 88 ldd r12, Z+16 ; 0x10 235ca: d1 88 ldd r13, Z+17 ; 0x11 235cc: e2 88 ldd r14, Z+18 ; 0x12 235ce: f3 88 ldd r15, Z+19 ; 0x13 235d0: c0 92 53 05 sts 0x0553, r12 ; 0x800553 235d4: d0 92 54 05 sts 0x0554, r13 ; 0x800554 235d8: e0 92 55 05 sts 0x0555, r14 ; 0x800555 235dc: 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) { 235e4: 51 11 cpse r21, r1 235e6: 1c c0 rjmp .+56 ; 0x23620 <__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)); 235e8: 1c 9b sbis 0x03, 4 ; 3 235ea: 8a c1 rjmp .+788 ; 0x23900 <__vector_17+0x77e> 235ec: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS)) && (current_block->steps[Z_AXIS].wide > 0)) { 235ee: 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)) { 235f0: 98 23 and r25, r24 235f2: b1 f0 breq .+44 ; 0x23620 <__vector_17+0x49e> 235f4: c0 84 ldd r12, Z+8 ; 0x08 235f6: d1 84 ldd r13, Z+9 ; 0x09 235f8: e2 84 ldd r14, Z+10 ; 0x0a 235fa: f3 84 ldd r15, Z+11 ; 0x0b 235fc: 1c 14 cp r1, r12 235fe: 1d 04 cpc r1, r13 23600: 1e 04 cpc r1, r14 23602: 1f 04 cpc r1, r15 23604: 6c f4 brge .+26 ; 0x23620 <__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); 23606: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 23608: c0 88 ldd r12, Z+16 ; 0x10 2360a: d1 88 ldd r13, Z+17 ; 0x11 2360c: e2 88 ldd r14, Z+18 ; 0x12 2360e: f3 88 ldd r15, Z+19 ; 0x13 23610: c0 92 53 05 sts 0x0553, r12 ; 0x800553 23614: d0 92 54 05 sts 0x0554, r13 ; 0x800554 23618: e0 92 55 05 sts 0x0555, r14 ; 0x800555 2361c: f0 92 56 05 sts 0x0556, r15 ; 0x800556 } #endif } endstop = _endstop; 23620: 80 93 51 05 sts 0x0551, r24 ; 0x800551 old_endstop = _endstop; //apply current endstop state to the old endstop 23624: 80 93 50 05 sts 0x0550, r24 ; 0x800550 endstop_hit = _endstop_hit; 23628: 20 93 5e 04 sts 0x045E, r18 ; 0x80045e <_ZL11endstop_hit.lto_priv.441> } // 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) { 2362c: 55 23 and r21, r21 2362e: f9 f0 breq .+62 ; 0x2366e <__vector_17+0x4ec> uint8_t _endstop_hit = endstop_hit; 23630: 20 91 5e 04 lds r18, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.441> uint8_t _endstop = endstop; 23634: 80 91 51 05 lds r24, 0x0551 ; 0x800551 uint8_t _old_endstop = old_endstop; 23638: 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)); 2363c: 1c 9b sbis 0x03, 4 ; 3 2363e: 69 c1 rjmp .+722 ; 0x23912 <__vector_17+0x790> 23640: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if(_endstop & _old_endstop & _BV(Z_AXIS)) { 23642: 94 70 andi r25, 0x04 ; 4 23644: 98 23 and r25, r24 23646: 69 f0 breq .+26 ; 0x23662 <__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); 23648: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2364a: 40 89 ldd r20, Z+16 ; 0x10 2364c: 51 89 ldd r21, Z+17 ; 0x11 2364e: 62 89 ldd r22, Z+18 ; 0x12 23650: 73 89 ldd r23, Z+19 ; 0x13 23652: 40 93 53 05 sts 0x0553, r20 ; 0x800553 23656: 50 93 54 05 sts 0x0554, r21 ; 0x800554 2365a: 60 93 55 05 sts 0x0555, r22 ; 0x800555 2365e: 70 93 56 05 sts 0x0556, r23 ; 0x800556 } endstop = _endstop; 23662: 80 93 51 05 sts 0x0551, r24 ; 0x800551 old_endstop = _endstop; //apply current endstop state to the old endstop 23666: 80 93 50 05 sts 0x0550, r24 ; 0x800550 endstop_hit = _endstop_hit; 2366a: 20 93 5e 04 sts 0x045E, r18 ; 0x80045e <_ZL11endstop_hit.lto_priv.441> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2366e: 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) 23670: c0 e0 ldi r28, 0x00 ; 0 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 23672: 83 ff sbrs r24, 3 23674: 50 c1 rjmp .+672 ; 0x23916 <__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) 23676: 80 91 70 05 lds r24, 0x0570 ; 0x800570 2367a: c8 17 cp r28, r24 2367c: 08 f0 brcs .+2 ; 0x23680 <__vector_17+0x4fe> 2367e: bd c2 rjmp .+1402 ; 0x23bfa <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 23680: 0f 94 7e 00 call 0x200fc ; 0x200fc // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 23684: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23688: f0 91 52 12 lds r31, 0x1252 ; 0x801252 2368c: 80 81 ld r24, Z 2368e: 91 81 ldd r25, Z+1 ; 0x01 23690: 20 91 58 05 lds r18, 0x0558 ; 0x800558 23694: 30 91 59 05 lds r19, 0x0559 ; 0x800559 23698: 82 0f add r24, r18 2369a: 93 1f adc r25, r19 2369c: 90 93 59 05 sts 0x0559, r25 ; 0x800559 236a0: 80 93 58 05 sts 0x0558, r24 ; 0x800558 if (counter[X_AXIS].lo > 0) { 236a4: 18 16 cp r1, r24 236a6: 19 06 cpc r1, r25 236a8: 6c f5 brge .+90 ; 0x23704 <__vector_17+0x582> STEP_NC_HI(X_AXIS); 236aa: 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; 236ac: e0 91 51 12 lds r30, 0x1251 ; 0x801251 236b0: f0 91 52 12 lds r31, 0x1252 ; 0x801252 236b4: 80 91 58 05 lds r24, 0x0558 ; 0x800558 236b8: 90 91 59 05 lds r25, 0x0559 ; 0x800559 236bc: 20 89 ldd r18, Z+16 ; 0x10 236be: 31 89 ldd r19, Z+17 ; 0x11 236c0: 82 1b sub r24, r18 236c2: 93 0b sbc r25, r19 236c4: 90 93 59 05 sts 0x0559, r25 ; 0x800559 236c8: 80 93 58 05 sts 0x0558, r24 ; 0x800558 count_position[X_AXIS]+=count_direction[X_AXIS]; 236cc: 90 91 5b 02 lds r25, 0x025B ; 0x80025b 236d0: 40 91 4c 06 lds r20, 0x064C ; 0x80064c 236d4: 50 91 4d 06 lds r21, 0x064D ; 0x80064d 236d8: 60 91 4e 06 lds r22, 0x064E ; 0x80064e 236dc: 70 91 4f 06 lds r23, 0x064F ; 0x80064f 236e0: 89 2f mov r24, r25 236e2: 99 0f add r25, r25 236e4: 99 0b sbc r25, r25 236e6: aa 0b sbc r26, r26 236e8: bb 0b sbc r27, r27 236ea: 84 0f add r24, r20 236ec: 95 1f adc r25, r21 236ee: a6 1f adc r26, r22 236f0: b7 1f adc r27, r23 236f2: 80 93 4c 06 sts 0x064C, r24 ; 0x80064c 236f6: 90 93 4d 06 sts 0x064D, r25 ; 0x80064d 236fa: a0 93 4e 06 sts 0x064E, r26 ; 0x80064e 236fe: b0 93 4f 06 sts 0x064F, r27 ; 0x80064f STEP_NC_LO(X_AXIS); 23702: 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; 23704: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23708: f0 91 52 12 lds r31, 0x1252 ; 0x801252 2370c: 84 81 ldd r24, Z+4 ; 0x04 2370e: 95 81 ldd r25, Z+5 ; 0x05 23710: 20 91 5c 05 lds r18, 0x055C ; 0x80055c 23714: 30 91 5d 05 lds r19, 0x055D ; 0x80055d 23718: 82 0f add r24, r18 2371a: 93 1f adc r25, r19 2371c: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23720: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c if (counter[Y_AXIS].lo > 0) { 23724: 18 16 cp r1, r24 23726: 19 06 cpc r1, r25 23728: 4c f5 brge .+82 ; 0x2377c <__vector_17+0x5fa> STEP_NC_HI(Y_AXIS); 2372a: 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; 2372c: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23730: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23734: 20 89 ldd r18, Z+16 ; 0x10 23736: 31 89 ldd r19, Z+17 ; 0x11 23738: 82 1b sub r24, r18 2373a: 93 0b sbc r25, r19 2373c: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23740: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c count_position[Y_AXIS]+=count_direction[Y_AXIS]; 23744: 90 91 5c 02 lds r25, 0x025C ; 0x80025c 23748: 40 91 50 06 lds r20, 0x0650 ; 0x800650 2374c: 50 91 51 06 lds r21, 0x0651 ; 0x800651 23750: 60 91 52 06 lds r22, 0x0652 ; 0x800652 23754: 70 91 53 06 lds r23, 0x0653 ; 0x800653 23758: 89 2f mov r24, r25 2375a: 99 0f add r25, r25 2375c: 99 0b sbc r25, r25 2375e: aa 0b sbc r26, r26 23760: bb 0b sbc r27, r27 23762: 84 0f add r24, r20 23764: 95 1f adc r25, r21 23766: a6 1f adc r26, r22 23768: b7 1f adc r27, r23 2376a: 80 93 50 06 sts 0x0650, r24 ; 0x800650 2376e: 90 93 51 06 sts 0x0651, r25 ; 0x800651 23772: a0 93 52 06 sts 0x0652, r26 ; 0x800652 23776: b0 93 53 06 sts 0x0653, r27 ; 0x800653 STEP_NC_LO(Y_AXIS); 2377a: 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; 2377c: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23780: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23784: 80 85 ldd r24, Z+8 ; 0x08 23786: 91 85 ldd r25, Z+9 ; 0x09 23788: 20 91 60 05 lds r18, 0x0560 ; 0x800560 2378c: 30 91 61 05 lds r19, 0x0561 ; 0x800561 23790: 82 0f add r24, r18 23792: 93 1f adc r25, r19 23794: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23798: 80 93 60 05 sts 0x0560, r24 ; 0x800560 if (counter[Z_AXIS].lo > 0) { 2379c: 18 16 cp r1, r24 2379e: 19 06 cpc r1, r25 237a0: 4c f5 brge .+82 ; 0x237f4 <__vector_17+0x672> STEP_NC_HI(Z_AXIS); 237a2: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 237a4: e0 91 51 12 lds r30, 0x1251 ; 0x801251 237a8: f0 91 52 12 lds r31, 0x1252 ; 0x801252 237ac: 20 89 ldd r18, Z+16 ; 0x10 237ae: 31 89 ldd r19, Z+17 ; 0x11 237b0: 82 1b sub r24, r18 237b2: 93 0b sbc r25, r19 237b4: 90 93 61 05 sts 0x0561, r25 ; 0x800561 237b8: 80 93 60 05 sts 0x0560, r24 ; 0x800560 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 237bc: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 237c0: 40 91 54 06 lds r20, 0x0654 ; 0x800654 237c4: 50 91 55 06 lds r21, 0x0655 ; 0x800655 237c8: 60 91 56 06 lds r22, 0x0656 ; 0x800656 237cc: 70 91 57 06 lds r23, 0x0657 ; 0x800657 237d0: 89 2f mov r24, r25 237d2: 99 0f add r25, r25 237d4: 99 0b sbc r25, r25 237d6: aa 0b sbc r26, r26 237d8: bb 0b sbc r27, r27 237da: 84 0f add r24, r20 237dc: 95 1f adc r25, r21 237de: a6 1f adc r26, r22 237e0: b7 1f adc r27, r23 237e2: 80 93 54 06 sts 0x0654, r24 ; 0x800654 237e6: 90 93 55 06 sts 0x0655, r25 ; 0x800655 237ea: a0 93 56 06 sts 0x0656, r26 ; 0x800656 237ee: b0 93 57 06 sts 0x0657, r27 ; 0x800657 STEP_NC_LO(Z_AXIS); 237f2: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 237f4: e0 91 51 12 lds r30, 0x1251 ; 0x801251 237f8: f0 91 52 12 lds r31, 0x1252 ; 0x801252 237fc: 80 91 64 05 lds r24, 0x0564 ; 0x800564 23800: 90 91 65 05 lds r25, 0x0565 ; 0x800565 23804: 24 85 ldd r18, Z+12 ; 0x0c 23806: 35 85 ldd r19, Z+13 ; 0x0d 23808: 82 0f add r24, r18 2380a: 93 1f adc r25, r19 2380c: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23810: 80 93 64 05 sts 0x0564, r24 ; 0x800564 23814: 20 89 ldd r18, Z+16 ; 0x10 23816: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 23818: 18 16 cp r1, r24 2381a: 19 06 cpc r1, r25 2381c: 44 f5 brge .+80 ; 0x2386e <__vector_17+0x6ec> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 2381e: 82 1b sub r24, r18 23820: 93 0b sbc r25, r19 23822: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23826: 80 93 64 05 sts 0x0564, r24 ; 0x800564 count_position[E_AXIS] += count_direction[E_AXIS]; 2382a: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 2382e: 40 91 58 06 lds r20, 0x0658 ; 0x800658 23832: 50 91 59 06 lds r21, 0x0659 ; 0x800659 23836: 60 91 5a 06 lds r22, 0x065A ; 0x80065a 2383a: 70 91 5b 06 lds r23, 0x065B ; 0x80065b 2383e: 89 2f mov r24, r25 23840: 99 0f add r25, r25 23842: 99 0b sbc r25, r25 23844: aa 0b sbc r26, r26 23846: bb 0b sbc r27, r27 23848: 84 0f add r24, r20 2384a: 95 1f adc r25, r21 2384c: a6 1f adc r26, r22 2384e: b7 1f adc r27, r23 23850: 80 93 58 06 sts 0x0658, r24 ; 0x800658 23854: 90 93 59 06 sts 0x0659, r25 ; 0x800659 23858: a0 93 5a 06 sts 0x065A, r26 ; 0x80065a 2385c: b0 93 5b 06 sts 0x065B, r27 ; 0x80065b #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 23860: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 23864: 80 91 69 05 lds r24, 0x0569 ; 0x800569 23868: 89 0f add r24, r25 2386a: 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) 2386e: 80 91 53 05 lds r24, 0x0553 ; 0x800553 23872: 90 91 54 05 lds r25, 0x0554 ; 0x800554 23876: 01 96 adiw r24, 0x01 ; 1 23878: 90 93 54 05 sts 0x0554, r25 ; 0x800554 2387c: 80 93 53 05 sts 0x0553, r24 ; 0x800553 23880: 82 17 cp r24, r18 23882: 93 07 cpc r25, r19 23884: 08 f0 brcs .+2 ; 0x23888 <__vector_17+0x706> 23886: b9 c1 rjmp .+882 ; 0x23bfa <__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) 23888: cf 5f subi r28, 0xFF ; 255 2388a: f5 ce rjmp .-534 ; 0x23676 <__vector_17+0x4f4> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 23890: 82 60 ori r24, 0x02 ; 2 23892: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 23896: 81 e0 ldi r24, 0x01 ; 1 23898: 2e ce rjmp .-932 ; 0x234f6 <__vector_17+0x374> } if((out_bits & (1< 2389e: 81 60 ori r24, 0x01 ; 1 238a0: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 238a4: 81 e0 ldi r24, 0x01 ; 1 238a6: 33 ce rjmp .-922 ; 0x2350e <__vector_17+0x38c> } if ((out_bits & (1< 238ac: 84 60 ori r24, 0x04 ; 4 238ae: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 238b2: 81 e0 ldi r24, 0x01 ; 1 238b4: 38 ce rjmp .-912 ; 0x23526 <__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; 238b6: 81 e0 ldi r24, 0x01 ; 1 238b8: 3d ce rjmp .-902 ; 0x23534 <__vector_17+0x3b2> } } else { _NEXT_ISR(2000); // 1kHz. 238ba: 80 ed ldi r24, 0xD0 ; 208 238bc: 97 e0 ldi r25, 0x07 ; 7 238be: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.437+0x1> 238c2: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.437> 238c6: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.439+0x1> 238ca: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.439> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 238ce: 8f ef ldi r24, 0xFF ; 255 238d0: 9f ef ldi r25, 0xFF ; 255 238d2: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 238d6: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> e_steps = 0; 238da: 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) 238de: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> 238e2: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 238e6: 00 97 sbiw r24, 0x00 ; 0 238e8: 09 f4 brne .+2 ; 0x238ec <__vector_17+0x76a> 238ea: 26 ce rjmp .-948 ; 0x23538 <__vector_17+0x3b6> --current_adv_steps; 238ec: 01 97 sbiw r24, 0x01 ; 1 238ee: 90 93 49 04 sts 0x0449, r25 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 238f2: 80 93 48 04 sts 0x0448, r24 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> 238f6: 20 ce rjmp .-960 ; 0x23538 <__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)); 238f8: 8e 7f andi r24, 0xFE ; 254 238fa: 39 ce rjmp .-910 ; 0x2356e <__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)); 238fc: 8d 7f andi r24, 0xFD ; 253 238fe: 56 ce rjmp .-852 ; 0x235ac <__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)); 23900: 8b 7f andi r24, 0xFB ; 251 23902: 75 ce rjmp .-790 ; 0x235ee <__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)); 23904: 01 99 sbic 0x00, 1 ; 0 23906: 03 c0 rjmp .+6 ; 0x2390e <__vector_17+0x78c> 23908: 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)) { 2390a: 90 74 andi r25, 0x40 ; 64 2390c: 71 ce rjmp .-798 ; 0x235f0 <__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)); 2390e: 8f 7b andi r24, 0xBF ; 191 23910: fc cf rjmp .-8 ; 0x2390a <__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)); 23912: 8b 7f andi r24, 0xFB ; 251 23914: 96 ce rjmp .-724 ; 0x23642 <__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) 23916: 80 91 70 05 lds r24, 0x0570 ; 0x800570 2391a: c8 17 cp r28, r24 2391c: 08 f0 brcs .+2 ; 0x23920 <__vector_17+0x79e> 2391e: 6d c1 rjmp .+730 ; 0x23bfa <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 23920: 0f 94 7e 00 call 0x200fc ; 0x200fc // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 23924: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23928: f0 91 52 12 lds r31, 0x1252 ; 0x801252 2392c: 80 81 ld r24, Z 2392e: 91 81 ldd r25, Z+1 ; 0x01 23930: a2 81 ldd r26, Z+2 ; 0x02 23932: b3 81 ldd r27, Z+3 ; 0x03 23934: 40 91 58 05 lds r20, 0x0558 ; 0x800558 23938: 50 91 59 05 lds r21, 0x0559 ; 0x800559 2393c: 60 91 5a 05 lds r22, 0x055A ; 0x80055a 23940: 70 91 5b 05 lds r23, 0x055B ; 0x80055b 23944: 84 0f add r24, r20 23946: 95 1f adc r25, r21 23948: a6 1f adc r26, r22 2394a: b7 1f adc r27, r23 2394c: 80 93 58 05 sts 0x0558, r24 ; 0x800558 23950: 90 93 59 05 sts 0x0559, r25 ; 0x800559 23954: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a 23958: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b if (counter[X_AXIS].wide > 0) { 2395c: 18 16 cp r1, r24 2395e: 19 06 cpc r1, r25 23960: 1a 06 cpc r1, r26 23962: 1b 06 cpc r1, r27 23964: cc f5 brge .+114 ; 0x239d8 <__vector_17+0x856> STEP_NC_HI(X_AXIS); 23966: 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; 23968: e0 91 51 12 lds r30, 0x1251 ; 0x801251 2396c: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23970: 80 91 58 05 lds r24, 0x0558 ; 0x800558 23974: 90 91 59 05 lds r25, 0x0559 ; 0x800559 23978: a0 91 5a 05 lds r26, 0x055A ; 0x80055a 2397c: b0 91 5b 05 lds r27, 0x055B ; 0x80055b 23980: 40 89 ldd r20, Z+16 ; 0x10 23982: 51 89 ldd r21, Z+17 ; 0x11 23984: 62 89 ldd r22, Z+18 ; 0x12 23986: 73 89 ldd r23, Z+19 ; 0x13 23988: 84 1b sub r24, r20 2398a: 95 0b sbc r25, r21 2398c: a6 0b sbc r26, r22 2398e: b7 0b sbc r27, r23 23990: 80 93 58 05 sts 0x0558, r24 ; 0x800558 23994: 90 93 59 05 sts 0x0559, r25 ; 0x800559 23998: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a 2399c: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b count_position[X_AXIS]+=count_direction[X_AXIS]; 239a0: 90 91 5b 02 lds r25, 0x025B ; 0x80025b 239a4: 40 91 4c 06 lds r20, 0x064C ; 0x80064c 239a8: 50 91 4d 06 lds r21, 0x064D ; 0x80064d 239ac: 60 91 4e 06 lds r22, 0x064E ; 0x80064e 239b0: 70 91 4f 06 lds r23, 0x064F ; 0x80064f 239b4: 89 2f mov r24, r25 239b6: 99 0f add r25, r25 239b8: 99 0b sbc r25, r25 239ba: aa 0b sbc r26, r26 239bc: bb 0b sbc r27, r27 239be: 84 0f add r24, r20 239c0: 95 1f adc r25, r21 239c2: a6 1f adc r26, r22 239c4: b7 1f adc r27, r23 239c6: 80 93 4c 06 sts 0x064C, r24 ; 0x80064c 239ca: 90 93 4d 06 sts 0x064D, r25 ; 0x80064d 239ce: a0 93 4e 06 sts 0x064E, r26 ; 0x80064e 239d2: b0 93 4f 06 sts 0x064F, r27 ; 0x80064f STEP_NC_LO(X_AXIS); 239d6: 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; 239d8: e0 91 51 12 lds r30, 0x1251 ; 0x801251 239dc: f0 91 52 12 lds r31, 0x1252 ; 0x801252 239e0: 84 81 ldd r24, Z+4 ; 0x04 239e2: 95 81 ldd r25, Z+5 ; 0x05 239e4: a6 81 ldd r26, Z+6 ; 0x06 239e6: b7 81 ldd r27, Z+7 ; 0x07 239e8: 40 91 5c 05 lds r20, 0x055C ; 0x80055c 239ec: 50 91 5d 05 lds r21, 0x055D ; 0x80055d 239f0: 60 91 5e 05 lds r22, 0x055E ; 0x80055e 239f4: 70 91 5f 05 lds r23, 0x055F ; 0x80055f 239f8: 84 0f add r24, r20 239fa: 95 1f adc r25, r21 239fc: a6 1f adc r26, r22 239fe: b7 1f adc r27, r23 23a00: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 23a04: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23a08: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e 23a0c: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f if (counter[Y_AXIS].wide > 0) { 23a10: 18 16 cp r1, r24 23a12: 19 06 cpc r1, r25 23a14: 1a 06 cpc r1, r26 23a16: 1b 06 cpc r1, r27 23a18: 8c f5 brge .+98 ; 0x23a7c <__vector_17+0x8fa> STEP_NC_HI(Y_AXIS); 23a1a: 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; 23a1c: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23a20: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23a24: 40 89 ldd r20, Z+16 ; 0x10 23a26: 51 89 ldd r21, Z+17 ; 0x11 23a28: 62 89 ldd r22, Z+18 ; 0x12 23a2a: 73 89 ldd r23, Z+19 ; 0x13 23a2c: 84 1b sub r24, r20 23a2e: 95 0b sbc r25, r21 23a30: a6 0b sbc r26, r22 23a32: b7 0b sbc r27, r23 23a34: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 23a38: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23a3c: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e 23a40: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f count_position[Y_AXIS]+=count_direction[Y_AXIS]; 23a44: 90 91 5c 02 lds r25, 0x025C ; 0x80025c 23a48: 40 91 50 06 lds r20, 0x0650 ; 0x800650 23a4c: 50 91 51 06 lds r21, 0x0651 ; 0x800651 23a50: 60 91 52 06 lds r22, 0x0652 ; 0x800652 23a54: 70 91 53 06 lds r23, 0x0653 ; 0x800653 23a58: 89 2f mov r24, r25 23a5a: 99 0f add r25, r25 23a5c: 99 0b sbc r25, r25 23a5e: aa 0b sbc r26, r26 23a60: bb 0b sbc r27, r27 23a62: 84 0f add r24, r20 23a64: 95 1f adc r25, r21 23a66: a6 1f adc r26, r22 23a68: b7 1f adc r27, r23 23a6a: 80 93 50 06 sts 0x0650, r24 ; 0x800650 23a6e: 90 93 51 06 sts 0x0651, r25 ; 0x800651 23a72: a0 93 52 06 sts 0x0652, r26 ; 0x800652 23a76: b0 93 53 06 sts 0x0653, r27 ; 0x800653 STEP_NC_LO(Y_AXIS); 23a7a: 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; 23a7c: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23a80: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23a84: 80 85 ldd r24, Z+8 ; 0x08 23a86: 91 85 ldd r25, Z+9 ; 0x09 23a88: a2 85 ldd r26, Z+10 ; 0x0a 23a8a: b3 85 ldd r27, Z+11 ; 0x0b 23a8c: 40 91 60 05 lds r20, 0x0560 ; 0x800560 23a90: 50 91 61 05 lds r21, 0x0561 ; 0x800561 23a94: 60 91 62 05 lds r22, 0x0562 ; 0x800562 23a98: 70 91 63 05 lds r23, 0x0563 ; 0x800563 23a9c: 84 0f add r24, r20 23a9e: 95 1f adc r25, r21 23aa0: a6 1f adc r26, r22 23aa2: b7 1f adc r27, r23 23aa4: 80 93 60 05 sts 0x0560, r24 ; 0x800560 23aa8: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23aac: a0 93 62 05 sts 0x0562, r26 ; 0x800562 23ab0: b0 93 63 05 sts 0x0563, r27 ; 0x800563 if (counter[Z_AXIS].wide > 0) { 23ab4: 18 16 cp r1, r24 23ab6: 19 06 cpc r1, r25 23ab8: 1a 06 cpc r1, r26 23aba: 1b 06 cpc r1, r27 23abc: 8c f5 brge .+98 ; 0x23b20 <__vector_17+0x99e> STEP_NC_HI(Z_AXIS); 23abe: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 23ac0: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23ac4: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23ac8: 40 89 ldd r20, Z+16 ; 0x10 23aca: 51 89 ldd r21, Z+17 ; 0x11 23acc: 62 89 ldd r22, Z+18 ; 0x12 23ace: 73 89 ldd r23, Z+19 ; 0x13 23ad0: 84 1b sub r24, r20 23ad2: 95 0b sbc r25, r21 23ad4: a6 0b sbc r26, r22 23ad6: b7 0b sbc r27, r23 23ad8: 80 93 60 05 sts 0x0560, r24 ; 0x800560 23adc: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23ae0: a0 93 62 05 sts 0x0562, r26 ; 0x800562 23ae4: b0 93 63 05 sts 0x0563, r27 ; 0x800563 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 23ae8: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 23aec: 40 91 54 06 lds r20, 0x0654 ; 0x800654 23af0: 50 91 55 06 lds r21, 0x0655 ; 0x800655 23af4: 60 91 56 06 lds r22, 0x0656 ; 0x800656 23af8: 70 91 57 06 lds r23, 0x0657 ; 0x800657 23afc: 89 2f mov r24, r25 23afe: 99 0f add r25, r25 23b00: 99 0b sbc r25, r25 23b02: aa 0b sbc r26, r26 23b04: bb 0b sbc r27, r27 23b06: 84 0f add r24, r20 23b08: 95 1f adc r25, r21 23b0a: a6 1f adc r26, r22 23b0c: b7 1f adc r27, r23 23b0e: 80 93 54 06 sts 0x0654, r24 ; 0x800654 23b12: 90 93 55 06 sts 0x0655, r25 ; 0x800655 23b16: a0 93 56 06 sts 0x0656, r26 ; 0x800656 23b1a: b0 93 57 06 sts 0x0657, r27 ; 0x800657 STEP_NC_LO(Z_AXIS); 23b1e: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 23b20: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23b24: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23b28: 80 91 64 05 lds r24, 0x0564 ; 0x800564 23b2c: 90 91 65 05 lds r25, 0x0565 ; 0x800565 23b30: a0 91 66 05 lds r26, 0x0566 ; 0x800566 23b34: b0 91 67 05 lds r27, 0x0567 ; 0x800567 23b38: 44 85 ldd r20, Z+12 ; 0x0c 23b3a: 55 85 ldd r21, Z+13 ; 0x0d 23b3c: 66 85 ldd r22, Z+14 ; 0x0e 23b3e: 77 85 ldd r23, Z+15 ; 0x0f 23b40: 84 0f add r24, r20 23b42: 95 1f adc r25, r21 23b44: a6 1f adc r26, r22 23b46: b7 1f adc r27, r23 23b48: 80 93 64 05 sts 0x0564, r24 ; 0x800564 23b4c: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23b50: a0 93 66 05 sts 0x0566, r26 ; 0x800566 23b54: b0 93 67 05 sts 0x0567, r27 ; 0x800567 23b58: 40 89 ldd r20, Z+16 ; 0x10 23b5a: 51 89 ldd r21, Z+17 ; 0x11 23b5c: 62 89 ldd r22, Z+18 ; 0x12 23b5e: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 23b60: 18 16 cp r1, r24 23b62: 19 06 cpc r1, r25 23b64: 1a 06 cpc r1, r26 23b66: 1b 06 cpc r1, r27 23b68: 74 f5 brge .+92 ; 0x23bc6 <__vector_17+0xa44> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 23b6a: 84 1b sub r24, r20 23b6c: 95 0b sbc r25, r21 23b6e: a6 0b sbc r26, r22 23b70: b7 0b sbc r27, r23 23b72: 80 93 64 05 sts 0x0564, r24 ; 0x800564 23b76: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23b7a: a0 93 66 05 sts 0x0566, r26 ; 0x800566 23b7e: b0 93 67 05 sts 0x0567, r27 ; 0x800567 count_position[E_AXIS] += count_direction[E_AXIS]; 23b82: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 23b86: c0 90 58 06 lds r12, 0x0658 ; 0x800658 23b8a: d0 90 59 06 lds r13, 0x0659 ; 0x800659 23b8e: e0 90 5a 06 lds r14, 0x065A ; 0x80065a 23b92: f0 90 5b 06 lds r15, 0x065B ; 0x80065b 23b96: 89 2f mov r24, r25 23b98: 99 0f add r25, r25 23b9a: 99 0b sbc r25, r25 23b9c: aa 0b sbc r26, r26 23b9e: bb 0b sbc r27, r27 23ba0: 8c 0d add r24, r12 23ba2: 9d 1d adc r25, r13 23ba4: ae 1d adc r26, r14 23ba6: bf 1d adc r27, r15 23ba8: 80 93 58 06 sts 0x0658, r24 ; 0x800658 23bac: 90 93 59 06 sts 0x0659, r25 ; 0x800659 23bb0: a0 93 5a 06 sts 0x065A, r26 ; 0x80065a 23bb4: b0 93 5b 06 sts 0x065B, r27 ; 0x80065b #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 23bb8: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 23bbc: 80 91 69 05 lds r24, 0x0569 ; 0x800569 23bc0: 89 0f add r24, r25 23bc2: 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) 23bc6: 80 91 53 05 lds r24, 0x0553 ; 0x800553 23bca: 90 91 54 05 lds r25, 0x0554 ; 0x800554 23bce: a0 91 55 05 lds r26, 0x0555 ; 0x800555 23bd2: b0 91 56 05 lds r27, 0x0556 ; 0x800556 23bd6: 01 96 adiw r24, 0x01 ; 1 23bd8: a1 1d adc r26, r1 23bda: b1 1d adc r27, r1 23bdc: 80 93 53 05 sts 0x0553, r24 ; 0x800553 23be0: 90 93 54 05 sts 0x0554, r25 ; 0x800554 23be4: a0 93 55 05 sts 0x0555, r26 ; 0x800555 23be8: b0 93 56 05 sts 0x0556, r27 ; 0x800556 23bec: 84 17 cp r24, r20 23bee: 95 07 cpc r25, r21 23bf0: a6 07 cpc r26, r22 23bf2: b7 07 cpc r27, r23 23bf4: 10 f4 brcc .+4 ; 0x23bfa <__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) 23bf6: cf 5f subi r28, 0xFF ; 255 23bf8: 8e ce rjmp .-740 ; 0x23916 <__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); 23bfa: 80 91 69 05 lds r24, 0x0569 ; 0x800569 23bfe: 88 23 and r24, r24 23c00: 39 f0 breq .+14 ; 0x23c10 <__vector_17+0xa8e> 23c02: 87 ff sbrs r24, 7 23c04: f2 c0 rjmp .+484 ; 0x23dea <__vector_17+0xc68> 23c06: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 23c0a: 80 64 ori r24, 0x40 ; 64 23c0c: 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) { 23c10: 40 91 53 05 lds r20, 0x0553 ; 0x800553 23c14: 50 91 54 05 lds r21, 0x0554 ; 0x800554 23c18: 60 91 55 05 lds r22, 0x0555 ; 0x800555 23c1c: 70 91 56 05 lds r23, 0x0556 ; 0x800556 23c20: c0 91 51 12 lds r28, 0x1251 ; 0x801251 23c24: d0 91 52 12 lds r29, 0x1252 ; 0x801252 23c28: 89 8d ldd r24, Y+25 ; 0x19 23c2a: 9a 8d ldd r25, Y+26 ; 0x1a 23c2c: ab 8d ldd r26, Y+27 ; 0x1b 23c2e: bc 8d ldd r27, Y+28 ; 0x1c 23c30: 84 17 cp r24, r20 23c32: 95 07 cpc r25, r21 23c34: a6 07 cpc r26, r22 23c36: b7 07 cpc r27, r23 23c38: 08 f4 brcc .+2 ; 0x23c3c <__vector_17+0xaba> 23c3a: 37 c1 rjmp .+622 ; 0x23eaa <__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); 23c3c: c0 90 6c 05 lds r12, 0x056C ; 0x80056c 23c40: d0 90 6d 05 lds r13, 0x056D ; 0x80056d 23c44: e0 90 6e 05 lds r14, 0x056E ; 0x80056e 23c48: 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. ); 23c4c: 2c 89 ldd r18, Y+20 ; 0x14 23c4e: 3d 89 ldd r19, Y+21 ; 0x15 23c50: 4e 89 ldd r20, Y+22 ; 0x16 23c52: aa 27 eor r26, r26 23c54: c3 9e mul r12, r19 23c56: b1 2d mov r27, r1 23c58: d4 9e mul r13, r20 23c5a: c0 01 movw r24, r0 23c5c: e4 9e mul r14, r20 23c5e: 90 0d add r25, r0 23c60: e3 9e mul r14, r19 23c62: 80 0d add r24, r0 23c64: 91 1d adc r25, r1 23c66: c4 9e mul r12, r20 23c68: b0 0d add r27, r0 23c6a: 81 1d adc r24, r1 23c6c: 9a 1f adc r25, r26 23c6e: d3 9e mul r13, r19 23c70: b0 0d add r27, r0 23c72: 81 1d adc r24, r1 23c74: 9a 1f adc r25, r26 23c76: e2 9e mul r14, r18 23c78: b0 0d add r27, r0 23c7a: 81 1d adc r24, r1 23c7c: 9a 1f adc r25, r26 23c7e: d2 9e mul r13, r18 23c80: b1 0d add r27, r1 23c82: 8a 1f adc r24, r26 23c84: 9a 1f adc r25, r26 23c86: bb 0f add r27, r27 23c88: 8a 1f adc r24, r26 23c8a: 9a 1f adc r25, r26 23c8c: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 23c8e: 2a ad ldd r18, Y+58 ; 0x3a 23c90: 3b ad ldd r19, Y+59 ; 0x3b 23c92: 82 0f add r24, r18 23c94: 93 1f adc r25, r19 23c96: 90 93 72 05 sts 0x0572, r25 ; 0x800572 23c9a: 80 93 71 05 sts 0x0571, r24 ; 0x800571 // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 23c9e: 2e a9 ldd r18, Y+54 ; 0x36 23ca0: 3f a9 ldd r19, Y+55 ; 0x37 23ca2: 28 17 cp r18, r24 23ca4: 39 07 cpc r19, r25 23ca6: 20 f4 brcc .+8 ; 0x23cb0 <__vector_17+0xb2e> acc_step_rate = current_block->nominal_rate; 23ca8: 30 93 72 05 sts 0x0572, r19 ; 0x800572 23cac: 20 93 71 05 sts 0x0571, r18 ; 0x800571 // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 23cb0: 80 91 71 05 lds r24, 0x0571 ; 0x800571 23cb4: 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; 23cb8: 81 34 cpi r24, 0x41 ; 65 23cba: bc e9 ldi r27, 0x9C ; 156 23cbc: 9b 07 cpc r25, r27 23cbe: 08 f0 brcs .+2 ; 0x23cc2 <__vector_17+0xb40> 23cc0: 98 c0 rjmp .+304 ; 0x23df2 <__vector_17+0xc70> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 23cc2: 81 32 cpi r24, 0x21 ; 33 23cc4: ee e4 ldi r30, 0x4E ; 78 23cc6: 9e 07 cpc r25, r30 23cc8: 08 f4 brcc .+2 ; 0x23ccc <__vector_17+0xb4a> 23cca: 96 c0 rjmp .+300 ; 0x23df8 <__vector_17+0xc76> step_rate = (step_rate >> 2)&0x3fff; 23ccc: 96 95 lsr r25 23cce: 87 95 ror r24 23cd0: 96 95 lsr r25 23cd2: 87 95 ror r24 step_loops = 4; 23cd4: 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; 23cd6: 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 23cda: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 23cdc: 81 15 cp r24, r1 23cde: 28 e0 ldi r18, 0x08 ; 8 23ce0: 92 07 cpc r25, r18 23ce2: 08 f4 brcc .+2 ; 0x23ce6 <__vector_17+0xb64> 23ce4: 9b c0 rjmp .+310 ; 0x23e1c <__vector_17+0xc9a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 23ce6: e9 2f mov r30, r25 23ce8: ff 27 eor r31, r31 23cea: ee 0f add r30, r30 23cec: ff 1f adc r31, r31 23cee: ee 0f add r30, r30 23cf0: ff 1f adc r31, r31 23cf2: 9f 01 movw r18, r30 23cf4: 29 56 subi r18, 0x69 ; 105 23cf6: 3f 46 sbci r19, 0x6F ; 111 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 23cf8: f9 01 movw r30, r18 23cfa: 32 96 adiw r30, 0x02 ; 2 23cfc: 45 91 lpm r20, Z+ 23cfe: 54 91 lpm r21, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 23d00: f9 01 movw r30, r18 23d02: 25 91 lpm r18, Z+ 23d04: 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. ); 23d06: 58 9f mul r21, r24 23d08: b0 01 movw r22, r0 23d0a: 48 9f mul r20, r24 23d0c: 00 0c add r0, r0 23d0e: 61 1d adc r22, r1 23d10: 11 24 eor r1, r1 23d12: 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); 23d14: 26 1b sub r18, r22 23d16: 37 0b sbc r19, r23 23d18: c9 01 movw r24, r18 23d1a: 24 36 cpi r18, 0x64 ; 100 23d1c: 31 05 cpc r19, r1 23d1e: 10 f4 brcc .+4 ; 0x23d24 <__vector_17+0xba2> 23d20: 84 e6 ldi r24, 0x64 ; 100 23d22: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 23d24: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.437+0x1> 23d28: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.437> 23d2c: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.439+0x1> 23d30: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.439> acceleration_time += timer; 23d34: c8 0e add r12, r24 23d36: d9 1e adc r13, r25 23d38: e1 1c adc r14, r1 23d3a: f1 1c adc r15, r1 23d3c: c0 92 6c 05 sts 0x056C, r12 ; 0x80056c 23d40: d0 92 6d 05 sts 0x056D, r13 ; 0x80056d 23d44: e0 92 6e 05 sts 0x056E, r14 ; 0x80056e 23d48: f0 92 6f 05 sts 0x056F, r15 ; 0x80056f #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 23d4c: fe 01 movw r30, r28 23d4e: e4 5b subi r30, 0xB4 ; 180 23d50: ff 4f sbci r31, 0xFF ; 255 23d52: 80 81 ld r24, Z 23d54: 81 11 cpse r24, r1 23d56: 80 c0 rjmp .+256 ; 0x23e58 <__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; 23d58: 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) { 23d5a: 80 ff sbrs r24, 0 23d5c: 16 c0 rjmp .+44 ; 0x23d8a <__vector_17+0xc08> LA_phase = -1; 23d5e: 9f ef ldi r25, 0xFF ; 255 23d60: 90 93 68 05 sts 0x0568, r25 ; 0x800568 if (current_adv_steps == target_adv_steps) { 23d64: e0 91 48 04 lds r30, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> 23d68: f0 91 49 04 lds r31, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 23d6c: 20 91 6a 05 lds r18, 0x056A ; 0x80056a 23d70: 30 91 6b 05 lds r19, 0x056B ; 0x80056b 23d74: e2 17 cp r30, r18 23d76: f3 07 cpc r31, r19 23d78: 09 f0 breq .+2 ; 0x23d7c <__vector_17+0xbfa> 23d7a: 27 c2 rjmp .+1102 ; 0x241ca <__vector_17+0x1048> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 23d7c: 8f ef ldi r24, 0xFF ; 255 23d7e: 9f ef ldi r25, 0xFF ; 255 23d80: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 23d84: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> 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; 23d88: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 23d8a: 80 fd sbrc r24, 0 23d8c: 07 c0 rjmp .+14 ; 0x23d9c <__vector_17+0xc1a> 23d8e: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> 23d92: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 23d96: 01 96 adiw r24, 0x01 ; 1 23d98: 09 f4 brne .+2 ; 0x23d9c <__vector_17+0xc1a> 23d9a: b7 c2 rjmp .+1390 ; 0x2430a <__vector_17+0x1188> // update timers & phase for the next iteration advance_spread(main_Rate); 23d9c: e0 91 4a 04 lds r30, 0x044A ; 0x80044a <_ZL9main_Rate.lto_priv.439> 23da0: f0 91 4b 04 lds r31, 0x044B ; 0x80044b <_ZL9main_Rate.lto_priv.439+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 23da4: 80 91 49 05 lds r24, 0x0549 ; 0x800549 23da8: 90 91 4a 05 lds r25, 0x054A ; 0x80054a 23dac: a0 91 4b 05 lds r26, 0x054B ; 0x80054b 23db0: b0 91 4c 05 lds r27, 0x054C ; 0x80054c 23db4: 2c 01 movw r4, r24 23db6: 3d 01 movw r6, r26 23db8: 4e 0e add r4, r30 23dba: 5f 1e adc r5, r31 23dbc: 61 1c adc r6, r1 23dbe: 71 1c adc r7, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 23dc0: 9e 01 movw r18, r28 23dc2: 23 5b subi r18, 0xB3 ; 179 23dc4: 3f 4f sbci r19, 0xFF ; 255 23dc6: d9 01 movw r26, r18 23dc8: cd 90 ld r12, X+ 23dca: dc 90 ld r13, X 23dcc: f1 2c mov r15, r1 23dce: e1 2c mov r14, r1 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 23dd0: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 23dd2: 4c 14 cp r4, r12 23dd4: 5d 04 cpc r5, r13 23dd6: 6e 04 cpc r6, r14 23dd8: 7f 04 cpc r7, r15 23dda: 08 f4 brcc .+2 ; 0x23dde <__vector_17+0xc5c> 23ddc: 26 c2 rjmp .+1100 ; 0x2422a <__vector_17+0x10a8> { ++ticks; 23dde: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 23de0: 4c 18 sub r4, r12 23de2: 5d 08 sbc r5, r13 23de4: 6e 08 sbc r6, r14 23de6: 7f 08 sbc r7, r15 23de8: f4 cf rjmp .-24 ; 0x23dd2 <__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); 23dea: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 23dee: 8f 7b andi r24, 0xBF ; 191 23df0: 0d cf rjmp .-486 ; 0x23c0c <__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; 23df2: 80 e4 ldi r24, 0x40 ; 64 23df4: 9c e9 ldi r25, 0x9C ; 156 23df6: 6a cf rjmp .-300 ; 0x23ccc <__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 23df8: 81 31 cpi r24, 0x11 ; 17 23dfa: f7 e2 ldi r31, 0x27 ; 39 23dfc: 9f 07 cpc r25, r31 23dfe: 20 f0 brcs .+8 ; 0x23e08 <__vector_17+0xc86> step_rate = (step_rate >> 1)&0x7fff; 23e00: 96 95 lsr r25 23e02: 87 95 ror r24 step_loops = 2; 23e04: 22 e0 ldi r18, 0x02 ; 2 23e06: 67 cf rjmp .-306 ; 0x23cd6 <__vector_17+0xb54> } else { step_loops = 1; 23e08: 21 e0 ldi r18, 0x01 ; 1 23e0a: 20 93 70 05 sts 0x0570, r18 ; 0x800570 23e0e: 80 32 cpi r24, 0x20 ; 32 23e10: 91 05 cpc r25, r1 23e12: 08 f0 brcs .+2 ; 0x23e16 <__vector_17+0xc94> 23e14: 62 cf rjmp .-316 ; 0x23cda <__vector_17+0xb58> 23e16: 80 e2 ldi r24, 0x20 ; 32 23e18: 90 e0 ldi r25, 0x00 ; 0 23e1a: 5f cf rjmp .-322 ; 0x23cda <__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; 23e1c: ac 01 movw r20, r24 23e1e: 56 95 lsr r21 23e20: 47 95 ror r20 23e22: 4c 7f andi r20, 0xFC ; 252 23e24: 49 56 subi r20, 0x69 ; 105 23e26: 53 47 sbci r21, 0x73 ; 115 timer = (unsigned short)pgm_read_word_near(table_address); 23e28: fa 01 movw r30, r20 23e2a: 25 91 lpm r18, Z+ 23e2c: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 23e2e: fa 01 movw r30, r20 23e30: 32 96 adiw r30, 0x02 ; 2 23e32: 65 91 lpm r22, Z+ 23e34: 74 91 lpm r23, Z 23e36: 87 70 andi r24, 0x07 ; 7 23e38: 99 27 eor r25, r25 23e3a: 86 9f mul r24, r22 23e3c: a0 01 movw r20, r0 23e3e: 87 9f mul r24, r23 23e40: 50 0d add r21, r0 23e42: 96 9f mul r25, r22 23e44: 50 0d add r21, r0 23e46: 11 24 eor r1, r1 23e48: 73 e0 ldi r23, 0x03 ; 3 23e4a: 56 95 lsr r21 23e4c: 47 95 ror r20 23e4e: 7a 95 dec r23 23e50: e1 f7 brne .-8 ; 0x23e4a <__vector_17+0xcc8> 23e52: 24 1b sub r18, r20 23e54: 35 0b sbc r19, r21 23e56: 60 cf rjmp .-320 ; 0x23d18 <__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) { 23e58: 40 91 53 05 lds r20, 0x0553 ; 0x800553 23e5c: 50 91 54 05 lds r21, 0x0554 ; 0x800554 23e60: 60 91 55 05 lds r22, 0x0555 ; 0x800555 23e64: 70 91 56 05 lds r23, 0x0556 ; 0x800556 23e68: 80 91 70 05 lds r24, 0x0570 ; 0x800570 23e6c: 90 e0 ldi r25, 0x00 ; 0 23e6e: b0 e0 ldi r27, 0x00 ; 0 23e70: a0 e0 ldi r26, 0x00 ; 0 23e72: 84 17 cp r24, r20 23e74: 95 07 cpc r25, r21 23e76: a6 07 cpc r26, r22 23e78: b7 07 cpc r27, r23 23e7a: 08 f4 brcc .+2 ; 0x23e7e <__vector_17+0xcfc> 23e7c: 6d cf rjmp .-294 ; 0x23d58 <__vector_17+0xbd6> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 23e7e: 80 91 57 05 lds r24, 0x0557 ; 0x800557 23e82: 81 11 cpse r24, r1 23e84: 02 c0 rjmp .+4 ; 0x23e8a <__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; 23e86: 83 e0 ldi r24, 0x03 ; 3 23e88: 68 cf rjmp .-304 ; 0x23d5a <__vector_17+0xbd8> if (e_extruding && current_adv_steps > target_adv_steps) 23e8a: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> 23e8e: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 23e92: 20 91 6a 05 lds r18, 0x056A ; 0x80056a 23e96: 30 91 6b 05 lds r19, 0x056B ; 0x80056b 23e9a: 28 17 cp r18, r24 23e9c: 39 07 cpc r19, r25 23e9e: 98 f7 brcc .-26 ; 0x23e86 <__vector_17+0xd04> target_adv_steps = current_adv_steps; 23ea0: 90 93 6b 05 sts 0x056B, r25 ; 0x80056b 23ea4: 80 93 6a 05 sts 0x056A, r24 ; 0x80056a 23ea8: ee cf rjmp .-36 ; 0x23e86 <__vector_17+0xd04> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 23eaa: 80 91 53 05 lds r24, 0x0553 ; 0x800553 23eae: 90 91 54 05 lds r25, 0x0554 ; 0x800554 23eb2: a0 91 55 05 lds r26, 0x0555 ; 0x800555 23eb6: b0 91 56 05 lds r27, 0x0556 ; 0x800556 23eba: 4d 8d ldd r20, Y+29 ; 0x1d 23ebc: 5e 8d ldd r21, Y+30 ; 0x1e 23ebe: 6f 8d ldd r22, Y+31 ; 0x1f 23ec0: 78 a1 ldd r23, Y+32 ; 0x20 23ec2: 48 17 cp r20, r24 23ec4: 59 07 cpc r21, r25 23ec6: 6a 07 cpc r22, r26 23ec8: 7b 07 cpc r23, r27 23eca: 08 f0 brcs .+2 ; 0x23ece <__vector_17+0xd4c> 23ecc: e3 c0 rjmp .+454 ; 0x24094 <__vector_17+0xf12> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 23ece: c0 90 74 05 lds r12, 0x0574 ; 0x800574 23ed2: d0 90 75 05 lds r13, 0x0575 ; 0x800575 23ed6: e0 90 76 05 lds r14, 0x0576 ; 0x800576 23eda: 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. ); 23ede: 6c 88 ldd r6, Y+20 ; 0x14 23ee0: 7d 88 ldd r7, Y+21 ; 0x15 23ee2: 8e 88 ldd r8, Y+22 ; 0x16 23ee4: aa 27 eor r26, r26 23ee6: c7 9c mul r12, r7 23ee8: b1 2d mov r27, r1 23eea: d8 9c mul r13, r8 23eec: f0 01 movw r30, r0 23eee: e8 9c mul r14, r8 23ef0: f0 0d add r31, r0 23ef2: e7 9c mul r14, r7 23ef4: e0 0d add r30, r0 23ef6: f1 1d adc r31, r1 23ef8: c8 9c mul r12, r8 23efa: b0 0d add r27, r0 23efc: e1 1d adc r30, r1 23efe: fa 1f adc r31, r26 23f00: d7 9c mul r13, r7 23f02: b0 0d add r27, r0 23f04: e1 1d adc r30, r1 23f06: fa 1f adc r31, r26 23f08: e6 9c mul r14, r6 23f0a: b0 0d add r27, r0 23f0c: e1 1d adc r30, r1 23f0e: fa 1f adc r31, r26 23f10: d6 9c mul r13, r6 23f12: b1 0d add r27, r1 23f14: ea 1f adc r30, r26 23f16: fa 1f adc r31, r26 23f18: bb 0f add r27, r27 23f1a: ea 1f adc r30, r26 23f1c: fa 1f adc r31, r26 23f1e: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 23f20: 20 91 71 05 lds r18, 0x0571 ; 0x800571 23f24: 30 91 72 05 lds r19, 0x0572 ; 0x800572 23f28: 8e ad ldd r24, Y+62 ; 0x3e 23f2a: 9f ad ldd r25, Y+63 ; 0x3f 23f2c: 2e 17 cp r18, r30 23f2e: 3f 07 cpc r19, r31 23f30: 30 f0 brcs .+12 ; 0x23f3e <__vector_17+0xdbc> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 23f32: 2e 1b sub r18, r30 23f34: 3f 0b sbc r19, r31 23f36: 82 17 cp r24, r18 23f38: 93 07 cpc r25, r19 23f3a: 08 f4 brcc .+2 ; 0x23f3e <__vector_17+0xdbc> 23f3c: 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; 23f3e: 81 34 cpi r24, 0x41 ; 65 23f40: ac e9 ldi r26, 0x9C ; 156 23f42: 9a 07 cpc r25, r26 23f44: 08 f0 brcs .+2 ; 0x23f48 <__vector_17+0xdc6> 23f46: 75 c0 rjmp .+234 ; 0x24032 <__vector_17+0xeb0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 23f48: 81 32 cpi r24, 0x21 ; 33 23f4a: be e4 ldi r27, 0x4E ; 78 23f4c: 9b 07 cpc r25, r27 23f4e: 08 f4 brcc .+2 ; 0x23f52 <__vector_17+0xdd0> 23f50: 73 c0 rjmp .+230 ; 0x24038 <__vector_17+0xeb6> step_rate = (step_rate >> 2)&0x3fff; 23f52: 96 95 lsr r25 23f54: 87 95 ror r24 23f56: 96 95 lsr r25 23f58: 87 95 ror r24 step_loops = 4; 23f5a: 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; 23f5c: 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 23f60: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 23f62: 81 15 cp r24, r1 23f64: f8 e0 ldi r31, 0x08 ; 8 23f66: 9f 07 cpc r25, r31 23f68: 08 f4 brcc .+2 ; 0x23f6c <__vector_17+0xdea> 23f6a: 78 c0 rjmp .+240 ; 0x2405c <__vector_17+0xeda> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 23f6c: e9 2f mov r30, r25 23f6e: ff 27 eor r31, r31 23f70: ee 0f add r30, r30 23f72: ff 1f adc r31, r31 23f74: ee 0f add r30, r30 23f76: ff 1f adc r31, r31 23f78: 9f 01 movw r18, r30 23f7a: 29 56 subi r18, 0x69 ; 105 23f7c: 3f 46 sbci r19, 0x6F ; 111 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 23f7e: f9 01 movw r30, r18 23f80: 32 96 adiw r30, 0x02 ; 2 23f82: a5 91 lpm r26, Z+ 23f84: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 23f86: f9 01 movw r30, r18 23f88: 25 91 lpm r18, Z+ 23f8a: 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. ); 23f8c: b8 9f mul r27, r24 23f8e: f0 01 movw r30, r0 23f90: a8 9f mul r26, r24 23f92: 00 0c add r0, r0 23f94: e1 1d adc r30, r1 23f96: 11 24 eor r1, r1 23f98: 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); 23f9a: 2e 1b sub r18, r30 23f9c: 3f 0b sbc r19, r31 23f9e: c9 01 movw r24, r18 23fa0: 24 36 cpi r18, 0x64 ; 100 23fa2: 31 05 cpc r19, r1 23fa4: 10 f4 brcc .+4 ; 0x23faa <__vector_17+0xe28> 23fa6: 84 e6 ldi r24, 0x64 ; 100 23fa8: 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); 23faa: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.437+0x1> 23fae: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.437> 23fb2: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.439+0x1> 23fb6: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.439> deceleration_time += timer; 23fba: c8 0e add r12, r24 23fbc: d9 1e adc r13, r25 23fbe: e1 1c adc r14, r1 23fc0: f1 1c adc r15, r1 23fc2: c0 92 74 05 sts 0x0574, r12 ; 0x800574 23fc6: d0 92 75 05 sts 0x0575, r13 ; 0x800575 23fca: e0 92 76 05 sts 0x0576, r14 ; 0x800576 23fce: f0 92 77 05 sts 0x0577, r15 ; 0x800577 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 23fd2: fe 01 movw r30, r28 23fd4: e4 5b subi r30, 0xB4 ; 180 23fd6: ff 4f sbci r31, 0xFF ; 255 23fd8: 80 81 ld r24, Z 23fda: 88 23 and r24, r24 23fdc: 09 f4 brne .+2 ; 0x23fe0 <__vector_17+0xe5e> 23fde: bc ce rjmp .-648 ; 0x23d58 <__vector_17+0xbd6> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 23fe0: 80 91 53 05 lds r24, 0x0553 ; 0x800553 23fe4: 90 91 54 05 lds r25, 0x0554 ; 0x800554 23fe8: a0 91 55 05 lds r26, 0x0555 ; 0x800555 23fec: b0 91 56 05 lds r27, 0x0556 ; 0x800556 23ff0: 20 91 70 05 lds r18, 0x0570 ; 0x800570 23ff4: 42 0f add r20, r18 23ff6: 51 1d adc r21, r1 23ff8: 61 1d adc r22, r1 23ffa: 71 1d adc r23, r1 23ffc: 48 17 cp r20, r24 23ffe: 59 07 cpc r21, r25 24000: 6a 07 cpc r22, r26 24002: 7b 07 cpc r23, r27 24004: 08 f4 brcc .+2 ; 0x24008 <__vector_17+0xe86> 24006: a8 ce rjmp .-688 ; 0x23d58 <__vector_17+0xbd6> target_adv_steps = current_block->final_adv_steps; 24008: 35 96 adiw r30, 0x05 ; 5 2400a: 20 81 ld r18, Z 2400c: 31 81 ldd r19, Z+1 ; 0x01 2400e: 30 93 6b 05 sts 0x056B, r19 ; 0x80056b 24012: 20 93 6a 05 sts 0x056A, r18 ; 0x80056a la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 24016: 80 91 57 05 lds r24, 0x0557 ; 0x800557 2401a: 88 23 and r24, r24 2401c: 09 f4 brne .+2 ; 0x24020 <__vector_17+0xe9e> 2401e: 33 cf rjmp .-410 ; 0x23e86 <__vector_17+0xd04> 24020: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> 24024: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 24028: 82 17 cp r24, r18 2402a: 93 07 cpc r25, r19 2402c: 08 f0 brcs .+2 ; 0x24030 <__vector_17+0xeae> 2402e: 2b cf rjmp .-426 ; 0x23e86 <__vector_17+0xd04> 24030: 37 cf rjmp .-402 ; 0x23ea0 <__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; 24032: 80 e4 ldi r24, 0x40 ; 64 24034: 9c e9 ldi r25, 0x9C ; 156 24036: 8d cf rjmp .-230 ; 0x23f52 <__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 24038: 81 31 cpi r24, 0x11 ; 17 2403a: e7 e2 ldi r30, 0x27 ; 39 2403c: 9e 07 cpc r25, r30 2403e: 20 f0 brcs .+8 ; 0x24048 <__vector_17+0xec6> step_rate = (step_rate >> 1)&0x7fff; 24040: 96 95 lsr r25 24042: 87 95 ror r24 step_loops = 2; 24044: 22 e0 ldi r18, 0x02 ; 2 24046: 8a cf rjmp .-236 ; 0x23f5c <__vector_17+0xdda> } else { step_loops = 1; 24048: 21 e0 ldi r18, 0x01 ; 1 2404a: 20 93 70 05 sts 0x0570, r18 ; 0x800570 2404e: 80 32 cpi r24, 0x20 ; 32 24050: 91 05 cpc r25, r1 24052: 08 f0 brcs .+2 ; 0x24056 <__vector_17+0xed4> 24054: 85 cf rjmp .-246 ; 0x23f60 <__vector_17+0xdde> 24056: 80 e2 ldi r24, 0x20 ; 32 24058: 90 e0 ldi r25, 0x00 ; 0 2405a: 82 cf rjmp .-252 ; 0x23f60 <__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; 2405c: dc 01 movw r26, r24 2405e: b6 95 lsr r27 24060: a7 95 ror r26 24062: ac 7f andi r26, 0xFC ; 252 24064: a9 56 subi r26, 0x69 ; 105 24066: b3 47 sbci r27, 0x73 ; 115 timer = (unsigned short)pgm_read_word_near(table_address); 24068: fd 01 movw r30, r26 2406a: 25 91 lpm r18, Z+ 2406c: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2406e: fd 01 movw r30, r26 24070: 32 96 adiw r30, 0x02 ; 2 24072: a5 91 lpm r26, Z+ 24074: b4 91 lpm r27, Z 24076: 87 70 andi r24, 0x07 ; 7 24078: 99 27 eor r25, r25 2407a: 8a 9f mul r24, r26 2407c: f0 01 movw r30, r0 2407e: 8b 9f mul r24, r27 24080: f0 0d add r31, r0 24082: 9a 9f mul r25, r26 24084: f0 0d add r31, r0 24086: 11 24 eor r1, r1 24088: a3 e0 ldi r26, 0x03 ; 3 2408a: f6 95 lsr r31 2408c: e7 95 ror r30 2408e: aa 95 dec r26 24090: e1 f7 brne .-8 ; 0x2408a <__vector_17+0xf08> 24092: 83 cf rjmp .-250 ; 0x23f9a <__vector_17+0xe18> } } #endif } else { if (! step_loops_nominal) { 24094: 80 91 73 05 lds r24, 0x0573 ; 0x800573 24098: 88 23 and r24, r24 2409a: 71 f0 breq .+28 ; 0x240b8 <__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; 2409c: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 2409e: 20 91 4d 05 lds r18, 0x054D ; 0x80054d 240a2: 30 91 4e 05 lds r19, 0x054E ; 0x80054e 240a6: 30 93 4f 04 sts 0x044F, r19 ; 0x80044f <_ZL11nextMainISR.lto_priv.437+0x1> 240aa: 20 93 4e 04 sts 0x044E, r18 ; 0x80044e <_ZL11nextMainISR.lto_priv.437> 240ae: 30 93 4b 04 sts 0x044B, r19 ; 0x80044b <_ZL9main_Rate.lto_priv.439+0x1> 240b2: 20 93 4a 04 sts 0x044A, r18 ; 0x80044a <_ZL9main_Rate.lto_priv.439> 240b6: 51 ce rjmp .-862 ; 0x23d5a <__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); 240b8: 8e a9 ldd r24, Y+54 ; 0x36 240ba: 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; 240bc: 81 34 cpi r24, 0x41 ; 65 240be: 2c e9 ldi r18, 0x9C ; 156 240c0: 92 07 cpc r25, r18 240c2: 08 f0 brcs .+2 ; 0x240c6 <__vector_17+0xf44> 240c4: 4e c0 rjmp .+156 ; 0x24162 <__vector_17+0xfe0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 240c6: 81 32 cpi r24, 0x21 ; 33 240c8: 4e e4 ldi r20, 0x4E ; 78 240ca: 94 07 cpc r25, r20 240cc: 08 f4 brcc .+2 ; 0x240d0 <__vector_17+0xf4e> 240ce: 4c c0 rjmp .+152 ; 0x24168 <__vector_17+0xfe6> step_rate = (step_rate >> 2)&0x3fff; 240d0: 96 95 lsr r25 240d2: 87 95 ror r24 240d4: 96 95 lsr r25 240d6: 87 95 ror r24 step_loops = 4; 240d8: 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; 240da: 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 240de: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 240e0: 81 15 cp r24, r1 240e2: a8 e0 ldi r26, 0x08 ; 8 240e4: 9a 07 cpc r25, r26 240e6: 08 f4 brcc .+2 ; 0x240ea <__vector_17+0xf68> 240e8: 51 c0 rjmp .+162 ; 0x2418c <__vector_17+0x100a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 240ea: e9 2f mov r30, r25 240ec: ff 27 eor r31, r31 240ee: ee 0f add r30, r30 240f0: ff 1f adc r31, r31 240f2: ee 0f add r30, r30 240f4: ff 1f adc r31, r31 240f6: 9f 01 movw r18, r30 240f8: 29 56 subi r18, 0x69 ; 105 240fa: 3f 46 sbci r19, 0x6F ; 111 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 240fc: f9 01 movw r30, r18 240fe: 32 96 adiw r30, 0x02 ; 2 24100: 65 91 lpm r22, Z+ 24102: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 24104: f9 01 movw r30, r18 24106: 25 91 lpm r18, Z+ 24108: 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. ); 2410a: 78 9f mul r23, r24 2410c: a0 01 movw r20, r0 2410e: 68 9f mul r22, r24 24110: 00 0c add r0, r0 24112: 41 1d adc r20, r1 24114: 11 24 eor r1, r1 24116: 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); 24118: c9 01 movw r24, r18 2411a: 84 1b sub r24, r20 2411c: 95 0b sbc r25, r21 2411e: 84 36 cpi r24, 0x64 ; 100 24120: 91 05 cpc r25, r1 24122: 10 f4 brcc .+4 ; 0x24128 <__vector_17+0xfa6> 24124: 84 e6 ldi r24, 0x64 ; 100 24126: 90 e0 ldi r25, 0x00 ; 0 24128: 90 93 4e 05 sts 0x054E, r25 ; 0x80054e 2412c: 80 93 4d 05 sts 0x054D, r24 ; 0x80054d step_loops_nominal = step_loops; 24130: 80 91 70 05 lds r24, 0x0570 ; 0x800570 24134: 80 93 73 05 sts 0x0573, r24 ; 0x800573 #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 24138: fe 01 movw r30, r28 2413a: e4 5b subi r30, 0xB4 ; 180 2413c: ff 4f sbci r31, 0xFF ; 255 2413e: 80 81 ld r24, Z 24140: 88 23 and r24, r24 24142: 09 f4 brne .+2 ; 0x24146 <__vector_17+0xfc4> 24144: ab cf rjmp .-170 ; 0x2409c <__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) 24146: 80 91 57 05 lds r24, 0x0557 ; 0x800557 2414a: 88 23 and r24, r24 2414c: 41 f0 breq .+16 ; 0x2415e <__vector_17+0xfdc> target_adv_steps = current_adv_steps; 2414e: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> 24152: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 24156: 90 93 6b 05 sts 0x056B, r25 ; 0x80056b 2415a: 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; 2415e: 81 e0 ldi r24, 0x01 ; 1 24160: 9e cf rjmp .-196 ; 0x2409e <__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; 24162: 80 e4 ldi r24, 0x40 ; 64 24164: 9c e9 ldi r25, 0x9C ; 156 24166: b4 cf rjmp .-152 ; 0x240d0 <__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 24168: 81 31 cpi r24, 0x11 ; 17 2416a: 57 e2 ldi r21, 0x27 ; 39 2416c: 95 07 cpc r25, r21 2416e: 20 f0 brcs .+8 ; 0x24178 <__vector_17+0xff6> step_rate = (step_rate >> 1)&0x7fff; 24170: 96 95 lsr r25 24172: 87 95 ror r24 step_loops = 2; 24174: 22 e0 ldi r18, 0x02 ; 2 24176: b1 cf rjmp .-158 ; 0x240da <__vector_17+0xf58> } else { step_loops = 1; 24178: 21 e0 ldi r18, 0x01 ; 1 2417a: 20 93 70 05 sts 0x0570, r18 ; 0x800570 2417e: 80 32 cpi r24, 0x20 ; 32 24180: 91 05 cpc r25, r1 24182: 08 f0 brcs .+2 ; 0x24186 <__vector_17+0x1004> 24184: ac cf rjmp .-168 ; 0x240de <__vector_17+0xf5c> 24186: 80 e2 ldi r24, 0x20 ; 32 24188: 90 e0 ldi r25, 0x00 ; 0 2418a: a9 cf rjmp .-174 ; 0x240de <__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; 2418c: 9c 01 movw r18, r24 2418e: 36 95 lsr r19 24190: 27 95 ror r18 24192: 2c 7f andi r18, 0xFC ; 252 24194: 29 56 subi r18, 0x69 ; 105 24196: 33 47 sbci r19, 0x73 ; 115 timer = (unsigned short)pgm_read_word_near(table_address); 24198: f9 01 movw r30, r18 2419a: 45 91 lpm r20, Z+ 2419c: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2419e: f9 01 movw r30, r18 241a0: 32 96 adiw r30, 0x02 ; 2 241a2: 65 91 lpm r22, Z+ 241a4: 74 91 lpm r23, Z 241a6: 87 70 andi r24, 0x07 ; 7 241a8: 99 27 eor r25, r25 241aa: 86 9f mul r24, r22 241ac: 90 01 movw r18, r0 241ae: 87 9f mul r24, r23 241b0: 30 0d add r19, r0 241b2: 96 9f mul r25, r22 241b4: 30 0d add r19, r0 241b6: 11 24 eor r1, r1 241b8: a3 e0 ldi r26, 0x03 ; 3 241ba: 36 95 lsr r19 241bc: 27 95 ror r18 241be: aa 95 dec r26 241c0: e1 f7 brne .-8 ; 0x241ba <__vector_17+0x1038> 241c2: ca 01 movw r24, r20 241c4: 82 1b sub r24, r18 241c6: 93 0b sbc r25, r19 241c8: aa cf rjmp .-172 ; 0x2411e <__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; 241ca: de 01 movw r26, r28 241cc: a3 5b subi r26, 0xB3 ; 179 241ce: bf 4f sbci r27, 0xFF ; 255 241d0: 4d 91 ld r20, X+ 241d2: 5c 91 ld r21, X 241d4: 11 97 sbiw r26, 0x01 ; 1 241d6: 70 e0 ldi r23, 0x00 ; 0 241d8: 60 e0 ldi r22, 0x00 ; 0 241da: 40 93 49 05 sts 0x0549, r20 ; 0x800549 241de: 50 93 4a 05 sts 0x054A, r21 ; 0x80054a 241e2: 60 93 4b 05 sts 0x054B, r22 ; 0x80054b 241e6: 70 93 4c 05 sts 0x054C, r23 ; 0x80054c e_step_loops = current_block->advance_step_loops; 241ea: 16 96 adiw r26, 0x06 ; 6 241ec: 9c 91 ld r25, X 241ee: 90 93 48 05 sts 0x0548, r25 ; 0x800548 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 241f2: 98 2f mov r25, r24 241f4: 92 70 andi r25, 0x02 ; 2 241f6: 09 f4 brne .+2 ; 0x241fa <__vector_17+0x1078> 241f8: c8 cd rjmp .-1136 ; 0x23d8a <__vector_17+0xc08> 241fa: 90 91 57 05 lds r25, 0x0557 ; 0x800557 241fe: 99 23 and r25, r25 24200: 09 f4 brne .+2 ; 0x24204 <__vector_17+0x1082> 24202: c3 cd rjmp .-1146 ; 0x23d8a <__vector_17+0xc08> 24204: 2e 17 cp r18, r30 24206: 3f 07 cpc r19, r31 24208: 08 f0 brcs .+2 ; 0x2420c <__vector_17+0x108a> 2420a: bf cd rjmp .-1154 ; 0x23d8a <__vector_17+0xc08> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 2420c: 44 0f add r20, r20 2420e: 55 1f adc r21, r21 24210: 66 1f adc r22, r22 24212: 77 1f adc r23, r23 24214: 40 93 49 05 sts 0x0549, r20 ; 0x800549 24218: 50 93 4a 05 sts 0x054A, r21 ; 0x80054a 2421c: 60 93 4b 05 sts 0x054B, r22 ; 0x80054b 24220: 70 93 4c 05 sts 0x054C, r23 ; 0x80054c LA_phase = 0; 24224: 10 92 68 05 sts 0x0568, r1 ; 0x800568 24228: b0 cd rjmp .-1184 ; 0x23d8a <__vector_17+0xc08> 2422a: 40 92 49 05 sts 0x0549, r4 ; 0x800549 2422e: 50 92 4a 05 sts 0x054A, r5 ; 0x80054a 24232: 60 92 4b 05 sts 0x054B, r6 ; 0x80054b 24236: 70 92 4c 05 sts 0x054C, r7 ; 0x80054c while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 2423a: 61 11 cpse r22, r1 2423c: 1d c0 rjmp .+58 ; 0x24278 <__vector_17+0x10f6> { eISR_Rate = timer; 2423e: f0 93 47 05 sts 0x0547, r31 ; 0x800547 24242: e0 93 46 05 sts 0x0546, r30 ; 0x800546 nextAdvanceISR = timer; 24246: f0 93 4d 04 sts 0x044D, r31 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 2424a: e0 93 4c 04 sts 0x044C, r30 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 2424e: 80 91 68 05 lds r24, 0x0568 ; 0x800568 24252: 87 fd sbrc r24, 7 24254: 5a c0 rjmp .+180 ; 0x2430a <__vector_17+0x1188> if (step_loops == e_step_loops) 24256: 80 91 70 05 lds r24, 0x0570 ; 0x800570 2425a: 10 91 48 05 lds r17, 0x0548 ; 0x800548 2425e: c3 5b subi r28, 0xB3 ; 179 24260: df 4f sbci r29, 0xFF ; 255 24262: 28 81 ld r18, Y 24264: 39 81 ldd r19, Y+1 ; 0x01 24266: 81 13 cpse r24, r17 24268: 35 c0 rjmp .+106 ; 0x242d4 <__vector_17+0x1152> LA_phase = (current_block->advance_rate < main_Rate); 2426a: 81 e0 ldi r24, 0x01 ; 1 2426c: 2e 17 cp r18, r30 2426e: 3f 07 cpc r19, r31 24270: 08 f4 brcc .+2 ; 0x24274 <__vector_17+0x10f2> 24272: 49 c0 rjmp .+146 ; 0x24306 <__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); 24274: 80 e0 ldi r24, 0x00 ; 0 24276: 47 c0 rjmp .+142 ; 0x24306 <__vector_17+0x1184> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 24278: 64 30 cpi r22, 0x04 ; 4 2427a: 28 f5 brcc .+74 ; 0x242c6 <__vector_17+0x1144> eISR_Rate = fastdiv(timer, ticks + 1); 2427c: 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); 2427e: 63 30 cpi r22, 0x03 ; 3 24280: a9 f0 breq .+42 ; 0x242ac <__vector_17+0x112a> 24282: 66 95 lsr r22 24284: af 01 movw r20, r30 24286: 02 c0 rjmp .+4 ; 0x2428c <__vector_17+0x110a> 24288: 56 95 lsr r21 2428a: 47 95 ror r20 2428c: 6a 95 dec r22 2428e: e2 f7 brpl .-8 ; 0x24288 <__vector_17+0x1106> 24290: 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); 24292: 70 93 47 05 sts 0x0547, r23 ; 0x800547 24296: 60 93 46 05 sts 0x0546, r22 ; 0x800546 } nextAdvanceISR = eISR_Rate; 2429a: 80 91 46 05 lds r24, 0x0546 ; 0x800546 2429e: 90 91 47 05 lds r25, 0x0547 ; 0x800547 242a2: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 242a6: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> 242aa: d1 cf rjmp .-94 ; 0x2424e <__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; 242ac: 9f 01 movw r18, r30 242ae: ab ea ldi r26, 0xAB ; 171 242b0: ba ea ldi r27, 0xAA ; 170 242b2: 0f 94 de a4 call 0x349bc ; 0x349bc <__umulhisi3> 242b6: 41 e1 ldi r20, 0x11 ; 17 242b8: 96 95 lsr r25 242ba: 87 95 ror r24 242bc: 77 95 ror r23 242be: 67 95 ror r22 242c0: 4a 95 dec r20 242c2: d1 f7 brne .-12 ; 0x242b8 <__vector_17+0x1136> 242c4: e6 cf rjmp .-52 ; 0x24292 <__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); 242c6: 70 e0 ldi r23, 0x00 ; 0 242c8: 6f 5f subi r22, 0xFF ; 255 242ca: 7f 4f sbci r23, 0xFF ; 255 242cc: cf 01 movw r24, r30 242ce: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__udivmodhi4> 242d2: df cf rjmp .-66 ; 0x24292 <__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); 242d4: 83 30 cpi r24, 0x03 ; 3 242d6: 09 f4 brne .+2 ; 0x242da <__vector_17+0x1158> 242d8: a2 c0 rjmp .+324 ; 0x2441e <__vector_17+0x129c> 242da: 86 95 lsr r24 242dc: a9 01 movw r20, r18 242de: 02 c0 rjmp .+4 ; 0x242e4 <__vector_17+0x1162> 242e0: 56 95 lsr r21 242e2: 47 95 ror r20 242e4: 8a 95 dec r24 242e6: e2 f7 brpl .-8 ; 0x242e0 <__vector_17+0x115e> 242e8: 13 30 cpi r17, 0x03 ; 3 242ea: 09 f4 brne .+2 ; 0x242ee <__vector_17+0x116c> 242ec: a6 c0 rjmp .+332 ; 0x2443a <__vector_17+0x12b8> 242ee: 16 95 lsr r17 242f0: bf 01 movw r22, r30 242f2: 02 c0 rjmp .+4 ; 0x242f8 <__vector_17+0x1176> 242f4: 76 95 lsr r23 242f6: 67 95 ror r22 242f8: 1a 95 dec r17 242fa: e2 f7 brpl .-8 ; 0x242f4 <__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); 242fc: 81 e0 ldi r24, 0x01 ; 1 242fe: 46 17 cp r20, r22 24300: 57 07 cpc r21, r23 24302: 08 f0 brcs .+2 ; 0x24306 <__vector_17+0x1184> 24304: b7 cf rjmp .-146 ; 0x24274 <__vector_17+0x10f2> 24306: 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(); 2430a: 0f 94 7e 00 call 0x200fc ; 0x200fc #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 2430e: 40 91 53 05 lds r20, 0x0553 ; 0x800553 24312: 50 91 54 05 lds r21, 0x0554 ; 0x800554 24316: 60 91 55 05 lds r22, 0x0555 ; 0x800555 2431a: 70 91 56 05 lds r23, 0x0556 ; 0x800556 2431e: e0 91 51 12 lds r30, 0x1251 ; 0x801251 24322: f0 91 52 12 lds r31, 0x1252 ; 0x801252 24326: 80 89 ldd r24, Z+16 ; 0x10 24328: 91 89 ldd r25, Z+17 ; 0x11 2432a: a2 89 ldd r26, Z+18 ; 0x12 2432c: b3 89 ldd r27, Z+19 ; 0x13 2432e: 48 17 cp r20, r24 24330: 59 07 cpc r21, r25 24332: 6a 07 cpc r22, r26 24334: 7b 07 cpc r23, r27 24336: 80 f0 brcs .+32 ; 0x24358 <__vector_17+0x11d6> current_block = NULL; 24338: 10 92 52 12 sts 0x1252, r1 ; 0x801252 2433c: 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) { 24340: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 24344: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 24348: 98 17 cp r25, r24 2434a: 31 f0 breq .+12 ; 0x24358 <__vector_17+0x11d6> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2434c: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 24350: 8f 5f subi r24, 0xFF ; 255 24352: 8f 70 andi r24, 0x0F ; 15 24354: 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; 24358: 60 91 4c 04 lds r22, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> 2435c: 70 91 4d 04 lds r23, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> if (eisr) 24360: 61 15 cp r22, r1 24362: 71 05 cpc r23, r1 24364: 09 f0 breq .+2 ; 0x24368 <__vector_17+0x11e6> 24366: 46 c0 rjmp .+140 ; 0x243f4 <__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) { 24368: 40 91 48 04 lds r20, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> 2436c: 50 91 49 04 lds r21, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 24370: 20 91 6a 05 lds r18, 0x056A ; 0x80056a 24374: 30 91 6b 05 lds r19, 0x056B ; 0x80056b 24378: 80 91 69 05 lds r24, 0x0569 ; 0x800569 2437c: 24 17 cp r18, r20 2437e: 35 07 cpc r19, r21 24380: 08 f0 brcs .+2 ; 0x24384 <__vector_17+0x1202> 24382: 6c c0 rjmp .+216 ; 0x2445c <__vector_17+0x12da> // decompression if (e_step_loops != 1) { 24384: 90 91 48 05 lds r25, 0x0548 ; 0x800548 24388: 91 30 cpi r25, 0x01 ; 1 2438a: 41 f0 breq .+16 ; 0x2439c <__vector_17+0x121a> uint16_t d_steps = current_adv_steps - target_adv_steps; 2438c: 42 1b sub r20, r18 2438e: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 24390: 94 17 cp r25, r20 24392: 15 06 cpc r1, r21 24394: 19 f0 breq .+6 ; 0x2439c <__vector_17+0x121a> 24396: 10 f0 brcs .+4 ; 0x2439c <__vector_17+0x121a> e_step_loops = d_steps; 24398: 40 93 48 05 sts 0x0548, r20 ; 0x800548 } e_steps -= e_step_loops; 2439c: 90 91 48 05 lds r25, 0x0548 ; 0x800548 243a0: 89 1b sub r24, r25 243a2: 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); 243a6: 88 23 and r24, r24 243a8: 39 f0 breq .+14 ; 0x243b8 <__vector_17+0x1236> 243aa: 87 ff sbrs r24, 7 243ac: 53 c0 rjmp .+166 ; 0x24454 <__vector_17+0x12d2> 243ae: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 243b2: 80 64 ori r24, 0x40 ; 64 243b4: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 243b8: 20 91 48 05 lds r18, 0x0548 ; 0x800548 243bc: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> 243c0: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 243c4: 82 1b sub r24, r18 243c6: 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; 243c8: 90 93 49 04 sts 0x0449, r25 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 243cc: 80 93 48 04 sts 0x0448, r24 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> } if (current_adv_steps == target_adv_steps) { 243d0: 20 91 48 04 lds r18, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> 243d4: 30 91 49 04 lds r19, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 243d8: 80 91 6a 05 lds r24, 0x056A ; 0x80056a 243dc: 90 91 6b 05 lds r25, 0x056B ; 0x80056b 243e0: 28 17 cp r18, r24 243e2: 39 07 cpc r19, r25 243e4: 09 f0 breq .+2 ; 0x243e8 <__vector_17+0x1266> 243e6: 66 c0 rjmp .+204 ; 0x244b4 <__vector_17+0x1332> // advance steps completed nextAdvanceISR = ADV_NEVER; 243e8: 8f ef ldi r24, 0xFF ; 255 243ea: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 243ec: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 243f0: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 243f4: 40 91 69 05 lds r20, 0x0569 ; 0x800569 243f8: 41 11 cpse r20, r1 243fa: 61 c0 rjmp .+194 ; 0x244be <__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) 243fc: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> 24400: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 24404: 20 91 4e 04 lds r18, 0x044E ; 0x80044e <_ZL11nextMainISR.lto_priv.437> 24408: 30 91 4f 04 lds r19, 0x044F ; 0x80044f <_ZL11nextMainISR.lto_priv.437+0x1> 2440c: 8f 3f cpi r24, 0xFF ; 255 2440e: 98 07 cpc r25, r24 24410: 09 f0 breq .+2 ; 0x24414 <__vector_17+0x1292> 24412: 98 c0 rjmp .+304 ; 0x24544 <__vector_17+0x13c2> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 24414: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 24418: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2441c: 9e c0 rjmp .+316 ; 0x2455a <__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; 2441e: ab ea ldi r26, 0xAB ; 171 24420: ba ea ldi r27, 0xAA ; 170 24422: 0f 94 de a4 call 0x349bc ; 0x349bc <__umulhisi3> 24426: ab 01 movw r20, r22 24428: bc 01 movw r22, r24 2442a: 31 e1 ldi r19, 0x11 ; 17 2442c: 76 95 lsr r23 2442e: 67 95 ror r22 24430: 57 95 ror r21 24432: 47 95 ror r20 24434: 3a 95 dec r19 24436: d1 f7 brne .-12 ; 0x2442c <__vector_17+0x12aa> 24438: 57 cf rjmp .-338 ; 0x242e8 <__vector_17+0x1166> 2443a: 9f 01 movw r18, r30 2443c: ab ea ldi r26, 0xAB ; 171 2443e: ba ea ldi r27, 0xAA ; 170 24440: 0f 94 de a4 call 0x349bc ; 0x349bc <__umulhisi3> 24444: 21 e1 ldi r18, 0x11 ; 17 24446: 96 95 lsr r25 24448: 87 95 ror r24 2444a: 77 95 ror r23 2444c: 67 95 ror r22 2444e: 2a 95 dec r18 24450: d1 f7 brne .-12 ; 0x24446 <__vector_17+0x12c4> 24452: 54 cf rjmp .-344 ; 0x242fc <__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); 24454: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24458: 8f 7b andi r24, 0xBF ; 191 2445a: ac cf rjmp .-168 ; 0x243b4 <__vector_17+0x1232> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 2445c: 42 17 cp r20, r18 2445e: 53 07 cpc r21, r19 24460: 08 f0 brcs .+2 ; 0x24464 <__vector_17+0x12e2> 24462: b6 cf rjmp .-148 ; 0x243d0 <__vector_17+0x124e> // compression if (e_step_loops != 1) { 24464: 90 91 48 05 lds r25, 0x0548 ; 0x800548 24468: 91 30 cpi r25, 0x01 ; 1 2446a: 41 f0 breq .+16 ; 0x2447c <__vector_17+0x12fa> uint16_t d_steps = target_adv_steps - current_adv_steps; 2446c: 24 1b sub r18, r20 2446e: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 24470: 92 17 cp r25, r18 24472: 13 06 cpc r1, r19 24474: 19 f0 breq .+6 ; 0x2447c <__vector_17+0x12fa> 24476: 10 f0 brcs .+4 ; 0x2447c <__vector_17+0x12fa> e_step_loops = d_steps; 24478: 20 93 48 05 sts 0x0548, r18 ; 0x800548 } e_steps += e_step_loops; 2447c: 90 91 48 05 lds r25, 0x0548 ; 0x800548 24480: 89 0f add r24, r25 24482: 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); 24486: 88 23 and r24, r24 24488: 39 f0 breq .+14 ; 0x24498 <__vector_17+0x1316> 2448a: 87 ff sbrs r24, 7 2448c: 0f c0 rjmp .+30 ; 0x244ac <__vector_17+0x132a> 2448e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24492: 80 64 ori r24, 0x40 ; 64 24494: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 24498: 80 91 48 05 lds r24, 0x0548 ; 0x800548 2449c: 20 91 48 04 lds r18, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> 244a0: 30 91 49 04 lds r19, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 244a4: 82 0f add r24, r18 244a6: 93 2f mov r25, r19 244a8: 91 1d adc r25, r1 244aa: 8e cf rjmp .-228 ; 0x243c8 <__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); 244ac: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 244b0: 8f 7b andi r24, 0xBF ; 191 244b2: f0 cf rjmp .-32 ; 0x24494 <__vector_17+0x1312> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 244b4: 80 91 46 05 lds r24, 0x0546 ; 0x800546 244b8: 90 91 47 05 lds r25, 0x0547 ; 0x800547 244bc: 97 cf rjmp .-210 ; 0x243ec <__vector_17+0x126a> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 244be: 80 91 68 05 lds r24, 0x0568 ; 0x800568 244c2: 87 fd sbrc r24, 7 244c4: 0e c0 rjmp .+28 ; 0x244e2 <__vector_17+0x1360> 244c6: 08 2e mov r0, r24 244c8: 00 0c add r0, r0 244ca: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 244cc: 21 e0 ldi r18, 0x01 ; 1 244ce: 30 e0 ldi r19, 0x00 ; 0 244d0: 61 15 cp r22, r1 244d2: 71 05 cpc r23, r1 244d4: 11 f0 breq .+4 ; 0x244da <__vector_17+0x1358> 244d6: 30 e0 ldi r19, 0x00 ; 0 244d8: 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)) { 244da: 82 17 cp r24, r18 244dc: 93 07 cpc r25, r19 244de: 09 f0 breq .+2 ; 0x244e2 <__vector_17+0x1360> 244e0: 8d cf rjmp .-230 ; 0x243fc <__vector_17+0x127a> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 244e2: 20 91 48 05 lds r18, 0x0548 ; 0x800548 244e6: 67 2b or r22, r23 244e8: 11 f0 breq .+4 ; 0x244ee <__vector_17+0x136c> 244ea: 20 91 70 05 lds r18, 0x0570 ; 0x800570 max_ticks = min(abs(e_steps), max_ticks); 244ee: 84 2f mov r24, r20 244f0: 04 2e mov r0, r20 244f2: 00 0c add r0, r0 244f4: 99 0b sbc r25, r25 244f6: 97 ff sbrs r25, 7 244f8: 03 c0 rjmp .+6 ; 0x24500 <__vector_17+0x137e> 244fa: 91 95 neg r25 244fc: 81 95 neg r24 244fe: 91 09 sbc r25, r1 24500: 30 e0 ldi r19, 0x00 ; 0 24502: 28 17 cp r18, r24 24504: 39 07 cpc r19, r25 24506: 0c f4 brge .+2 ; 0x2450a <__vector_17+0x1388> 24508: c9 01 movw r24, r18 2450a: 47 ff sbrs r20, 7 2450c: 17 c0 rjmp .+46 ; 0x2453c <__vector_17+0x13ba> 2450e: 61 e0 ldi r22, 0x01 ; 1 24510: 4f ef ldi r20, 0xFF ; 255 24512: 5f ef ldi r21, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 24514: 43 9a sbi 0x08, 3 ; 8 e_steps += (rev? 1: -1); 24516: 90 91 69 05 lds r25, 0x0569 ; 0x800569 2451a: 96 0f add r25, r22 2451c: 90 93 69 05 sts 0x0569, r25 ; 0x800569 STEP_NC_LO(E_AXIS); 24520: 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; 24522: 20 91 02 17 lds r18, 0x1702 ; 0x801702 24526: 30 91 03 17 lds r19, 0x1703 ; 0x801703 2452a: 24 0f add r18, r20 2452c: 35 1f adc r19, r21 2452e: 30 93 03 17 sts 0x1703, r19 ; 0x801703 24532: 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); 24536: 81 50 subi r24, 0x01 ; 1 24538: 69 f7 brne .-38 ; 0x24514 <__vector_17+0x1392> 2453a: 60 cf rjmp .-320 ; 0x243fc <__vector_17+0x127a> 2453c: 6f ef ldi r22, 0xFF ; 255 2453e: 41 e0 ldi r20, 0x01 ; 1 24540: 50 e0 ldi r21, 0x00 ; 0 24542: e8 cf rjmp .-48 ; 0x24514 <__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) 24544: ac 01 movw r20, r24 24546: 48 5d subi r20, 0xD8 ; 216 24548: 5f 4f sbci r21, 0xFF ; 255 2454a: 42 17 cp r20, r18 2454c: 53 07 cpc r21, r19 2454e: 08 f0 brcs .+2 ; 0x24552 <__vector_17+0x13d0> 24550: 61 cf rjmp .-318 ; 0x24414 <__vector_17+0x1292> OCR1A = nextAdvanceISR; 24552: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 24556: 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) { 2455a: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2455e: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 24562: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 24566: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2456a: 40 96 adiw r24, 0x10 ; 16 2456c: 28 17 cp r18, r24 2456e: 39 07 cpc r19, r25 24570: 48 f4 brcc .+18 ; 0x24584 <__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; 24572: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 24576: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2457a: 40 96 adiw r24, 0x10 ; 16 2457c: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 24580: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 24584: ff 91 pop r31 24586: ef 91 pop r30 24588: df 91 pop r29 2458a: cf 91 pop r28 2458c: bf 91 pop r27 2458e: af 91 pop r26 24590: 9f 91 pop r25 24592: 8f 91 pop r24 24594: 7f 91 pop r23 24596: 6f 91 pop r22 24598: 5f 91 pop r21 2459a: 4f 91 pop r20 2459c: 3f 91 pop r19 2459e: 2f 91 pop r18 245a0: 1f 91 pop r17 245a2: ff 90 pop r15 245a4: ef 90 pop r14 245a6: df 90 pop r13 245a8: cf 90 pop r12 245aa: 8f 90 pop r8 245ac: 7f 90 pop r7 245ae: 6f 90 pop r6 245b0: 5f 90 pop r5 245b2: 4f 90 pop r4 245b4: 0f 90 pop r0 245b6: 0b be out 0x3b, r0 ; 59 245b8: 0f 90 pop r0 245ba: 0f be out 0x3f, r0 ; 63 245bc: 0f 90 pop r0 245be: 1f 90 pop r1 245c0: 18 95 reti 000245c2 : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 245c2: 90 91 4f 05 lds r25, 0x054F ; 0x80054f check_z_endstop = check; 245c6: 80 93 4f 05 sts 0x054F, r24 ; 0x80054f CRITICAL_SECTION_START; 245ca: 2f b7 in r18, 0x3f ; 63 245cc: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 245ce: 80 91 5e 04 lds r24, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.441> 245d2: 8b 7f andi r24, 0xFB ; 251 245d4: 80 93 5e 04 sts 0x045E, r24 ; 0x80045e <_ZL11endstop_hit.lto_priv.441> CRITICAL_SECTION_END; 245d8: 2f bf out 0x3f, r18 ; 63 return old; } 245da: 89 2f mov r24, r25 245dc: 08 95 ret 000245de : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 245de: 80 91 5e 04 lds r24, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.441> CRITICAL_SECTION_START; 245e2: 2f b7 in r18, 0x3f ; 63 245e4: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 245e6: 90 91 5e 04 lds r25, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.441> 245ea: 9b 7f andi r25, 0xFB ; 251 245ec: 90 93 5e 04 sts 0x045E, r25 ; 0x80045e <_ZL11endstop_hit.lto_priv.441> CRITICAL_SECTION_END; 245f0: 2f bf out 0x3f, r18 ; 63 return hit; } 245f2: 82 fb bst r24, 2 245f4: 88 27 eor r24, r24 245f6: 80 f9 bld r24, 0 245f8: 08 95 ret 000245fa : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 245fa: 90 91 5e 04 lds r25, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.441> endstop_hit = 0; 245fe: 10 92 5e 04 sts 0x045E, r1 ; 0x80045e <_ZL11endstop_hit.lto_priv.441> return old; 24602: 81 e0 ldi r24, 0x01 ; 1 24604: 91 11 cpse r25, r1 24606: 01 c0 rjmp .+2 ; 0x2460a 24608: 80 e0 ldi r24, 0x00 ; 0 } 2460a: 08 95 ret 0002460c : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 2460c: 90 91 47 04 lds r25, 0x0447 ; 0x800447 24610: 91 30 cpi r25, 0x01 ; 1 24612: 99 f0 breq .+38 ; 0x2463a 24614: 28 f0 brcs .+10 ; 0x24620 24616: 92 30 cpi r25, 0x02 ; 2 24618: a1 f0 breq .+40 ; 0x24642 2461a: 93 30 cpi r25, 0x03 ; 3 2461c: b1 f0 breq .+44 ; 0x2464a 2461e: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 24620: 81 11 cpse r24, r1 24622: 02 c0 rjmp .+4 ; 0x24628 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(); 24624: 0d 94 d8 00 jmp 0x201b0 ; 0x201b0 switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 24628: 82 30 cpi r24, 0x02 ; 2 2462a: 11 f4 brne .+4 ; 0x24630 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 2462c: 0d 94 97 05 jmp 0x20b2e ; 0x20b2e 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) 24630: 85 30 cpi r24, 0x05 ; 5 24632: 81 f5 brne .+96 ; 0x24694 Sound_DoSound_Alert(false); 24634: 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); 24636: 0d 94 c4 00 jmp 0x20188 ; 0x20188 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) 2463a: 88 23 and r24, r24 2463c: 99 f3 breq .-26 ; 0x24624 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2463e: 82 30 cpi r24, 0x02 ; 2 24640: a9 f3 breq .-22 ; 0x2462c Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 24642: 85 30 cpi r24, 0x05 ; 5 24644: 39 f5 brne .+78 ; 0x24694 Sound_DoSound_Alert(true); 24646: 81 e0 ldi r24, 0x01 ; 1 24648: f6 cf rjmp .-20 ; 0x24636 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) 2464a: 88 23 and r24, r24 2464c: 59 f3 breq .-42 ; 0x24624 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2464e: 82 30 cpi r24, 0x02 ; 2 24650: 69 f3 breq .-38 ; 0x2462c Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 24652: 85 30 cpi r24, 0x05 ; 5 24654: 79 f3 breq .-34 ; 0x24634 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 24656: 86 30 cpi r24, 0x06 ; 6 24658: 71 f4 brne .+28 ; 0x24676 2465a: 85 e0 ldi r24, 0x05 ; 5 2465c: 27 e2 ldi r18, 0x27 ; 39 2465e: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 24660: 72 9a sbi 0x0e, 2 ; 14 24662: f9 01 movw r30, r18 24664: 31 97 sbiw r30, 0x01 ; 1 24666: f1 f7 brne .-4 ; 0x24664 delayMicroseconds(75); WRITE(BEEPER,LOW); 24668: 72 98 cbi 0x0e, 2 ; 14 2466a: f9 01 movw r30, r18 2466c: 31 97 sbiw r30, 0x01 ; 1 2466e: f1 f7 brne .-4 ; 0x2466c 24670: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 24672: b1 f7 brne .-20 ; 0x24660 24674: 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) 24676: 87 30 cpi r24, 0x07 ; 7 24678: 69 f4 brne .+26 ; 0x24694 2467a: 84 e1 ldi r24, 0x14 ; 20 2467c: 23 e7 ldi r18, 0x73 ; 115 2467e: 31 e0 ldi r19, 0x01 ; 1 backlight_wake(1); uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 24680: 72 9a sbi 0x0e, 2 ; 14 24682: f9 01 movw r30, r18 24684: 31 97 sbiw r30, 0x01 ; 1 24686: f1 f7 brne .-4 ; 0x24684 delayMicroseconds(94); WRITE(BEEPER,LOW); 24688: 72 98 cbi 0x0e, 2 ; 14 2468a: f9 01 movw r30, r18 2468c: 31 97 sbiw r30, 0x01 ; 1 2468e: f1 f7 brne .-4 ; 0x2468c 24690: 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++) 24692: b1 f7 brne .-20 ; 0x24680 Sound_DoSound_Blind_Alert(); break; default: break; } } 24694: 08 95 ret 00024696 : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 24696: 0f 93 push r16 24698: 1f 93 push r17 2469a: cf 93 push r28 2469c: df 93 push r29 2469e: 8c 01 movw r16, r24 246a0: 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; 246a2: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 246a6: 80 93 5d 12 sts 0x125D, r24 ; 0x80125d setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 246aa: 0f 94 c0 01 call 0x20380 ; 0x20380 246ae: 81 11 cpse r24, r1 246b0: 04 c0 rjmp .+8 ; 0x246ba resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 246b2: d0 93 5a 12 sts 0x125A, r29 ; 0x80125a 246b6: c0 93 59 12 sts 0x1259, r28 ; 0x801259 { const FilamentAction action = eFilamentAction; 246ba: c0 91 94 03 lds r28, 0x0394 ; 0x800394 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 246be: 87 ef ldi r24, 0xF7 ; 247 246c0: 8c 0f add r24, r28 246c2: 82 30 cpi r24, 0x02 ; 2 246c4: f8 f4 brcc .+62 ; 0x24704 { lcd_return_to_status(); 246c6: 0f 94 18 05 call 0x20a30 ; 0x20a30 if (action == FilamentAction::Lay1Cal) 246ca: ca 30 cpi r28, 0x0A ; 10 246cc: 41 f4 brne .+16 ; 0x246de { lcd_commands_type = LcdCommands::Layer1Cal; 246ce: 84 e0 ldi r24, 0x04 ; 4 246d0: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e } menu_back(); clearFilamentAction(); } } } 246d4: df 91 pop r29 246d6: cf 91 pop r28 246d8: 1f 91 pop r17 246da: 0f 91 pop r16 246dc: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 246de: 60 e0 ldi r22, 0x00 ; 0 246e0: 70 e0 ldi r23, 0x00 ; 0 246e2: 80 e2 ldi r24, 0x20 ; 32 246e4: 91 e4 ldi r25, 0x41 ; 65 246e6: 0e 94 51 6d call 0xdaa2 ; 0xdaa2 if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 246ea: 8f e5 ldi r24, 0x5F ; 95 246ec: 9f e0 ldi r25, 0x0F ; 15 246ee: 0f 94 3e a4 call 0x3487c ; 0x3487c 246f2: 88 23 and r24, r24 246f4: 79 f3 breq .-34 ; 0x246d4 lcd_wizard(WizState::LoadFilHot); 246f6: 88 e0 ldi r24, 0x08 ; 8 } menu_back(); clearFilamentAction(); } } } 246f8: df 91 pop r29 246fa: cf 91 pop r28 246fc: 1f 91 pop r17 246fe: 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); 24700: 0c 94 87 e9 jmp 0x1d30e ; 0x1d30e 24704: 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) 24708: 80 91 16 06 lds r24, 0x0616 ; 0x800616 2470c: 81 11 cpse r24, r1 2470e: 12 c0 rjmp .+36 ; 0x24734 24710: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 24714: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 24718: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2471c: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 24720: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 24724: 60 1b sub r22, r16 24726: 71 0b sbc r23, r17 24728: 6c 5f subi r22, 0xFC ; 252 2472a: 7f 4f sbci r23, 0xFF ; 255 2472c: 69 30 cpi r22, 0x09 ; 9 2472e: 71 05 cpc r23, r1 24730: 08 f0 brcs .+2 ; 0x24734 24732: 60 c0 rjmp .+192 ; 0x247f4 { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 24734: c1 50 subi r28, 0x01 ; 1 24736: c8 30 cpi r28, 0x08 ; 8 24738: 88 f5 brcc .+98 ; 0x2479c 2473a: ec 2f mov r30, r28 2473c: f0 e0 ldi r31, 0x00 ; 0 2473e: 88 27 eor r24, r24 24740: eb 55 subi r30, 0x5B ; 91 24742: fc 4d sbci r31, 0xDC ; 220 24744: 8e 4f sbci r24, 0xFE ; 254 24746: 0d 94 4e a5 jmp 0x34a9c ; 0x34a9c <__tablejump2__> 2474a: e8 37 cpi r30, 0x78 ; 120 2474c: e8 37 cpi r30, 0x78 ; 120 2474e: e8 37 cpi r30, 0x78 ; 120 24750: 8a 37 cpi r24, 0x7A ; 122 24752: 9a 38 cpi r25, 0x8A ; 138 24754: c2 37 cpi r28, 0x72 ; 114 24756: 6a 38 cpi r22, 0x8A ; 138 24758: ca 38 cpi r28, 0x8A ; 138 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 2475a: c2 e5 ldi r28, 0x52 ; 82 2475c: de ec ldi r29, 0xCE ; 206 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2475e: 80 91 14 06 lds r24, 0x0614 ; 0x800614 24762: 88 23 and r24, r24 24764: 29 f0 breq .+10 ; 0x24770 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 24766: 82 e0 ldi r24, 0x02 ; 2 24768: 0f 94 06 23 call 0x2460c ; 0x2460c bFilamentWaitingFlag = false; 2476c: 10 92 14 06 sts 0x0614, r1 ; 0x800614 } if (filamentActionMenu) { 24770: 20 97 sbiw r28, 0x00 ; 0 24772: 09 f4 brne .+2 ; 0x24776 24774: af cf rjmp .-162 ; 0x246d4 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 24776: 0f 94 54 02 call 0x204a8 ; 0x204a8 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 2477a: 61 e0 ldi r22, 0x01 ; 1 2477c: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2477e: df 91 pop r29 24780: cf 91 pop r28 24782: 1f 91 pop r17 24784: 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); 24786: 0c 94 38 63 jmp 0xc670 ; 0xc670 switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 2478a: 80 91 14 06 lds r24, 0x0614 ; 0x800614 2478e: 88 23 and r24, r24 24790: 41 f0 breq .+16 ; 0x247a2 24792: 61 e0 ldi r22, 0x01 ; 1 24794: 82 ea ldi r24, 0xA2 ; 162 24796: 98 e3 ldi r25, 0x38 ; 56 24798: 0e 94 38 63 call 0xc670 ; 0xc670 // 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; 2479c: d0 e0 ldi r29, 0x00 ; 0 2479e: c0 e0 ldi r28, 0x00 ; 0 247a0: de cf rjmp .-68 ; 0x2475e case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 247a2: 0f 94 54 02 call 0x204a8 ; 0x204a8 if (eFilamentAction == FilamentAction::AutoLoad) { 247a6: 80 91 94 03 lds r24, 0x0394 ; 0x800394 247aa: 82 30 cpi r24, 0x02 ; 2 247ac: 19 f4 brne .+6 ; 0x247b4 // loading no longer cancellable eFilamentAction = FilamentAction::Load; 247ae: 81 e0 ldi r24, 0x01 ; 1 247b0: 80 93 94 03 sts 0x0394, r24 ; 0x800394 } if (eFilamentAction == FilamentAction::Load) 247b4: 80 91 94 03 lds r24, 0x0394 ; 0x800394 247b8: 81 30 cpi r24, 0x01 ; 1 247ba: 31 f4 brne .+12 ; 0x247c8 enquecommand_P(MSG_M701); // load filament 247bc: 61 e0 ldi r22, 0x01 ; 1 247be: 8c eb ldi r24, 0xBC ; 188 247c0: 9b e6 ldi r25, 0x6B ; 107 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 247c2: 0e 94 65 8d call 0x11aca ; 0x11aca 247c6: ea cf rjmp .-44 ; 0x2479c eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 247c8: 83 30 cpi r24, 0x03 ; 3 247ca: 41 f7 brne .-48 ; 0x2479c enquecommand_P(MSG_M702); // unload filament 247cc: 61 e0 ldi r22, 0x01 ; 1 247ce: 8c e6 ldi r24, 0x6C ; 108 247d0: 99 e6 ldi r25, 0x69 ; 105 247d2: f7 cf rjmp .-18 ; 0x247c2 break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 247d4: cc ec ldi r28, 0xCC ; 204 247d6: dd ec ldi r29, 0xCD ; 205 247d8: c2 cf rjmp .-124 ; 0x2475e break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 247da: 0f 94 54 02 call 0x204a8 ; 0x204a8 MMU2::mmu2.unload(); 247de: 0f 94 cf 9d call 0x33b9e ; 0x33b9e // 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(); 247e2: 0f 94 0d 09 call 0x2121a ; 0x2121a 247e6: da cf rjmp .-76 ; 0x2479c break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 247e8: ca e4 ldi r28, 0x4A ; 74 247ea: de ec ldi r29, 0xCE ; 206 247ec: b8 cf rjmp .-144 ; 0x2475e break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 247ee: c2 e4 ldi r28, 0x42 ; 66 247f0: de ec ldi r29, 0xCE ; 206 247f2: b5 cf rjmp .-150 ; 0x2475e menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 247f4: 80 91 14 06 lds r24, 0x0614 ; 0x800614 247f8: 88 23 and r24, r24 247fa: 21 f0 breq .+8 ; 0x24804 247fc: 80 91 59 02 lds r24, 0x0259 ; 0x800259 24800: 88 23 and r24, r24 24802: 71 f1 breq .+92 ; 0x24860 // 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; 24804: 81 e0 ldi r24, 0x01 ; 1 24806: 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; 2480a: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_clear(); 2480e: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); 24812: 87 e2 ldi r24, 0x27 ; 39 24814: 9d e3 ldi r25, 0x3D ; 61 24816: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2481a: ac 01 movw r20, r24 2481c: 63 e0 ldi r22, 0x03 ; 3 2481e: 80 e0 ldi r24, 0x00 ; 0 24820: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_set_cursor(0, 1); 24824: 61 e0 ldi r22, 0x01 ; 1 24826: 80 e0 ldi r24, 0x00 ; 0 24828: 0e 94 b5 6f call 0xdf6a ; 0xdf6a switch (eFilamentAction) 2482c: e0 91 94 03 lds r30, 0x0394 ; 0x800394 24830: e1 50 subi r30, 0x01 ; 1 24832: e8 30 cpi r30, 0x08 ; 8 24834: a8 f4 brcc .+42 ; 0x24860 24836: f0 e0 ldi r31, 0x00 ; 0 24838: 88 27 eor r24, r24 2483a: ee 5d subi r30, 0xDE ; 222 2483c: fb 4d sbci r31, 0xDB ; 219 2483e: 8e 4f sbci r24, 0xFE ; 254 24840: 0d 94 4e a5 jmp 0x34a9c ; 0x34a9c <__tablejump2__> 24844: 78 37 cpi r23, 0x78 ; 120 24846: 78 37 cpi r23, 0x78 ; 120 24848: 5c 37 cpi r21, 0x7C ; 124 2484a: 78 37 cpi r23, 0x78 ; 120 2484c: 5c 37 cpi r21, 0x7C ; 124 2484e: 3c 38 cpi r19, 0x8C ; 140 24850: 6e 38 cpi r22, 0x8E ; 142 24852: 78 37 cpi r23, 0x78 ; 120 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 24854: 8d eb ldi r24, 0xBD ; 189 24856: 98 e5 ldi r25, 0x58 ; 88 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 24858: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2485c: 0e 94 78 6f call 0xdef0 ; 0xdef0 // handled earlier break; } } if (bFilamentWaitingFlag) { 24860: 80 91 14 06 lds r24, 0x0614 ; 0x800614 24864: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 24866: 0f 94 f0 09 call 0x213e0 ; 0x213e0 } if (lcd_clicked()) 2486a: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 2486e: 88 23 and r24, r24 24870: 09 f4 brne .+2 ; 0x24874 24872: 30 cf rjmp .-416 ; 0x246d4 { // Filament action canceled while preheating bFilamentWaitingFlag = false; 24874: 10 92 14 06 sts 0x0614, r1 ; 0x800614 if (!bFilamentPreheatState) 24878: 80 91 15 06 lds r24, 0x0615 ; 0x800615 2487c: 81 11 cpse r24, r1 2487e: 0e c0 rjmp .+28 ; 0x2489c return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 24880: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 24884: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 24888: 0e 94 90 66 call 0xcd20 ; 0xcd20 2488c: 81 11 cpse r24, r1 2488e: 04 c0 rjmp .+8 ; 0x24898 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 24890: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 24894: 10 92 59 12 sts 0x1259, r1 ; 0x801259 menu_back(); 24898: 0e 94 76 63 call 0xc6ec ; 0xc6ec } menu_back(); 2489c: 0e 94 76 63 call 0xc6ec ; 0xc6ec clearFilamentAction(); } } } 248a0: df 91 pop r29 248a2: cf 91 pop r28 248a4: 1f 91 pop r17 248a6: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 248a8: 0d 94 0d 09 jmp 0x2121a ; 0x2121a 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)); 248ac: 86 ea ldi r24, 0xA6 ; 166 248ae: 98 e5 ldi r25, 0x58 ; 88 248b0: d3 cf rjmp .-90 ; 0x24858 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 248b2: 80 e9 ldi r24, 0x90 ; 144 248b4: 98 e5 ldi r25, 0x58 ; 88 248b6: d0 cf rjmp .-96 ; 0x24858 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 248b8: 8c e7 ldi r24, 0x7C ; 124 248ba: 98 e5 ldi r25, 0x58 ; 88 248bc: cd cf rjmp .-102 ; 0x24858 000248be : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 248be: 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) ); 248c2: 40 91 01 13 lds r20, 0x1301 ; 0x801301 248c6: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 248ca: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 248ce: 41 30 cpi r20, 0x01 ; 1 248d0: 59 f0 breq .+22 ; 0x248e8 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() 248d2: 10 92 16 06 sts 0x0616, r1 ; 0x800616 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 248d6: 80 91 57 02 lds r24, 0x0257 ; 0x800257 248da: 90 91 58 02 lds r25, 0x0258 ; 0x800258 248de: 28 17 cp r18, r24 248e0: 39 07 cpc r19, r25 248e2: 5c f4 brge .+22 ; 0x248fa bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 248e4: 0d 94 10 09 jmp 0x21220 ; 0x21220 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() 248e8: 90 91 d7 12 lds r25, 0x12D7 ; 0x8012d7 248ec: 91 11 cpse r25, r1 248ee: f1 cf rjmp .-30 ; 0x248d2 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 248f0: 86 50 subi r24, 0x06 ; 6 248f2: 82 30 cpi r24, 0x02 ; 2 248f4: 70 f7 brcc .-36 ; 0x248d2 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() 248f6: 40 93 16 06 sts 0x0616, r20 ; 0x800616 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 248fa: 81 e0 ldi r24, 0x01 ; 1 248fc: 80 93 15 06 sts 0x0615, r24 ; 0x800615 mFilamentItem(target_temperature[0], target_temperature_bed); 24900: 60 91 59 12 lds r22, 0x1259 ; 0x801259 24904: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 24908: c9 01 movw r24, r18 2490a: 0f 94 4b 23 call 0x24696 ; 0x24696 bFilamentSkipPreheat = false; // Reset flag 2490e: 10 92 16 06 sts 0x0616, r1 ; 0x800616 } else { lcd_generic_preheat_menu(); } } 24912: 08 95 ret 00024914 : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 24914: 82 e0 ldi r24, 0x02 ; 2 24916: 0d 94 5f 24 jmp 0x248be ; 0x248be 0002491a : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 2491a: 81 e0 ldi r24, 0x01 ; 1 2491c: 0d 94 5f 24 jmp 0x248be ; 0x248be 00024920 : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 24920: 83 e0 ldi r24, 0x03 ; 3 24922: 0d 94 5f 24 jmp 0x248be ; 0x248be 00024926 : } } static void mFilamentItem_farm() { bFilamentPreheatState = false; 24926: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, FARM_PREHEAT_HPB_TEMP); 2492a: 60 e5 ldi r22, 0x50 ; 80 2492c: 70 e0 ldi r23, 0x00 ; 0 2492e: 8a ef ldi r24, 0xFA ; 250 24930: 90 e0 ldi r25, 0x00 ; 0 24932: 0d 94 4b 23 jmp 0x24696 ; 0x24696 00024936 : } static void mFilamentItem_farm_nozzle() { bFilamentPreheatState = false; 24936: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); 2493a: 70 e0 ldi r23, 0x00 ; 0 2493c: 60 e0 ldi r22, 0x00 ; 0 2493e: 8a ef ldi r24, 0xFA ; 250 24940: 90 e0 ldi r25, 0x00 ; 0 24942: 0d 94 4b 23 jmp 0x24696 ; 0x24696 00024946 : } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 24946: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 2494a: 6c e3 ldi r22, 0x3C ; 60 2494c: 70 e0 ldi r23, 0x00 ; 0 2494e: 87 ed ldi r24, 0xD7 ; 215 24950: 90 e0 ldi r25, 0x00 ; 0 24952: 0d 94 4b 23 jmp 0x24696 ; 0x24696 00024956 : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 24956: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 2495a: 65 e5 ldi r22, 0x55 ; 85 2495c: 70 e0 ldi r23, 0x00 ; 0 2495e: 86 ee ldi r24, 0xE6 ; 230 24960: 90 e0 ldi r25, 0x00 ; 0 24962: 0d 94 4b 23 jmp 0x24696 ; 0x24696 00024966 : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 24966: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2496a: 69 e6 ldi r22, 0x69 ; 105 2496c: 70 e0 ldi r23, 0x00 ; 0 2496e: 84 e0 ldi r24, 0x04 ; 4 24970: 91 e0 ldi r25, 0x01 ; 1 24972: 0d 94 4b 23 jmp 0x24696 ; 0x24696 00024976 : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 24976: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 2497a: 69 e6 ldi r22, 0x69 ; 105 2497c: 70 e0 ldi r23, 0x00 ; 0 2497e: 83 e1 ldi r24, 0x13 ; 19 24980: 91 e0 ldi r25, 0x01 ; 1 24982: 0d 94 4b 23 jmp 0x24696 ; 0x24696 00024986 : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 24986: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 2498a: 6b e4 ldi r22, 0x4B ; 75 2498c: 70 e0 ldi r23, 0x00 ; 0 2498e: 87 ed ldi r24, 0xD7 ; 215 24990: 90 e0 ldi r25, 0x00 ; 0 24992: 0d 94 4b 23 jmp 0x24696 ; 0x24696 00024996 : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 24996: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 2499a: 6a e5 ldi r22, 0x5A ; 90 2499c: 70 e0 ldi r23, 0x00 ; 0 2499e: 83 e1 ldi r24, 0x13 ; 19 249a0: 91 e0 ldi r25, 0x01 ; 1 249a2: 0d 94 4b 23 jmp 0x24696 ; 0x24696 000249a6 : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 249a6: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 249aa: 64 e6 ldi r22, 0x64 ; 100 249ac: 70 e0 ldi r23, 0x00 ; 0 249ae: 8f ef ldi r24, 0xFF ; 255 249b0: 90 e0 ldi r25, 0x00 ; 0 249b2: 0d 94 4b 23 jmp 0x24696 ; 0x24696 000249b6 : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 249b6: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 249ba: 64 e6 ldi r22, 0x64 ; 100 249bc: 70 e0 ldi r23, 0x00 ; 0 249be: 8c ed ldi r24, 0xDC ; 220 249c0: 90 e0 ldi r25, 0x00 ; 0 249c2: 0d 94 4b 23 jmp 0x24696 ; 0x24696 000249c6 : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 249c6: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 249ca: 64 e6 ldi r22, 0x64 ; 100 249cc: 70 e0 ldi r23, 0x00 ; 0 249ce: 8e ef ldi r24, 0xFE ; 254 249d0: 90 e0 ldi r25, 0x00 ; 0 249d2: 0d 94 4b 23 jmp 0x24696 ; 0x24696 000249d6 : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 249d6: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 249da: 62 e3 ldi r22, 0x32 ; 50 249dc: 70 e0 ldi r23, 0x00 ; 0 249de: 80 ef ldi r24, 0xF0 ; 240 249e0: 90 e0 ldi r25, 0x00 ; 0 249e2: 0d 94 4b 23 jmp 0x24696 ; 0x24696 000249e6 : } 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){ 249e6: cf 92 push r12 249e8: df 92 push r13 249ea: ef 92 push r14 249ec: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 249ee: 41 11 cpse r20, r1 249f0: 04 c0 rjmp .+8 ; 0x249fa 249f2: 20 91 47 04 lds r18, 0x0447 ; 0x800447 249f6: 22 30 cpi r18, 0x02 ; 2 249f8: 61 f0 breq .+24 ; 0x24a12 249fa: 9b 01 movw r18, r22 249fc: 6c 01 movw r12, r24 249fe: f1 2c mov r15, r1 24a00: e1 2c mov r14, r1 if(!tone_) { 24a02: 67 2b or r22, r23 24a04: 59 f4 brne .+22 ; 0x24a1c WRITE(BEEPER, HIGH); 24a06: 72 9a sbi 0x0e, 2 ; 14 _delay(ms); 24a08: c7 01 movw r24, r14 24a0a: b6 01 movw r22, r12 24a0c: 0f 94 ce 0a call 0x2159c ; 0x2159c 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); 24a10: 72 98 cbi 0x0e, 2 ; 14 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 24a12: ff 90 pop r15 24a14: ef 90 pop r14 24a16: df 90 pop r13 24a18: cf 90 pop r12 24a1a: 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); 24a1c: 22 0f add r18, r18 24a1e: 33 1f adc r19, r19 24a20: 50 e0 ldi r21, 0x00 ; 0 24a22: 40 e0 ldi r20, 0x00 ; 0 24a24: 60 e0 ldi r22, 0x00 ; 0 24a26: 74 e2 ldi r23, 0x24 ; 36 24a28: 84 ef ldi r24, 0xF4 ; 244 24a2a: 90 e0 ldi r25, 0x00 ; 0 24a2c: 0f 94 2f a5 call 0x34a5e ; 0x34a5e <__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; 24a30: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 24a32: 21 15 cp r18, r1 24a34: 31 05 cpc r19, r1 24a36: 81 e0 ldi r24, 0x01 ; 1 24a38: 48 07 cpc r20, r24 24a3a: 51 05 cpc r21, r1 24a3c: 44 f0 brlt .+16 ; 0x24a4e pwm_freq /= 64; // Increase prescaler to 64 24a3e: 86 e0 ldi r24, 0x06 ; 6 24a40: 56 95 lsr r21 24a42: 47 95 ror r20 24a44: 37 95 ror r19 24a46: 27 95 ror r18 24a48: 8a 95 dec r24 24a4a: d1 f7 brne .-12 ; 0x24a40 prescalarbits = 0b011; 24a4c: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 24a4e: 21 50 subi r18, 0x01 ; 1 24a50: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 24a52: 4f b7 in r20, 0x3f ; 63 24a54: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 24a56: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 24a5a: 88 7f andi r24, 0xF8 ; 248 24a5c: 89 2b or r24, r25 24a5e: 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); 24a62: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 24a66: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24a6a: 26 9f mul r18, r22 24a6c: c0 01 movw r24, r0 24a6e: 27 9f mul r18, r23 24a70: 90 0d add r25, r0 24a72: 36 9f mul r19, r22 24a74: 90 0d add r25, r0 24a76: 11 24 eor r1, r1 24a78: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24a7c: 6f ef ldi r22, 0xFF ; 255 24a7e: 70 e0 ldi r23, 0x00 ; 0 24a80: 51 ff sbrs r21, 1 24a82: 04 c0 rjmp .+8 ; 0x24a8c 24a84: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 24a88: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24a8c: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__udivmodhi4> 24a90: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24a94: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 24a98: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24a9c: 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); 24aa0: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24aa4: 83 60 ori r24, 0x03 ; 3 24aa6: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 24aaa: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 24aac: c7 01 movw r24, r14 24aae: b6 01 movw r22, r12 24ab0: 0f 94 ce 0a call 0x2159c ; 0x2159c } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 24ab4: 2f b7 in r18, 0x3f ; 63 24ab6: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 24ab8: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 24abc: 88 7f andi r24, 0xF8 ; 248 24abe: 85 60 ori r24, 0x05 ; 5 24ac0: 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); 24ac4: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 24ac8: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24acc: 3f ef ldi r19, 0xFF ; 255 24ace: 34 9f mul r19, r20 24ad0: c0 01 movw r24, r0 24ad2: 35 9f mul r19, r21 24ad4: 90 0d add r25, r0 24ad6: 11 24 eor r1, r1 24ad8: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24adc: 6f ef ldi r22, 0xFF ; 255 24ade: 70 e0 ldi r23, 0x00 ; 0 24ae0: 31 ff sbrs r19, 1 24ae2: 04 c0 rjmp .+8 ; 0x24aec 24ae4: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 24ae8: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24aec: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__udivmodhi4> 24af0: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24af4: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 24af8: 8f ef ldi r24, 0xFF ; 255 24afa: 90 e0 ldi r25, 0x00 ; 0 24afc: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24b00: 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)); 24b04: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24b08: 8c 7f andi r24, 0xFC ; 252 24b0a: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 24b0e: 2f bf out 0x3f, r18 ; 63 24b10: 7f cf rjmp .-258 ; 0x24a10 00024b12 : /// 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() { 24b12: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 24b14: c0 91 47 04 lds r28, 0x0447 ; 0x800447 24b18: c2 30 cpi r28, 0x02 ; 2 24b1a: 59 f1 breq .+86 ; 0x24b72 // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 24b1c: c1 30 cpi r28, 0x01 ; 1 24b1e: 69 f4 brne .+26 ; 0x24b3a if (bFirst) return; 24b20: 80 91 c1 04 lds r24, 0x04C1 ; 0x8004c1 <_ZL6bFirst.lto_priv.498> 24b24: 81 11 cpse r24, r1 24b26: 25 c0 rjmp .+74 ; 0x24b72 Sound_MakeCustom(80, 0, false); 24b28: 40 e0 ldi r20, 0x00 ; 0 24b2a: 70 e0 ldi r23, 0x00 ; 0 24b2c: 60 e0 ldi r22, 0x00 ; 0 24b2e: 80 e5 ldi r24, 0x50 ; 80 24b30: 90 e0 ldi r25, 0x00 ; 0 24b32: 0f 94 f3 24 call 0x249e6 ; 0x249e6 bFirst = true; 24b36: c0 93 c1 04 sts 0x04C1, r28 ; 0x8004c1 <_ZL6bFirst.lto_priv.498> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 24b3a: 60 ed ldi r22, 0xD0 ; 208 24b3c: 77 e0 ldi r23, 0x07 ; 7 24b3e: 8e eb ldi r24, 0xBE ; 190 24b40: 94 e0 ldi r25, 0x04 ; 4 24b42: 0f 94 58 0b call 0x216b0 ; 0x216b0 ::expired_cont(unsigned short)> 24b46: 88 23 and r24, r24 24b48: a1 f0 breq .+40 ; 0x24b72 beep_timer.start(); 24b4a: 8e eb ldi r24, 0xBE ; 190 24b4c: 94 e0 ldi r25, 0x04 ; 4 24b4e: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 24b52: 80 91 47 04 lds r24, 0x0447 ; 0x800447 24b56: 81 11 cpse r24, r1 24b58: 08 c0 rjmp .+16 ; 0x24b6a Sound_MakeCustom(80, 0, false); 24b5a: 40 e0 ldi r20, 0x00 ; 0 24b5c: 70 e0 ldi r23, 0x00 ; 0 24b5e: 60 e0 ldi r22, 0x00 ; 0 24b60: 80 e5 ldi r24, 0x50 ; 80 24b62: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 24b64: 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); 24b66: 0d 94 f3 24 jmp 0x249e6 ; 0x249e6 } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 24b6a: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 24b6c: 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); 24b6e: 0d 94 06 23 jmp 0x2460c ; 0x2460c } } #endif // BEEPER > 0 } 24b72: cf 91 pop r28 24b74: 08 95 ret 00024b76 : { #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; 24b76: 98 b1 in r25, 0x08 ; 8 24b78: 90 7f andi r25, 0xF0 ; 240 PORTC = portC | (axes_mask & 0x0f); //set step signals by mask 24b7a: 89 2b or r24, r25 24b7c: 88 b9 out 0x08, r24 ; 8 asm("nop"); 24b7e: 00 00 nop PORTC = portC; //set step signals to zero 24b80: 98 b9 out 0x08, r25 ; 8 asm("nop"); 24b82: 00 00 nop #endif #endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a)) } 24b84: 08 95 ret 00024b86 : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 24b86: 82 30 cpi r24, 0x02 ; 2 24b88: b9 f0 breq .+46 ; 0x24bb8 24b8a: 83 30 cpi r24, 0x03 ; 3 24b8c: e9 f0 breq .+58 ; 0x24bc8 24b8e: 81 30 cpi r24, 0x01 ; 1 24b90: 59 f0 breq .+22 ; 0x24ba8 { #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; 24b92: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24b96: 61 11 cpse r22, r1 24b98: 05 c0 rjmp .+10 ; 0x24ba4 24b9a: 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; 24b9c: 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"); 24ba0: 00 00 nop } 24ba2: 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; 24ba4: 8d 7f andi r24, 0xFD ; 253 24ba6: fa cf rjmp .-12 ; 0x24b9c case 1: if (dir == INVERT_Y_DIR) PORTL |= 1; else PORTL &= ~1; break; 24ba8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24bac: 61 11 cpse r22, r1 24bae: 02 c0 rjmp .+4 ; 0x24bb4 24bb0: 81 60 ori r24, 0x01 ; 1 24bb2: f4 cf rjmp .-24 ; 0x24b9c 24bb4: 8e 7f andi r24, 0xFE ; 254 24bb6: f2 cf rjmp .-28 ; 0x24b9c case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 24bb8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24bbc: 61 11 cpse r22, r1 24bbe: 02 c0 rjmp .+4 ; 0x24bc4 24bc0: 84 60 ori r24, 0x04 ; 4 24bc2: ec cf rjmp .-40 ; 0x24b9c 24bc4: 8b 7f andi r24, 0xFB ; 251 24bc6: ea cf rjmp .-44 ; 0x24b9c case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 24bc8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24bcc: 61 30 cpi r22, 0x01 ; 1 24bce: 11 f4 brne .+4 ; 0x24bd4 24bd0: 80 64 ori r24, 0x40 ; 64 24bd2: e4 cf rjmp .-56 ; 0x24b9c 24bd4: 8f 7b andi r24, 0xBF ; 191 24bd6: e2 cf rjmp .-60 ; 0x24b9c 00024bd8 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 24bd8: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24bda: 0d b4 in r0, 0x2d ; 45 24bdc: 07 fe sbrs r0, 7 24bde: fd cf rjmp .-6 ; 0x24bda } 24be0: 08 95 ret 00024be2 : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 24be2: 8f ef ldi r24, 0xFF ; 255 24be4: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24be6: 0d b4 in r0, 0x2d ; 45 24be8: 07 fe sbrs r0, 7 24bea: fd cf rjmp .-6 ; 0x24be6 return SPDR; 24bec: 8e b5 in r24, 0x2e ; 46 } 24bee: 08 95 ret 00024bf0 : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 24bf0: 8f 92 push r8 24bf2: 9f 92 push r9 24bf4: af 92 push r10 24bf6: bf 92 push r11 24bf8: ef 92 push r14 24bfa: ff 92 push r15 24bfc: 0f 93 push r16 24bfe: 1f 93 push r17 24c00: cf 93 push r28 24c02: 7c 01 movw r14, r24 24c04: c6 2f mov r28, r22 24c06: 49 01 movw r8, r18 24c08: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 24c0a: fc 01 movw r30, r24 24c0c: 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); 24c0e: 89 2f mov r24, r25 24c10: 80 6a ori r24, 0xA0 ; 160 24c12: 86 95 lsr r24 24c14: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 24c16: 90 fd sbrc r25, 0 24c18: 03 c0 rjmp .+6 ; 0x24c20 24c1a: 81 e0 ldi r24, 0x01 ; 1 24c1c: 96 30 cpi r25, 0x06 ; 6 24c1e: 09 f4 brne .+2 ; 0x24c22 24c20: 80 e0 ldi r24, 0x00 ; 0 24c22: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 24c24: 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); 24c26: 8c e2 ldi r24, 0x2C ; 44 24c28: 91 e0 ldi r25, 0x01 ; 1 24c2a: 0f 94 54 65 call 0x2caa8 ; 0x2caa8 // send command spiSend(cmd | 0x40); 24c2e: 8c 2f mov r24, r28 24c30: 80 64 ori r24, 0x40 ; 64 24c32: 0f 94 ec 25 call 0x24bd8 ; 0x24bd8 24c36: 08 e1 ldi r16, 0x18 ; 24 24c38: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 24c3a: d5 01 movw r26, r10 24c3c: c4 01 movw r24, r8 24c3e: 00 2e mov r0, r16 24c40: 04 c0 rjmp .+8 ; 0x24c4a 24c42: b6 95 lsr r27 24c44: a7 95 ror r26 24c46: 97 95 ror r25 24c48: 87 95 ror r24 24c4a: 0a 94 dec r0 24c4c: d2 f7 brpl .-12 ; 0x24c42 24c4e: 0f 94 ec 25 call 0x24bd8 ; 0x24bd8 24c52: 08 50 subi r16, 0x08 ; 8 24c54: 11 09 sbc r17, r1 24c56: 08 3f cpi r16, 0xF8 ; 248 24c58: ff ef ldi r31, 0xFF ; 255 24c5a: 1f 07 cpc r17, r31 24c5c: 71 f7 brne .-36 ; 0x24c3a // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 24c5e: 85 e9 ldi r24, 0x95 ; 149 24c60: cc 23 and r28, r28 24c62: 21 f0 breq .+8 ; 0x24c6c if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 24c64: 87 e8 ldi r24, 0x87 ; 135 24c66: c8 30 cpi r28, 0x08 ; 8 24c68: 09 f0 breq .+2 ; 0x24c6c // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 24c6a: 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); 24c6c: 0f 94 ec 25 call 0x24bd8 ; 0x24bd8 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 24c70: cc 30 cpi r28, 0x0C ; 12 24c72: 11 f4 brne .+4 ; 0x24c78 24c74: 0f 94 f1 25 call 0x24be2 ; 0x24be2 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 24c78: 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 */ } 24c7a: 0f 94 f1 25 call 0x24be2 ; 0x24be2 24c7e: f7 01 movw r30, r14 24c80: 82 83 std Z+2, r24 ; 0x02 24c82: 87 ff sbrs r24, 7 24c84: 04 c0 rjmp .+8 ; 0x24c8e 24c86: cf 3f cpi r28, 0xFF ; 255 24c88: 11 f0 breq .+4 ; 0x24c8e 24c8a: cf 5f subi r28, 0xFF ; 255 24c8c: f6 cf rjmp .-20 ; 0x24c7a return status_; } 24c8e: cf 91 pop r28 24c90: 1f 91 pop r17 24c92: 0f 91 pop r16 24c94: ff 90 pop r15 24c96: ef 90 pop r14 24c98: bf 90 pop r11 24c9a: af 90 pop r10 24c9c: 9f 90 pop r9 24c9e: 8f 90 pop r8 24ca0: 08 95 ret 00024ca2 : * \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) { 24ca2: 0f 93 push r16 24ca4: 1f 93 push r17 24ca6: cf 93 push r28 24ca8: df 93 push r29 24caa: ec 01 movw r28, r24 24cac: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 24cae: 8b 81 ldd r24, Y+3 ; 0x03 24cb0: 83 30 cpi r24, 0x03 ; 3 24cb2: 39 f0 breq .+14 ; 0x24cc2 24cb4: 89 e0 ldi r24, 0x09 ; 9 24cb6: 44 0f add r20, r20 24cb8: 55 1f adc r21, r21 24cba: 66 1f adc r22, r22 24cbc: 77 1f adc r23, r23 24cbe: 8a 95 dec r24 24cc0: d1 f7 brne .-12 ; 0x24cb6 if (cardCommand(CMD24, blockNumber)) { 24cc2: 9a 01 movw r18, r20 24cc4: ab 01 movw r20, r22 24cc6: 68 e1 ldi r22, 0x18 ; 24 24cc8: ce 01 movw r24, r28 24cca: 0f 94 f8 25 call 0x24bf0 ; 0x24bf0 24cce: 88 23 and r24, r24 24cd0: 19 f0 breq .+6 ; 0x24cd8 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 24cd2: 86 e0 ldi r24, 0x06 ; 6 24cd4: 88 83 st Y, r24 24cd6: 39 c0 rjmp .+114 ; 0x24d4a } //------------------------------------------------------------------------------ /** 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; 24cd8: 8e ef ldi r24, 0xFE ; 254 24cda: 8e bd out 0x2e, r24 ; 46 24cdc: f8 01 movw r30, r16 24cde: c8 01 movw r24, r16 24ce0: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24ce2: 0d b4 in r0, 0x2d ; 45 24ce4: 07 fe sbrs r0, 7 24ce6: fd cf rjmp .-6 ; 0x24ce2 SPDR = buf[i]; 24ce8: 20 81 ld r18, Z 24cea: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24cec: 0d b4 in r0, 0x2d ; 45 24cee: 07 fe sbrs r0, 7 24cf0: fd cf rjmp .-6 ; 0x24cec SPDR = buf[i + 1]; 24cf2: 21 81 ldd r18, Z+1 ; 0x01 24cf4: 2e bd out 0x2e, r18 ; 46 24cf6: 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) { 24cf8: e8 17 cp r30, r24 24cfa: f9 07 cpc r31, r25 24cfc: 91 f7 brne .-28 ; 0x24ce2 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 */ } 24cfe: 0d b4 in r0, 0x2d ; 45 24d00: 07 fe sbrs r0, 7 24d02: fd cf rjmp .-6 ; 0x24cfe //------------------------------------------------------------------------------ // 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 24d04: 8f ef ldi r24, 0xFF ; 255 24d06: 0f 94 ec 25 call 0x24bd8 ; 0x24bd8 spiSend(0xff); // dummy crc 24d0a: 8f ef ldi r24, 0xFF ; 255 24d0c: 0f 94 ec 25 call 0x24bd8 ; 0x24bd8 status_ = spiRec(); 24d10: 0f 94 f1 25 call 0x24be2 ; 0x24be2 24d14: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 24d16: 8f 71 andi r24, 0x1F ; 31 24d18: 85 30 cpi r24, 0x05 ; 5 24d1a: 99 f4 brne .+38 ; 0x24d42 goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 24d1c: 88 e5 ldi r24, 0x58 ; 88 24d1e: 92 e0 ldi r25, 0x02 ; 2 24d20: 0f 94 54 65 call 0x2caa8 ; 0x2caa8 24d24: 18 2f mov r17, r24 24d26: 87 e1 ldi r24, 0x17 ; 23 24d28: 11 23 and r17, r17 24d2a: a1 f2 breq .-88 ; 0x24cd4 error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 24d2c: 20 e0 ldi r18, 0x00 ; 0 24d2e: 30 e0 ldi r19, 0x00 ; 0 24d30: a9 01 movw r20, r18 24d32: 6d e0 ldi r22, 0x0D ; 13 24d34: ce 01 movw r24, r28 24d36: 0f 94 f8 25 call 0x24bf0 ; 0x24bf0 24d3a: 88 23 and r24, r24 24d3c: 51 f0 breq .+20 ; 0x24d52 24d3e: 86 e1 ldi r24, 0x16 ; 22 24d40: c9 cf rjmp .-110 ; 0x24cd4 24d42: 83 e1 ldi r24, 0x13 ; 19 24d44: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 24d46: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 } chipSelectHigh(); return true; fail: chipSelectHigh(); 24d4a: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 return false; 24d4e: 10 e0 ldi r17, 0x00 ; 0 24d50: 06 c0 rjmp .+12 ; 0x24d5e 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()) { 24d52: 0f 94 f1 25 call 0x24be2 ; 0x24be2 24d56: 81 11 cpse r24, r1 24d58: f2 cf rjmp .-28 ; 0x24d3e error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 24d5a: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 return true; fail: chipSelectHigh(); return false; } 24d5e: 81 2f mov r24, r17 24d60: df 91 pop r29 24d62: cf 91 pop r28 24d64: 1f 91 pop r17 24d66: 0f 91 pop r16 24d68: 08 95 ret 00024d6a : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 24d6a: cf 93 push r28 if (cacheDirty_) { 24d6c: 80 91 42 0e lds r24, 0x0E42 ; 0x800e42 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 24d70: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 24d72: 88 23 and r24, r24 24d74: a1 f0 breq .+40 ; 0x24d9e if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 24d76: 40 91 3a 0e lds r20, 0x0E3A ; 0x800e3a 24d7a: 50 91 3b 0e lds r21, 0x0E3B ; 0x800e3b 24d7e: 60 91 3c 0e lds r22, 0x0E3C ; 0x800e3c 24d82: 70 91 3d 0e lds r23, 0x0E3D ; 0x800e3d 24d86: 26 e4 ldi r18, 0x46 ; 70 24d88: 3e e0 ldi r19, 0x0E ; 14 24d8a: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 24d8e: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 24d92: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 24d96: c8 2f mov r28, r24 24d98: 81 11 cpse r24, r1 24d9a: 04 c0 rjmp .+8 ; 0x24da4 cacheDirty_ = 0; } return true; fail: return false; 24d9c: c0 e0 ldi r28, 0x00 ; 0 } 24d9e: 8c 2f mov r24, r28 24da0: cf 91 pop r28 24da2: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 24da4: 40 91 3e 0e lds r20, 0x0E3E ; 0x800e3e 24da8: 50 91 3f 0e lds r21, 0x0E3F ; 0x800e3f 24dac: 60 91 40 0e lds r22, 0x0E40 ; 0x800e40 24db0: 70 91 41 0e lds r23, 0x0E41 ; 0x800e41 24db4: 41 15 cp r20, r1 24db6: 51 05 cpc r21, r1 24db8: 61 05 cpc r22, r1 24dba: 71 05 cpc r23, r1 24dbc: 91 f0 breq .+36 ; 0x24de2 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 24dbe: 26 e4 ldi r18, 0x46 ; 70 24dc0: 3e e0 ldi r19, 0x0E ; 14 24dc2: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 24dc6: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 24dca: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 24dce: 88 23 and r24, r24 24dd0: 29 f3 breq .-54 ; 0x24d9c goto fail; } cacheMirrorBlock_ = 0; 24dd2: 10 92 3e 0e sts 0x0E3E, r1 ; 0x800e3e 24dd6: 10 92 3f 0e sts 0x0E3F, r1 ; 0x800e3f 24dda: 10 92 40 0e sts 0x0E40, r1 ; 0x800e40 24dde: 10 92 41 0e sts 0x0E41, r1 ; 0x800e41 } cacheDirty_ = 0; 24de2: 10 92 42 0e sts 0x0E42, r1 ; 0x800e42 24de6: db cf rjmp .-74 ; 0x24d9e 00024de8 : * \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) { 24de8: 2f 92 push r2 24dea: 3f 92 push r3 24dec: 4f 92 push r4 24dee: 5f 92 push r5 24df0: 6f 92 push r6 24df2: 7f 92 push r7 24df4: 8f 92 push r8 24df6: 9f 92 push r9 24df8: af 92 push r10 24dfa: bf 92 push r11 24dfc: cf 92 push r12 24dfe: df 92 push r13 24e00: ef 92 push r14 24e02: ff 92 push r15 24e04: 0f 93 push r16 24e06: 1f 93 push r17 24e08: cf 93 push r28 24e0a: df 93 push r29 24e0c: ec 01 movw r28, r24 24e0e: 2a 01 movw r4, r20 24e10: 3b 01 movw r6, r22 24e12: 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; 24e14: 8b 81 ldd r24, Y+3 ; 0x03 24e16: 83 30 cpi r24, 0x03 ; 3 24e18: 39 f0 breq .+14 ; 0x24e28 24e1a: 69 e0 ldi r22, 0x09 ; 9 24e1c: 44 0c add r4, r4 24e1e: 55 1c adc r5, r5 24e20: 66 1c adc r6, r6 24e22: 77 1c adc r7, r7 24e24: 6a 95 dec r22 24e26: d1 f7 brne .-12 ; 0x24e1c retry2: 24e28: 43 e0 ldi r20, 0x03 ; 3 24e2a: 94 2e mov r9, r20 24e2c: 56 01 movw r10, r12 24e2e: 81 e0 ldi r24, 0x01 ; 1 24e30: a8 1a sub r10, r24 24e32: 8e ef ldi r24, 0xFE ; 254 24e34: b8 0a sbc r11, r24 24e36: 16 01 movw r2, r12 24e38: ee ef ldi r30, 0xFE ; 254 24e3a: 3e 1a sub r3, r30 24e3c: 54 e0 ldi r21, 0x04 ; 4 24e3e: 85 2e mov r8, r21 retryCnt --; 24e40: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 24e42: a3 01 movw r20, r6 24e44: 92 01 movw r18, r4 24e46: 61 e1 ldi r22, 0x11 ; 17 24e48: ce 01 movw r24, r28 24e4a: 0f 94 f8 25 call 0x24bf0 ; 0x24bf0 24e4e: 88 23 and r24, r24 24e50: 79 f0 breq .+30 ; 0x24e70 24e52: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 24e54: 99 20 and r9, r9 24e56: 09 f4 brne .+2 ; 0x24e5a 24e58: 7a c0 rjmp .+244 ; 0x24f4e if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 24e5a: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 24e5e: 20 e0 ldi r18, 0x00 ; 0 24e60: 30 e0 ldi r19, 0x00 ; 0 24e62: a9 01 movw r20, r18 24e64: 6c e0 ldi r22, 0x0C ; 12 24e66: ce 01 movw r24, r28 24e68: 0f 94 f8 25 call 0x24bf0 ; 0x24bf0 errorCode_ = 0; 24e6c: 18 82 st Y, r1 24e6e: e8 cf rjmp .-48 ; 0x24e40 #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 24e70: 0f 94 01 0b call 0x21602 ; 0x21602 24e74: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 24e76: 0f 94 f1 25 call 0x24be2 ; 0x24be2 24e7a: 8a 83 std Y+2, r24 ; 0x02 24e7c: 8f 3f cpi r24, 0xFF ; 255 24e7e: 91 f4 brne .+36 ; 0x24ea4 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 24e80: 0f 94 01 0b call 0x21602 ; 0x21602 24e84: 60 1b sub r22, r16 24e86: 71 0b sbc r23, r17 24e88: 6d 32 cpi r22, 0x2D ; 45 24e8a: 71 40 sbci r23, 0x01 ; 1 24e8c: a0 f3 brcs .-24 ; 0x24e76 24e8e: 81 e1 ldi r24, 0x11 ; 17 24e90: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 24e92: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 24e96: 8c 81 ldd r24, Y+4 ; 0x04 24e98: 88 23 and r24, r24 24e9a: e1 f2 breq .-72 ; 0x24e54 spiSend(0XFF); 24e9c: 8f ef ldi r24, 0xFF ; 255 24e9e: 0f 94 ec 25 call 0x24bd8 ; 0x24bd8 24ea2: d8 cf rjmp .-80 ; 0x24e54 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 24ea4: 8e 3f cpi r24, 0xFE ; 254 24ea6: 11 f0 breq .+4 ; 0x24eac 24ea8: 8f e0 ldi r24, 0x0F ; 15 24eaa: f2 cf rjmp .-28 ; 0x24e90 //------------------------------------------------------------------------------ /** 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; 24eac: 8f ef ldi r24, 0xFF ; 255 24eae: 8e bd out 0x2e, r24 ; 46 24eb0: d6 01 movw r26, r12 24eb2: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24eb4: 0d b4 in r0, 0x2d ; 45 24eb6: 07 fe sbrs r0, 7 24eb8: fd cf rjmp .-6 ; 0x24eb4 buf[i] = SPDR; 24eba: 9e b5 in r25, 0x2e ; 46 24ebc: 91 93 st Z+, r25 SPDR = 0XFF; 24ebe: 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++) { 24ec0: ea 15 cp r30, r10 24ec2: fb 05 cpc r31, r11 24ec4: b9 f7 brne .-18 ; 0x24eb4 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24ec6: 0d b4 in r0, 0x2d ; 45 24ec8: 07 fe sbrs r0, 7 24eca: fd cf rjmp .-6 ; 0x24ec6 buf[nbyte] = SPDR; 24ecc: 8e b5 in r24, 0x2e ; 46 24ece: f5 01 movw r30, r10 24ed0: 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; 24ed2: f1 2c mov r15, r1 24ed4: 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); 24ed6: 8d 91 ld r24, X+ 24ed8: ef 2d mov r30, r15 24eda: ff 27 eor r31, r31 24edc: e8 27 eor r30, r24 24ede: ee 0f add r30, r30 24ee0: ff 1f adc r31, r31 24ee2: e2 57 subi r30, 0x72 ; 114 24ee4: f5 47 sbci r31, 0x75 ; 117 24ee6: 85 91 lpm r24, Z+ 24ee8: 94 91 lpm r25, Z 24eea: fe 2c mov r15, r14 24eec: ee 24 eor r14, r14 24eee: e8 26 eor r14, r24 24ef0: 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++) { 24ef2: 2a 16 cp r2, r26 24ef4: 3b 06 cpc r3, r27 24ef6: 79 f7 brne .-34 ; 0x24ed6 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 24ef8: 0f 94 f1 25 call 0x24be2 ; 0x24be2 24efc: 08 2f mov r16, r24 24efe: 10 e0 ldi r17, 0x00 ; 0 24f00: 10 2f mov r17, r16 24f02: 00 27 eor r16, r16 recvCrc |= spiRec(); 24f04: 0f 94 f1 25 call 0x24be2 ; 0x24be2 24f08: 08 2b or r16, r24 if (calcCrc != recvCrc) 24f0a: 0e 15 cp r16, r14 24f0c: 1f 05 cpc r17, r15 24f0e: 19 f0 breq .+6 ; 0x24f16 24f10: f0 e2 ldi r31, 0x20 ; 32 24f12: f8 83 st Y, r31 24f14: be cf rjmp .-132 ; 0x24e92 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 24f16: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 24f1a: cc 81 ldd r28, Y+4 ; 0x04 24f1c: cc 23 and r28, r28 24f1e: d9 f0 breq .+54 ; 0x24f56 spiSend(0XFF); 24f20: 8f ef ldi r24, 0xFF ; 255 24f22: 0f 94 ec 25 call 0x24bd8 ; 0x24bd8 #endif fail: chipSelectHigh(); return false; } 24f26: 8c 2f mov r24, r28 24f28: df 91 pop r29 24f2a: cf 91 pop r28 24f2c: 1f 91 pop r17 24f2e: 0f 91 pop r16 24f30: ff 90 pop r15 24f32: ef 90 pop r14 24f34: df 90 pop r13 24f36: cf 90 pop r12 24f38: bf 90 pop r11 24f3a: af 90 pop r10 24f3c: 9f 90 pop r9 24f3e: 8f 90 pop r8 24f40: 7f 90 pop r7 24f42: 6f 90 pop r6 24f44: 5f 90 pop r5 24f46: 4f 90 pop r4 24f48: 3f 90 pop r3 24f4a: 2f 90 pop r2 24f4c: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 24f4e: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 return false; 24f52: c0 e0 ldi r28, 0x00 ; 0 24f54: e8 cf rjmp .-48 ; 0x24f26 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 24f56: c1 e0 ldi r28, 0x01 ; 1 24f58: e6 cf rjmp .-52 ; 0x24f26 00024f5a : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 24f5a: cf 92 push r12 24f5c: df 92 push r13 24f5e: ef 92 push r14 24f60: ff 92 push r15 24f62: cf 93 push r28 24f64: 6b 01 movw r12, r22 24f66: 7c 01 movw r14, r24 24f68: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 24f6a: 80 91 3a 0e lds r24, 0x0E3A ; 0x800e3a 24f6e: 90 91 3b 0e lds r25, 0x0E3B ; 0x800e3b 24f72: a0 91 3c 0e lds r26, 0x0E3C ; 0x800e3c 24f76: b0 91 3d 0e lds r27, 0x0E3D ; 0x800e3d 24f7a: 8c 15 cp r24, r12 24f7c: 9d 05 cpc r25, r13 24f7e: ae 05 cpc r26, r14 24f80: bf 05 cpc r27, r15 24f82: 01 f1 breq .+64 ; 0x24fc4 if (!cacheFlush()) goto fail; 24f84: 0f 94 b5 26 call 0x24d6a ; 0x24d6a 24f88: 81 11 cpse r24, r1 24f8a: 08 c0 rjmp .+16 ; 0x24f9c } if (dirty) cacheDirty_ = true; return true; fail: return false; 24f8c: c0 e0 ldi r28, 0x00 ; 0 } 24f8e: 8c 2f mov r24, r28 24f90: cf 91 pop r28 24f92: ff 90 pop r15 24f94: ef 90 pop r14 24f96: df 90 pop r13 24f98: cf 90 pop r12 24f9a: 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; 24f9c: 26 e4 ldi r18, 0x46 ; 70 24f9e: 3e e0 ldi r19, 0x0E ; 14 24fa0: b7 01 movw r22, r14 24fa2: a6 01 movw r20, r12 24fa4: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 24fa8: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 24fac: 0f 94 f4 26 call 0x24de8 ; 0x24de8 24fb0: 88 23 and r24, r24 24fb2: 61 f3 breq .-40 ; 0x24f8c cacheBlockNumber_ = blockNumber; 24fb4: c0 92 3a 0e sts 0x0E3A, r12 ; 0x800e3a 24fb8: d0 92 3b 0e sts 0x0E3B, r13 ; 0x800e3b 24fbc: e0 92 3c 0e sts 0x0E3C, r14 ; 0x800e3c 24fc0: f0 92 3d 0e sts 0x0E3D, r15 ; 0x800e3d } if (dirty) cacheDirty_ = true; 24fc4: cc 23 and r28, r28 24fc6: 21 f0 breq .+8 ; 0x24fd0 24fc8: 81 e0 ldi r24, 0x01 ; 1 24fca: 80 93 42 0e sts 0x0E42, r24 ; 0x800e42 24fce: df cf rjmp .-66 ; 0x24f8e return true; 24fd0: c1 e0 ldi r28, 0x01 ; 1 24fd2: dd cf rjmp .-70 ; 0x24f8e 00024fd4 : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 24fd4: 4f 92 push r4 24fd6: 5f 92 push r5 24fd8: 6f 92 push r6 24fda: 7f 92 push r7 24fdc: 8f 92 push r8 24fde: 9f 92 push r9 24fe0: af 92 push r10 24fe2: bf 92 push r11 24fe4: cf 92 push r12 24fe6: df 92 push r13 24fe8: ef 92 push r14 24fea: ff 92 push r15 24fec: 0f 93 push r16 24fee: 1f 93 push r17 24ff0: cf 93 push r28 24ff2: df 93 push r29 24ff4: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 24ff6: 42 30 cpi r20, 0x02 ; 2 24ff8: 51 05 cpc r21, r1 24ffa: 61 05 cpc r22, r1 24ffc: 71 05 cpc r23, r1 24ffe: 90 f4 brcc .+36 ; 0x25024 // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 25000: 80 e0 ldi r24, 0x00 ; 0 } 25002: df 91 pop r29 25004: cf 91 pop r28 25006: 1f 91 pop r17 25008: 0f 91 pop r16 2500a: ff 90 pop r15 2500c: ef 90 pop r14 2500e: df 90 pop r13 25010: cf 90 pop r12 25012: bf 90 pop r11 25014: af 90 pop r10 25016: 9f 90 pop r9 25018: 8f 90 pop r8 2501a: 7f 90 pop r7 2501c: 6f 90 pop r6 2501e: 5f 90 pop r5 25020: 4f 90 pop r4 25022: 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; 25024: 89 85 ldd r24, Y+9 ; 0x09 25026: 9a 85 ldd r25, Y+10 ; 0x0a 25028: ab 85 ldd r26, Y+11 ; 0x0b 2502a: bc 85 ldd r27, Y+12 ; 0x0c 2502c: 01 96 adiw r24, 0x01 ; 1 2502e: a1 1d adc r26, r1 25030: b1 1d adc r27, r1 25032: 84 17 cp r24, r20 25034: 95 07 cpc r25, r21 25036: a6 07 cpc r26, r22 25038: b7 07 cpc r27, r23 2503a: 10 f3 brcs .-60 ; 0x25000 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 2503c: 8f 89 ldd r24, Y+23 ; 0x17 2503e: 80 31 cpi r24, 0x10 ; 16 25040: c9 f5 brne .+114 ; 0x250b4 lba = fatStartBlock_ + (cluster >> 8); 25042: 85 2e mov r8, r21 25044: 96 2e mov r9, r22 25046: a7 2e mov r10, r23 25048: bb 24 eor r11, r11 2504a: 8b 89 ldd r24, Y+19 ; 0x13 2504c: 9c 89 ldd r25, Y+20 ; 0x14 2504e: ad 89 ldd r26, Y+21 ; 0x15 25050: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 25052: 88 0e add r8, r24 25054: 99 1e adc r9, r25 25056: aa 1e adc r10, r26 25058: bb 1e adc r11, r27 2505a: 28 01 movw r4, r16 2505c: 39 01 movw r6, r18 2505e: 6a 01 movw r12, r20 25060: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 25062: 41 e0 ldi r20, 0x01 ; 1 25064: c5 01 movw r24, r10 25066: b4 01 movw r22, r8 25068: 0f 94 ad 27 call 0x24f5a ; 0x24f5a 2506c: 88 23 and r24, r24 2506e: 41 f2 breq .-112 ; 0x25000 // store entry if (fatType_ == 16) { 25070: 9f 89 ldd r25, Y+23 ; 0x17 25072: 90 31 cpi r25, 0x10 ; 16 25074: 81 f5 brne .+96 ; 0x250d6 cacheBuffer_.fat16[cluster & 0XFF] = value; 25076: dd 24 eor r13, r13 25078: ee 24 eor r14, r14 2507a: ff 24 eor r15, r15 2507c: f6 01 movw r30, r12 2507e: ee 0f add r30, r30 25080: ff 1f adc r31, r31 25082: ea 5b subi r30, 0xBA ; 186 25084: f1 4f sbci r31, 0xF1 ; 241 25086: 11 83 std Z+1, r17 ; 0x01 25088: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 2508a: 9a 89 ldd r25, Y+18 ; 0x12 2508c: 92 30 cpi r25, 0x02 ; 2 2508e: 08 f4 brcc .+2 ; 0x25092 25090: b8 cf rjmp .-144 ; 0x25002 25092: 4d 81 ldd r20, Y+5 ; 0x05 25094: 5e 81 ldd r21, Y+6 ; 0x06 25096: 6f 81 ldd r22, Y+7 ; 0x07 25098: 78 85 ldd r23, Y+8 ; 0x08 2509a: 84 0e add r8, r20 2509c: 95 1e adc r9, r21 2509e: a6 1e adc r10, r22 250a0: b7 1e adc r11, r23 250a2: 80 92 3e 0e sts 0x0E3E, r8 ; 0x800e3e 250a6: 90 92 3f 0e sts 0x0E3F, r9 ; 0x800e3f 250aa: a0 92 40 0e sts 0x0E40, r10 ; 0x800e40 250ae: b0 92 41 0e sts 0x0E41, r11 ; 0x800e41 250b2: a7 cf rjmp .-178 ; 0x25002 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 250b4: 80 32 cpi r24, 0x20 ; 32 250b6: 09 f0 breq .+2 ; 0x250ba 250b8: a3 cf rjmp .-186 ; 0x25000 lba = fatStartBlock_ + (cluster >> 7); 250ba: 8b 89 ldd r24, Y+19 ; 0x13 250bc: 9c 89 ldd r25, Y+20 ; 0x14 250be: ad 89 ldd r26, Y+21 ; 0x15 250c0: be 89 ldd r27, Y+22 ; 0x16 250c2: 4a 01 movw r8, r20 250c4: 5b 01 movw r10, r22 250c6: e7 e0 ldi r30, 0x07 ; 7 250c8: b6 94 lsr r11 250ca: a7 94 ror r10 250cc: 97 94 ror r9 250ce: 87 94 ror r8 250d0: ea 95 dec r30 250d2: d1 f7 brne .-12 ; 0x250c8 250d4: be cf rjmp .-132 ; 0x25052 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 250d6: e8 94 clt 250d8: c7 f8 bld r12, 7 250da: dd 24 eor r13, r13 250dc: ee 24 eor r14, r14 250de: ff 24 eor r15, r15 250e0: f6 01 movw r30, r12 250e2: ee 0f add r30, r30 250e4: ff 1f adc r31, r31 250e6: ee 0f add r30, r30 250e8: ff 1f adc r31, r31 250ea: ea 5b subi r30, 0xBA ; 186 250ec: f1 4f sbci r31, 0xF1 ; 241 250ee: 40 82 st Z, r4 250f0: 51 82 std Z+1, r5 ; 0x01 250f2: 62 82 std Z+2, r6 ; 0x02 250f4: 73 82 std Z+3, r7 ; 0x03 250f6: c9 cf rjmp .-110 ; 0x2508a 000250f8 : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 250f8: cf 92 push r12 250fa: df 92 push r13 250fc: ef 92 push r14 250fe: ff 92 push r15 25100: 0f 93 push r16 25102: 1f 93 push r17 25104: cf 93 push r28 25106: df 93 push r29 25108: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 2510a: 81 85 ldd r24, Z+9 ; 0x09 2510c: 92 85 ldd r25, Z+10 ; 0x0a 2510e: a3 85 ldd r26, Z+11 ; 0x0b 25110: b4 85 ldd r27, Z+12 ; 0x0c 25112: 01 96 adiw r24, 0x01 ; 1 25114: a1 1d adc r26, r1 25116: b1 1d adc r27, r1 25118: 84 17 cp r24, r20 2511a: 95 07 cpc r25, r21 2511c: a6 07 cpc r26, r22 2511e: b7 07 cpc r27, r23 25120: 50 f4 brcc .+20 ; 0x25136 *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 25122: 80 e0 ldi r24, 0x00 ; 0 } 25124: df 91 pop r29 25126: cf 91 pop r28 25128: 1f 91 pop r17 2512a: 0f 91 pop r16 2512c: ff 90 pop r15 2512e: ef 90 pop r14 25130: df 90 pop r13 25132: cf 90 pop r12 25134: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 25136: 87 89 ldd r24, Z+23 ; 0x17 25138: 80 31 cpi r24, 0x10 ; 16 2513a: a9 f5 brne .+106 ; 0x251a6 lba = fatStartBlock_ + (cluster >> 8); 2513c: bb 27 eor r27, r27 2513e: a7 2f mov r26, r23 25140: 96 2f mov r25, r22 25142: 85 2f mov r24, r21 25144: c3 88 ldd r12, Z+19 ; 0x13 25146: d4 88 ldd r13, Z+20 ; 0x14 25148: e5 88 ldd r14, Z+21 ; 0x15 2514a: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2514c: 8c 0d add r24, r12 2514e: 9d 1d adc r25, r13 25150: ae 1d adc r26, r14 25152: bf 1d adc r27, r15 25154: e9 01 movw r28, r18 25156: 6a 01 movw r12, r20 25158: 7b 01 movw r14, r22 2515a: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 2515c: 40 91 3a 0e lds r20, 0x0E3A ; 0x800e3a 25160: 50 91 3b 0e lds r21, 0x0E3B ; 0x800e3b 25164: 60 91 3c 0e lds r22, 0x0E3C ; 0x800e3c 25168: 70 91 3d 0e lds r23, 0x0E3D ; 0x800e3d 2516c: 84 17 cp r24, r20 2516e: 95 07 cpc r25, r21 25170: a6 07 cpc r26, r22 25172: b7 07 cpc r27, r23 25174: 49 f5 brne .+82 ; 0x251c8 if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 25176: f8 01 movw r30, r16 25178: 87 89 ldd r24, Z+23 ; 0x17 2517a: 80 31 cpi r24, 0x10 ; 16 2517c: 69 f5 brne .+90 ; 0x251d8 *value = cacheBuffer_.fat16[cluster & 0XFF]; 2517e: b7 01 movw r22, r14 25180: a6 01 movw r20, r12 25182: 55 27 eor r21, r21 25184: 66 27 eor r22, r22 25186: 77 27 eor r23, r23 25188: 44 0f add r20, r20 2518a: 55 1f adc r21, r21 2518c: 4a 5b subi r20, 0xBA ; 186 2518e: 51 4f sbci r21, 0xF1 ; 241 25190: fa 01 movw r30, r20 25192: 80 81 ld r24, Z 25194: 91 81 ldd r25, Z+1 ; 0x01 25196: b0 e0 ldi r27, 0x00 ; 0 25198: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2519a: 88 83 st Y, r24 2519c: 99 83 std Y+1, r25 ; 0x01 2519e: aa 83 std Y+2, r26 ; 0x02 251a0: bb 83 std Y+3, r27 ; 0x03 251a2: 81 e0 ldi r24, 0x01 ; 1 251a4: bf cf rjmp .-130 ; 0x25124 *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 251a6: 80 32 cpi r24, 0x20 ; 32 251a8: 09 f0 breq .+2 ; 0x251ac 251aa: bb cf rjmp .-138 ; 0x25122 lba = fatStartBlock_ + (cluster >> 7); 251ac: c3 88 ldd r12, Z+19 ; 0x13 251ae: d4 88 ldd r13, Z+20 ; 0x14 251b0: e5 88 ldd r14, Z+21 ; 0x15 251b2: f6 88 ldd r15, Z+22 ; 0x16 251b4: db 01 movw r26, r22 251b6: ca 01 movw r24, r20 251b8: c7 e0 ldi r28, 0x07 ; 7 251ba: b6 95 lsr r27 251bc: a7 95 ror r26 251be: 97 95 ror r25 251c0: 87 95 ror r24 251c2: ca 95 dec r28 251c4: d1 f7 brne .-12 ; 0x251ba 251c6: c2 cf rjmp .-124 ; 0x2514c } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 251c8: 40 e0 ldi r20, 0x00 ; 0 251ca: bc 01 movw r22, r24 251cc: cd 01 movw r24, r26 251ce: 0f 94 ad 27 call 0x24f5a ; 0x24f5a 251d2: 81 11 cpse r24, r1 251d4: d0 cf rjmp .-96 ; 0x25176 251d6: a5 cf rjmp .-182 ; 0x25122 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 251d8: b7 01 movw r22, r14 251da: a6 01 movw r20, r12 251dc: 4f 77 andi r20, 0x7F ; 127 251de: 55 27 eor r21, r21 251e0: 66 27 eor r22, r22 251e2: 77 27 eor r23, r23 251e4: 44 0f add r20, r20 251e6: 55 1f adc r21, r21 251e8: 44 0f add r20, r20 251ea: 55 1f adc r21, r21 251ec: 4a 5b subi r20, 0xBA ; 186 251ee: 51 4f sbci r21, 0xF1 ; 241 251f0: fa 01 movw r30, r20 251f2: 80 81 ld r24, Z 251f4: 91 81 ldd r25, Z+1 ; 0x01 251f6: a2 81 ldd r26, Z+2 ; 0x02 251f8: b3 81 ldd r27, Z+3 ; 0x03 251fa: bf 70 andi r27, 0x0F ; 15 251fc: ce cf rjmp .-100 ; 0x2519a 000251fe : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 251fe: 4f 92 push r4 25200: 5f 92 push r5 25202: 6f 92 push r6 25204: 7f 92 push r7 25206: af 92 push r10 25208: bf 92 push r11 2520a: cf 92 push r12 2520c: df 92 push r13 2520e: ef 92 push r14 25210: ff 92 push r15 25212: 0f 93 push r16 25214: 1f 93 push r17 25216: cf 93 push r28 25218: df 93 push r29 2521a: 00 d0 rcall .+0 ; 0x2521c 2521c: 1f 92 push r1 2521e: cd b7 in r28, 0x3d ; 61 25220: de b7 in r29, 0x3e ; 62 25222: 8c 01 movw r16, r24 25224: 49 83 std Y+1, r20 ; 0x01 25226: 5a 83 std Y+2, r21 ; 0x02 25228: 6b 83 std Y+3, r22 ; 0x03 2522a: 7c 83 std Y+4, r23 ; 0x04 2522c: 59 01 movw r10, r18 uint32_t s = 0; 2522e: c1 2c mov r12, r1 25230: d1 2c mov r13, r1 25232: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 25234: 41 2c mov r4, r1 25236: 82 e0 ldi r24, 0x02 ; 2 25238: 58 2e mov r5, r24 2523a: 61 2c mov r6, r1 2523c: 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; 2523e: 49 81 ldd r20, Y+1 ; 0x01 25240: 5a 81 ldd r21, Y+2 ; 0x02 25242: 6b 81 ldd r22, Y+3 ; 0x03 25244: 7c 81 ldd r23, Y+4 ; 0x04 25246: 9e 01 movw r18, r28 25248: 2f 5f subi r18, 0xFF ; 255 2524a: 3f 4f sbci r19, 0xFF ; 255 2524c: c8 01 movw r24, r16 2524e: 0f 94 7c 28 call 0x250f8 ; 0x250f8 25252: 88 23 and r24, r24 25254: 19 f1 breq .+70 ; 0x2529c s += 512UL << clusterSizeShift_; 25256: f8 01 movw r30, r16 25258: 85 85 ldd r24, Z+13 ; 0x0d 2525a: a3 01 movw r20, r6 2525c: 92 01 movw r18, r4 2525e: 04 c0 rjmp .+8 ; 0x25268 25260: 22 0f add r18, r18 25262: 33 1f adc r19, r19 25264: 44 1f adc r20, r20 25266: 55 1f adc r21, r21 25268: 8a 95 dec r24 2526a: d2 f7 brpl .-12 ; 0x25260 2526c: da 01 movw r26, r20 2526e: c9 01 movw r24, r18 25270: c8 0e add r12, r24 25272: d9 1e adc r13, r25 25274: ea 1e adc r14, r26 25276: fb 1e adc r15, r27 } while (!isEOC(cluster)); 25278: 49 81 ldd r20, Y+1 ; 0x01 2527a: 5a 81 ldd r21, Y+2 ; 0x02 2527c: 6b 81 ldd r22, Y+3 ; 0x03 2527e: 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; 25280: 87 89 ldd r24, Z+23 ; 0x17 25282: 80 31 cpi r24, 0x10 ; 16 25284: f1 f4 brne .+60 ; 0x252c2 25286: 81 e0 ldi r24, 0x01 ; 1 25288: 48 3f cpi r20, 0xF8 ; 248 2528a: 5f 4f sbci r21, 0xFF ; 255 2528c: 61 05 cpc r22, r1 2528e: 71 05 cpc r23, r1 25290: b0 f2 brcs .-84 ; 0x2523e *size = s; 25292: f5 01 movw r30, r10 25294: c0 82 st Z, r12 25296: d1 82 std Z+1, r13 ; 0x01 25298: e2 82 std Z+2, r14 ; 0x02 2529a: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2529c: 0f 90 pop r0 2529e: 0f 90 pop r0 252a0: 0f 90 pop r0 252a2: 0f 90 pop r0 252a4: df 91 pop r29 252a6: cf 91 pop r28 252a8: 1f 91 pop r17 252aa: 0f 91 pop r16 252ac: ff 90 pop r15 252ae: ef 90 pop r14 252b0: df 90 pop r13 252b2: cf 90 pop r12 252b4: bf 90 pop r11 252b6: af 90 pop r10 252b8: 7f 90 pop r7 252ba: 6f 90 pop r6 252bc: 5f 90 pop r5 252be: 4f 90 pop r4 252c0: 08 95 ret return cluster >= FAT32EOC_MIN; 252c2: 81 e0 ldi r24, 0x01 ; 1 252c4: 48 3f cpi r20, 0xF8 ; 248 252c6: 5f 4f sbci r21, 0xFF ; 255 252c8: 6f 4f sbci r22, 0xFF ; 255 252ca: 7f 40 sbci r23, 0x0F ; 15 252cc: 08 f4 brcc .+2 ; 0x252d0 252ce: b7 cf rjmp .-146 ; 0x2523e 252d0: e0 cf rjmp .-64 ; 0x25292 000252d2 : * \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) { 252d2: 0f 93 push r16 252d4: 1f 93 push r17 252d6: cf 93 push r28 252d8: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 252da: fc 01 movw r30, r24 252dc: 23 81 ldd r18, Z+3 ; 0x03 252de: 22 23 and r18, r18 252e0: 31 f0 breq .+12 ; 0x252ee dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 252e2: 80 e0 ldi r24, 0x00 ; 0 } 252e4: df 91 pop r29 252e6: cf 91 pop r28 252e8: 1f 91 pop r17 252ea: 0f 91 pop r16 252ec: 08 95 ret 252ee: 8b 01 movw r16, r22 252f0: ec 01 movw r28, r24 252f2: fb 01 movw r30, r22 252f4: 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)) { 252f6: 80 31 cpi r24, 0x10 ; 16 252f8: 39 f5 brne .+78 ; 0x25348 type_ = FAT_FILE_TYPE_ROOT_FIXED; 252fa: 82 e0 ldi r24, 0x02 ; 2 252fc: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 252fe: 1d 8a std Y+21, r1 ; 0x15 25300: 1e 8a std Y+22, r1 ; 0x16 25302: 1f 8a std Y+23, r1 ; 0x17 25304: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 25306: 80 8d ldd r24, Z+24 ; 0x18 25308: 91 8d ldd r25, Z+25 ; 0x19 2530a: b0 e0 ldi r27, 0x00 ; 0 2530c: a0 e0 ldi r26, 0x00 ; 0 2530e: 25 e0 ldi r18, 0x05 ; 5 25310: 88 0f add r24, r24 25312: 99 1f adc r25, r25 25314: aa 1f adc r26, r26 25316: bb 1f adc r27, r27 25318: 2a 95 dec r18 2531a: d1 f7 brne .-12 ; 0x25310 2531c: 89 8b std Y+17, r24 ; 0x11 2531e: 9a 8b std Y+18, r25 ; 0x12 25320: ab 8b std Y+19, r26 ; 0x13 25322: 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; 25324: 1a 8f std Y+26, r17 ; 0x1a 25326: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 25328: 81 e0 ldi r24, 0x01 ; 1 2532a: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2532c: 1c 82 std Y+4, r1 ; 0x04 2532e: 1d 82 std Y+5, r1 ; 0x05 25330: 1e 82 std Y+6, r1 ; 0x06 25332: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 25334: 18 86 std Y+8, r1 ; 0x08 25336: 19 86 std Y+9, r1 ; 0x09 25338: 1a 86 std Y+10, r1 ; 0x0a 2533a: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 2533c: 1c 86 std Y+12, r1 ; 0x0c 2533e: 1d 86 std Y+13, r1 ; 0x0d 25340: 1e 86 std Y+14, r1 ; 0x0e 25342: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 25344: 18 8a std Y+16, r1 ; 0x10 25346: ce cf rjmp .-100 ; 0x252e4 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) { 25348: 80 32 cpi r24, 0x20 ; 32 2534a: 59 f6 brne .-106 ; 0x252e2 type_ = FAT_FILE_TYPE_ROOT32; 2534c: 83 e0 ldi r24, 0x03 ; 3 2534e: 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_;} 25350: 42 8d ldd r20, Z+26 ; 0x1a 25352: 53 8d ldd r21, Z+27 ; 0x1b 25354: 64 8d ldd r22, Z+28 ; 0x1c 25356: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 25358: 4d 8b std Y+21, r20 ; 0x15 2535a: 5e 8b std Y+22, r21 ; 0x16 2535c: 6f 8b std Y+23, r22 ; 0x17 2535e: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 25360: 9e 01 movw r18, r28 25362: 2f 5e subi r18, 0xEF ; 239 25364: 3f 4f sbci r19, 0xFF ; 255 25366: c8 01 movw r24, r16 25368: 0f 94 ff 28 call 0x251fe ; 0x251fe 2536c: 81 11 cpse r24, r1 2536e: da cf rjmp .-76 ; 0x25324 25370: b8 cf rjmp .-144 ; 0x252e2 00025372 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 25372: cf 92 push r12 25374: df 92 push r13 25376: ef 92 push r14 25378: ff 92 push r15 2537a: 1f 93 push r17 2537c: cf 93 push r28 2537e: df 93 push r29 25380: ec 01 movw r28, r24 25382: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 25384: e1 11 cpse r30, r1 25386: 09 c0 rjmp .+18 ; 0x2539a 25388: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2538a: df 91 pop r29 2538c: cf 91 pop r28 2538e: 1f 91 pop r17 25390: ff 90 pop r15 25392: ef 90 pop r14 25394: df 90 pop r13 25396: cf 90 pop r12 25398: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2539a: 89 81 ldd r24, Y+1 ; 0x01 2539c: 80 ff sbrs r24, 0 2539e: f4 cf rjmp .-24 ; 0x25388 gfOffset = curPosition_ & 0X1FF; // offset in block 253a0: 48 85 ldd r20, Y+8 ; 0x08 253a2: 59 85 ldd r21, Y+9 ; 0x09 253a4: 6a 85 ldd r22, Y+10 ; 0x0a 253a6: 7b 85 ldd r23, Y+11 ; 0x0b 253a8: 9a 01 movw r18, r20 253aa: 31 70 andi r19, 0x01 ; 1 253ac: 3a a3 std Y+34, r19 ; 0x22 253ae: 29 a3 std Y+33, r18 ; 0x21 253b0: 89 8d ldd r24, Y+25 ; 0x19 253b2: 9a 8d ldd r25, Y+26 ; 0x1a 253b4: 6a 01 movw r12, r20 253b6: 7b 01 movw r14, r22 253b8: f9 e0 ldi r31, 0x09 ; 9 253ba: f6 94 lsr r15 253bc: e7 94 ror r14 253be: d7 94 ror r13 253c0: c7 94 ror r12 253c2: fa 95 dec r31 253c4: d1 f7 brne .-12 ; 0x253ba if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 253c6: e2 30 cpi r30, 0x02 ; 2 253c8: 79 f4 brne .+30 ; 0x253e8 // 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); 253ca: fc 01 movw r30, r24 253cc: 82 8d ldd r24, Z+26 ; 0x1a 253ce: 93 8d ldd r25, Z+27 ; 0x1b 253d0: a4 8d ldd r26, Z+28 ; 0x1c 253d2: b5 8d ldd r27, Z+29 ; 0x1d 253d4: 8c 0d add r24, r12 253d6: 9d 1d adc r25, r13 253d8: ae 1d adc r26, r14 253da: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 253dc: 8d 8f std Y+29, r24 ; 0x1d 253de: 9e 8f std Y+30, r25 ; 0x1e 253e0: af 8f std Y+31, r26 ; 0x1f 253e2: b8 a3 std Y+32, r27 ; 0x20 } return true; 253e4: 81 e0 ldi r24, 0x01 ; 1 253e6: d1 cf rjmp .-94 ; 0x2538a 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);} 253e8: fc 01 movw r30, r24 253ea: 14 81 ldd r17, Z+4 ; 0x04 253ec: 11 50 subi r17, 0x01 ; 1 253ee: 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) { 253f0: 23 2b or r18, r19 253f2: 71 f4 brne .+28 ; 0x25410 253f4: 11 11 cpse r17, r1 253f6: 0c c0 rjmp .+24 ; 0x25410 // start of new cluster if (curPosition_ == 0) { 253f8: 45 2b or r20, r21 253fa: 46 2b or r20, r22 253fc: 47 2b or r20, r23 253fe: 31 f5 brne .+76 ; 0x2544c // use first cluster in file curCluster_ = firstCluster_; 25400: 8d 89 ldd r24, Y+21 ; 0x15 25402: 9e 89 ldd r25, Y+22 ; 0x16 25404: af 89 ldd r26, Y+23 ; 0x17 25406: b8 8d ldd r27, Y+24 ; 0x18 25408: 8c 83 std Y+4, r24 ; 0x04 2540a: 9d 83 std Y+5, r25 ; 0x05 2540c: ae 83 std Y+6, r26 ; 0x06 2540e: 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; 25410: e9 8d ldd r30, Y+25 ; 0x19 25412: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 25414: 8c 81 ldd r24, Y+4 ; 0x04 25416: 9d 81 ldd r25, Y+5 ; 0x05 25418: ae 81 ldd r26, Y+6 ; 0x06 2541a: bf 81 ldd r27, Y+7 ; 0x07 2541c: 02 97 sbiw r24, 0x02 ; 2 2541e: a1 09 sbc r26, r1 25420: b1 09 sbc r27, r1 25422: 25 85 ldd r18, Z+13 ; 0x0d 25424: 04 c0 rjmp .+8 ; 0x2542e 25426: 88 0f add r24, r24 25428: 99 1f adc r25, r25 2542a: aa 1f adc r26, r26 2542c: bb 1f adc r27, r27 2542e: 2a 95 dec r18 25430: d2 f7 brpl .-12 ; 0x25426 25432: 46 85 ldd r20, Z+14 ; 0x0e 25434: 57 85 ldd r21, Z+15 ; 0x0f 25436: 60 89 ldd r22, Z+16 ; 0x10 25438: 71 89 ldd r23, Z+17 ; 0x11 2543a: 84 0f add r24, r20 2543c: 95 1f adc r25, r21 2543e: a6 1f adc r26, r22 25440: b7 1f adc r27, r23 25442: 81 0f add r24, r17 25444: 91 1d adc r25, r1 25446: a1 1d adc r26, r1 25448: b1 1d adc r27, r1 2544a: c8 cf rjmp .-112 ; 0x253dc if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2544c: 4c 81 ldd r20, Y+4 ; 0x04 2544e: 5d 81 ldd r21, Y+5 ; 0x05 25450: 6e 81 ldd r22, Y+6 ; 0x06 25452: 7f 81 ldd r23, Y+7 ; 0x07 25454: 9e 01 movw r18, r28 25456: 2c 5f subi r18, 0xFC ; 252 25458: 3f 4f sbci r19, 0xFF ; 255 2545a: 0f 94 7c 28 call 0x250f8 ; 0x250f8 2545e: 81 11 cpse r24, r1 25460: d7 cf rjmp .-82 ; 0x25410 25462: 92 cf rjmp .-220 ; 0x25388 00025464 : * \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) { 25464: 8f 92 push r8 25466: 9f 92 push r9 25468: af 92 push r10 2546a: bf 92 push r11 2546c: cf 92 push r12 2546e: df 92 push r13 25470: ef 92 push r14 25472: ff 92 push r15 25474: 0f 93 push r16 25476: 1f 93 push r17 25478: cf 93 push r28 2547a: df 93 push r29 2547c: ec 01 movw r28, r24 2547e: 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; 25480: 81 11 cpse r24, r1 25482: 0e c0 rjmp .+28 ; 0x254a0 done: return true; fail: return false; 25484: 80 e0 ldi r24, 0x00 ; 0 } 25486: df 91 pop r29 25488: cf 91 pop r28 2548a: 1f 91 pop r17 2548c: 0f 91 pop r16 2548e: ff 90 pop r15 25490: ef 90 pop r14 25492: df 90 pop r13 25494: cf 90 pop r12 25496: bf 90 pop r11 25498: af 90 pop r10 2549a: 9f 90 pop r9 2549c: 8f 90 pop r8 2549e: 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; 254a0: 09 89 ldd r16, Y+17 ; 0x11 254a2: 1a 89 ldd r17, Y+18 ; 0x12 254a4: 2b 89 ldd r18, Y+19 ; 0x13 254a6: 3c 89 ldd r19, Y+20 ; 0x14 254a8: 04 17 cp r16, r20 254aa: 15 07 cpc r17, r21 254ac: 26 07 cpc r18, r22 254ae: 37 07 cpc r19, r23 254b0: 48 f3 brcs .-46 ; 0x25484 254b2: 4a 01 movw r8, r20 254b4: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 254b6: 82 30 cpi r24, 0x02 ; 2 254b8: 31 f4 brne .+12 ; 0x254c6 curPosition_ = pos; 254ba: 88 86 std Y+8, r8 ; 0x08 254bc: 99 86 std Y+9, r9 ; 0x09 254be: aa 86 std Y+10, r10 ; 0x0a 254c0: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 254c2: 81 e0 ldi r24, 0x01 ; 1 254c4: e0 cf rjmp .-64 ; 0x25486 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 254c6: 81 14 cp r8, r1 254c8: 91 04 cpc r9, r1 254ca: a1 04 cpc r10, r1 254cc: b1 04 cpc r11, r1 254ce: 49 f4 brne .+18 ; 0x254e2 // set position to start of file curCluster_ = 0; 254d0: 1c 82 std Y+4, r1 ; 0x04 254d2: 1d 82 std Y+5, r1 ; 0x05 254d4: 1e 82 std Y+6, r1 ; 0x06 254d6: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 254d8: 18 86 std Y+8, r1 ; 0x08 254da: 19 86 std Y+9, r1 ; 0x09 254dc: 1a 86 std Y+10, r1 ; 0x0a 254de: 1b 86 std Y+11, r1 ; 0x0b 254e0: f0 cf rjmp .-32 ; 0x254c2 goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 254e2: 08 85 ldd r16, Y+8 ; 0x08 254e4: 19 85 ldd r17, Y+9 ; 0x09 254e6: 2a 85 ldd r18, Y+10 ; 0x0a 254e8: 3b 85 ldd r19, Y+11 ; 0x0b 254ea: e9 8d ldd r30, Y+25 ; 0x19 254ec: fa 8d ldd r31, Y+26 ; 0x1a 254ee: 85 85 ldd r24, Z+13 ; 0x0d 254f0: 90 e0 ldi r25, 0x00 ; 0 254f2: 09 96 adiw r24, 0x09 ; 9 254f4: b9 01 movw r22, r18 254f6: a8 01 movw r20, r16 254f8: 41 50 subi r20, 0x01 ; 1 254fa: 51 09 sbc r21, r1 254fc: 61 09 sbc r22, r1 254fe: 71 09 sbc r23, r1 25500: 08 2e mov r0, r24 25502: 04 c0 rjmp .+8 ; 0x2550c 25504: 76 95 lsr r23 25506: 67 95 ror r22 25508: 57 95 ror r21 2550a: 47 95 ror r20 2550c: 0a 94 dec r0 2550e: d2 f7 brpl .-12 ; 0x25504 nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 25510: 75 01 movw r14, r10 25512: 64 01 movw r12, r8 25514: e1 e0 ldi r30, 0x01 ; 1 25516: ce 1a sub r12, r30 25518: d1 08 sbc r13, r1 2551a: e1 08 sbc r14, r1 2551c: f1 08 sbc r15, r1 2551e: 04 c0 rjmp .+8 ; 0x25528 25520: f6 94 lsr r15 25522: e7 94 ror r14 25524: d7 94 ror r13 25526: c7 94 ror r12 25528: 8a 95 dec r24 2552a: d2 f7 brpl .-12 ; 0x25520 if (nNew < nCur || curPosition_ == 0) { 2552c: c4 16 cp r12, r20 2552e: d5 06 cpc r13, r21 25530: e6 06 cpc r14, r22 25532: f7 06 cpc r15, r23 25534: 20 f0 brcs .+8 ; 0x2553e 25536: 01 2b or r16, r17 25538: 02 2b or r16, r18 2553a: 03 2b or r16, r19 2553c: 11 f5 brne .+68 ; 0x25582 // must follow chain from first cluster curCluster_ = firstCluster_; 2553e: 8d 89 ldd r24, Y+21 ; 0x15 25540: 9e 89 ldd r25, Y+22 ; 0x16 25542: af 89 ldd r26, Y+23 ; 0x17 25544: b8 8d ldd r27, Y+24 ; 0x18 25546: 8c 83 std Y+4, r24 ; 0x04 25548: 9d 83 std Y+5, r25 ; 0x05 2554a: ae 83 std Y+6, r26 ; 0x06 2554c: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2554e: 8e 01 movw r16, r28 25550: 0c 5f subi r16, 0xFC ; 252 25552: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 25554: c1 14 cp r12, r1 25556: d1 04 cpc r13, r1 25558: e1 04 cpc r14, r1 2555a: f1 04 cpc r15, r1 2555c: 09 f4 brne .+2 ; 0x25560 2555e: ad cf rjmp .-166 ; 0x254ba if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 25560: 4c 81 ldd r20, Y+4 ; 0x04 25562: 5d 81 ldd r21, Y+5 ; 0x05 25564: 6e 81 ldd r22, Y+6 ; 0x06 25566: 7f 81 ldd r23, Y+7 ; 0x07 25568: 98 01 movw r18, r16 2556a: 89 8d ldd r24, Y+25 ; 0x19 2556c: 9a 8d ldd r25, Y+26 ; 0x1a 2556e: 0f 94 7c 28 call 0x250f8 ; 0x250f8 25572: 91 e0 ldi r25, 0x01 ; 1 25574: c9 1a sub r12, r25 25576: d1 08 sbc r13, r1 25578: e1 08 sbc r14, r1 2557a: f1 08 sbc r15, r1 2557c: 81 11 cpse r24, r1 2557e: ea cf rjmp .-44 ; 0x25554 25580: 81 cf rjmp .-254 ; 0x25484 if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 25582: c4 1a sub r12, r20 25584: d5 0a sbc r13, r21 25586: e6 0a sbc r14, r22 25588: f7 0a sbc r15, r23 2558a: e1 cf rjmp .-62 ; 0x2554e 0002558c : 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() { 2558c: 3f 92 push r3 2558e: 4f 92 push r4 25590: 5f 92 push r5 25592: 6f 92 push r6 25594: 7f 92 push r7 25596: 8f 92 push r8 25598: 9f 92 push r9 2559a: af 92 push r10 2559c: bf 92 push r11 2559e: cf 92 push r12 255a0: df 92 push r13 255a2: ef 92 push r14 255a4: ff 92 push r15 255a6: 0f 93 push r16 255a8: 1f 93 push r17 255aa: cf 93 push r28 255ac: df 93 push r29 255ae: cd b7 in r28, 0x3d ; 61 255b0: de b7 in r29, 0x3e ; 62 255b2: 2c 97 sbiw r28, 0x0c ; 12 255b4: 0f b6 in r0, 0x3f ; 63 255b6: f8 94 cli 255b8: de bf out 0x3e, r29 ; 62 255ba: 0f be out 0x3f, r0 ; 63 255bc: cd bf out 0x3d, r28 ; 61 255be: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 255c0: dc 01 movw r26, r24 255c2: 59 96 adiw r26, 0x19 ; 25 255c4: 8d 90 ld r8, X+ 255c6: 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; 255c8: f4 01 movw r30, r8 255ca: 81 85 ldd r24, Z+9 ; 0x09 255cc: 92 85 ldd r25, Z+10 ; 0x0a 255ce: a3 85 ldd r26, Z+11 ; 0x0b 255d0: b4 85 ldd r27, Z+12 ; 0x0c 255d2: 9c 01 movw r18, r24 255d4: ad 01 movw r20, r26 255d6: 2f 5f subi r18, 0xFF ; 255 255d8: 3f 4f sbci r19, 0xFF ; 255 255da: 4f 4f sbci r20, 0xFF ; 255 255dc: 5f 4f sbci r21, 0xFF ; 255 255de: 29 87 std Y+9, r18 ; 0x09 255e0: 3a 87 std Y+10, r19 ; 0x0a 255e2: 4b 87 std Y+11, r20 ; 0x0b 255e4: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 255e6: d5 01 movw r26, r10 255e8: 14 96 adiw r26, 0x04 ; 4 255ea: 4d 90 ld r4, X+ 255ec: 5d 90 ld r5, X+ 255ee: 6d 90 ld r6, X+ 255f0: 7c 90 ld r7, X 255f2: 17 97 sbiw r26, 0x07 ; 7 255f4: 41 14 cp r4, r1 255f6: 51 04 cpc r5, r1 255f8: 61 04 cpc r6, r1 255fa: 71 04 cpc r7, r1 255fc: 09 f4 brne .+2 ; 0x25600 255fe: 59 c0 rjmp .+178 ; 0x256b2 // try to make file contiguous bgnCluster = *curCluster + 1; 25600: bf ef ldi r27, 0xFF ; 255 25602: 4b 1a sub r4, r27 25604: 5b 0a sbc r5, r27 25606: 6b 0a sbc r6, r27 25608: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 2560a: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 2560c: 73 01 movw r14, r6 2560e: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 25610: 1d 82 std Y+5, r1 ; 0x05 25612: 1e 82 std Y+6, r1 ; 0x06 25614: 1f 82 std Y+7, r1 ; 0x07 25616: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 25618: f4 01 movw r30, r8 2561a: 81 85 ldd r24, Z+9 ; 0x09 2561c: 92 85 ldd r25, Z+10 ; 0x0a 2561e: a3 85 ldd r26, Z+11 ; 0x0b 25620: b4 85 ldd r27, Z+12 ; 0x0c 25622: 2d 81 ldd r18, Y+5 ; 0x05 25624: 3e 81 ldd r19, Y+6 ; 0x06 25626: 4f 81 ldd r20, Y+7 ; 0x07 25628: 58 85 ldd r21, Y+8 ; 0x08 2562a: 28 17 cp r18, r24 2562c: 39 07 cpc r19, r25 2562e: 4a 07 cpc r20, r26 25630: 5b 07 cpc r21, r27 25632: 08 f0 brcs .+2 ; 0x25636 25634: 56 c0 rjmp .+172 ; 0x256e2 // past end - start from beginning of FAT if (endCluster > fatEnd) { 25636: 89 85 ldd r24, Y+9 ; 0x09 25638: 9a 85 ldd r25, Y+10 ; 0x0a 2563a: ab 85 ldd r26, Y+11 ; 0x0b 2563c: bc 85 ldd r27, Y+12 ; 0x0c 2563e: 8c 15 cp r24, r12 25640: 9d 05 cpc r25, r13 25642: ae 05 cpc r26, r14 25644: bf 05 cpc r27, r15 25646: 50 f4 brcc .+20 ; 0x2565c bgnCluster = endCluster = 2; 25648: 82 e0 ldi r24, 0x02 ; 2 2564a: c8 2e mov r12, r24 2564c: d1 2c mov r13, r1 2564e: e1 2c mov r14, r1 25650: f1 2c mov r15, r1 25652: 92 e0 ldi r25, 0x02 ; 2 25654: 49 2e mov r4, r25 25656: 51 2c mov r5, r1 25658: 61 2c mov r6, r1 2565a: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 2565c: 9e 01 movw r18, r28 2565e: 2f 5f subi r18, 0xFF ; 255 25660: 3f 4f sbci r19, 0xFF ; 255 25662: b7 01 movw r22, r14 25664: a6 01 movw r20, r12 25666: c4 01 movw r24, r8 25668: 0f 94 7c 28 call 0x250f8 ; 0x250f8 2566c: 88 23 and r24, r24 2566e: c9 f1 breq .+114 ; 0x256e2 if (f != 0) { 25670: 89 81 ldd r24, Y+1 ; 0x01 25672: 9a 81 ldd r25, Y+2 ; 0x02 25674: ab 81 ldd r26, Y+3 ; 0x03 25676: bc 81 ldd r27, Y+4 ; 0x04 25678: 89 2b or r24, r25 2567a: 8a 2b or r24, r26 2567c: 8b 2b or r24, r27 2567e: 01 f1 breq .+64 ; 0x256c0 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 25680: 26 01 movw r4, r12 25682: 37 01 movw r6, r14 25684: 9f ef ldi r25, 0xFF ; 255 25686: 49 1a sub r4, r25 25688: 59 0a sbc r5, r25 2568a: 69 0a sbc r6, r25 2568c: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2568e: 2d 81 ldd r18, Y+5 ; 0x05 25690: 3e 81 ldd r19, Y+6 ; 0x06 25692: 4f 81 ldd r20, Y+7 ; 0x07 25694: 58 85 ldd r21, Y+8 ; 0x08 25696: 2f 5f subi r18, 0xFF ; 255 25698: 3f 4f sbci r19, 0xFF ; 255 2569a: 4f 4f sbci r20, 0xFF ; 255 2569c: 5f 4f sbci r21, 0xFF ; 255 2569e: 2d 83 std Y+5, r18 ; 0x05 256a0: 3e 83 std Y+6, r19 ; 0x06 256a2: 4f 83 std Y+7, r20 ; 0x07 256a4: 58 87 std Y+8, r21 ; 0x08 256a6: 3f ef ldi r19, 0xFF ; 255 256a8: c3 1a sub r12, r19 256aa: d3 0a sbc r13, r19 256ac: e3 0a sbc r14, r19 256ae: f3 0a sbc r15, r19 256b0: b3 cf rjmp .-154 ; 0x25618 // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 256b2: 40 80 ld r4, Z 256b4: 51 80 ldd r5, Z+1 ; 0x01 256b6: 62 80 ldd r6, Z+2 ; 0x02 256b8: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 256ba: 33 24 eor r3, r3 256bc: 33 94 inc r3 256be: a6 cf rjmp .-180 ; 0x2560c 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) { 256c0: c4 14 cp r12, r4 256c2: d5 04 cpc r13, r5 256c4: e6 04 cpc r14, r6 256c6: f7 04 cpc r15, r7 256c8: 11 f7 brne .-60 ; 0x2568e 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); 256ca: 0f ef ldi r16, 0xFF ; 255 256cc: 1f ef ldi r17, 0xFF ; 255 256ce: 2f ef ldi r18, 0xFF ; 255 256d0: 3f e0 ldi r19, 0x0F ; 15 256d2: b7 01 movw r22, r14 256d4: a6 01 movw r20, r12 256d6: c4 01 movw r24, r8 256d8: 0f 94 ea 27 call 0x24fd4 ; 0x24fd4 256dc: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 256de: 81 11 cpse r24, r1 256e0: 1a c0 rjmp .+52 ; 0x25716 flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 256e2: 71 2c mov r7, r1 } 256e4: 87 2d mov r24, r7 256e6: 2c 96 adiw r28, 0x0c ; 12 256e8: 0f b6 in r0, 0x3f ; 63 256ea: f8 94 cli 256ec: de bf out 0x3e, r29 ; 62 256ee: 0f be out 0x3f, r0 ; 63 256f0: cd bf out 0x3d, r28 ; 61 256f2: df 91 pop r29 256f4: cf 91 pop r28 256f6: 1f 91 pop r17 256f8: 0f 91 pop r16 256fa: ff 90 pop r15 256fc: ef 90 pop r14 256fe: df 90 pop r13 25700: cf 90 pop r12 25702: bf 90 pop r11 25704: af 90 pop r10 25706: 9f 90 pop r9 25708: 8f 90 pop r8 2570a: 7f 90 pop r7 2570c: 6f 90 pop r6 2570e: 5f 90 pop r5 25710: 4f 90 pop r4 25712: 3f 90 pop r3 25714: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 25716: f5 01 movw r30, r10 25718: 44 81 ldd r20, Z+4 ; 0x04 2571a: 55 81 ldd r21, Z+5 ; 0x05 2571c: 66 81 ldd r22, Z+6 ; 0x06 2571e: 77 81 ldd r23, Z+7 ; 0x07 25720: 41 15 cp r20, r1 25722: 51 05 cpc r21, r1 25724: 61 05 cpc r22, r1 25726: 71 05 cpc r23, r1 25728: 39 f0 breq .+14 ; 0x25738 // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 2572a: 97 01 movw r18, r14 2572c: 86 01 movw r16, r12 2572e: c4 01 movw r24, r8 25730: 0f 94 ea 27 call 0x24fd4 ; 0x24fd4 25734: 88 23 and r24, r24 25736: a9 f2 breq .-86 ; 0x256e2 } // return first cluster number to caller *curCluster = bgnCluster; 25738: d5 01 movw r26, r10 2573a: 14 96 adiw r26, 0x04 ; 4 2573c: cd 92 st X+, r12 2573e: dd 92 st X+, r13 25740: ed 92 st X+, r14 25742: fc 92 st X, r15 25744: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 25746: 33 20 and r3, r3 25748: 51 f0 breq .+20 ; 0x2575e 2574a: d7 01 movw r26, r14 2574c: c6 01 movw r24, r12 2574e: 01 96 adiw r24, 0x01 ; 1 25750: a1 1d adc r26, r1 25752: b1 1d adc r27, r1 25754: f4 01 movw r30, r8 25756: 80 83 st Z, r24 25758: 91 83 std Z+1, r25 ; 0x01 2575a: a2 83 std Z+2, r26 ; 0x02 2575c: 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) { 2575e: f5 01 movw r30, r10 25760: 85 89 ldd r24, Z+21 ; 0x15 25762: 96 89 ldd r25, Z+22 ; 0x16 25764: a7 89 ldd r26, Z+23 ; 0x17 25766: b0 8d ldd r27, Z+24 ; 0x18 25768: 89 2b or r24, r25 2576a: 8a 2b or r24, r26 2576c: 8b 2b or r24, r27 2576e: 09 f0 breq .+2 ; 0x25772 25770: b9 cf rjmp .-142 ; 0x256e4 firstCluster_ = curCluster_; 25772: c5 8a std Z+21, r12 ; 0x15 25774: d6 8a std Z+22, r13 ; 0x16 25776: e7 8a std Z+23, r14 ; 0x17 25778: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 2577a: 81 81 ldd r24, Z+1 ; 0x01 2577c: 80 68 ori r24, 0x80 ; 128 2577e: 81 83 std Z+1, r24 ; 0x01 25780: b1 cf rjmp .-158 ; 0x256e4 00025782 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 25782: cf 93 push r28 25784: df 93 push r29 25786: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 25788: 46 2f mov r20, r22 2578a: 41 70 andi r20, 0x01 ; 1 2578c: 6c 85 ldd r22, Y+12 ; 0x0c 2578e: 7d 85 ldd r23, Y+13 ; 0x0d 25790: 8e 85 ldd r24, Y+14 ; 0x0e 25792: 9f 85 ldd r25, Y+15 ; 0x0f 25794: 0f 94 ad 27 call 0x24f5a ; 0x24f5a 25798: 88 23 and r24, r24 2579a: 51 f0 breq .+20 ; 0x257b0 return vol_->cache()->dir + dirIndex_; 2579c: 88 89 ldd r24, Y+16 ; 0x10 2579e: 20 e2 ldi r18, 0x20 ; 32 257a0: 82 9f mul r24, r18 257a2: c0 01 movw r24, r0 257a4: 11 24 eor r1, r1 257a6: 8a 5b subi r24, 0xBA ; 186 257a8: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 257aa: df 91 pop r29 257ac: cf 91 pop r28 257ae: 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; 257b0: 90 e0 ldi r25, 0x00 ; 0 257b2: 80 e0 ldi r24, 0x00 ; 0 257b4: fa cf rjmp .-12 ; 0x257aa 000257b6 : * \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() { 257b6: cf 93 push r28 257b8: df 93 push r29 257ba: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 257bc: 8b 81 ldd r24, Y+3 ; 0x03 257be: 88 23 and r24, r24 257c0: 49 f1 breq .+82 ; 0x25814 if (flags_ & F_FILE_DIR_DIRTY) { 257c2: 89 81 ldd r24, Y+1 ; 0x01 257c4: 87 ff sbrs r24, 7 257c6: 22 c0 rjmp .+68 ; 0x2580c dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 257c8: 61 e0 ldi r22, 0x01 ; 1 257ca: ce 01 movw r24, r28 257cc: 0f 94 c1 2b call 0x25782 ; 0x25782 257d0: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 257d2: 89 2b or r24, r25 257d4: f9 f0 breq .+62 ; 0x25814 257d6: 80 81 ld r24, Z 257d8: 85 3e cpi r24, 0xE5 ; 229 257da: e1 f0 breq .+56 ; 0x25814 // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 257dc: 8b 81 ldd r24, Y+3 ; 0x03 257de: 82 30 cpi r24, 0x02 ; 2 257e0: 40 f4 brcc .+16 ; 0x257f2 257e2: 89 89 ldd r24, Y+17 ; 0x11 257e4: 9a 89 ldd r25, Y+18 ; 0x12 257e6: ab 89 ldd r26, Y+19 ; 0x13 257e8: bc 89 ldd r27, Y+20 ; 0x14 257ea: 84 8f std Z+28, r24 ; 0x1c 257ec: 95 8f std Z+29, r25 ; 0x1d 257ee: a6 8f std Z+30, r26 ; 0x1e 257f0: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 257f2: 8d 89 ldd r24, Y+21 ; 0x15 257f4: 9e 89 ldd r25, Y+22 ; 0x16 257f6: 93 8f std Z+27, r25 ; 0x1b 257f8: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 257fa: 8d 89 ldd r24, Y+21 ; 0x15 257fc: 9e 89 ldd r25, Y+22 ; 0x16 257fe: af 89 ldd r26, Y+23 ; 0x17 25800: b8 8d ldd r27, Y+24 ; 0x18 25802: b5 8b std Z+21, r27 ; 0x15 25804: 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; 25806: 89 81 ldd r24, Y+1 ; 0x01 25808: 8f 77 andi r24, 0x7F ; 127 2580a: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 2580c: df 91 pop r29 2580e: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 25810: 0d 94 b5 26 jmp 0x24d6a ; 0x24d6a fail: writeError = true; 25814: 81 e0 ldi r24, 0x01 ; 1 25816: 88 83 st Y, r24 return false; } 25818: 80 e0 ldi r24, 0x00 ; 0 2581a: df 91 pop r29 2581c: cf 91 pop r28 2581e: 08 95 ret 00025820 : * * \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() { 25820: cf 93 push r28 25822: df 93 push r29 25824: ec 01 movw r28, r24 bool rtn = sync(); 25826: 0f 94 db 2b call 0x257b6 ; 0x257b6 type_ = FAT_FILE_TYPE_CLOSED; 2582a: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 2582c: df 91 pop r29 2582e: cf 91 pop r28 25830: 08 95 ret 00025832 : * \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) { 25832: cf 93 push r28 25834: df 93 push r29 25836: eb 01 movw r28, r22 25838: fc 01 movw r30, r24 2583a: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 2583c: 21 11 cpse r18, r1 2583e: 04 c0 rjmp .+8 ; 0x25848 25840: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 25842: df 91 pop r29 25844: cf 91 pop r28 25846: 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; 25848: 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()) { 2584a: 22 30 cpi r18, 0x02 ; 2 2584c: 28 f4 brcc .+10 ; 0x25858 name[0] = '/'; 2584e: 8f e2 ldi r24, 0x2F ; 47 25850: 88 83 st Y, r24 name[1] = '\0'; 25852: 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; 25854: 81 e0 ldi r24, 0x01 ; 1 25856: f5 cf rjmp .-22 ; 0x25842 name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 25858: 60 e0 ldi r22, 0x00 ; 0 2585a: 0f 94 c1 2b call 0x25782 ; 0x25782 if (!p) return false; 2585e: 00 97 sbiw r24, 0x00 ; 0 25860: 79 f3 breq .-34 ; 0x25840 25862: 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; 25864: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 25866: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 25868: 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; 2586a: 2d 91 ld r18, X+ 2586c: 20 32 cpi r18, 0x20 ; 32 2586e: 99 f0 breq .+38 ; 0x25896 if (i == 8) name[j++] = '.'; 25870: 88 30 cpi r24, 0x08 ; 8 25872: 31 f4 brne .+12 ; 0x25880 25874: 9e 01 movw r18, r28 25876: 26 0f add r18, r22 25878: 31 1d adc r19, r1 2587a: f9 01 movw r30, r18 2587c: 90 83 st Z, r25 2587e: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 25880: 9e 01 movw r18, r28 25882: 26 0f add r18, r22 25884: 31 1d adc r19, r1 25886: ad 01 movw r20, r26 25888: 41 50 subi r20, 0x01 ; 1 2588a: 51 09 sbc r21, r1 2588c: fa 01 movw r30, r20 2588e: 40 81 ld r20, Z 25890: f9 01 movw r30, r18 25892: 40 83 st Z, r20 25894: 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++) { 25896: 8f 5f subi r24, 0xFF ; 255 25898: 8b 30 cpi r24, 0x0B ; 11 2589a: 39 f7 brne .-50 ; 0x2586a if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 2589c: fe 01 movw r30, r28 2589e: e6 0f add r30, r22 258a0: f1 1d adc r31, r1 258a2: 10 82 st Z, r1 258a4: d7 cf rjmp .-82 ; 0x25854 000258a6 : * 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) { 258a6: 2f 92 push r2 258a8: 3f 92 push r3 258aa: 4f 92 push r4 258ac: 5f 92 push r5 258ae: 6f 92 push r6 258b0: 7f 92 push r7 258b2: 8f 92 push r8 258b4: 9f 92 push r9 258b6: af 92 push r10 258b8: bf 92 push r11 258ba: cf 92 push r12 258bc: df 92 push r13 258be: ef 92 push r14 258c0: ff 92 push r15 258c2: 0f 93 push r16 258c4: 1f 93 push r17 258c6: cf 93 push r28 258c8: df 93 push r29 258ca: 00 d0 rcall .+0 ; 0x258cc 258cc: 1f 92 push r1 258ce: cd b7 in r28, 0x3d ; 61 258d0: de b7 in r29, 0x3e ; 62 258d2: 9c 83 std Y+4, r25 ; 0x04 258d4: 8b 83 std Y+3, r24 ; 0x03 258d6: 4b 01 movw r8, r22 258d8: 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; 258da: dc 01 movw r26, r24 258dc: 13 96 adiw r26, 0x03 ; 3 258de: 8c 91 ld r24, X 258e0: 81 11 cpse r24, r1 258e2: 19 c0 rjmp .+50 ; 0x25916 toRead -= n; } return nbyte; fail: return -1; 258e4: 8f ef ldi r24, 0xFF ; 255 258e6: 9f ef ldi r25, 0xFF ; 255 } 258e8: 0f 90 pop r0 258ea: 0f 90 pop r0 258ec: 0f 90 pop r0 258ee: 0f 90 pop r0 258f0: df 91 pop r29 258f2: cf 91 pop r28 258f4: 1f 91 pop r17 258f6: 0f 91 pop r16 258f8: ff 90 pop r15 258fa: ef 90 pop r14 258fc: df 90 pop r13 258fe: cf 90 pop r12 25900: bf 90 pop r11 25902: af 90 pop r10 25904: 9f 90 pop r9 25906: 8f 90 pop r8 25908: 7f 90 pop r7 2590a: 6f 90 pop r6 2590c: 5f 90 pop r5 2590e: 4f 90 pop r4 25910: 3f 90 pop r3 25912: 2f 90 pop r2 25914: 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; 25916: eb 81 ldd r30, Y+3 ; 0x03 25918: fc 81 ldd r31, Y+4 ; 0x04 2591a: 81 81 ldd r24, Z+1 ; 0x01 2591c: 80 ff sbrs r24, 0 2591e: e2 cf rjmp .-60 ; 0x258e4 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 25920: 01 89 ldd r16, Z+17 ; 0x11 25922: 12 89 ldd r17, Z+18 ; 0x12 25924: 23 89 ldd r18, Z+19 ; 0x13 25926: 34 89 ldd r19, Z+20 ; 0x14 25928: 40 85 ldd r20, Z+8 ; 0x08 2592a: 51 85 ldd r21, Z+9 ; 0x09 2592c: 62 85 ldd r22, Z+10 ; 0x0a 2592e: 73 85 ldd r23, Z+11 ; 0x0b 25930: c7 01 movw r24, r14 25932: b0 e0 ldi r27, 0x00 ; 0 25934: a0 e0 ldi r26, 0x00 ; 0 25936: 28 01 movw r4, r16 25938: 39 01 movw r6, r18 2593a: 44 1a sub r4, r20 2593c: 55 0a sbc r5, r21 2593e: 66 0a sbc r6, r22 25940: 77 0a sbc r7, r23 25942: 84 15 cp r24, r4 25944: 95 05 cpc r25, r5 25946: a6 05 cpc r26, r6 25948: b7 05 cpc r27, r7 2594a: 18 f0 brcs .+6 ; 0x25952 nbyte = fileSize_ - curPosition_; 2594c: 78 01 movw r14, r16 2594e: e4 1a sub r14, r20 25950: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 25952: 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; 25954: 8b 81 ldd r24, Y+3 ; 0x03 25956: 9c 81 ldd r25, Y+4 ; 0x04 25958: 04 96 adiw r24, 0x04 ; 4 2595a: 9a 83 std Y+2, r25 ; 0x02 2595c: 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; 2595e: 61 2c mov r6, r1 25960: 32 e0 ldi r19, 0x02 ; 2 25962: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 25964: c1 14 cp r12, r1 25966: d1 04 cpc r13, r1 25968: 09 f4 brne .+2 ; 0x2596c 2596a: b7 c0 rjmp .+366 ; 0x25ada offset = curPosition_ & 0X1FF; // offset in block 2596c: ab 81 ldd r26, Y+3 ; 0x03 2596e: bc 81 ldd r27, Y+4 ; 0x04 25970: 18 96 adiw r26, 0x08 ; 8 25972: 4d 91 ld r20, X+ 25974: 5d 91 ld r21, X+ 25976: 6d 91 ld r22, X+ 25978: 7c 91 ld r23, X 2597a: 1b 97 sbiw r26, 0x0b ; 11 2597c: 5a 01 movw r10, r20 2597e: b1 e0 ldi r27, 0x01 ; 1 25980: bb 22 and r11, r27 25982: eb 81 ldd r30, Y+3 ; 0x03 25984: fc 81 ldd r31, Y+4 ; 0x04 25986: 81 8d ldd r24, Z+25 ; 0x19 25988: 92 8d ldd r25, Z+26 ; 0x1a 2598a: 1a 01 movw r2, r20 2598c: 2b 01 movw r4, r22 2598e: 29 e0 ldi r18, 0x09 ; 9 25990: 56 94 lsr r5 25992: 47 94 ror r4 25994: 37 94 ror r3 25996: 27 94 ror r2 25998: 2a 95 dec r18 2599a: d1 f7 brne .-12 ; 0x25990 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2599c: 23 81 ldd r18, Z+3 ; 0x03 2599e: 22 30 cpi r18, 0x02 ; 2 259a0: 91 f5 brne .+100 ; 0x25a06 block = vol_->rootDirStart() + (curPosition_ >> 9); 259a2: dc 01 movw r26, r24 259a4: 5a 96 adiw r26, 0x1a ; 26 259a6: 6d 91 ld r22, X+ 259a8: 7d 91 ld r23, X+ 259aa: 8d 91 ld r24, X+ 259ac: 9c 91 ld r25, X 259ae: 5d 97 sbiw r26, 0x1d ; 29 259b0: 62 0d add r22, r2 259b2: 73 1d adc r23, r3 259b4: 84 1d adc r24, r4 259b6: 95 1d adc r25, r5 259b8: 83 01 movw r16, r6 259ba: 0a 19 sub r16, r10 259bc: 1b 09 sbc r17, r11 259be: c0 16 cp r12, r16 259c0: d1 06 cpc r13, r17 259c2: 08 f4 brcc .+2 ; 0x259c6 259c4: 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()) { 259c6: 01 15 cp r16, r1 259c8: b2 e0 ldi r27, 0x02 ; 2 259ca: 1b 07 cpc r17, r27 259cc: 71 f4 brne .+28 ; 0x259ea 259ce: 20 91 3a 0e lds r18, 0x0E3A ; 0x800e3a 259d2: 30 91 3b 0e lds r19, 0x0E3B ; 0x800e3b 259d6: 40 91 3c 0e lds r20, 0x0E3C ; 0x800e3c 259da: 50 91 3d 0e lds r21, 0x0E3D ; 0x800e3d 259de: 62 17 cp r22, r18 259e0: 73 07 cpc r23, r19 259e2: 84 07 cpc r24, r20 259e4: 95 07 cpc r25, r21 259e6: 09 f0 breq .+2 ; 0x259ea 259e8: 59 c0 rjmp .+178 ; 0x25a9c 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; 259ea: 40 e0 ldi r20, 0x00 ; 0 259ec: 0f 94 ad 27 call 0x24f5a ; 0x24f5a 259f0: 88 23 and r24, r24 259f2: 09 f4 brne .+2 ; 0x259f6 259f4: 77 cf rjmp .-274 ; 0x258e4 uint8_t* src = vol_->cache()->data + offset; 259f6: b5 01 movw r22, r10 259f8: 6a 5b subi r22, 0xBA ; 186 259fa: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 259fc: a8 01 movw r20, r16 259fe: c4 01 movw r24, r8 25a00: 0f 94 67 aa call 0x354ce ; 0x354ce 25a04: 57 c0 rjmp .+174 ; 0x25ab4 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);} 25a06: fc 01 movw r30, r24 25a08: 14 81 ldd r17, Z+4 ; 0x04 25a0a: 11 50 subi r17, 0x01 ; 1 25a0c: 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) { 25a0e: a1 14 cp r10, r1 25a10: b1 04 cpc r11, r1 25a12: 81 f4 brne .+32 ; 0x25a34 25a14: 11 11 cpse r17, r1 25a16: 0e c0 rjmp .+28 ; 0x25a34 // start of new cluster if (curPosition_ == 0) { 25a18: 45 2b or r20, r21 25a1a: 46 2b or r20, r22 25a1c: 47 2b or r20, r23 25a1e: 79 f5 brne .+94 ; 0x25a7e // use first cluster in file curCluster_ = firstCluster_; 25a20: eb 81 ldd r30, Y+3 ; 0x03 25a22: fc 81 ldd r31, Y+4 ; 0x04 25a24: 85 89 ldd r24, Z+21 ; 0x15 25a26: 96 89 ldd r25, Z+22 ; 0x16 25a28: a7 89 ldd r26, Z+23 ; 0x17 25a2a: b0 8d ldd r27, Z+24 ; 0x18 25a2c: 84 83 std Z+4, r24 ; 0x04 25a2e: 95 83 std Z+5, r25 ; 0x05 25a30: a6 83 std Z+6, r26 ; 0x06 25a32: 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; 25a34: ab 81 ldd r26, Y+3 ; 0x03 25a36: bc 81 ldd r27, Y+4 ; 0x04 25a38: 59 96 adiw r26, 0x19 ; 25 25a3a: ed 91 ld r30, X+ 25a3c: fc 91 ld r31, X 25a3e: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 25a40: 14 96 adiw r26, 0x04 ; 4 25a42: 6d 91 ld r22, X+ 25a44: 7d 91 ld r23, X+ 25a46: 8d 91 ld r24, X+ 25a48: 9c 91 ld r25, X 25a4a: 17 97 sbiw r26, 0x07 ; 7 25a4c: 62 50 subi r22, 0x02 ; 2 25a4e: 71 09 sbc r23, r1 25a50: 81 09 sbc r24, r1 25a52: 91 09 sbc r25, r1 25a54: 25 85 ldd r18, Z+13 ; 0x0d 25a56: 04 c0 rjmp .+8 ; 0x25a60 25a58: 66 0f add r22, r22 25a5a: 77 1f adc r23, r23 25a5c: 88 1f adc r24, r24 25a5e: 99 1f adc r25, r25 25a60: 2a 95 dec r18 25a62: d2 f7 brpl .-12 ; 0x25a58 25a64: 26 85 ldd r18, Z+14 ; 0x0e 25a66: 37 85 ldd r19, Z+15 ; 0x0f 25a68: 40 89 ldd r20, Z+16 ; 0x10 25a6a: 51 89 ldd r21, Z+17 ; 0x11 25a6c: 62 0f add r22, r18 25a6e: 73 1f adc r23, r19 25a70: 84 1f adc r24, r20 25a72: 95 1f adc r25, r21 25a74: 61 0f add r22, r17 25a76: 71 1d adc r23, r1 25a78: 81 1d adc r24, r1 25a7a: 91 1d adc r25, r1 25a7c: 9d cf rjmp .-198 ; 0x259b8 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 25a7e: ab 81 ldd r26, Y+3 ; 0x03 25a80: bc 81 ldd r27, Y+4 ; 0x04 25a82: 14 96 adiw r26, 0x04 ; 4 25a84: 4d 91 ld r20, X+ 25a86: 5d 91 ld r21, X+ 25a88: 6d 91 ld r22, X+ 25a8a: 7c 91 ld r23, X 25a8c: 17 97 sbiw r26, 0x07 ; 7 25a8e: 29 81 ldd r18, Y+1 ; 0x01 25a90: 3a 81 ldd r19, Y+2 ; 0x02 25a92: 0f 94 7c 28 call 0x250f8 ; 0x250f8 25a96: 81 11 cpse r24, r1 25a98: cd cf rjmp .-102 ; 0x25a34 25a9a: 24 cf rjmp .-440 ; 0x258e4 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);} 25a9c: 94 01 movw r18, r8 25a9e: ab 01 movw r20, r22 25aa0: bc 01 movw r22, r24 25aa2: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 25aa6: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 25aaa: 0f 94 f4 26 call 0x24de8 ; 0x24de8 // 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; 25aae: 88 23 and r24, r24 25ab0: 09 f4 brne .+2 ; 0x25ab4 25ab2: 18 cf rjmp .-464 ; 0x258e4 // 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; 25ab4: 80 0e add r8, r16 25ab6: 91 1e adc r9, r17 curPosition_ += n; 25ab8: eb 81 ldd r30, Y+3 ; 0x03 25aba: fc 81 ldd r31, Y+4 ; 0x04 25abc: 80 85 ldd r24, Z+8 ; 0x08 25abe: 91 85 ldd r25, Z+9 ; 0x09 25ac0: a2 85 ldd r26, Z+10 ; 0x0a 25ac2: b3 85 ldd r27, Z+11 ; 0x0b 25ac4: 80 0f add r24, r16 25ac6: 91 1f adc r25, r17 25ac8: a1 1d adc r26, r1 25aca: b1 1d adc r27, r1 25acc: 80 87 std Z+8, r24 ; 0x08 25ace: 91 87 std Z+9, r25 ; 0x09 25ad0: a2 87 std Z+10, r26 ; 0x0a 25ad2: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 25ad4: c0 1a sub r12, r16 25ad6: d1 0a sbc r13, r17 25ad8: 45 cf rjmp .-374 ; 0x25964 } return nbyte; 25ada: c7 01 movw r24, r14 25adc: 05 cf rjmp .-502 ; 0x258e8 00025ade : * 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) { 25ade: df 92 push r13 25ae0: ef 92 push r14 25ae2: ff 92 push r15 25ae4: 0f 93 push r16 25ae6: 1f 93 push r17 25ae8: cf 93 push r28 25aea: df 93 push r29 25aec: 8c 01 movw r16, r24 25aee: eb 01 movw r28, r22 25af0: 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; 25af2: 8d e0 ldi r24, 0x0D ; 13 25af4: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 25af6: 40 e2 ldi r20, 0x20 ; 32 25af8: 50 e0 ldi r21, 0x00 ; 0 25afa: be 01 movw r22, r28 25afc: c8 01 movw r24, r16 25afe: 0f 94 53 2c call 0x258a6 ; 0x258a6 if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 25b02: 80 32 cpi r24, 0x20 ; 32 25b04: 91 05 cpc r25, r1 25b06: 71 f0 breq .+28 ; 0x25b24 25b08: 21 e0 ldi r18, 0x01 ; 1 25b0a: 89 2b or r24, r25 25b0c: 09 f4 brne .+2 ; 0x25b10 25b0e: 20 e0 ldi r18, 0x00 ; 0 25b10: 82 2f mov r24, r18 25b12: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 25b14: df 91 pop r29 25b16: cf 91 pop r28 25b18: 1f 91 pop r17 25b1a: 0f 91 pop r16 25b1c: ff 90 pop r15 25b1e: ef 90 pop r14 25b20: df 90 pop r13 25b22: 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; 25b24: 28 81 ld r18, Y 25b26: 22 23 and r18, r18 25b28: 09 f4 brne .+2 ; 0x25b2c 25b2a: 3f c0 rjmp .+126 ; 0x25baa // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 25b2c: 25 3e cpi r18, 0xE5 ; 229 25b2e: 19 f3 breq .-58 ; 0x25af6 25b30: 2e 32 cpi r18, 0x2E ; 46 25b32: 09 f3 breq .-62 ; 0x25af6 //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) 25b34: 3b 85 ldd r19, Y+11 ; 0x0b 25b36: 3f 73 andi r19, 0x3F ; 63 25b38: 3f 30 cpi r19, 0x0F ; 15 25b3a: 99 f5 brne .+102 ; 0x25ba2 25b3c: e1 14 cp r14, r1 25b3e: f1 04 cpc r15, r1 25b40: 81 f1 breq .+96 ; 0x25ba2 { 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) 25b42: 4a 8d ldd r20, Y+26 ; 0x1a 25b44: 5b 8d ldd r21, Y+27 ; 0x1b 25b46: 45 2b or r20, r21 25b48: 61 f5 brne .+88 ; 0x25ba2 25b4a: 2f 71 andi r18, 0x1F ; 31 25b4c: 3f ef ldi r19, 0xFF ; 255 25b4e: 32 0f add r19, r18 25b50: 34 30 cpi r19, 0x04 ; 4 25b52: 38 f5 brcc .+78 ; 0x25ba2 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 25b54: 21 50 subi r18, 0x01 ; 1 25b56: 33 0b sbc r19, r19 25b58: d2 9e mul r13, r18 25b5a: c0 01 movw r24, r0 25b5c: d3 9e mul r13, r19 25b5e: 90 0d add r25, r0 25b60: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 25b62: f7 01 movw r30, r14 25b64: e8 0f add r30, r24 25b66: f9 1f adc r31, r25 25b68: 29 81 ldd r18, Y+1 ; 0x01 25b6a: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 25b6c: 2b 81 ldd r18, Y+3 ; 0x03 25b6e: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 25b70: 2d 81 ldd r18, Y+5 ; 0x05 25b72: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 25b74: 2f 81 ldd r18, Y+7 ; 0x07 25b76: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 25b78: 29 85 ldd r18, Y+9 ; 0x09 25b7a: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 25b7c: 2e 85 ldd r18, Y+14 ; 0x0e 25b7e: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 25b80: 28 89 ldd r18, Y+16 ; 0x10 25b82: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 25b84: 2a 89 ldd r18, Y+18 ; 0x12 25b86: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 25b88: 2c 89 ldd r18, Y+20 ; 0x14 25b8a: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 25b8c: 2e 89 ldd r18, Y+22 ; 0x16 25b8e: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 25b90: 28 8d ldd r18, Y+24 ; 0x18 25b92: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 25b94: 2c 8d ldd r18, Y+28 ; 0x1c 25b96: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 25b98: 2e 8d ldd r18, Y+30 ; 0x1e 25b9a: 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) 25b9c: 28 81 ld r18, Y 25b9e: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 25ba0: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 25ba2: 2b 85 ldd r18, Y+11 ; 0x0b 25ba4: 23 fd sbrc r18, 3 25ba6: a7 cf rjmp .-178 ; 0x25af6 25ba8: b5 cf rjmp .-150 ; 0x25b14 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; 25baa: 80 e0 ldi r24, 0x00 ; 0 25bac: b3 cf rjmp .-154 ; 0x25b14 00025bae : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 25bae: 4f 92 push r4 25bb0: 5f 92 push r5 25bb2: 6f 92 push r6 25bb4: 7f 92 push r7 25bb6: af 92 push r10 25bb8: bf 92 push r11 25bba: cf 92 push r12 25bbc: df 92 push r13 25bbe: ef 92 push r14 25bc0: ff 92 push r15 25bc2: 0f 93 push r16 25bc4: 1f 93 push r17 25bc6: cf 93 push r28 25bc8: df 93 push r29 25bca: 1f 92 push r1 25bcc: cd b7 in r28, 0x3d ; 61 25bce: de b7 in r29, 0x3e ; 62 25bd0: 8c 01 movw r16, r24 25bd2: 7b 01 movw r14, r22 25bd4: 5a 01 movw r10, r20 25bd6: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 25bd8: db 01 movw r26, r22 25bda: 59 96 adiw r26, 0x19 ; 25 25bdc: 8d 91 ld r24, X+ 25bde: 9c 91 ld r25, X 25be0: f8 01 movw r30, r16 25be2: 92 8f std Z+26, r25 ; 0x1a 25be4: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 25be6: cb 01 movw r24, r22 25be8: 0e 94 01 7a call 0xf402 ; 0xf402 } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 25bec: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 25bee: f7 01 movw r30, r14 25bf0: 80 85 ldd r24, Z+8 ; 0x08 25bf2: 91 85 ldd r25, Z+9 ; 0x09 25bf4: a2 85 ldd r26, Z+10 ; 0x0a 25bf6: b3 85 ldd r27, Z+11 ; 0x0b 25bf8: 41 89 ldd r20, Z+17 ; 0x11 25bfa: 52 89 ldd r21, Z+18 ; 0x12 25bfc: 63 89 ldd r22, Z+19 ; 0x13 25bfe: 74 89 ldd r23, Z+20 ; 0x14 25c00: 84 17 cp r24, r20 25c02: 95 07 cpc r25, r21 25c04: a6 07 cpc r26, r22 25c06: b7 07 cpc r27, r23 25c08: 08 f0 brcs .+2 ; 0x25c0c 25c0a: 52 c0 rjmp .+164 ; 0x25cb0 index = 0XF & (dirFile->curPosition_ >> 5); 25c0c: 55 e0 ldi r21, 0x05 ; 5 25c0e: b6 95 lsr r27 25c10: a7 95 ror r26 25c12: 97 95 ror r25 25c14: 87 95 ror r24 25c16: 5a 95 dec r21 25c18: d1 f7 brne .-12 ; 0x25c0e 25c1a: f8 2f mov r31, r24 25c1c: ff 70 andi r31, 0x0F ; 15 25c1e: 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; 25c20: d7 01 movw r26, r14 25c22: 13 96 adiw r26, 0x03 ; 3 25c24: 8c 91 ld r24, X 25c26: 82 30 cpi r24, 0x02 ; 2 25c28: 10 f4 brcc .+4 ; 0x25c2e if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 25c2a: 80 e0 ldi r24, 0x00 ; 0 25c2c: db c0 rjmp .+438 ; 0x25de4 * \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; 25c2e: 41 e0 ldi r20, 0x01 ; 1 25c30: 50 e0 ldi r21, 0x00 ; 0 25c32: be 01 movw r22, r28 25c34: 6f 5f subi r22, 0xFF ; 255 25c36: 7f 4f sbci r23, 0xFF ; 255 25c38: c7 01 movw r24, r14 25c3a: 0f 94 53 2c call 0x258a6 ; 0x258a6 25c3e: 01 97 sbiw r24, 0x01 ; 1 25c40: a1 f7 brne .-24 ; 0x25c2a // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 25c42: f7 01 movw r30, r14 25c44: 80 85 ldd r24, Z+8 ; 0x08 25c46: 91 85 ldd r25, Z+9 ; 0x09 25c48: a2 85 ldd r26, Z+10 ; 0x0a 25c4a: b3 85 ldd r27, Z+11 ; 0x0b 25c4c: 4f 96 adiw r24, 0x1f ; 31 25c4e: a1 1d adc r26, r1 25c50: b1 1d adc r27, r1 25c52: 80 87 std Z+8, r24 ; 0x08 25c54: 91 87 std Z+9, r25 ; 0x09 25c56: a2 87 std Z+10, r26 ; 0x0a 25c58: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 25c5a: f0 e2 ldi r31, 0x20 ; 32 25c5c: df 9e mul r13, r31 25c5e: b0 01 movw r22, r0 25c60: 11 24 eor r1, r1 25c62: 6a 5b subi r22, 0xBA ; 186 25c64: 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; 25c66: 61 15 cp r22, r1 25c68: 71 05 cpc r23, r1 25c6a: f9 f2 breq .-66 ; 0x25c2a if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 25c6c: db 01 movw r26, r22 25c6e: 8c 91 ld r24, X 25c70: 88 23 and r24, r24 25c72: 41 f0 breq .+16 ; 0x25c84 25c74: 85 3e cpi r24, 0xE5 ; 229 25c76: 09 f0 breq .+2 ; 0x25c7a 25c78: 4c c0 rjmp .+152 ; 0x25d12 // remember first empty slot if (!emptyFound) { 25c7a: 77 20 and r7, r7 25c7c: 29 f0 breq .+10 ; 0x25c88 return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 25c7e: 77 24 eor r7, r7 25c80: 73 94 inc r7 25c82: b5 cf rjmp .-150 ; 0x25bee 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) { 25c84: 71 10 cpse r7, r1 25c86: 0e c0 rjmp .+28 ; 0x25ca4 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 25c88: 80 91 3a 0e lds r24, 0x0E3A ; 0x800e3a 25c8c: 90 91 3b 0e lds r25, 0x0E3B ; 0x800e3b 25c90: a0 91 3c 0e lds r26, 0x0E3C ; 0x800e3c 25c94: b0 91 3d 0e lds r27, 0x0E3D ; 0x800e3d 25c98: f8 01 movw r30, r16 25c9a: 84 87 std Z+12, r24 ; 0x0c 25c9c: 95 87 std Z+13, r25 ; 0x0d 25c9e: a6 87 std Z+14, r26 ; 0x0e 25ca0: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 25ca2: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 25ca4: db 01 movw r26, r22 25ca6: 8c 91 ld r24, X 25ca8: 81 11 cpse r24, r1 25caa: e9 cf rjmp .-46 ; 0x25c7e 25cac: 77 24 eor r7, r7 25cae: 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; 25cb0: 8c 2d mov r24, r12 25cb2: 82 74 andi r24, 0x42 ; 66 25cb4: 82 34 cpi r24, 0x42 ; 66 25cb6: 09 f0 breq .+2 ; 0x25cba 25cb8: b8 cf rjmp .-144 ; 0x25c2a if (emptyFound) { 25cba: 77 20 and r7, r7 25cbc: 09 f4 brne .+2 ; 0x25cc0 25cbe: a2 c0 rjmp .+324 ; 0x25e04 index = dirIndex_; 25cc0: f8 01 movw r30, r16 25cc2: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 25cc4: 61 e0 ldi r22, 0x01 ; 1 25cc6: c8 01 movw r24, r16 25cc8: 0f 94 c1 2b call 0x25782 ; 0x25782 if (!p) goto fail; 25ccc: 00 97 sbiw r24, 0x00 ; 0 25cce: 09 f4 brne .+2 ; 0x25cd2 25cd0: ac cf rjmp .-168 ; 0x25c2a // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 25cd2: 20 e2 ldi r18, 0x20 ; 32 25cd4: dc 01 movw r26, r24 25cd6: 1d 92 st X+, r1 25cd8: 2a 95 dec r18 25cda: e9 f7 brne .-6 ; 0x25cd6 memcpy(p->name, dname, 11); 25cdc: 2b e0 ldi r18, 0x0B ; 11 25cde: f5 01 movw r30, r10 25ce0: dc 01 movw r26, r24 25ce2: 01 90 ld r0, Z+ 25ce4: 0d 92 st X+, r0 25ce6: 2a 95 dec r18 25ce8: e1 f7 brne .-8 ; 0x25ce2 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 25cea: 21 e2 ldi r18, 0x21 ; 33 25cec: 38 e2 ldi r19, 0x28 ; 40 25cee: fc 01 movw r30, r24 25cf0: 31 8b std Z+17, r19 ; 0x11 25cf2: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 25cf4: 40 e0 ldi r20, 0x00 ; 0 25cf6: 58 e0 ldi r21, 0x08 ; 8 25cf8: 57 87 std Z+15, r21 ; 0x0f 25cfa: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 25cfc: 33 8b std Z+19, r19 ; 0x13 25cfe: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 25d00: 31 8f std Z+25, r19 ; 0x19 25d02: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 25d04: 57 8b std Z+23, r21 ; 0x17 25d06: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 25d08: 0f 94 b5 26 call 0x24d6a ; 0x24d6a 25d0c: 81 11 cpse r24, r1 25d0e: 09 c0 rjmp .+18 ; 0x25d22 25d10: 8c cf rjmp .-232 ; 0x25c2a dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 25d12: 4b e0 ldi r20, 0x0B ; 11 25d14: 50 e0 ldi r21, 0x00 ; 0 25d16: c5 01 movw r24, r10 25d18: 0f 94 5a aa call 0x354b4 ; 0x354b4 25d1c: 89 2b or r24, r25 25d1e: 09 f0 breq .+2 ; 0x25d22 25d20: 66 cf rjmp .-308 ; 0x25bee } //------------------------------------------------------------------------------ // 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]; 25d22: f0 e2 ldi r31, 0x20 ; 32 25d24: df 9e mul r13, r31 25d26: d0 01 movw r26, r0 25d28: 11 24 eor r1, r1 25d2a: 9d 01 movw r18, r26 25d2c: 2a 5b subi r18, 0xBA ; 186 25d2e: 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)) { 25d30: f9 01 movw r30, r18 25d32: 83 85 ldd r24, Z+11 ; 0x0b 25d34: 81 71 andi r24, 0x11 ; 17 25d36: 21 f0 breq .+8 ; 0x25d40 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 25d38: 8c 2d mov r24, r12 25d3a: 82 71 andi r24, 0x12 ; 18 25d3c: 09 f0 breq .+2 ; 0x25d40 25d3e: fc c0 rjmp .+504 ; 0x25f38 } //------------------------------------------------------------------------------ // 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]; 25d40: f8 01 movw r30, r16 25d42: 81 8d ldd r24, Z+25 ; 0x19 25d44: 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(); 25d46: 40 91 3a 0e lds r20, 0x0E3A ; 0x800e3a 25d4a: 50 91 3b 0e lds r21, 0x0E3B ; 0x800e3b 25d4e: 60 91 3c 0e lds r22, 0x0E3C ; 0x800e3c 25d52: 70 91 3d 0e lds r23, 0x0E3D ; 0x800e3d 25d56: 44 87 std Z+12, r20 ; 0x0c 25d58: 55 87 std Z+13, r21 ; 0x0d 25d5a: 66 87 std Z+14, r22 ; 0x0e 25d5c: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 25d5e: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 25d60: fd 01 movw r30, r26 25d62: ea 5b subi r30, 0xBA ; 186 25d64: f1 4f sbci r31, 0xF1 ; 241 25d66: 44 88 ldd r4, Z+20 ; 0x14 25d68: 55 88 ldd r5, Z+21 ; 0x15 25d6a: 71 2c mov r7, r1 25d6c: 61 2c mov r6, r1 25d6e: 32 01 movw r6, r4 25d70: 55 24 eor r5, r5 25d72: 44 24 eor r4, r4 25d74: d8 01 movw r26, r16 25d76: 55 96 adiw r26, 0x15 ; 21 25d78: 4d 92 st X+, r4 25d7a: 5d 92 st X+, r5 25d7c: 6d 92 st X+, r6 25d7e: 7c 92 st X, r7 25d80: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 25d82: 42 8d ldd r20, Z+26 ; 0x1a 25d84: 53 8d ldd r21, Z+27 ; 0x1b 25d86: 70 e0 ldi r23, 0x00 ; 0 25d88: 60 e0 ldi r22, 0x00 ; 0 25d8a: 44 29 or r20, r4 25d8c: 55 29 or r21, r5 25d8e: 66 29 or r22, r6 25d90: 77 29 or r23, r7 25d92: 55 96 adiw r26, 0x15 ; 21 25d94: 4d 93 st X+, r20 25d96: 5d 93 st X+, r21 25d98: 6d 93 st X+, r22 25d9a: 7c 93 st X, r23 25d9c: 58 97 sbiw r26, 0x18 ; 24 25d9e: d9 01 movw r26, r18 25da0: 1b 96 adiw r26, 0x0b ; 11 25da2: 2c 91 ld r18, X 25da4: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 25da6: 09 f0 breq .+2 ; 0x25daa 25da8: b9 c0 rjmp .+370 ; 0x25f1c fileSize_ = p->fileSize; 25daa: 84 8d ldd r24, Z+28 ; 0x1c 25dac: 95 8d ldd r25, Z+29 ; 0x1d 25dae: a6 8d ldd r26, Z+30 ; 0x1e 25db0: b7 8d ldd r27, Z+31 ; 0x1f 25db2: f8 01 movw r30, r16 25db4: 81 8b std Z+17, r24 ; 0x11 25db6: 92 8b std Z+18, r25 ; 0x12 25db8: a3 8b std Z+19, r26 ; 0x13 25dba: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 25dbc: 81 e0 ldi r24, 0x01 ; 1 25dbe: 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; 25dc0: 8c 2d mov r24, r12 25dc2: 8f 70 andi r24, 0x0F ; 15 25dc4: f8 01 movw r30, r16 25dc6: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 25dc8: 14 82 std Z+4, r1 ; 0x04 25dca: 15 82 std Z+5, r1 ; 0x05 25dcc: 16 82 std Z+6, r1 ; 0x06 25dce: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 25dd0: 10 86 std Z+8, r1 ; 0x08 25dd2: 11 86 std Z+9, r1 ; 0x09 25dd4: 12 86 std Z+10, r1 ; 0x0a 25dd6: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 25dd8: 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; 25dda: c4 fe sbrs r12, 4 25ddc: 03 c0 rjmp .+6 ; 0x25de4 25dde: c8 01 movw r24, r16 25de0: 0f 94 67 68 call 0x2d0ce ; 0x2d0ce // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 25de4: 0f 90 pop r0 25de6: df 91 pop r29 25de8: cf 91 pop r28 25dea: 1f 91 pop r17 25dec: 0f 91 pop r16 25dee: ff 90 pop r15 25df0: ef 90 pop r14 25df2: df 90 pop r13 25df4: cf 90 pop r12 25df6: bf 90 pop r11 25df8: af 90 pop r10 25dfa: 7f 90 pop r7 25dfc: 6f 90 pop r6 25dfe: 5f 90 pop r5 25e00: 4f 90 pop r4 25e02: 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; 25e04: d7 01 movw r26, r14 25e06: 13 96 adiw r26, 0x03 ; 3 25e08: 8c 91 ld r24, X 25e0a: 13 97 sbiw r26, 0x03 ; 3 25e0c: 82 30 cpi r24, 0x02 ; 2 25e0e: 09 f4 brne .+2 ; 0x25e12 25e10: 0c cf rjmp .-488 ; 0x25c2a // 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; 25e12: 51 96 adiw r26, 0x11 ; 17 25e14: 8d 91 ld r24, X+ 25e16: 9d 91 ld r25, X+ 25e18: 0d 90 ld r0, X+ 25e1a: bc 91 ld r27, X 25e1c: a0 2d mov r26, r0 25e1e: 80 3e cpi r24, 0xE0 ; 224 25e20: 9f 4f sbci r25, 0xFF ; 255 25e22: af 41 sbci r26, 0x1F ; 31 25e24: b1 05 cpc r27, r1 25e26: 08 f0 brcs .+2 ; 0x25e2a 25e28: 00 cf rjmp .-512 ; 0x25c2a if (!addCluster()) goto fail; 25e2a: c7 01 movw r24, r14 25e2c: 0f 94 c6 2a call 0x2558c ; 0x2558c 25e30: 88 23 and r24, r24 25e32: 09 f4 brne .+2 ; 0x25e36 25e34: fa ce rjmp .-524 ; 0x25c2a if (!vol_->cacheFlush()) goto fail; 25e36: 0f 94 b5 26 call 0x24d6a ; 0x24d6a 25e3a: 88 23 and r24, r24 25e3c: 09 f4 brne .+2 ; 0x25e40 25e3e: f5 ce rjmp .-534 ; 0x25c2a block = vol_->clusterStartBlock(curCluster_); 25e40: d7 01 movw r26, r14 25e42: 59 96 adiw r26, 0x19 ; 25 25e44: ed 91 ld r30, X+ 25e46: fc 91 ld r31, X 25e48: 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_);} 25e4a: 14 96 adiw r26, 0x04 ; 4 25e4c: 4d 90 ld r4, X+ 25e4e: 5d 90 ld r5, X+ 25e50: 6d 90 ld r6, X+ 25e52: 7c 90 ld r7, X 25e54: 17 97 sbiw r26, 0x07 ; 7 25e56: b2 e0 ldi r27, 0x02 ; 2 25e58: 4b 1a sub r4, r27 25e5a: 51 08 sbc r5, r1 25e5c: 61 08 sbc r6, r1 25e5e: 71 08 sbc r7, r1 25e60: 85 85 ldd r24, Z+13 ; 0x0d 25e62: 04 c0 rjmp .+8 ; 0x25e6c 25e64: 44 0c add r4, r4 25e66: 55 1c adc r5, r5 25e68: 66 1c adc r6, r6 25e6a: 77 1c adc r7, r7 25e6c: 8a 95 dec r24 25e6e: d2 f7 brpl .-12 ; 0x25e64 25e70: 86 85 ldd r24, Z+14 ; 0x0e 25e72: 97 85 ldd r25, Z+15 ; 0x0f 25e74: a0 89 ldd r26, Z+16 ; 0x10 25e76: b1 89 ldd r27, Z+17 ; 0x11 25e78: 48 0e add r4, r24 25e7a: 59 1e adc r5, r25 25e7c: 6a 1e adc r6, r26 25e7e: 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; 25e80: 81 e0 ldi r24, 0x01 ; 1 25e82: 80 93 42 0e sts 0x0E42, r24 ; 0x800e42 cacheBlockNumber_ = blockNumber; 25e86: 40 92 3a 0e sts 0x0E3A, r4 ; 0x800e3a 25e8a: 50 92 3b 0e sts 0x0E3B, r5 ; 0x800e3b 25e8e: 60 92 3c 0e sts 0x0E3C, r6 ; 0x800e3c 25e92: 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); 25e96: e6 e4 ldi r30, 0x46 ; 70 25e98: fe e0 ldi r31, 0x0E ; 14 25e9a: 80 e0 ldi r24, 0x00 ; 0 25e9c: 92 e0 ldi r25, 0x02 ; 2 25e9e: df 01 movw r26, r30 25ea0: 9c 01 movw r18, r24 25ea2: 1d 92 st X+, r1 25ea4: 21 50 subi r18, 0x01 ; 1 25ea6: 30 40 sbci r19, 0x00 ; 0 25ea8: e1 f7 brne .-8 ; 0x25ea2 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 25eaa: dd 24 eor r13, r13 25eac: d3 94 inc r13 25eae: d7 01 movw r26, r14 25eb0: 59 96 adiw r26, 0x19 ; 25 25eb2: ed 91 ld r30, X+ 25eb4: fc 91 ld r31, X 25eb6: 84 81 ldd r24, Z+4 ; 0x04 25eb8: d8 16 cp r13, r24 25eba: 98 f4 brcc .+38 ; 0x25ee2 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); 25ebc: 26 e4 ldi r18, 0x46 ; 70 25ebe: 3e e0 ldi r19, 0x0E ; 14 25ec0: b3 01 movw r22, r6 25ec2: a2 01 movw r20, r4 25ec4: 4d 0d add r20, r13 25ec6: 51 1d adc r21, r1 25ec8: 61 1d adc r22, r1 25eca: 71 1d adc r23, r1 25ecc: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 25ed0: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 25ed4: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 25ed8: 88 23 and r24, r24 25eda: 09 f4 brne .+2 ; 0x25ede 25edc: a6 ce rjmp .-692 ; 0x25c2a // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 25ede: d3 94 inc r13 25ee0: e6 cf rjmp .-52 ; 0x25eae if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 25ee2: 25 85 ldd r18, Z+13 ; 0x0d 25ee4: 80 e0 ldi r24, 0x00 ; 0 25ee6: 92 e0 ldi r25, 0x02 ; 2 25ee8: a0 e0 ldi r26, 0x00 ; 0 25eea: b0 e0 ldi r27, 0x00 ; 0 25eec: 04 c0 rjmp .+8 ; 0x25ef6 25eee: 88 0f add r24, r24 25ef0: 99 1f adc r25, r25 25ef2: aa 1f adc r26, r26 25ef4: bb 1f adc r27, r27 25ef6: 2a 95 dec r18 25ef8: d2 f7 brpl .-12 ; 0x25eee 25efa: f7 01 movw r30, r14 25efc: 41 89 ldd r20, Z+17 ; 0x11 25efe: 52 89 ldd r21, Z+18 ; 0x12 25f00: 63 89 ldd r22, Z+19 ; 0x13 25f02: 74 89 ldd r23, Z+20 ; 0x14 25f04: 84 0f add r24, r20 25f06: 95 1f adc r25, r21 25f08: a6 1f adc r26, r22 25f0a: b7 1f adc r27, r23 25f0c: 81 8b std Z+17, r24 ; 0x11 25f0e: 92 8b std Z+18, r25 ; 0x12 25f10: a3 8b std Z+19, r26 ; 0x13 25f12: 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; 25f14: 86 e4 ldi r24, 0x46 ; 70 25f16: 9e e0 ldi r25, 0x0E ; 14 index = 0; 25f18: d1 2c mov r13, r1 25f1a: db ce rjmp .-586 ; 0x25cd2 // 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)) { 25f1c: 20 31 cpi r18, 0x10 ; 16 25f1e: 61 f4 brne .+24 ; 0x25f38 if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 25f20: 98 01 movw r18, r16 25f22: 2f 5e subi r18, 0xEF ; 239 25f24: 3f 4f sbci r19, 0xFF ; 255 25f26: 0f 94 ff 28 call 0x251fe ; 0x251fe 25f2a: 88 23 and r24, r24 25f2c: 29 f0 breq .+10 ; 0x25f38 type_ = FAT_FILE_TYPE_SUBDIR; 25f2e: 84 e0 ldi r24, 0x04 ; 4 25f30: d8 01 movw r26, r16 25f32: 13 96 adiw r26, 0x03 ; 3 25f34: 8c 93 st X, r24 25f36: 44 cf rjmp .-376 ; 0x25dc0 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 25f38: d8 01 movw r26, r16 25f3a: 13 96 adiw r26, 0x03 ; 3 25f3c: 1c 92 st X, r1 25f3e: 75 ce rjmp .-790 ; 0x25c2a 00025f40 : } } #endif //PRUSA_M28 void prusa_statistics(uint8_t _message) { 25f40: cf 93 push r28 const uint8_t _fil_nr = 0; if (!farm_mode) 25f42: 90 91 60 0d lds r25, 0x0D60 ; 0x800d60 25f46: 99 23 and r25, r25 25f48: 09 f4 brne .+2 ; 0x25f4c 25f4a: f6 c0 rjmp .+492 ; 0x26138 25f4c: c8 2f mov r28, r24 return; switch (_message) { 25f4e: 87 30 cpi r24, 0x07 ; 7 25f50: 09 f4 brne .+2 ; 0x25f54 25f52: be c0 rjmp .+380 ; 0x260d0 25f54: 08 f0 brcs .+2 ; 0x25f58 25f56: 46 c0 rjmp .+140 ; 0x25fe4 25f58: 83 30 cpi r24, 0x03 ; 3 25f5a: 09 f4 brne .+2 ; 0x25f5e 25f5c: ed c0 rjmp .+474 ; 0x26138 25f5e: 80 f5 brcc .+96 ; 0x25fc0 25f60: 81 30 cpi r24, 0x01 ; 1 25f62: 09 f4 brne .+2 ; 0x25f66 25f64: 88 c0 rjmp .+272 ; 0x26076 25f66: 08 f4 brcc .+2 ; 0x25f6a 25f68: 60 c0 rjmp .+192 ; 0x2602a 25f6a: 8b e7 ldi r24, 0x7B ; 123 25f6c: 0e 94 0c 7a call 0xf418 ; 0xf418 farm_timer = 1; break; case 2: // heating done SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 25f70: 83 e0 ldi r24, 0x03 ; 3 25f72: 0f 94 e0 05 call 0x20bc0 ; 0x20bc0 prusa_stat_farm_number(); 25f76: 0f 94 93 05 call 0x20b26 ; 0x20b26 25f7a: 8d e7 ldi r24, 0x7D ; 125 25f7c: 0e 94 0c 7a call 0xf418 ; 0xf418 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 25f80: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_ECHOLN('}'); status_number = 3; 25f84: c3 e0 ldi r28, 0x03 ; 3 25f86: c0 93 bd 04 sts 0x04BD, r28 ; 0x8004bd <_ZL13status_number.lto_priv.490> farm_timer = 1; 25f8a: 81 e0 ldi r24, 0x01 ; 1 25f8c: 80 93 74 02 sts 0x0274, r24 ; 0x800274 if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 25f90: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 25f94: 81 11 cpse r24, r1 25f96: 05 c0 rjmp .+10 ; 0x25fa2 25f98: 80 91 94 03 lds r24, 0x0394 ; 0x800394 25f9c: 88 23 and r24, r24 25f9e: 09 f4 brne .+2 ; 0x25fa2 25fa0: 78 c0 rjmp .+240 ; 0x26092 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 25fa2: 8b e7 ldi r24, 0x7B ; 123 25fa4: 0e 94 0c 7a call 0xf418 ; 0xf418 SERIAL_ECHO('{'); prusa_stat_printerstatus(4); 25fa8: 84 e0 ldi r24, 0x04 ; 4 25faa: 0f 94 e0 05 call 0x20bc0 ; 0x20bc0 prusa_stat_farm_number(); 25fae: 0f 94 93 05 call 0x20b26 ; 0x20b26 status_number = 4; 25fb2: 84 e0 ldi r24, 0x04 ; 4 25fb4: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.490> SERIAL_ECHO('{'); prusa_stat_printerstatus(3); prusa_stat_farm_number(); status_number = 3; } farm_timer = 1; 25fb8: 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; 25fba: 80 93 74 02 sts 0x0274, r24 ; 0x800274 25fbe: 1e c0 rjmp .+60 ; 0x25ffc void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 25fc0: 85 30 cpi r24, 0x05 ; 5 25fc2: 09 f4 brne .+2 ; 0x25fc6 25fc4: 71 c0 rjmp .+226 ; 0x260a8 // 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:"); 25fc6: 80 e8 ldi r24, 0x80 ; 128 25fc8: 9a e8 ldi r25, 0x8A ; 138 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 25fca: c6 30 cpi r28, 0x06 ; 6 25fcc: 08 f4 brcc .+2 ; 0x25fd0 25fce: 6e c0 rjmp .+220 ; 0x260ac prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 6: // print done SERIAL_ECHOPGM("{[PRN:8]"); 25fd0: 89 e6 ldi r24, 0x69 ; 105 25fd2: 9a e8 ldi r25, 0x8A ; 138 25fd4: 0e 94 1f 7b call 0xf63e ; 0xf63e prusa_stat_farm_number(); 25fd8: 0f 94 93 05 call 0x20b26 ; 0x20b26 status_number = 8; 25fdc: 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; 25fde: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.490> 25fe2: 74 c0 rjmp .+232 ; 0x260cc void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 25fe4: 86 31 cpi r24, 0x16 ; 22 25fe6: 09 f4 brne .+2 ; 0x25fea 25fe8: 9b c0 rjmp .+310 ; 0x26120 25fea: 70 f4 brcc .+28 ; 0x26008 25fec: 84 31 cpi r24, 0x14 ; 20 25fee: 09 f4 brne .+2 ; 0x25ff2 25ff0: 80 c0 rjmp .+256 ; 0x260f2 25ff2: 08 f0 brcs .+2 ; 0x25ff6 25ff4: 89 c0 rjmp .+274 ; 0x26108 25ff6: 88 30 cpi r24, 0x08 ; 8 25ff8: 09 f4 brne .+2 ; 0x25ffc 25ffa: 72 c0 rjmp .+228 ; 0x260e0 25ffc: 8d e7 ldi r24, 0x7D ; 125 25ffe: 0e 94 0c 7a call 0xf418 ; 0xf418 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 26002: cf 91 pop r28 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 26004: 0c 94 17 7b jmp 0xf62e ; 0xf62e void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 26008: 8b 35 cpi r24, 0x5B ; 91 2600a: 09 f4 brne .+2 ; 0x2600e 2600c: 91 c0 rjmp .+290 ; 0x26130 2600e: 30 f4 brcc .+12 ; 0x2601c prusa_stat_farm_number(); status_number = 5; break; case 90: // Error - Thermal Runaway prusa_statistics_err('1'); 26010: 81 e3 ldi r24, 0x31 ; 49 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 26012: ca 35 cpi r28, 0x5A ; 90 26014: 99 f7 brne .-26 ; 0x25ffc break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 26016: 0f 94 ed 05 call 0x20bda ; 0x20bda 2601a: f0 cf rjmp .-32 ; 0x25ffc void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 2601c: 8c 35 cpi r24, 0x5C ; 92 2601e: 09 f4 brne .+2 ; 0x26022 26020: 89 c0 rjmp .+274 ; 0x26134 break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 26022: 84 e3 ldi r24, 0x34 ; 52 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 26024: cd 35 cpi r28, 0x5D ; 93 26026: b9 f3 breq .-18 ; 0x26016 26028: e9 cf rjmp .-46 ; 0x25ffc case 0: // default message if (busy_state == PAUSED_FOR_USER) { 2602a: 80 91 78 02 lds r24, 0x0278 ; 0x800278 2602e: 84 30 cpi r24, 0x04 ; 4 26030: 21 f4 brne .+8 ; 0x2603a prusa_statistics_case0(15); 26032: 8f e0 ldi r24, 0x0F ; 15 } else if (printingIsPaused()) { prusa_statistics_case0(14); 26034: 0f 94 df 15 call 0x22bbe ; 0x22bbe 26038: e1 cf rjmp .-62 ; 0x25ffc switch (_message) { case 0: // default message if (busy_state == PAUSED_FOR_USER) { prusa_statistics_case0(15); } else if (printingIsPaused()) { 2603a: 0e 94 90 66 call 0xcd20 ; 0xcd20 2603e: 88 23 and r24, r24 26040: 11 f0 breq .+4 ; 0x26046 prusa_statistics_case0(14); 26042: 8e e0 ldi r24, 0x0E ; 14 26044: f7 cf rjmp .-18 ; 0x26034 } else if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 26046: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 2604a: 81 11 cpse r24, r1 2604c: 04 c0 rjmp .+8 ; 0x26056 2604e: 80 91 94 03 lds r24, 0x0394 ; 0x800394 26052: 88 23 and r24, r24 26054: 11 f0 breq .+4 ; 0x2605a prusa_statistics_case0(4); 26056: 84 e0 ldi r24, 0x04 ; 4 26058: ed cf rjmp .-38 ; 0x26034 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2605a: 8b e7 ldi r24, 0x7B ; 123 2605c: 0e 94 0c 7a call 0xf418 ; 0xf418 } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(1); 26060: 81 e0 ldi r24, 0x01 ; 1 26062: 0f 94 e0 05 call 0x20bc0 ; 0x20bc0 prusa_stat_farm_number(); 26066: 0f 94 93 05 call 0x20b26 ; 0x20b26 prusa_stat_diameter(); 2606a: 0f 94 fc 05 call 0x20bf8 ; 0x20bf8 status_number = 1; 2606e: 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; 26070: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.490> 26074: c3 cf rjmp .-122 ; 0x25ffc 26076: 8b e7 ldi r24, 0x7B ; 123 26078: 0e 94 0c 7a call 0xf418 ; 0xf418 } break; case 1: // 1 heating SERIAL_ECHO('{'); prusa_stat_printerstatus(2); 2607c: 82 e0 ldi r24, 0x02 ; 2 2607e: 0f 94 e0 05 call 0x20bc0 ; 0x20bc0 prusa_stat_farm_number(); 26082: 0f 94 93 05 call 0x20b26 ; 0x20b26 status_number = 2; 26086: 82 e0 ldi r24, 0x02 ; 2 26088: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.490> farm_timer = 1; 2608c: c0 93 74 02 sts 0x0274, r28 ; 0x800274 26090: b5 cf rjmp .-150 ; 0x25ffc 26092: 8b e7 ldi r24, 0x7B ; 123 26094: 0e 94 0c 7a call 0xf418 ; 0xf418 prusa_stat_farm_number(); status_number = 4; } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 26098: 83 e0 ldi r24, 0x03 ; 3 2609a: 0f 94 e0 05 call 0x20bc0 ; 0x20bc0 prusa_stat_farm_number(); 2609e: 0f 94 93 05 call 0x20b26 ; 0x20b26 status_number = 3; 260a2: c0 93 bd 04 sts 0x04BD, r28 ; 0x8004bd <_ZL13status_number.lto_priv.490> 260a6: 88 cf rjmp .-240 ; 0x25fb8 prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 5: // print not succesfull SERIAL_ECHOPGM("{[RES:0][FIL:"); 260a8: 82 e7 ldi r24, 0x72 ; 114 260aa: 9a e8 ldi r25, 0x8A ; 138 // 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:"); 260ac: 0e 94 1f 7b call 0xf63e ; 0xf63e 260b0: 60 e0 ldi r22, 0x00 ; 0 260b2: 70 e0 ldi r23, 0x00 ; 0 260b4: cb 01 movw r24, r22 260b6: 0e 94 85 7a call 0xf50a ; 0xf50a 260ba: 8d e5 ldi r24, 0x5D ; 93 260bc: 0e 94 0c 7a call 0xf418 ; 0xf418 MYSERIAL.print(int(_fil_nr)); SERIAL_ECHO(']'); prusa_stat_printerstatus(status_number); 260c0: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.490> 260c4: 0f 94 e0 05 call 0x20bc0 ; 0x20bc0 prusa_stat_farm_number(); 260c8: 0f 94 93 05 call 0x20b26 ; 0x20b26 farm_timer = 2; 260cc: 82 e0 ldi r24, 0x02 ; 2 260ce: 75 cf rjmp .-278 ; 0x25fba prusa_stat_farm_number(); status_number = 8; farm_timer = 2; break; case 7: // print done - stopped SERIAL_ECHOPGM("{[PRN:9]"); 260d0: 80 e6 ldi r24, 0x60 ; 96 260d2: 9a e8 ldi r25, 0x8A ; 138 260d4: 0e 94 1f 7b call 0xf63e ; 0xf63e prusa_stat_farm_number(); 260d8: 0f 94 93 05 call 0x20b26 ; 0x20b26 status_number = 9; 260dc: 89 e0 ldi r24, 0x09 ; 9 260de: 7f cf rjmp .-258 ; 0x25fde farm_timer = 2; break; case 8: // printer started SERIAL_ECHOPGM("{[PRN:0]"); 260e0: 87 e5 ldi r24, 0x57 ; 87 260e2: 9a e8 ldi r25, 0x8A ; 138 260e4: 0e 94 1f 7b call 0xf63e ; 0xf63e prusa_stat_farm_number(); 260e8: 0f 94 93 05 call 0x20b26 ; 0x20b26 status_number = 0; 260ec: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL13status_number.lto_priv.490> 260f0: ed cf rjmp .-38 ; 0x260cc 260f2: 8b e7 ldi r24, 0x7B ; 123 260f4: 0e 94 0c 7a call 0xf418 ; 0xf418 farm_timer = 2; break; case 20: // echo farm no SERIAL_ECHO('{'); prusa_stat_printerstatus(status_number); 260f8: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.490> 260fc: 0f 94 e0 05 call 0x20bc0 ; 0x20bc0 prusa_stat_farm_number(); 26100: 0f 94 93 05 call 0x20b26 ; 0x20b26 farm_timer = 4; 26104: 84 e0 ldi r24, 0x04 ; 4 26106: 59 cf rjmp .-334 ; 0x25fba 26108: 8b e7 ldi r24, 0x7B ; 123 2610a: 0e 94 0c 7a call 0xf418 ; 0xf418 break; case 21: // temperatures SERIAL_ECHO('{'); prusa_stat_temperatures(); 2610e: 0f 94 a3 05 call 0x20b46 ; 0x20b46 prusa_stat_farm_number(); 26112: 0f 94 93 05 call 0x20b26 ; 0x20b26 prusa_stat_printerstatus(status_number); 26116: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.490> 2611a: 0f 94 e0 05 call 0x20bc0 ; 0x20bc0 2611e: 6e cf rjmp .-292 ; 0x25ffc break; case 22: // waiting for filament change SERIAL_ECHOPGM("{[PRN:5]"); 26120: 8e e4 ldi r24, 0x4E ; 78 26122: 9a e8 ldi r25, 0x8A ; 138 26124: 0e 94 1f 7b call 0xf63e ; 0xf63e prusa_stat_farm_number(); 26128: 0f 94 93 05 call 0x20b26 ; 0x20b26 status_number = 5; 2612c: 85 e0 ldi r24, 0x05 ; 5 2612e: a0 cf rjmp .-192 ; 0x26070 case 90: // Error - Thermal Runaway prusa_statistics_err('1'); break; case 91: // Error - Thermal Runaway Preheat prusa_statistics_err('2'); 26130: 82 e3 ldi r24, 0x32 ; 50 26132: 71 cf rjmp .-286 ; 0x26016 break; case 92: // Error - Min temp prusa_statistics_err('3'); 26134: 83 e3 ldi r24, 0x33 ; 51 26136: 6f cf rjmp .-290 ; 0x26016 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 26138: cf 91 pop r28 2613a: 08 95 ret 0002613c : 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()") { 2613c: cf 92 push r12 2613e: df 92 push r13 26140: ef 92 push r14 26142: ff 92 push r15 26144: 0f 93 push r16 26146: 1f 93 push r17 26148: cf 93 push r28 2614a: df 93 push r29 2614c: 00 d0 rcall .+0 ; 0x2614e 2614e: 00 d0 rcall .+0 ; 0x26150 26150: 1f 92 push r1 26152: 1f 92 push r1 26154: cd b7 in r28, 0x3d ; 61 26156: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 26158: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 2615c: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 26160: 00 97 sbiw r24, 0x00 ; 0 26162: e1 f1 breq .+120 ; 0x261dc { const int16_t initial_feedmultiply = feedmultiply; 26164: 20 91 8e 02 lds r18, 0x028E ; 0x80028e 26168: 30 91 8f 02 lds r19, 0x028F ; 0x80028f // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2616c: 24 36 cpi r18, 0x64 ; 100 2616e: 31 05 cpc r19, r1 26170: 4c f4 brge .+18 ; 0x26184 26172: ac 01 movw r20, r24 26174: 42 0f add r20, r18 26176: 53 1f adc r21, r19 26178: 45 36 cpi r20, 0x65 ; 101 2617a: 51 05 cpc r21, r1 2617c: 6c f4 brge .+26 ; 0x26198 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; 2617e: 82 0f add r24, r18 26180: 93 1f adc r25, r19 26182: 0c c0 rjmp .+24 ; 0x2619c #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 26184: 24 36 cpi r18, 0x64 ; 100 26186: 31 05 cpc r19, r1 26188: 09 f4 brne .+2 ; 0x2618c 2618a: 55 c0 rjmp .+170 ; 0x26236 (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 2618c: ac 01 movw r20, r24 2618e: 42 0f add r20, r18 26190: 53 1f adc r21, r19 26192: 44 36 cpi r20, 0x64 ; 100 26194: 51 05 cpc r21, r1 26196: 9c f7 brge .-26 ; 0x2617e { feedmultiply = 100; 26198: 84 e6 ldi r24, 0x64 ; 100 2619a: 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; 2619c: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 261a0: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e if (initial_feedmultiply != feedmultiply) { 261a4: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 261a8: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 261ac: 82 17 cp r24, r18 261ae: 93 07 cpc r25, r19 261b0: a9 f0 breq .+42 ; 0x261dc feedmultiply = constrain(feedmultiply, 10, 999); 261b2: 88 3e cpi r24, 0xE8 ; 232 261b4: 53 e0 ldi r21, 0x03 ; 3 261b6: 95 07 cpc r25, r21 261b8: 14 f0 brlt .+4 ; 0x261be 261ba: 87 ee ldi r24, 0xE7 ; 231 261bc: 93 e0 ldi r25, 0x03 ; 3 261be: 8a 30 cpi r24, 0x0A ; 10 261c0: 91 05 cpc r25, r1 261c2: 14 f4 brge .+4 ; 0x261c8 261c4: 8a e0 ldi r24, 0x0A ; 10 261c6: 90 e0 ldi r25, 0x00 ; 0 261c8: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 261cc: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e lcd_encoder = 0; // Consume rotation event 261d0: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 261d4: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e refresh_saved_feedrate_multiplier_in_ram(); 261d8: 0e 94 98 64 call 0xc930 ; 0xc930 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 261dc: 80 91 59 02 lds r24, 0x0259 ; 0x800259 261e0: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 261e2: 10 92 0a 06 sts 0x060A, r1 ; 0x80060a } if (lcd_status_update_delay) 261e6: 10 91 0a 06 lds r17, 0x060A ; 0x80060a 261ea: 11 23 and r17, r17 261ec: 91 f1 breq .+100 ; 0x26252 lcd_status_update_delay--; 261ee: 2f ef ldi r18, 0xFF ; 255 261f0: 21 0f add r18, r17 261f2: 20 93 0a 06 sts 0x060A, r18 ; 0x80060a if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 261f6: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 261fa: 81 11 cpse r24, r1 261fc: 0d c0 rjmp .+26 ; 0x26218 261fe: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 26202: 88 23 and r24, r24 26204: 49 f0 breq .+18 ; 0x26218 menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 26206: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df menu_submenu(lcd_main_menu); 2620a: 60 e0 ldi r22, 0x00 ; 0 2620c: 86 ee ldi r24, 0xE6 ; 230 2620e: 96 ec ldi r25, 0xC6 ; 198 26210: 0e 94 38 63 call 0xc670 ; 0xc670 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 26214: 0e 94 fa 70 call 0xe1f4 ; 0xe1f4 } } 26218: 28 96 adiw r28, 0x08 ; 8 2621a: 0f b6 in r0, 0x3f ; 63 2621c: f8 94 cli 2621e: de bf out 0x3e, r29 ; 62 26220: 0f be out 0x3f, r0 ; 63 26222: cd bf out 0x3d, r28 ; 61 26224: df 91 pop r29 26226: cf 91 pop r28 26228: 1f 91 pop r17 2622a: 0f 91 pop r16 2622c: ff 90 pop r15 2622e: ef 90 pop r14 26230: df 90 pop r13 26232: cf 90 pop r12 26234: 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) { 26236: 8b 30 cpi r24, 0x0B ; 11 26238: 91 05 cpc r25, r1 2623a: 1c f0 brlt .+6 ; 0x26242 feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 2623c: 86 5a subi r24, 0xA6 ; 166 2623e: 9f 4f sbci r25, 0xFF ; 255 26240: ad cf rjmp .-166 ; 0x2619c } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 26242: 86 3f cpi r24, 0xF6 ; 246 26244: 4f ef ldi r20, 0xFF ; 255 26246: 94 07 cpc r25, r20 26248: 0c f0 brlt .+2 ; 0x2624c 2624a: ac cf rjmp .-168 ; 0x261a4 feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 2624c: 82 59 subi r24, 0x92 ; 146 2624e: 9f 4f sbci r25, 0xFF ; 255 26250: a5 cf rjmp .-182 ; 0x2619c 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; 26252: 6a e0 ldi r22, 0x0A ; 10 26254: 60 93 0a 06 sts 0x060A, r22 ; 0x80060a ReInitLCD++; 26258: 80 91 09 06 lds r24, 0x0609 ; 0x800609 2625c: 8f 5f subi r24, 0xFF ; 255 2625e: 80 93 09 06 sts 0x0609, r24 ; 0x800609 if (ReInitLCD == 30) 26262: 8e 31 cpi r24, 0x1E ; 30 26264: 09 f0 breq .+2 ; 0x26268 26266: 9f c0 rjmp .+318 ; 0x263a6 { ReInitLCD = 0 ; 26268: 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(); 2626c: 0e 94 fa 70 call 0xe1f4 ; 0xe1f4 lcd_status_message_idx = 0; // Re-draw message from beginning 26270: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.418> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 26274: 0e 94 41 6f call 0xde82 ; 0xde82 lcd_home(); //line 0 26278: 0e 94 7a 70 call 0xe0f4 ; 0xe0f4 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 2627c: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 26280: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 26284: 07 2e mov r0, r23 26286: 00 0c add r0, r0 26288: 88 0b sbc r24, r24 2628a: 99 0b sbc r25, r25 2628c: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__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)); 26290: 20 e0 ldi r18, 0x00 ; 0 26292: 30 e0 ldi r19, 0x00 ; 0 26294: 40 e0 ldi r20, 0x00 ; 0 26296: 5f e3 ldi r21, 0x3F ; 63 26298: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2629c: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 262a0: 6b 01 movw r12, r22 262a2: 20 e0 ldi r18, 0x00 ; 0 262a4: 30 e0 ldi r19, 0x00 ; 0 262a6: 40 e0 ldi r20, 0x00 ; 0 262a8: 5f e3 ldi r21, 0x3F ; 63 262aa: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 262ae: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 262b2: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 262b6: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 262ba: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 262be: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 262c2: a6 01 movw r20, r12 262c4: 82 e8 ldi r24, 0x82 ; 130 262c6: 0f 94 d2 09 call 0x213a4 ; 0x213a4 lcd_space(3); //3 spaces 262ca: 83 e0 ldi r24, 0x03 ; 3 262cc: 0e 94 83 6f call 0xdf06 ; 0xdf06 } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 262d0: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 262d4: 81 30 cpi r24, 0x01 ; 1 262d6: 09 f0 breq .+2 ; 0x262da 262d8: 6e c0 rjmp .+220 ; 0x263b6 lcd_puts_P(_N("Z --- ")); 262da: 8e e0 ldi r24, 0x0E ; 14 262dc: 9b e6 ldi r25, 0x6B ; 107 262de: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 262e2: 61 e0 ldi r22, 0x01 ; 1 262e4: 80 e0 ldi r24, 0x00 ; 0 262e6: 0e 94 b5 6f call 0xdf6a ; 0xdf6a }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 262ea: 60 91 59 12 lds r22, 0x1259 ; 0x801259 262ee: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 262f2: 07 2e mov r0, r23 262f4: 00 0c add r0, r0 262f6: 88 0b sbc r24, r24 262f8: 99 0b sbc r25, r25 262fa: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 262fe: 20 e0 ldi r18, 0x00 ; 0 26300: 30 e0 ldi r19, 0x00 ; 0 26302: 40 e0 ldi r20, 0x00 ; 0 26304: 5f e3 ldi r21, 0x3F ; 63 26306: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2630a: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 2630e: 6b 01 movw r12, r22 26310: 20 e0 ldi r18, 0x00 ; 0 26312: 30 e0 ldi r19, 0x00 ; 0 26314: 40 e0 ldi r20, 0x00 ; 0 26316: 5f e3 ldi r21, 0x3F ; 63 26318: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 2631c: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 26320: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 26324: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 26328: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2632c: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 26330: a6 01 movw r20, r12 26332: 80 e8 ldi r24, 0x80 ; 128 26334: 0f 94 d2 09 call 0x213a4 ; 0x213a4 lcd_space(3); //3 spaces 26338: 83 e0 ldi r24, 0x03 ; 3 2633a: 0e 94 83 6f call 0xdf06 ; 0xdf06 #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 2633e: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 26342: 8f 93 push r24 26344: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 26348: 8f 93 push r24 2634a: 87 e1 ldi r24, 0x17 ; 23 2634c: 9b e6 ldi r25, 0x6B ; 107 2634e: 9f 93 push r25 26350: 8f 93 push r24 26352: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_space(8 - chars); 26356: 98 e0 ldi r25, 0x08 ; 8 26358: 98 1b sub r25, r24 2635a: 89 2f mov r24, r25 2635c: 0e 94 83 6f call 0xdf06 ; 0xdf06 #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 26360: 62 e0 ldi r22, 0x02 ; 2 26362: 80 e0 ldi r24, 0x00 ; 0 26364: 0e 94 b5 6f call 0xdf6a ; 0xdf6a } // 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(" ")); 26368: 0f 90 pop r0 2636a: 0f 90 pop r0 2636c: 0f 90 pop r0 2636e: 0f 90 pop r0 26370: 80 91 42 12 lds r24, 0x1242 ; 0x801242 26374: e0 90 d7 13 lds r14, 0x13D7 ; 0x8013d7 26378: 81 11 cpse r24, r1 2637a: 3e c0 rjmp .+124 ; 0x263f8 2637c: 2a e2 ldi r18, 0x2A ; 42 2637e: c2 2e mov r12, r18 26380: 2b e6 ldi r18, 0x6B ; 107 26382: d2 2e mov r13, r18 26384: e1 10 cpse r14, r1 26386: 3c c0 rjmp .+120 ; 0x26400 26388: 8e e2 ldi r24, 0x2E ; 46 2638a: c8 2e mov r12, r24 2638c: 8b e6 ldi r24, 0x6B ; 107 2638e: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 26390: 0e 94 ec 66 call 0xcdd8 ; 0xcdd8 26394: f8 2e mov r15, r24 26396: 88 23 and r24, r24 26398: d9 f1 breq .+118 ; 0x26410 2639a: 80 91 6f 02 lds r24, 0x026F ; 0x80026f 2639e: 8f 3f cpi r24, 0xFF ; 255 263a0: 89 f5 brne .+98 ; 0x26404 263a2: f1 2c mov r15, r1 263a4: 35 c0 rjmp .+106 ; 0x26410 ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 263a6: 0f 94 f9 a4 call 0x349f2 ; 0x349f2 <__divmodqi4> 263aa: 91 11 cpse r25, r1 263ac: 63 cf rjmp .-314 ; 0x26274 lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 263ae: 80 e0 ldi r24, 0x00 ; 0 263b0: 0e 94 b9 70 call 0xe172 ; 0xe172 263b4: 5d cf rjmp .-326 ; 0x26270 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]?' ':'?'); 263b6: 80 91 3b 06 lds r24, 0x063B ; 0x80063b 263ba: 88 23 and r24, r24 263bc: d9 f0 breq .+54 ; 0x263f4 263be: 80 e2 ldi r24, 0x20 ; 32 263c0: 1f 92 push r1 263c2: 8f 93 push r24 263c4: 80 91 6c 12 lds r24, 0x126C ; 0x80126c 263c8: 8f 93 push r24 263ca: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 263ce: 8f 93 push r24 263d0: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 263d4: 8f 93 push r24 263d6: 80 91 69 12 lds r24, 0x1269 ; 0x801269 263da: 8f 93 push r24 263dc: 85 e0 ldi r24, 0x05 ; 5 263de: 9b e6 ldi r25, 0x6B ; 107 263e0: 9f 93 push r25 263e2: 8f 93 push r24 263e4: 0e 94 66 6f call 0xdecc ; 0xdecc 263e8: 0f b6 in r0, 0x3f ; 63 263ea: f8 94 cli 263ec: de bf out 0x3e, r29 ; 62 263ee: 0f be out 0x3f, r0 ; 63 263f0: cd bf out 0x3d, r28 ; 61 263f2: 77 cf rjmp .-274 ; 0x262e2 263f4: 8f e3 ldi r24, 0x3F ; 63 263f6: e4 cf rjmp .-56 ; 0x263c0 } // 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(" ")); 263f8: 92 e3 ldi r25, 0x32 ; 50 263fa: c9 2e mov r12, r25 263fc: 9b e6 ldi r25, 0x6B ; 107 263fe: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 26400: ee 20 and r14, r14 26402: 31 f2 breq .-116 ; 0x26390 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 26404: 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)); 26408: ff 24 eor r15, r15 2640a: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2640c: 88 23 and r24, r24 2640e: 99 f1 breq .+102 ; 0x26476 { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 26410: 81 ea ldi r24, 0xA1 ; 161 26412: 9d e0 ldi r25, 0x0D ; 13 26414: 0f 94 3e a4 call 0x3487c ; 0x3487c 26418: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 2641a: 0e 94 f1 78 call 0xf1e2 ; 0xf1e2 if ((nextSheet >= 0) && (sheetNR != nextSheet)) 2641e: 87 fd sbrc r24, 7 26420: 2a c0 rjmp .+84 ; 0x26476 26422: 08 17 cp r16, r24 26424: 41 f1 breq .+80 ; 0x26476 { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 26426: 9b e0 ldi r25, 0x0B ; 11 26428: 09 02 muls r16, r25 2642a: b0 01 movw r22, r0 2642c: 11 24 eor r1, r1 2642e: 67 5b subi r22, 0xB7 ; 183 26430: 72 4f sbci r23, 0xF2 ; 242 26432: 47 e0 ldi r20, 0x07 ; 7 26434: 50 e0 ldi r21, 0x00 ; 0 26436: 8e 01 movw r16, r28 26438: 0f 5f subi r16, 0xFF ; 255 2643a: 1f 4f sbci r17, 0xFF ; 255 2643c: c8 01 movw r24, r16 2643e: 0f 94 2e a4 call 0x3485c ; 0x3485c sheet[7] = '\0'; 26442: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 26444: 1f 93 push r17 26446: 0f 93 push r16 26448: 8a e8 ldi r24, 0x8A ; 138 2644a: 98 e9 ldi r25, 0x98 ; 152 lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2644c: 9f 93 push r25 2644e: 8f 93 push r24 26450: 0e 94 66 6f call 0xdecc ; 0xdecc 26454: 0f 90 pop r0 26456: 0f 90 pop r0 26458: 0f 90 pop r0 2645a: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 2645c: 80 91 01 13 lds r24, 0x1301 ; 0x801301 26460: 81 30 cpi r24, 0x01 ; 1 26462: 09 f0 breq .+2 ; 0x26466 26464: 5a c0 rjmp .+180 ; 0x2651a // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 26466: 0f 94 29 05 call 0x20a52 ; 0x20a52 2646a: 95 e0 ldi r25, 0x05 ; 5 2646c: 98 1b sub r25, r24 2646e: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 26470: 0e 94 83 6f call 0xdf06 ; 0xdf06 26474: 5f c0 rjmp .+190 ; 0x26534 lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 26476: e1 10 cpse r14, r1 26478: 04 c0 rjmp .+8 ; 0x26482 2647a: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.420> 2647e: 81 11 cpse r24, r1 26480: 42 c0 rjmp .+132 ; 0x26506 // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 26482: df 92 push r13 26484: cf 92 push r12 26486: 86 e8 ldi r24, 0x86 ; 134 26488: 98 e9 ldi r25, 0x98 ; 152 2648a: 9f 93 push r25 2648c: 8f 93 push r24 2648e: 0e 94 66 6f call 0xdecc ; 0xdecc 26492: 0f 90 pop r0 26494: 0f 90 pop r0 26496: 0f 90 pop r0 26498: 0f 90 pop r0 else if (print_percent_done_silent <= 100) { percent_done = print_percent_done_silent; } #else if (print_percent_done_normal <= 100) 2649a: 80 91 6f 02 lds r24, 0x026F ; 0x80026f 2649e: 85 36 cpi r24, 0x65 ; 101 264a0: d0 f1 brcs .+116 ; 0x26516 264a2: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 264a6: 88 23 and r24, r24 264a8: 19 f1 breq .+70 ; 0x264f0 264aa: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 264ae: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 264b2: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 264b6: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 264ba: 00 97 sbiw r24, 0x00 ; 0 264bc: a1 05 cpc r26, r1 264be: b1 05 cpc r27, r1 264c0: b9 f0 breq .+46 ; 0x264f0 264c2: bc 01 movw r22, r24 264c4: cd 01 movw r24, r26 264c6: 6d 59 subi r22, 0x9D ; 157 264c8: 7f 4f sbci r23, 0xFF ; 255 264ca: 8f 4f sbci r24, 0xFF ; 255 264cc: 9f 4f sbci r25, 0xFF ; 255 264ce: 24 e6 ldi r18, 0x64 ; 100 264d0: 30 e0 ldi r19, 0x00 ; 0 264d2: 40 e0 ldi r20, 0x00 ; 0 264d4: 50 e0 ldi r21, 0x00 ; 0 264d6: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 264da: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 264de: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 264e2: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 264e6: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 264ea: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 264ee: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 264f0: 21 2f mov r18, r17 264f2: 30 e0 ldi r19, 0x00 ; 0 264f4: 84 e2 ldi r24, 0x24 ; 36 264f6: 9b e6 ldi r25, 0x6B ; 107 264f8: f1 10 cpse r15, r1 264fa: 02 c0 rjmp .+4 ; 0x26500 264fc: 8e e1 ldi r24, 0x1E ; 30 264fe: 9b e6 ldi r25, 0x6B ; 107 26500: 3f 93 push r19 26502: 2f 93 push r18 26504: a3 cf rjmp .-186 ; 0x2644c if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 26506: 81 e0 ldi r24, 0x01 ; 1 26508: 0e 94 83 6f call 0xdf06 ; 0xdf06 lcd_print(hostName); // Two characters 2650c: 85 e0 ldi r24, 0x05 ; 5 2650e: 96 e0 ldi r25, 0x06 ; 6 26510: 0e 94 ba 73 call 0xe774 ; 0xe774 26514: c2 cf rjmp .-124 ; 0x2649a 26516: 18 2f mov r17, r24 26518: eb cf rjmp .-42 ; 0x264f0 lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { 2651a: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 2651e: 88 23 and r24, r24 26520: 09 f4 brne .+2 ; 0x26524 26522: a5 c0 rjmp .+330 ; 0x2666e } // Print farm number (5 chars total) static void lcdui_print_farm(void) { lcd_printf_P(_N(" FRM ")); 26524: 86 e3 ldi r24, 0x36 ; 54 26526: 9b e6 ldi r25, 0x6B ; 107 26528: 9f 93 push r25 2652a: 8f 93 push r24 2652c: 0e 94 66 6f call 0xdecc ; 0xdecc 26530: 0f 90 pop r0 26532: 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()) { 26534: 0e 94 ec 66 call 0xcdd8 ; 0xcdd8 26538: 88 23 and r24, r24 2653a: 09 f4 brne .+2 ; 0x2653e 2653c: ac c0 rjmp .+344 ; 0x26696 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) 2653e: c0 90 72 02 lds r12, 0x0272 ; 0x800272 26542: 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) 26546: e0 90 70 02 lds r14, 0x0270 ; 0x800270 2654a: f0 90 71 02 lds r15, 0x0271 ; 0x800271 #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 2654e: 80 91 08 06 lds r24, 0x0608 ; 0x800608 26552: 8a 30 cpi r24, 0x0A ; 10 26554: 11 f4 brne .+4 ; 0x2655a clock_interval = 0; 26556: 10 92 08 06 sts 0x0608, r1 ; 0x800608 clock_interval++; 2655a: 80 91 08 06 lds r24, 0x0608 ; 0x800608 2655e: 8f 5f subi r24, 0xFF ; 255 26560: 80 93 08 06 sts 0x0608, r24 ; 0x800608 if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 26564: 2f ef ldi r18, 0xFF ; 255 26566: e2 16 cp r14, r18 26568: f2 06 cpc r15, r18 2656a: 21 f0 breq .+8 ; 0x26574 2656c: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 2656e: 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) { 26570: 86 30 cpi r24, 0x06 ; 6 26572: 70 f4 brcc .+28 ; 0x26590 print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 26574: 3f ef ldi r19, 0xFF ; 255 26576: c3 16 cp r12, r19 26578: d3 06 cpc r13, r19 2657a: 09 f0 breq .+2 ; 0x2657e 2657c: 7a c0 rjmp .+244 ; 0x26672 print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 2657e: 0f 94 cd 14 call 0x2299a ; 0x2299a 26582: 2c e3 ldi r18, 0x3C ; 60 26584: 30 e0 ldi r19, 0x00 ; 0 26586: 40 e0 ldi r20, 0x00 ; 0 26588: 50 e0 ldi r21, 0x00 ; 0 2658a: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__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 = ' '; 2658e: 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)) { 26590: 40 91 8e 02 lds r20, 0x028E ; 0x80028e 26594: 50 91 8f 02 lds r21, 0x028F ; 0x80028f 26598: 44 36 cpi r20, 0x64 ; 100 2659a: 51 05 cpc r21, r1 2659c: 09 f4 brne .+2 ; 0x265a0 2659e: 6c c0 rjmp .+216 ; 0x26678 265a0: c2 16 cp r12, r18 265a2: d3 06 cpc r13, r19 265a4: 21 f0 breq .+8 ; 0x265ae 265a6: e2 16 cp r14, r18 265a8: f3 06 cpc r15, r19 265aa: 09 f0 breq .+2 ; 0x265ae 265ac: 65 c0 rjmp .+202 ; 0x26678 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); 265ae: a4 e6 ldi r26, 0x64 ; 100 265b0: b0 e0 ldi r27, 0x00 ; 0 265b2: 0f 94 de a4 call 0x349bc ; 0x349bc <__umulhisi3> 265b6: 9a 01 movw r18, r20 265b8: 55 0f add r21, r21 265ba: 44 0b sbc r20, r20 265bc: 55 0b sbc r21, r21 265be: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 265c2: 4f e3 ldi r20, 0x3F ; 63 265c4: e4 2e mov r14, r20 265c6: 04 2e mov r0, r20 265c8: 00 0c add r0, r0 265ca: ff 08 sbc r15, r15 265cc: e1 2f mov r30, r17 265ce: 01 2e mov r0, r17 265d0: 00 0c add r0, r0 265d2: ff 0b sbc r31, r31 265d4: c9 01 movw r24, r18 265d6: 6c e3 ldi r22, 0x3C ; 60 265d8: 70 e0 ldi r23, 0x00 ; 0 265da: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__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 265de: 20 37 cpi r18, 0x70 ; 112 265e0: 37 41 sbci r19, 0x17 ; 23 265e2: 08 f0 brcs .+2 ; 0x265e6 265e4: 4b c0 rjmp .+150 ; 0x2667c chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 265e6: ff 92 push r15 265e8: 4f 93 push r20 265ea: ff 93 push r31 265ec: 1f 93 push r17 265ee: 9f 93 push r25 265f0: 8f 93 push r24 265f2: 7f 93 push r23 265f4: 6f 93 push r22 265f6: 80 e5 ldi r24, 0x50 ; 80 265f8: 9b e6 ldi r25, 0x6B ; 107 265fa: 9f 93 push r25 265fc: 8f 93 push r24 265fe: 0e 94 66 6f call 0xdecc ; 0xdecc else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 26602: 0f b6 in r0, 0x3f ; 63 26604: f8 94 cli 26606: de bf out 0x3e, r29 ; 62 26608: 0f be out 0x3f, r0 ; 63 2660a: 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); 2660c: 98 e0 ldi r25, 0x08 ; 8 2660e: 98 1b sub r25, r24 26610: 89 2f mov r24, r25 26612: 0e 94 83 6f call 0xdf06 ; 0xdf06 #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 26616: 63 e0 ldi r22, 0x03 ; 3 26618: 80 e0 ldi r24, 0x00 ; 0 2661a: 0e 94 b5 6f call 0xdf6a ; 0xdf6a #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 2661e: 0f 94 ae 0b call 0x2175c ; 0x2175c void prusa_statistics_update_from_status_screen() { if (farm_mode) { 26622: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 26626: 88 23 and r24, r24 26628: b1 f0 breq .+44 ; 0x26656 farm_timer--; 2662a: 80 91 74 02 lds r24, 0x0274 ; 0x800274 2662e: 81 50 subi r24, 0x01 ; 1 if (farm_timer < 1) { 26630: d9 f1 breq .+118 ; 0x266a8 SERIAL_ECHOLN('}'); } void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; 26632: 80 93 74 02 sts 0x0274, r24 ; 0x800274 if (farm_timer < 1) { farm_timer = 10; prusa_statistics(0); } switch (farm_timer) { 26636: 80 91 74 02 lds r24, 0x0274 ; 0x800274 2663a: 85 30 cpi r24, 0x05 ; 5 2663c: e1 f1 breq .+120 ; 0x266b6 2663e: 88 30 cpi r24, 0x08 ; 8 26640: 51 f4 brne .+20 ; 0x26656 case 8: prusa_statistics(21); 26642: 85 e1 ldi r24, 0x15 ; 21 26644: 0f 94 a0 2f call 0x25f40 ; 0x25f40 if(eFilamentAction != FilamentAction::None) 26648: 80 91 94 03 lds r24, 0x0394 ; 0x800394 2664c: 88 23 and r24, r24 2664e: 19 f0 breq .+6 ; 0x26656 prusa_statistics(22); 26650: 86 e1 ldi r24, 0x16 ; 22 break; case 5: if (IS_SD_PRINTING) prusa_statistics(20); 26652: 0f 94 a0 2f call 0x25f40 ; 0x25f40 lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 26656: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 2665a: 88 23 and r24, r24 2665c: 09 f4 brne .+2 ; 0x26660 2665e: cb cd rjmp .-1130 ; 0x261f6 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) { 26660: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 26664: 81 11 cpse r24, r1 26666: c7 cd rjmp .-1138 ; 0x261f6 26668: 0e 94 92 f3 call 0x1e724 ; 0x1e724 2666c: c4 cd rjmp .-1144 ; 0x261f6 lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2666e: 85 e0 ldi r24, 0x05 ; 5 26670: ff ce rjmp .-514 ; 0x26470 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) { 26672: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 26674: 12 e5 ldi r17, 0x52 ; 82 26676: 8c cf rjmp .-232 ; 0x26590 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 = ' '; 26678: 40 e2 ldi r20, 0x20 ; 32 2667a: a4 cf rjmp .-184 ; 0x265c4 } 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); 2667c: ff 92 push r15 2667e: 4f 93 push r20 26680: ff 93 push r31 26682: 1f 93 push r17 26684: 7f 93 push r23 26686: 6f 93 push r22 26688: 85 e4 ldi r24, 0x45 ; 69 2668a: 9b e6 ldi r25, 0x6B ; 107 2668c: 9f 93 push r25 2668e: 8f 93 push r24 26690: 0e 94 66 6f call 0xdecc ; 0xdecc 26694: b6 cf rjmp .-148 ; 0x26602 } 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 "--:-- ")); 26696: 8c e3 ldi r24, 0x3C ; 60 26698: 9b e6 ldi r25, 0x6B ; 107 2669a: 9f 93 push r25 2669c: 8f 93 push r24 2669e: 0e 94 66 6f call 0xdecc ; 0xdecc 266a2: 0f 90 pop r0 266a4: 0f 90 pop r0 266a6: b2 cf rjmp .-156 ; 0x2660c void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; if (farm_timer < 1) { farm_timer = 10; 266a8: 8a e0 ldi r24, 0x0A ; 10 266aa: 80 93 74 02 sts 0x0274, r24 ; 0x800274 prusa_statistics(0); 266ae: 80 e0 ldi r24, 0x00 ; 0 266b0: 0f 94 a0 2f call 0x25f40 ; 0x25f40 266b4: c0 cf rjmp .-128 ; 0x26636 prusa_statistics(21); if(eFilamentAction != FilamentAction::None) prusa_statistics(22); break; case 5: if (IS_SD_PRINTING) 266b6: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 266ba: 88 23 and r24, r24 266bc: 61 f2 breq .-104 ; 0x26656 prusa_statistics(20); 266be: 84 e1 ldi r24, 0x14 ; 20 266c0: c8 cf rjmp .-112 ; 0x26652 000266c2 : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 266c2: cf 93 push r28 266c4: df 93 push r29 if(IsStopped() == false) { 266c6: 90 91 3b 12 lds r25, 0x123B ; 0x80123b 266ca: 91 11 cpse r25, r1 266cc: 21 c0 rjmp .+66 ; 0x26710 266ce: c6 2f mov r28, r22 266d0: d8 2f mov r29, r24 if (isPreheat) { 266d2: 88 23 and r24, r24 266d4: 09 f1 breq .+66 ; 0x26718 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 266d6: 8b ee ldi r24, 0xEB ; 235 266d8: 97 e9 ldi r25, 0x97 ; 151 266da: 66 23 and r22, r22 266dc: 11 f0 breq .+4 ; 0x266e2 266de: 89 ef ldi r24, 0xF9 ; 249 266e0: 97 e9 ldi r25, 0x97 ; 151 266e2: 63 e0 ldi r22, 0x03 ; 3 266e4: 0e 94 17 d8 call 0x1b02e ; 0x1b02e SERIAL_ERROR_START; 266e8: 87 ec ldi r24, 0xC7 ; 199 266ea: 92 ea ldi r25, 0xA2 ; 162 266ec: 0e 94 1f 7b call 0xf63e ; 0xf63e if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 266f0: 88 ec ldi r24, 0xC8 ; 200 266f2: 97 e9 ldi r25, 0x97 ; 151 { if(IsStopped() == false) { if (isPreheat) { lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 266f4: c1 11 cpse r28, r1 266f6: 02 c0 rjmp .+4 ; 0x266fc SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 266f8: 86 ea ldi r24, 0xA6 ; 166 266fa: 97 e9 ldi r25, 0x97 ; 151 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"); 266fc: 0e 94 18 7d call 0xfa30 ; 0xfa30 } } prusa_statistics(0); 26700: 80 e0 ldi r24, 0x00 ; 0 26702: 0f 94 a0 2f call 0x25f40 ; 0x25f40 prusa_statistics(isPreheat? 91 : 90); 26706: 8a e5 ldi r24, 0x5A ; 90 26708: d1 11 cpse r29, r1 2670a: 8b e5 ldi r24, 0x5B ; 91 2670c: 0f 94 a0 2f call 0x25f40 ; 0x25f40 } ThermalStop(); } 26710: df 91 pop r29 26712: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 26714: 0d 94 c5 66 jmp 0x2cd8a ; 0x2cd8a 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); 26718: 82 e8 ldi r24, 0x82 ; 130 2671a: 97 e9 ldi r25, 0x97 ; 151 2671c: 66 23 and r22, r22 2671e: 11 f0 breq .+4 ; 0x26724 26720: 82 e9 ldi r24, 0x92 ; 146 26722: 97 e9 ldi r25, 0x97 ; 151 26724: 63 e0 ldi r22, 0x03 ; 3 26726: 0e 94 17 d8 call 0x1b02e ; 0x1b02e SERIAL_ERROR_START; 2672a: 87 ec ldi r24, 0xC7 ; 199 2672c: 92 ea ldi r25, 0xA2 ; 162 2672e: 0e 94 1f 7b call 0xf63e ; 0xf63e if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 26732: 89 e6 ldi r24, 0x69 ; 105 26734: 97 e9 ldi r25, 0x97 ; 151 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) { 26736: c1 11 cpse r28, r1 26738: e1 cf rjmp .-62 ; 0x266fc SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 2673a: 81 e5 ldi r24, 0x51 ; 81 2673c: 97 e9 ldi r25, 0x97 ; 151 2673e: de cf rjmp .-68 ; 0x266fc 00026740 : #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) { 26740: 2f 92 push r2 26742: 3f 92 push r3 26744: 4f 92 push r4 26746: 5f 92 push r5 26748: 6f 92 push r6 2674a: 7f 92 push r7 2674c: 8f 92 push r8 2674e: 9f 92 push r9 26750: af 92 push r10 26752: bf 92 push r11 26754: cf 92 push r12 26756: df 92 push r13 26758: ef 92 push r14 2675a: ff 92 push r15 2675c: 0f 93 push r16 2675e: 1f 93 push r17 26760: cf 93 push r28 26762: df 93 push r29 26764: cd b7 in r28, 0x3d ; 61 26766: de b7 in r29, 0x3e ; 62 26768: e0 97 sbiw r28, 0x30 ; 48 2676a: 0f b6 in r0, 0x3f ; 63 2676c: f8 94 cli 2676e: de bf out 0x3e, r29 ; 62 26770: 0f be out 0x3f, r0 ; 63 26772: cd bf out 0x3d, r28 ; 61 26774: 6a 87 std Y+10, r22 ; 0x0a 26776: 7b 87 std Y+11, r23 ; 0x0b 26778: 8c 87 std Y+12, r24 ; 0x0c 2677a: 9d 87 std Y+13, r25 ; 0x0d 2677c: 1a 01 movw r2, r20 2677e: 3a a7 std Y+42, r19 ; 0x2a 26780: 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(); 26782: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 pid_tuning_finished = false; 26786: 10 92 41 02 sts 0x0241, r1 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.425> // 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; 2678a: 29 a5 ldd r18, Y+41 ; 0x29 2678c: 3a a5 ldd r19, Y+42 ; 0x2a 2678e: 30 93 01 06 sts 0x0601, r19 ; 0x800601 26792: 20 93 00 06 sts 0x0600, r18 ; 0x800600 float input = 0.0; pid_cycle=0; 26796: 10 92 03 06 sts 0x0603, r1 ; 0x800603 2679a: 10 92 02 06 sts 0x0602, r1 ; 0x800602 bool heating = true; unsigned long temp_millis = _millis(); 2679e: 0f 94 01 0b call 0x21602 ; 0x21602 267a2: 6e 83 std Y+6, r22 ; 0x06 267a4: 7f 83 std Y+7, r23 ; 0x07 267a6: 88 87 std Y+8, r24 ; 0x08 267a8: 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 267aa: 37 fe sbrs r3, 7 267ac: ff c0 rjmp .+510 ; 0x269ac 267ae: 3d e2 ldi r19, 0x2D ; 45 267b0: 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(); 267b2: 0f 94 01 0b call 0x21602 ; 0x21602 267b6: 6c a3 std Y+36, r22 ; 0x24 267b8: 7d a3 std Y+37, r23 ; 0x25 267ba: 8e a3 std Y+38, r24 ; 0x26 267bc: 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."); 267be: 8c eb ldi r24, 0xBC ; 188 267c0: 95 e9 ldi r25, 0x95 ; 149 #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) unsigned long extruder_autofan_last_check = _millis(); #endif if ((extruder >= EXTRUDERS) 267c2: 12 14 cp r1, r2 267c4: 13 04 cpc r1, r3 267c6: 0c f4 brge .+2 ; 0x267ca 267c8: 8a c2 rjmp .+1300 ; 0x26cde pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 267ca: 89 ea ldi r24, 0xA9 ; 169 267cc: 95 e9 ldi r25, 0x95 ; 149 267ce: 0e 94 18 7d call 0xfa30 ; 0xfa30 267d2: 6a 85 ldd r22, Y+10 ; 0x0a 267d4: 7b 85 ldd r23, Y+11 ; 0x0b 267d6: 8c 85 ldd r24, Y+12 ; 0x0c 267d8: 9d 85 ldd r25, Y+13 ; 0x0d 267da: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 267de: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 267e0: 21 14 cp r2, r1 267e2: 31 04 cpc r3, r1 267e4: 09 f4 brne .+2 ; 0x267e8 267e6: e5 c0 rjmp .+458 ; 0x269b2 { soft_pwm_bed = (MAX_BED_POWER)/2; 267e8: 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 267ec: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 267f0: 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 267f4: 8e 81 ldd r24, Y+6 ; 0x06 267f6: 9f 81 ldd r25, Y+7 ; 0x07 267f8: a8 85 ldd r26, Y+8 ; 0x08 267fa: b9 85 ldd r27, Y+9 ; 0x09 267fc: 8e 87 std Y+14, r24 ; 0x0e 267fe: 9f 87 std Y+15, r25 ; 0x0f 26800: a8 8b std Y+16, r26 ; 0x10 26802: b9 8b std Y+17, r27 ; 0x11 26804: 88 a3 std Y+32, r24 ; 0x20 26806: 99 a3 std Y+33, r25 ; 0x21 26808: aa a3 std Y+34, r26 ; 0x22 2680a: bb a3 std Y+35, r27 ; 0x23 2680c: 1a 8a std Y+18, r1 ; 0x12 2680e: 90 e4 ldi r25, 0x40 ; 64 26810: 9b 8b std Y+19, r25 ; 0x13 26812: ac e1 ldi r26, 0x1C ; 28 26814: ac 8b std Y+20, r26 ; 0x14 26816: b6 e4 ldi r27, 0x46 ; 70 26818: bd 8b std Y+21, r27 ; 0x15 2681a: 1e 8a std Y+22, r1 ; 0x16 2681c: 1f 8a std Y+23, r1 ; 0x17 2681e: 18 8e std Y+24, r1 ; 0x18 26820: 19 8e std Y+25, r1 ; 0x19 26822: 6f e7 ldi r22, 0x7F ; 127 26824: c6 2e mov r12, r22 26826: d1 2c mov r13, r1 26828: e1 2c mov r14, r1 2682a: f1 2c mov r15, r1 2682c: 00 e0 ldi r16, 0x00 ; 0 2682e: 10 e0 ldi r17, 0x00 ; 0 26830: 18 aa std Y+48, r1 ; 0x30 26832: 1f a6 std Y+47, r1 ; 0x2f 26834: 1d 82 std Y+5, r1 ; 0x05 26836: 2f e7 ldi r18, 0x7F ; 127 26838: 30 e0 ldi r19, 0x00 ; 0 2683a: 40 e0 ldi r20, 0x00 ; 0 2683c: 50 e0 ldi r21, 0x00 ; 0 2683e: 29 83 std Y+1, r18 ; 0x01 26840: 3a 83 std Y+2, r19 ; 0x02 26842: 4b 83 std Y+3, r20 ; 0x03 26844: 5c 83 std Y+4, r21 ; 0x04 26846: 1b 8e std Y+27, r1 ; 0x1b 26848: 1c 8e std Y+28, r1 ; 0x1c 2684a: 1d 8e std Y+29, r1 ; 0x1d 2684c: 1e 8e std Y+30, r1 ; 0x1e 2684e: 31 e0 ldi r19, 0x01 ; 1 26850: 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(); 26852: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 26854: 40 91 d5 05 lds r20, 0x05D5 ; 0x8005d5 26858: 48 a7 std Y+40, r20 ; 0x28 2685a: 44 23 and r20, r20 2685c: 09 f4 brne .+2 ; 0x26860 2685e: 2c c2 rjmp .+1112 ; 0x26cb8 updateTemperatures(); 26860: 0e 94 b5 ff call 0x1ff6a ; 0x1ff6a input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 26864: 21 14 cp r2, r1 26866: 31 04 cpc r3, r1 26868: 09 f0 breq .+2 ; 0x2686c 2686a: aa c0 rjmp .+340 ; 0x269c0 2686c: 00 91 5a 0d lds r16, 0x0D5A ; 0x800d5a 26870: 10 91 5b 0d lds r17, 0x0D5B ; 0x800d5b 26874: 50 91 5c 0d lds r21, 0x0D5C ; 0x800d5c 26878: 58 ab std Y+48, r21 ; 0x30 2687a: 80 91 5d 0d lds r24, 0x0D5D ; 0x800d5d 2687e: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 26880: 2e 89 ldd r18, Y+22 ; 0x16 26882: 3f 89 ldd r19, Y+23 ; 0x17 26884: 48 8d ldd r20, Y+24 ; 0x18 26886: 59 8d ldd r21, Y+25 ; 0x19 26888: b8 01 movw r22, r16 2688a: 88 a9 ldd r24, Y+48 ; 0x30 2688c: 9f a5 ldd r25, Y+47 ; 0x2f 2688e: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 26892: 87 fd sbrc r24, 7 26894: 06 c0 rjmp .+12 ; 0x268a2 26896: 0e 8b std Y+22, r16 ; 0x16 26898: 1f 8b std Y+23, r17 ; 0x17 2689a: b8 a9 ldd r27, Y+48 ; 0x30 2689c: b8 8f std Y+24, r27 ; 0x18 2689e: 2f a5 ldd r18, Y+47 ; 0x2f 268a0: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 268a2: 2a 89 ldd r18, Y+18 ; 0x12 268a4: 3b 89 ldd r19, Y+19 ; 0x13 268a6: 4c 89 ldd r20, Y+20 ; 0x14 268a8: 5d 89 ldd r21, Y+21 ; 0x15 268aa: b8 01 movw r22, r16 268ac: 88 a9 ldd r24, Y+48 ; 0x30 268ae: 9f a5 ldd r25, Y+47 ; 0x2f 268b0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 268b4: 18 16 cp r1, r24 268b6: 34 f0 brlt .+12 ; 0x268c4 268b8: 0a 8b std Y+18, r16 ; 0x12 268ba: 1b 8b std Y+19, r17 ; 0x13 268bc: 38 a9 ldd r19, Y+48 ; 0x30 268be: 3c 8b std Y+20, r19 ; 0x14 268c0: 4f a5 ldd r20, Y+47 ; 0x2f 268c2: 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) { 268c4: 0f 94 01 0b call 0x21602 ; 0x21602 268c8: 2c a1 ldd r18, Y+36 ; 0x24 268ca: 3d a1 ldd r19, Y+37 ; 0x25 268cc: 4e a1 ldd r20, Y+38 ; 0x26 268ce: 5f a1 ldd r21, Y+39 ; 0x27 268d0: 62 1b sub r22, r18 268d2: 73 0b sbc r23, r19 268d4: 84 0b sbc r24, r20 268d6: 95 0b sbc r25, r21 268d8: 65 3c cpi r22, 0xC5 ; 197 268da: 79 40 sbci r23, 0x09 ; 9 268dc: 81 05 cpc r24, r1 268de: 91 05 cpc r25, r1 268e0: 40 f0 brcs .+16 ; 0x268f2 checkExtruderAutoFans(); 268e2: 0e 94 56 78 call 0xf0ac ; 0xf0ac extruder_autofan_last_check = _millis(); 268e6: 0f 94 01 0b call 0x21602 ; 0x21602 268ea: 6c a3 std Y+36, r22 ; 0x24 268ec: 7d a3 std Y+37, r23 ; 0x25 268ee: 8e a3 std Y+38, r24 ; 0x26 268f0: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 268f2: 4a 8d ldd r20, Y+26 ; 0x1a 268f4: 44 23 and r20, r20 268f6: 09 f4 brne .+2 ; 0x268fa 268f8: 4c c0 rjmp .+152 ; 0x26992 268fa: 2a 85 ldd r18, Y+10 ; 0x0a 268fc: 3b 85 ldd r19, Y+11 ; 0x0b 268fe: 4c 85 ldd r20, Y+12 ; 0x0c 26900: 5d 85 ldd r21, Y+13 ; 0x0d 26902: b8 01 movw r22, r16 26904: 88 a9 ldd r24, Y+48 ; 0x30 26906: 9f a5 ldd r25, Y+47 ; 0x2f 26908: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2690c: 18 16 cp r1, r24 2690e: 0c f0 brlt .+2 ; 0x26912 26910: d3 c1 rjmp .+934 ; 0x26cb8 if(_millis() - t2 > 5000) { 26912: 0f 94 01 0b call 0x21602 ; 0x21602 26916: 2e 85 ldd r18, Y+14 ; 0x0e 26918: 3f 85 ldd r19, Y+15 ; 0x0f 2691a: 48 89 ldd r20, Y+16 ; 0x10 2691c: 59 89 ldd r21, Y+17 ; 0x11 2691e: 62 1b sub r22, r18 26920: 73 0b sbc r23, r19 26922: 84 0b sbc r24, r20 26924: 95 0b sbc r25, r21 26926: 69 38 cpi r22, 0x89 ; 137 26928: 73 41 sbci r23, 0x13 ; 19 2692a: 81 05 cpc r24, r1 2692c: 91 05 cpc r25, r1 2692e: 08 f4 brcc .+2 ; 0x26932 26930: c3 c1 rjmp .+902 ; 0x26cb8 26932: d7 01 movw r26, r14 26934: c6 01 movw r24, r12 26936: 29 81 ldd r18, Y+1 ; 0x01 26938: 3a 81 ldd r19, Y+2 ; 0x02 2693a: 4b 81 ldd r20, Y+3 ; 0x03 2693c: 5c 81 ldd r21, Y+4 ; 0x04 2693e: 82 1b sub r24, r18 26940: 93 0b sbc r25, r19 26942: a4 0b sbc r26, r20 26944: b5 0b sbc r27, r21 26946: b5 95 asr r27 26948: a7 95 ror r26 2694a: 97 95 ror r25 2694c: 87 95 ror r24 heating=false; if (extruder<0) { 2694e: 21 14 cp r2, r1 26950: 31 04 cpc r3, r1 26952: 09 f4 brne .+2 ; 0x26956 26954: 40 c0 rjmp .+128 ; 0x269d6 soft_pwm_bed = (bias - d) >> 1; 26956: 80 93 ee 05 sts 0x05EE, r24 ; 0x8005ee } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 2695a: 0f 94 01 0b call 0x21602 ; 0x21602 2695e: 6e 83 std Y+6, r22 ; 0x06 26960: 7f 83 std Y+7, r23 ; 0x07 26962: 88 87 std Y+8, r24 ; 0x08 26964: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 26966: dc 01 movw r26, r24 26968: cb 01 movw r24, r22 2696a: 2e 85 ldd r18, Y+14 ; 0x0e 2696c: 3f 85 ldd r19, Y+15 ; 0x0f 2696e: 48 89 ldd r20, Y+16 ; 0x10 26970: 59 89 ldd r21, Y+17 ; 0x11 26972: 82 1b sub r24, r18 26974: 93 0b sbc r25, r19 26976: a4 0b sbc r26, r20 26978: b5 0b sbc r27, r21 2697a: 8b 8f std Y+27, r24 ; 0x1b 2697c: 9c 8f std Y+28, r25 ; 0x1c 2697e: ad 8f std Y+29, r26 ; 0x1d 26980: be 8f std Y+30, r27 ; 0x1e max=temp; 26982: 3a 85 ldd r19, Y+10 ; 0x0a 26984: 3e 8b std Y+22, r19 ; 0x16 26986: 4b 85 ldd r20, Y+11 ; 0x0b 26988: 4f 8b std Y+23, r20 ; 0x17 2698a: 5c 85 ldd r21, Y+12 ; 0x0c 2698c: 58 8f std Y+24, r21 ; 0x18 2698e: 8d 85 ldd r24, Y+13 ; 0x0d 26990: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 26992: 2a 85 ldd r18, Y+10 ; 0x0a 26994: 3b 85 ldd r19, Y+11 ; 0x0b 26996: 4c 85 ldd r20, Y+12 ; 0x0c 26998: 5d 85 ldd r21, Y+13 ; 0x0d 2699a: b8 01 movw r22, r16 2699c: 88 a9 ldd r24, Y+48 ; 0x30 2699e: 9f a5 ldd r25, Y+47 ; 0x2f 269a0: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 269a4: 87 fd sbrc r24, 7 269a6: 1a c0 rjmp .+52 ; 0x269dc if(_millis() - t1 > 5000) { 269a8: 1a 8e std Y+26, r1 ; 0x1a 269aa: 86 c1 rjmp .+780 ; 0x26cb8 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 269ac: 4a e0 ldi r20, 0x0A ; 10 269ae: 4f 8f std Y+31, r20 ; 0x1f 269b0: 00 cf rjmp .-512 ; 0x267b2 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; 269b2: 20 93 f5 05 sts 0x05F5, r18 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.502> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 269b6: 70 93 5e 12 sts 0x125E, r23 ; 0x80125e 269ba: 60 93 5d 12 sts 0x125D, r22 ; 0x80125d 269be: 1a cf rjmp .-460 ; 0x267f4 wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 269c0: 00 91 bc 03 lds r16, 0x03BC ; 0x8003bc 269c4: 10 91 bd 03 lds r17, 0x03BD ; 0x8003bd 269c8: 90 91 be 03 lds r25, 0x03BE ; 0x8003be 269cc: 98 ab std Y+48, r25 ; 0x30 269ce: a0 91 bf 03 lds r26, 0x03BF ; 0x8003bf 269d2: af a7 std Y+47, r26 ; 0x2f 269d4: 55 cf rjmp .-342 ; 0x26880 heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 269d6: 80 93 f5 05 sts 0x05F5, r24 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.502> 269da: bf cf rjmp .-130 ; 0x2695a t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 269dc: 0f 94 01 0b call 0x21602 ; 0x21602 269e0: 2e 81 ldd r18, Y+6 ; 0x06 269e2: 3f 81 ldd r19, Y+7 ; 0x07 269e4: 48 85 ldd r20, Y+8 ; 0x08 269e6: 59 85 ldd r21, Y+9 ; 0x09 269e8: 62 1b sub r22, r18 269ea: 73 0b sbc r23, r19 269ec: 84 0b sbc r24, r20 269ee: 95 0b sbc r25, r21 269f0: 69 38 cpi r22, 0x89 ; 137 269f2: 73 41 sbci r23, 0x13 ; 19 269f4: 81 05 cpc r24, r1 269f6: 91 05 cpc r25, r1 269f8: b8 f2 brcs .-82 ; 0x269a8 heating=true; t2=_millis(); 269fa: 0f 94 01 0b call 0x21602 ; 0x21602 269fe: 6e 87 std Y+14, r22 ; 0x0e 26a00: 7f 87 std Y+15, r23 ; 0x0f 26a02: 88 8b std Y+16, r24 ; 0x10 26a04: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 26a06: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26a0a: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26a0e: 18 16 cp r1, r24 26a10: 19 06 cpc r1, r25 26a12: 0c f0 brlt .+2 ; 0x26a16 26a14: 2c c1 rjmp .+600 ; 0x26c6e } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 26a16: 8e 85 ldd r24, Y+14 ; 0x0e 26a18: 9f 85 ldd r25, Y+15 ; 0x0f 26a1a: a8 89 ldd r26, Y+16 ; 0x10 26a1c: b9 89 ldd r27, Y+17 ; 0x11 26a1e: 2e 81 ldd r18, Y+6 ; 0x06 26a20: 3f 81 ldd r19, Y+7 ; 0x07 26a22: 48 85 ldd r20, Y+8 ; 0x08 26a24: 59 85 ldd r21, Y+9 ; 0x09 26a26: 82 1b sub r24, r18 26a28: 93 0b sbc r25, r19 26a2a: a4 0b sbc r26, r20 26a2c: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 26a2e: 4b 8c ldd r4, Y+27 ; 0x1b 26a30: 5c 8c ldd r5, Y+28 ; 0x1c 26a32: 6d 8c ldd r6, Y+29 ; 0x1d 26a34: 7e 8c ldd r7, Y+30 ; 0x1e 26a36: 48 0e add r4, r24 26a38: 59 1e adc r5, r25 26a3a: 6a 1e adc r6, r26 26a3c: 7b 1e adc r7, r27 26a3e: 2b 8d ldd r18, Y+27 ; 0x1b 26a40: 3c 8d ldd r19, Y+28 ; 0x1c 26a42: 4d 8d ldd r20, Y+29 ; 0x1d 26a44: 5e 8d ldd r21, Y+30 ; 0x1e 26a46: 28 1b sub r18, r24 26a48: 39 0b sbc r19, r25 26a4a: 4a 0b sbc r20, r26 26a4c: 5b 0b sbc r21, r27 26a4e: 69 81 ldd r22, Y+1 ; 0x01 26a50: 7a 81 ldd r23, Y+2 ; 0x02 26a52: 8b 81 ldd r24, Y+3 ; 0x03 26a54: 9c 81 ldd r25, Y+4 ; 0x04 26a56: 0f 94 a1 a4 call 0x34942 ; 0x34942 <__mulsi3> 26a5a: a3 01 movw r20, r6 26a5c: 92 01 movw r18, r4 26a5e: 0f 94 2f a5 call 0x34a5e ; 0x34a5e <__divmodsi4> 26a62: da 01 movw r26, r20 26a64: c9 01 movw r24, r18 26a66: 8c 0d add r24, r12 26a68: 9d 1d adc r25, r13 26a6a: ae 1d adc r26, r14 26a6c: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 26a6e: 84 31 cpi r24, 0x14 ; 20 26a70: 91 05 cpc r25, r1 26a72: a1 05 cpc r26, r1 26a74: b1 05 cpc r27, r1 26a76: 0c f4 brge .+2 ; 0x26a7a 26a78: 3c c1 rjmp .+632 ; 0x26cf2 26a7a: 6c 01 movw r12, r24 26a7c: 7d 01 movw r14, r26 26a7e: 3c ee ldi r19, 0xEC ; 236 26a80: c3 16 cp r12, r19 26a82: d1 04 cpc r13, r1 26a84: e1 04 cpc r14, r1 26a86: f1 04 cpc r15, r1 26a88: 2c f0 brlt .+10 ; 0x26a94 26a8a: 4b ee ldi r20, 0xEB ; 235 26a8c: c4 2e mov r12, r20 26a8e: d1 2c mov r13, r1 26a90: e1 2c mov r14, r1 26a92: 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; 26a94: 80 38 cpi r24, 0x80 ; 128 26a96: 91 05 cpc r25, r1 26a98: a1 05 cpc r26, r1 26a9a: b1 05 cpc r27, r1 26a9c: 0c f4 brge .+2 ; 0x26aa0 26a9e: 37 c1 rjmp .+622 ; 0x26d0e 26aa0: 8e ef ldi r24, 0xFE ; 254 26aa2: 90 e0 ldi r25, 0x00 ; 0 26aa4: a0 e0 ldi r26, 0x00 ; 0 26aa6: b0 e0 ldi r27, 0x00 ; 0 26aa8: 8c 19 sub r24, r12 26aaa: 9d 09 sbc r25, r13 26aac: ae 09 sbc r26, r14 26aae: bf 09 sbc r27, r15 26ab0: 89 83 std Y+1, r24 ; 0x01 26ab2: 9a 83 std Y+2, r25 ; 0x02 26ab4: ab 83 std Y+3, r26 ; 0x03 26ab6: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 26ab8: 81 ea ldi r24, 0xA1 ; 161 26aba: 95 e9 ldi r25, 0x95 ; 149 26abc: 0e 94 1f 7b call 0xf63e ; 0xf63e 26ac0: c7 01 movw r24, r14 26ac2: b6 01 movw r22, r12 26ac4: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 26ac8: 8c e9 ldi r24, 0x9C ; 156 26aca: 95 e9 ldi r25, 0x95 ; 149 26acc: 0e 94 1f 7b call 0xf63e ; 0xf63e 26ad0: 69 81 ldd r22, Y+1 ; 0x01 26ad2: 7a 81 ldd r23, Y+2 ; 0x02 26ad4: 8b 81 ldd r24, Y+3 ; 0x03 26ad6: 9c 81 ldd r25, Y+4 ; 0x04 26ad8: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 26adc: 85 e9 ldi r24, 0x95 ; 149 26ade: 95 e9 ldi r25, 0x95 ; 149 26ae0: 0e 94 1f 7b call 0xf63e ; 0xf63e else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 26ae4: 42 e0 ldi r20, 0x02 ; 2 26ae6: 6a 89 ldd r22, Y+18 ; 0x12 26ae8: 7b 89 ldd r23, Y+19 ; 0x13 26aea: 8c 89 ldd r24, Y+20 ; 0x14 26aec: 9d 89 ldd r25, Y+21 ; 0x15 26aee: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 26af2: 8e e8 ldi r24, 0x8E ; 142 26af4: 95 e9 ldi r25, 0x95 ; 149 26af6: 0e 94 1f 7b call 0xf63e ; 0xf63e 26afa: 6e 89 ldd r22, Y+22 ; 0x16 26afc: 7f 89 ldd r23, Y+23 ; 0x17 26afe: 88 8d ldd r24, Y+24 ; 0x18 26b00: 99 8d ldd r25, Y+25 ; 0x19 26b02: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 if(pid_cycle > 2) { 26b06: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26b0a: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26b0e: 03 97 sbiw r24, 0x03 ; 3 26b10: 0c f4 brge .+2 ; 0x26b14 26b12: ad c0 rjmp .+346 ; 0x26c6e Ku = (4.0*d)/(3.14159*(max-min)/2.0); 26b14: 69 81 ldd r22, Y+1 ; 0x01 26b16: 7a 81 ldd r23, Y+2 ; 0x02 26b18: 8b 81 ldd r24, Y+3 ; 0x03 26b1a: 9c 81 ldd r25, Y+4 ; 0x04 26b1c: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 26b20: 20 e0 ldi r18, 0x00 ; 0 26b22: 30 e0 ldi r19, 0x00 ; 0 26b24: 40 e8 ldi r20, 0x80 ; 128 26b26: 50 e4 ldi r21, 0x40 ; 64 26b28: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 26b2c: 4b 01 movw r8, r22 26b2e: 5c 01 movw r10, r24 26b30: 2a 89 ldd r18, Y+18 ; 0x12 26b32: 3b 89 ldd r19, Y+19 ; 0x13 26b34: 4c 89 ldd r20, Y+20 ; 0x14 26b36: 5d 89 ldd r21, Y+21 ; 0x15 26b38: 6e 89 ldd r22, Y+22 ; 0x16 26b3a: 7f 89 ldd r23, Y+23 ; 0x17 26b3c: 88 8d ldd r24, Y+24 ; 0x18 26b3e: 99 8d ldd r25, Y+25 ; 0x19 26b40: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 26b44: 20 ed ldi r18, 0xD0 ; 208 26b46: 3f e0 ldi r19, 0x0F ; 15 26b48: 49 e4 ldi r20, 0x49 ; 73 26b4a: 50 e4 ldi r21, 0x40 ; 64 26b4c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 26b50: 20 e0 ldi r18, 0x00 ; 0 26b52: 30 e0 ldi r19, 0x00 ; 0 26b54: 40 e0 ldi r20, 0x00 ; 0 26b56: 5f e3 ldi r21, 0x3F ; 63 26b58: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 26b5c: 9b 01 movw r18, r22 26b5e: ac 01 movw r20, r24 26b60: c5 01 movw r24, r10 26b62: b4 01 movw r22, r8 26b64: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 26b68: 4b 01 movw r8, r22 26b6a: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 26b6c: c3 01 movw r24, r6 26b6e: b2 01 movw r22, r4 26b70: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 26b74: 20 e0 ldi r18, 0x00 ; 0 26b76: 30 e0 ldi r19, 0x00 ; 0 26b78: 4a e7 ldi r20, 0x7A ; 122 26b7a: 54 e4 ldi r21, 0x44 ; 68 26b7c: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 26b80: 2b 01 movw r4, r22 26b82: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 26b84: 88 e8 ldi r24, 0x88 ; 136 26b86: 95 e9 ldi r25, 0x95 ; 149 26b88: 0e 94 1f 7b call 0xf63e ; 0xf63e 26b8c: 42 e0 ldi r20, 0x02 ; 2 26b8e: c5 01 movw r24, r10 26b90: b4 01 movw r22, r8 26b92: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 26b96: 82 e8 ldi r24, 0x82 ; 130 26b98: 95 e9 ldi r25, 0x95 ; 149 26b9a: 0e 94 1f 7b call 0xf63e ; 0xf63e 26b9e: c3 01 movw r24, r6 26ba0: b2 01 movw r22, r4 26ba2: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 _Kp = 0.6*Ku; 26ba6: 2a e9 ldi r18, 0x9A ; 154 26ba8: 39 e9 ldi r19, 0x99 ; 153 26baa: 49 e1 ldi r20, 0x19 ; 25 26bac: 5f e3 ldi r21, 0x3F ; 63 26bae: c5 01 movw r24, r10 26bb0: b4 01 movw r22, r8 26bb2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 26bb6: 4b 01 movw r8, r22 26bb8: 5c 01 movw r10, r24 26bba: 80 92 da 03 sts 0x03DA, r8 ; 0x8003da <_Kp> 26bbe: 90 92 db 03 sts 0x03DB, r9 ; 0x8003db <_Kp+0x1> 26bc2: a0 92 dc 03 sts 0x03DC, r10 ; 0x8003dc <_Kp+0x2> 26bc6: b0 92 dd 03 sts 0x03DD, r11 ; 0x8003dd <_Kp+0x3> _Ki = 2*_Kp/Tu; 26bca: ac 01 movw r20, r24 26bcc: 9b 01 movw r18, r22 26bce: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 26bd2: a3 01 movw r20, r6 26bd4: 92 01 movw r18, r4 26bd6: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 26bda: 60 93 d6 03 sts 0x03D6, r22 ; 0x8003d6 <_Ki> 26bde: 70 93 d7 03 sts 0x03D7, r23 ; 0x8003d7 <_Ki+0x1> 26be2: 80 93 d8 03 sts 0x03D8, r24 ; 0x8003d8 <_Ki+0x2> 26be6: 90 93 d9 03 sts 0x03D9, r25 ; 0x8003d9 <_Ki+0x3> _Kd = _Kp*Tu/8; 26bea: a3 01 movw r20, r6 26bec: 92 01 movw r18, r4 26bee: c5 01 movw r24, r10 26bf0: b4 01 movw r22, r8 26bf2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 26bf6: 20 e0 ldi r18, 0x00 ; 0 26bf8: 30 e0 ldi r19, 0x00 ; 0 26bfa: 40 e0 ldi r20, 0x00 ; 0 26bfc: 5e e3 ldi r21, 0x3E ; 62 26bfe: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 26c02: 60 93 d2 03 sts 0x03D2, r22 ; 0x8003d2 <_Kd> 26c06: 70 93 d3 03 sts 0x03D3, r23 ; 0x8003d3 <_Kd+0x1> 26c0a: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 <_Kd+0x2> 26c0e: 90 93 d5 03 sts 0x03D5, r25 ; 0x8003d5 <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 26c12: 84 e7 ldi r24, 0x74 ; 116 26c14: 95 e9 ldi r25, 0x95 ; 149 26c16: 0e 94 18 7d call 0xfa30 ; 0xfa30 SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 26c1a: 8e e6 ldi r24, 0x6E ; 110 26c1c: 95 e9 ldi r25, 0x95 ; 149 26c1e: 0e 94 1f 7b call 0xf63e ; 0xf63e 26c22: 60 91 da 03 lds r22, 0x03DA ; 0x8003da <_Kp> 26c26: 70 91 db 03 lds r23, 0x03DB ; 0x8003db <_Kp+0x1> 26c2a: 80 91 dc 03 lds r24, 0x03DC ; 0x8003dc <_Kp+0x2> 26c2e: 90 91 dd 03 lds r25, 0x03DD ; 0x8003dd <_Kp+0x3> 26c32: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 26c36: 88 e6 ldi r24, 0x68 ; 104 26c38: 95 e9 ldi r25, 0x95 ; 149 26c3a: 0e 94 1f 7b call 0xf63e ; 0xf63e 26c3e: 60 91 d6 03 lds r22, 0x03D6 ; 0x8003d6 <_Ki> 26c42: 70 91 d7 03 lds r23, 0x03D7 ; 0x8003d7 <_Ki+0x1> 26c46: 80 91 d8 03 lds r24, 0x03D8 ; 0x8003d8 <_Ki+0x2> 26c4a: 90 91 d9 03 lds r25, 0x03D9 ; 0x8003d9 <_Ki+0x3> 26c4e: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 26c52: 82 e6 ldi r24, 0x62 ; 98 26c54: 95 e9 ldi r25, 0x95 ; 149 26c56: 0e 94 1f 7b call 0xf63e ; 0xf63e 26c5a: 60 91 d2 03 lds r22, 0x03D2 ; 0x8003d2 <_Kd> 26c5e: 70 91 d3 03 lds r23, 0x03D3 ; 0x8003d3 <_Kd+0x1> 26c62: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 <_Kd+0x2> 26c66: 90 91 d5 03 lds r25, 0x03D5 ; 0x8003d5 <_Kd+0x3> 26c6a: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 26c6e: 89 81 ldd r24, Y+1 ; 0x01 26c70: 9a 81 ldd r25, Y+2 ; 0x02 26c72: ab 81 ldd r26, Y+3 ; 0x03 26c74: bc 81 ldd r27, Y+4 ; 0x04 26c76: 8c 0d add r24, r12 26c78: 9d 1d adc r25, r13 26c7a: ae 1d adc r26, r14 26c7c: bf 1d adc r27, r15 26c7e: b5 95 asr r27 26c80: a7 95 ror r26 26c82: 97 95 ror r25 26c84: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 26c86: 21 14 cp r2, r1 26c88: 31 04 cpc r3, r1 26c8a: 09 f4 brne .+2 ; 0x26c8e 26c8c: 45 c0 rjmp .+138 ; 0x26d18 { soft_pwm_bed = (bias + d) >> 1; 26c8e: 80 93 ee 05 sts 0x05EE, r24 ; 0x8005ee } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 26c92: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26c96: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26c9a: 01 96 adiw r24, 0x01 ; 1 26c9c: 90 93 03 06 sts 0x0603, r25 ; 0x800603 26ca0: 80 93 02 06 sts 0x0602, r24 ; 0x800602 min=temp; 26ca4: 3a 85 ldd r19, Y+10 ; 0x0a 26ca6: 3a 8b std Y+18, r19 ; 0x12 26ca8: 4b 85 ldd r20, Y+11 ; 0x0b 26caa: 4b 8b std Y+19, r20 ; 0x13 26cac: 5c 85 ldd r21, Y+12 ; 0x0c 26cae: 5c 8b std Y+20, r21 ; 0x14 26cb0: 8d 85 ldd r24, Y+13 ; 0x0d 26cb2: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 26cb4: 98 a5 ldd r25, Y+40 ; 0x28 26cb6: 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)) { 26cb8: 20 e0 ldi r18, 0x00 ; 0 26cba: 30 e0 ldi r19, 0x00 ; 0 26cbc: 40 ea ldi r20, 0xA0 ; 160 26cbe: 51 e4 ldi r21, 0x41 ; 65 26cc0: 6a 85 ldd r22, Y+10 ; 0x0a 26cc2: 7b 85 ldd r23, Y+11 ; 0x0b 26cc4: 8c 85 ldd r24, Y+12 ; 0x0c 26cc6: 9d 85 ldd r25, Y+13 ; 0x0d 26cc8: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 26ccc: 98 01 movw r18, r16 26cce: 48 a9 ldd r20, Y+48 ; 0x30 26cd0: 5f a5 ldd r21, Y+47 ; 0x2f 26cd2: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 26cd6: 87 ff sbrs r24, 7 26cd8: 22 c0 rjmp .+68 ; 0x26d1e SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 26cda: 88 e3 ldi r24, 0x38 ; 56 26cdc: 95 e9 ldi r25, 0x95 ; 149 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"); 26cde: 0e 94 18 7d call 0xfa30 ; 0xfa30 pid_tuning_finished = true; 26ce2: 81 e0 ldi r24, 0x01 ; 1 26ce4: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.425> pid_cycle = 0; 26ce8: 10 92 03 06 sts 0x0603, r1 ; 0x800603 26cec: 10 92 02 06 sts 0x0602, r1 ; 0x800602 26cf0: 98 c0 rjmp .+304 ; 0x26e22 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); 26cf2: 34 e1 ldi r19, 0x14 ; 20 26cf4: c3 2e mov r12, r19 26cf6: d1 2c mov r13, r1 26cf8: e1 2c mov r14, r1 26cfa: f1 2c mov r15, r1 26cfc: 24 e1 ldi r18, 0x14 ; 20 26cfe: 30 e0 ldi r19, 0x00 ; 0 26d00: 40 e0 ldi r20, 0x00 ; 0 26d02: 50 e0 ldi r21, 0x00 ; 0 26d04: 29 83 std Y+1, r18 ; 0x01 26d06: 3a 83 std Y+2, r19 ; 0x02 26d08: 4b 83 std Y+3, r20 ; 0x03 26d0a: 5c 83 std Y+4, r21 ; 0x04 26d0c: d5 ce rjmp .-598 ; 0x26ab8 26d0e: c9 82 std Y+1, r12 ; 0x01 26d10: da 82 std Y+2, r13 ; 0x02 26d12: eb 82 std Y+3, r14 ; 0x03 26d14: fc 82 std Y+4, r15 ; 0x04 26d16: d0 ce rjmp .-608 ; 0x26ab8 if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 26d18: 80 93 f5 05 sts 0x05F5, r24 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.502> 26d1c: ba cf rjmp .-140 ; 0x26c92 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 26d1e: 0f 94 01 0b call 0x21602 ; 0x21602 26d22: 28 a1 ldd r18, Y+32 ; 0x20 26d24: 39 a1 ldd r19, Y+33 ; 0x21 26d26: 4a a1 ldd r20, Y+34 ; 0x22 26d28: 5b a1 ldd r21, Y+35 ; 0x23 26d2a: 62 1b sub r22, r18 26d2c: 73 0b sbc r23, r19 26d2e: 84 0b sbc r24, r20 26d30: 95 0b sbc r25, r21 26d32: 61 3d cpi r22, 0xD1 ; 209 26d34: 77 40 sbci r23, 0x07 ; 7 26d36: 81 05 cpc r24, r1 26d38: 91 05 cpc r25, r1 26d3a: 58 f1 brcs .+86 ; 0x26d92 int p; if (extruder<0){ p=soft_pwm_bed; 26d3c: a0 90 ee 05 lds r10, 0x05EE ; 0x8005ee 26d40: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 26d42: 85 e3 ldi r24, 0x35 ; 53 26d44: 95 e9 ldi r25, 0x95 ; 149 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 26d46: 21 14 cp r2, r1 26d48: 31 04 cpc r3, r1 26d4a: 29 f4 brne .+10 ; 0x26d56 p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 26d4c: a0 90 f5 05 lds r10, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.502> 26d50: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 26d52: 82 e3 ldi r24, 0x32 ; 50 26d54: 95 e9 ldi r25, 0x95 ; 149 26d56: 0e 94 1f 7b call 0xf63e ; 0xf63e 26d5a: 42 e0 ldi r20, 0x02 ; 2 26d5c: b8 01 movw r22, r16 26d5e: 88 a9 ldd r24, Y+48 ; 0x30 26d60: 9f a5 ldd r25, Y+47 ; 0x2f 26d62: 0e 94 a1 7a call 0xf542 ; 0xf542 } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 26d66: 8e e2 ldi r24, 0x2E ; 46 26d68: 95 e9 ldi r25, 0x95 ; 149 26d6a: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_PROTOCOLLN(p); 26d6e: c5 01 movw r24, r10 26d70: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a if (safety_check_cycles == 0) { //save ambient temp 26d74: 4d 81 ldd r20, Y+5 ; 0x05 26d76: 44 23 and r20, r20 26d78: 09 f4 brne .+2 ; 0x26d7c 26d7a: 6c c0 rjmp .+216 ; 0x26e54 temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 26d7c: 5f 8d ldd r21, Y+31 ; 0x1f 26d7e: 45 17 cp r20, r21 26d80: 70 f5 brcc .+92 ; 0x26dde safety_check_cycles++; 26d82: 4f 5f subi r20, 0xFF ; 255 26d84: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 26d86: 0f 94 01 0b call 0x21602 ; 0x21602 26d8a: 68 a3 std Y+32, r22 ; 0x20 26d8c: 79 a3 std Y+33, r23 ; 0x21 26d8e: 8a a3 std Y+34, r24 ; 0x22 26d90: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 26d92: 0f 94 01 0b call 0x21602 ; 0x21602 26d96: 4b 01 movw r8, r22 26d98: 5c 01 movw r10, r24 26d9a: 0f 94 01 0b call 0x21602 ; 0x21602 26d9e: 4e 80 ldd r4, Y+6 ; 0x06 26da0: 5f 80 ldd r5, Y+7 ; 0x07 26da2: 68 84 ldd r6, Y+8 ; 0x08 26da4: 79 84 ldd r7, Y+9 ; 0x09 26da6: 2e 85 ldd r18, Y+14 ; 0x0e 26da8: 3f 85 ldd r19, Y+15 ; 0x0f 26daa: 48 89 ldd r20, Y+16 ; 0x10 26dac: 59 89 ldd r21, Y+17 ; 0x11 26dae: 42 0e add r4, r18 26db0: 53 1e adc r5, r19 26db2: 64 1e adc r6, r20 26db4: 75 1e adc r7, r21 26db6: 84 18 sub r8, r4 26db8: 95 08 sbc r9, r5 26dba: a6 08 sbc r10, r6 26dbc: b7 08 sbc r11, r7 26dbe: 86 0e add r8, r22 26dc0: 97 1e adc r9, r23 26dc2: a8 1e adc r10, r24 26dc4: b9 1e adc r11, r25 26dc6: 31 e8 ldi r19, 0x81 ; 129 26dc8: 83 16 cp r8, r19 26dca: 3f e4 ldi r19, 0x4F ; 79 26dcc: 93 06 cpc r9, r19 26dce: 32 e1 ldi r19, 0x12 ; 18 26dd0: a3 06 cpc r10, r19 26dd2: b1 04 cpc r11, r1 26dd4: 08 f4 brcc .+2 ; 0x26dd8 26dd6: 47 c0 rjmp .+142 ; 0x26e66 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 26dd8: 81 e1 ldi r24, 0x11 ; 17 26dda: 95 e9 ldi r25, 0x95 ; 149 26ddc: 80 cf rjmp .-256 ; 0x26cde 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 26dde: 8d 81 ldd r24, Y+5 ; 0x05 26de0: 9f 8d ldd r25, Y+31 ; 0x1f 26de2: 89 13 cpse r24, r25 26de4: d0 cf rjmp .-96 ; 0x26d86 safety_check_cycles++; 26de6: 8f 5f subi r24, 0xFF ; 255 26de8: 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) { 26dea: 2b a5 ldd r18, Y+43 ; 0x2b 26dec: 3c a5 ldd r19, Y+44 ; 0x2c 26dee: 4d a5 ldd r20, Y+45 ; 0x2d 26df0: 5e a5 ldd r21, Y+46 ; 0x2e 26df2: b8 01 movw r22, r16 26df4: 88 a9 ldd r24, Y+48 ; 0x30 26df6: 9f a5 ldd r25, Y+47 ; 0x2f 26df8: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 26dfc: 9f 77 andi r25, 0x7F ; 127 26dfe: 20 e0 ldi r18, 0x00 ; 0 26e00: 30 e0 ldi r19, 0x00 ; 0 26e02: 40 ea ldi r20, 0xA0 ; 160 26e04: 50 e4 ldi r21, 0x40 ; 64 26e06: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 26e0a: 87 ff sbrs r24, 7 26e0c: bc cf rjmp .-136 ; 0x26d86 temp_runaway_stop(false, (extruder<0)); 26e0e: 63 2d mov r22, r3 26e10: 66 1f adc r22, r22 26e12: 66 27 eor r22, r22 26e14: 66 1f adc r22, r22 26e16: 80 e0 ldi r24, 0x00 ; 0 26e18: 0f 94 61 33 call 0x266c2 ; 0x266c2 pid_tuning_finished = true; 26e1c: 81 e0 ldi r24, 0x01 ; 1 26e1e: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.425> pid_cycle = 0; return; } lcd_update(0); } } 26e22: e0 96 adiw r28, 0x30 ; 48 26e24: 0f b6 in r0, 0x3f ; 63 26e26: f8 94 cli 26e28: de bf out 0x3e, r29 ; 62 26e2a: 0f be out 0x3f, r0 ; 63 26e2c: cd bf out 0x3d, r28 ; 61 26e2e: df 91 pop r29 26e30: cf 91 pop r28 26e32: 1f 91 pop r17 26e34: 0f 91 pop r16 26e36: ff 90 pop r15 26e38: ef 90 pop r14 26e3a: df 90 pop r13 26e3c: cf 90 pop r12 26e3e: bf 90 pop r11 26e40: af 90 pop r10 26e42: 9f 90 pop r9 26e44: 8f 90 pop r8 26e46: 7f 90 pop r7 26e48: 6f 90 pop r6 26e4a: 5f 90 pop r5 26e4c: 4f 90 pop r4 26e4e: 3f 90 pop r3 26e50: 2f 90 pop r2 26e52: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 26e54: 0b a7 std Y+43, r16 ; 0x2b 26e56: 1c a7 std Y+44, r17 ; 0x2c 26e58: a8 a9 ldd r26, Y+48 ; 0x30 26e5a: ad a7 std Y+45, r26 ; 0x2d 26e5c: bf a5 ldd r27, Y+47 ; 0x2f 26e5e: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 26e60: 21 e0 ldi r18, 0x01 ; 1 26e62: 2d 83 std Y+5, r18 ; 0x05 26e64: 90 cf rjmp .-224 ; 0x26d86 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 26e66: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26e6a: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26e6e: 49 a5 ldd r20, Y+41 ; 0x29 26e70: 5a a5 ldd r21, Y+42 ; 0x2a 26e72: 48 17 cp r20, r24 26e74: 59 07 cpc r21, r25 26e76: 1c f4 brge .+6 ; 0x26e7e SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 26e78: 85 eb ldi r24, 0xB5 ; 181 26e7a: 94 e9 ldi r25, 0x94 ; 148 26e7c: 30 cf rjmp .-416 ; 0x26cde pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 26e7e: 80 e0 ldi r24, 0x00 ; 0 26e80: 0e 94 54 6f call 0xdea8 ; 0xdea8 26e84: e6 cc rjmp .-1588 ; 0x26852 00026e86 : } void handle_temp_error(); void manage_heater() { 26e86: cf 92 push r12 26e88: df 92 push r13 26e8a: ef 92 push r14 26e8c: ff 92 push r15 26e8e: 0f 93 push r16 26e90: 1f 93 push r17 26e92: cf 93 push r28 26e94: df 93 push r29 26e96: 1f 92 push r1 26e98: 1f 92 push r1 26e9a: cd b7 in r28, 0x3d ; 61 26e9c: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 26e9e: 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) 26ea0: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 26ea4: 88 23 and r24, r24 26ea6: 09 f4 brne .+2 ; 0x26eaa 26ea8: 29 c2 rjmp .+1106 ; 0x272fc return; // syncronize temperatures with isr updateTemperatures(); 26eaa: 0e 94 b5 ff call 0x1ff6a ; 0x1ff6a if(thermal_model::warning_state.warning) thermal_model::handle_warning(); #endif // handle temperature errors if(temp_error_state.v) 26eae: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 26eb2: 88 23 and r24, r24 26eb4: 89 f1 breq .+98 ; 0x26f18 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 26eb6: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 26eba: 82 95 swap r24 26ebc: 86 95 lsr r24 26ebe: 87 70 andi r24, 0x07 ; 7 26ec0: 81 30 cpi r24, 0x01 ; 1 26ec2: 01 f1 breq .+64 ; 0x26f04 26ec4: 08 f4 brcc .+2 ; 0x26ec8 26ec6: be c1 rjmp .+892 ; 0x27244 26ec8: 84 30 cpi r24, 0x04 ; 4 26eca: 30 f5 brcc .+76 ; 0x26f18 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 26ecc: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 26ed0: 86 95 lsr r24 26ed2: 86 95 lsr r24 26ed4: 83 70 andi r24, 0x03 ; 3 26ed6: 82 30 cpi r24, 0x02 ; 2 26ed8: f8 f4 brcc .+62 ; 0x26f18 case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 26eda: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 26ede: 86 95 lsr r24 26ee0: 86 95 lsr r24 26ee2: 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), 26ee4: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 26ee8: 92 95 swap r25 26eea: 96 95 lsr r25 26eec: 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( 26eee: 61 e0 ldi r22, 0x01 ; 1 26ef0: 81 30 cpi r24, 0x01 ; 1 26ef2: 09 f0 breq .+2 ; 0x26ef6 26ef4: 60 e0 ldi r22, 0x00 ; 0 26ef6: 81 e0 ldi r24, 0x01 ; 1 26ef8: 92 30 cpi r25, 0x02 ; 2 26efa: 09 f0 breq .+2 ; 0x26efe 26efc: 80 e0 ldi r24, 0x00 ; 0 26efe: 0f 94 61 33 call 0x266c2 ; 0x266c2 26f02: 0a c0 rjmp .+20 ; 0x26f18 void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 26f04: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 26f08: 86 95 lsr r24 26f0a: 86 95 lsr r24 26f0c: 83 70 andi r24, 0x03 ; 3 26f0e: 09 f4 brne .+2 ; 0x26f12 26f10: 4b c1 rjmp .+662 ; 0x271a8 26f12: 81 30 cpi r24, 0x01 ; 1 26f14: 09 f4 brne .+2 ; 0x26f18 26f16: 79 c1 rjmp .+754 ; 0x2720a #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)) { 26f18: 0f 94 01 0b call 0x21602 ; 0x21602 26f1c: 00 91 07 17 lds r16, 0x1707 ; 0x801707 26f20: 10 91 08 17 lds r17, 0x1708 ; 0x801708 26f24: 20 91 09 17 lds r18, 0x1709 ; 0x801709 26f28: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 26f2c: 60 1b sub r22, r16 26f2e: 71 0b sbc r23, r17 26f30: 82 0b sbc r24, r18 26f32: 93 0b sbc r25, r19 26f34: 69 38 cpi r22, 0x89 ; 137 26f36: 73 41 sbci r23, 0x13 ; 19 26f38: 81 05 cpc r24, r1 26f3a: 91 05 cpc r25, r1 26f3c: d0 f0 brcs .+52 ; 0x26f72 26f3e: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 26f42: 81 11 cpse r24, r1 26f44: 16 c0 rjmp .+44 ; 0x26f72 extruder_autofan_last_check = _millis(); 26f46: 0f 94 01 0b call 0x21602 ; 0x21602 26f4a: 60 93 07 17 sts 0x1707, r22 ; 0x801707 26f4e: 70 93 08 17 sts 0x1708, r23 ; 0x801708 26f52: 80 93 09 17 sts 0x1709, r24 ; 0x801709 26f56: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a fanSpeedBckp = fanSpeedSoftPwm; 26f5a: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 26f5e: 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 26f62: 8b 34 cpi r24, 0x4B ; 75 26f64: 18 f0 brcs .+6 ; 0x26f6c // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 26f66: 8f ef ldi r24, 0xFF ; 255 26f68: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d } fan_measuring = true; 26f6c: 81 e0 ldi r24, 0x01 ; 1 26f6e: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 26f72: 0f 94 01 0b call 0x21602 ; 0x21602 26f76: 00 91 07 17 lds r16, 0x1707 ; 0x801707 26f7a: 10 91 08 17 lds r17, 0x1708 ; 0x801708 26f7e: 20 91 09 17 lds r18, 0x1709 ; 0x801709 26f82: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 26f86: 60 1b sub r22, r16 26f88: 71 0b sbc r23, r17 26f8a: 82 0b sbc r24, r18 26f8c: 93 0b sbc r25, r19 26f8e: 65 36 cpi r22, 0x65 ; 101 26f90: 71 05 cpc r23, r1 26f92: 81 05 cpc r24, r1 26f94: 91 05 cpc r25, r1 26f96: 08 f4 brcc .+2 ; 0x26f9a 26f98: a5 c1 rjmp .+842 ; 0x272e4 26f9a: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 26f9e: 88 23 and r24, r24 26fa0: 09 f4 brne .+2 ; 0x26fa4 26fa2: a0 c1 rjmp .+832 ; 0x272e4 #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))); 26fa4: 60 91 b5 05 lds r22, 0x05B5 ; 0x8005b5 26fa8: 70 91 b6 05 lds r23, 0x05B6 ; 0x8005b6 26fac: 07 2e mov r0, r23 26fae: 00 0c add r0, r0 26fb0: 88 0b sbc r24, r24 26fb2: 99 0b sbc r25, r25 26fb4: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 26fb8: 6b 01 movw r12, r22 26fba: 7c 01 movw r14, r24 26fbc: 0f 94 01 0b call 0x21602 ; 0x21602 26fc0: 00 91 07 17 lds r16, 0x1707 ; 0x801707 26fc4: 10 91 08 17 lds r17, 0x1708 ; 0x801708 26fc8: 20 91 09 17 lds r18, 0x1709 ; 0x801709 26fcc: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 26fd0: 60 1b sub r22, r16 26fd2: 71 0b sbc r23, r17 26fd4: 82 0b sbc r24, r18 26fd6: 93 0b sbc r25, r19 26fd8: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 26fdc: 9b 01 movw r18, r22 26fde: ac 01 movw r20, r24 26fe0: 60 e0 ldi r22, 0x00 ; 0 26fe2: 70 e0 ldi r23, 0x00 ; 0 26fe4: 8a e7 ldi r24, 0x7A ; 122 26fe6: 93 e4 ldi r25, 0x43 ; 67 26fe8: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 26fec: a7 01 movw r20, r14 26fee: 96 01 movw r18, r12 26ff0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 26ff4: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 26ff8: 70 93 b8 03 sts 0x03B8, r23 ; 0x8003b8 26ffc: 60 93 b7 03 sts 0x03B7, r22 ; 0x8003b7 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); 27000: 60 91 b7 05 lds r22, 0x05B7 ; 0x8005b7 27004: 70 91 b8 05 lds r23, 0x05B8 ; 0x8005b8 27008: 07 2e mov r0, r23 2700a: 00 0c add r0, r0 2700c: 88 0b sbc r24, r24 2700e: 99 0b sbc r25, r25 27010: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 27014: 6b 01 movw r12, r22 27016: 7c 01 movw r14, r24 27018: 0f 94 01 0b call 0x21602 ; 0x21602 2701c: 00 91 07 17 lds r16, 0x1707 ; 0x801707 27020: 10 91 08 17 lds r17, 0x1708 ; 0x801708 27024: 20 91 09 17 lds r18, 0x1709 ; 0x801709 27028: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 2702c: 60 1b sub r22, r16 2702e: 71 0b sbc r23, r17 27030: 82 0b sbc r24, r18 27032: 93 0b sbc r25, r19 27034: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 27038: 9b 01 movw r18, r22 2703a: ac 01 movw r20, r24 2703c: 60 e0 ldi r22, 0x00 ; 0 2703e: 70 e0 ldi r23, 0x00 ; 0 27040: 8a e7 ldi r24, 0x7A ; 122 27042: 93 e4 ldi r25, 0x43 ; 67 27044: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 27048: a7 01 movw r20, r14 2704a: 96 01 movw r18, r12 2704c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 27050: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 27054: 70 93 ba 03 sts 0x03BA, r23 ; 0x8003ba 27058: 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; 2705c: 10 92 b6 05 sts 0x05B6, r1 ; 0x8005b6 27060: 10 92 b5 05 sts 0x05B5, r1 ; 0x8005b5 fan_edge_counter[1] = 0; 27064: 10 92 b8 05 sts 0x05B8, r1 ; 0x8005b8 27068: 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) 2706c: 83 e0 ldi r24, 0x03 ; 3 2706e: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 27070: 82 e0 ldi r24, 0x02 ; 2 27072: 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) 27074: 80 91 40 02 lds r24, 0x0240 ; 0x800240 27078: 88 23 and r24, r24 2707a: 51 f0 breq .+20 ; 0x27090 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 2707c: 87 e8 ldi r24, 0x87 ; 135 2707e: 9f e0 ldi r25, 0x0F ; 15 27080: 0f 94 3e a4 call 0x3487c ; 0x3487c 27084: 91 e0 ldi r25, 0x01 ; 1 27086: 81 11 cpse r24, r1 27088: 01 c0 rjmp .+2 ; 0x2708c 2708a: 90 e0 ldi r25, 0x00 ; 0 2708c: 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]++;} 27090: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 27094: 90 91 b8 03 lds r25, 0x03B8 ; 0x8003b8 27098: 44 97 sbiw r24, 0x14 ; 20 2709a: 0c f0 brlt .+2 ; 0x2709e 2709c: f2 c0 rjmp .+484 ; 0x27282 2709e: 20 e0 ldi r18, 0x00 ; 0 270a0: 30 e0 ldi r19, 0x00 ; 0 270a2: 48 e4 ldi r20, 0x48 ; 72 270a4: 52 e4 ldi r21, 0x42 ; 66 270a6: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 270aa: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 270ae: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 270b2: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 270b6: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 270ba: 18 16 cp r1, r24 270bc: 0c f0 brlt .+2 ; 0x270c0 270be: e1 c0 rjmp .+450 ; 0x27282 270c0: 80 91 80 05 lds r24, 0x0580 ; 0x800580 270c4: 8f 5f subi r24, 0xFF ; 255 270c6: 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){ 270ca: 80 91 80 05 lds r24, 0x0580 ; 0x800580 270ce: 81 11 cpse r24, r1 270d0: 0b c0 rjmp .+22 ; 0x270e8 270d2: 80 91 81 05 lds r24, 0x0581 ; 0x800581 270d6: 81 11 cpse r24, r1 270d8: 07 c0 rjmp .+14 ; 0x270e8 270da: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 270de: 82 30 cpi r24, 0x02 ; 2 270e0: 19 f4 brne .+6 ; 0x270e8 // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 270e2: 81 e0 ldi r24, 0x01 ; 1 270e4: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 270e8: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 270ec: 81 30 cpi r24, 0x01 ; 1 270ee: 61 f4 brne .+24 ; 0x27108 270f0: 0e 94 ec 66 call 0xcdd8 ; 0xcdd8 270f4: 81 11 cpse r24, r1 270f6: 08 c0 rjmp .+16 ; 0x27108 fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 270f8: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 270fc: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.421> 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 27100: 8a e8 ldi r24, 0x8A ; 138 27102: 9c e6 ldi r25, 0x6C ; 108 27104: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 27108: 80 91 40 02 lds r24, 0x0240 ; 0x800240 2710c: 88 23 and r24, r24 2710e: 09 f4 brne .+2 ; 0x27112 27110: d9 c0 rjmp .+434 ; 0x272c4 27112: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 27116: 82 30 cpi r24, 0x02 ; 2 27118: 09 f4 brne .+2 ; 0x2711c 2711a: d4 c0 rjmp .+424 ; 0x272c4 2711c: 80 e8 ldi r24, 0x80 ; 128 2711e: e8 2e mov r14, r24 27120: 85 e0 ldi r24, 0x05 ; 5 27122: f8 2e mov r15, r24 27124: ce 01 movw r24, r28 27126: 01 96 adiw r24, 0x01 ; 1 27128: 6c 01 movw r12, r24 { for (uint8_t fan = 0; fan < 2; fan++) 2712a: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 2712c: 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]) 2712e: f7 01 movw r30, r14 27130: 91 91 ld r25, Z+ 27132: 7f 01 movw r14, r30 27134: f6 01 movw r30, r12 27136: 81 91 ld r24, Z+ 27138: 6f 01 movw r12, r30 2713a: 89 17 cp r24, r25 2713c: 80 f5 brcc .+96 ; 0x2719e { fan_speed_errors[fan] = 0; 2713e: f7 01 movw r30, r14 27140: 31 97 sbiw r30, 0x01 ; 1 27142: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 27144: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 27148: 82 30 cpi r24, 0x02 ; 2 2714a: 49 f1 breq .+82 ; 0x2719e fan_check_error = EFCE_REPORTED; 2714c: 00 93 ce 03 sts 0x03CE, r16 ; 0x8003ce if (printJobOngoing()) { 27150: 0e 94 9b 66 call 0xcd36 ; 0xcd36 27154: 88 23 and r24, r24 27156: 09 f4 brne .+2 ; 0x2715a 27158: 9a c0 rjmp .+308 ; 0x2728e // A print is ongoing, pause the print normally if(!printingIsPaused()) { 2715a: 0e 94 90 66 call 0xcd20 ; 0xcd20 2715e: 81 11 cpse r24, r1 27160: 07 c0 rjmp .+14 ; 0x27170 if (usb_timer.running()) 27162: 80 91 42 12 lds r24, 0x1242 ; 0x801242 27166: 88 23 and r24, r24 27168: 09 f4 brne .+2 ; 0x2716c 2716a: 8e c0 rjmp .+284 ; 0x27288 lcd_pause_usb_print(); 2716c: 0f 94 14 05 call 0x20a28 ; 0x20a28 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 27170: 11 30 cpi r17, 0x01 ; 1 27172: 09 f4 brne .+2 ; 0x27176 27174: 93 c0 rjmp .+294 ; 0x2729c //! 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); 27176: 86 ee ldi r24, 0xE6 ; 230 27178: 95 e9 ldi r25, 0x95 ; 149 2717a: 0e 94 18 7d call 0xfa30 ; 0xfa30 if (get_message_level() == 0) { 2717e: 80 91 c0 03 lds r24, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.421> 27182: 81 11 cpse r24, r1 27184: 0c c0 rjmp .+24 ; 0x2719e Sound_MakeCustom(200,0,true); 27186: 41 e0 ldi r20, 0x01 ; 1 27188: 70 e0 ldi r23, 0x00 ; 0 2718a: 60 e0 ldi r22, 0x00 ; 0 2718c: 88 ec ldi r24, 0xC8 ; 200 2718e: 90 e0 ldi r25, 0x00 ; 0 27190: 0f 94 f3 24 call 0x249e6 ; 0x249e6 LCD_ALERTMESSAGERPGM(lcdMsg); 27194: 62 e0 ldi r22, 0x02 ; 2 27196: 8a ec ldi r24, 0xCA ; 202 27198: 98 e6 ldi r25, 0x68 ; 104 2719a: 0e 94 17 d8 call 0x1b02e ; 0x1b02e 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++) 2719e: 11 30 cpi r17, 0x01 ; 1 271a0: 09 f4 brne .+2 ; 0x271a4 271a2: 90 c0 rjmp .+288 ; 0x272c4 271a4: 11 e0 ldi r17, 0x01 ; 1 271a6: c3 cf rjmp .-122 ; 0x2712e case TempErrorSource::hotend: if(temp_error_state.assert) { 271a8: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 271ac: 81 ff sbrs r24, 1 271ae: 12 c0 rjmp .+36 ; 0x271d4 min_temp_error(temp_error_state.index); 271b0: 60 91 cc 03 lds r22, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 271b4: 62 95 swap r22 271b6: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 271b8: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 271bc: 81 11 cpse r24, r1 271be: 07 c0 rjmp .+14 ; 0x271ce temp_error_messagepgm(err, e); 271c0: 81 e4 ldi r24, 0x41 ; 65 271c2: 96 e9 ldi r25, 0x96 ; 150 271c4: 0f 94 38 0d call 0x21a70 ; 0x21a70 prusa_statistics(92); 271c8: 8c e5 ldi r24, 0x5C ; 92 271ca: 0f 94 a0 2f call 0x25f40 ; 0x25f40 } ThermalStop(); 271ce: 0f 94 c5 66 call 0x2cd8a ; 0x2cd8a 271d2: a2 ce rjmp .-700 ; 0x26f18 // 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); 271d4: 60 91 0d 04 lds r22, 0x040D ; 0x80040d <_ZL8minttemp.lto_priv.426> 271d8: 70 91 0e 04 lds r23, 0x040E ; 0x80040e <_ZL8minttemp.lto_priv.426+0x1> 271dc: 6b 5f subi r22, 0xFB ; 251 271de: 7f 4f sbci r23, 0xFF ; 255 271e0: 07 2e mov r0, r23 271e2: 00 0c add r0, r0 271e4: 88 0b sbc r24, r24 271e6: 99 0b sbc r25, r25 271e8: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 271ec: 8b 01 movw r16, r22 271ee: 9c 01 movw r18, r24 271f0: 40 91 5a 0d lds r20, 0x0D5A ; 0x800d5a 271f4: 50 91 5b 0d lds r21, 0x0D5B ; 0x800d5b 271f8: 60 91 5c 0d lds r22, 0x0D5C ; 0x800d5c 271fc: 70 91 5d 0d lds r23, 0x0D5D ; 0x800d5d 27200: 8a e6 ldi r24, 0x6A ; 106 27202: 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); 27204: 0f 94 5a 05 call 0x20ab4 ; 0x20ab4 27208: 87 ce rjmp .-754 ; 0x26f18 // 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) { 2720a: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 2720e: 81 ff sbrs r24, 1 27210: 0a c0 rjmp .+20 ; 0x27226 ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 27212: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 27216: 81 11 cpse r24, r1 27218: da cf rjmp .-76 ; 0x271ce temp_error_messagepgm(err); 2721a: 61 e0 ldi r22, 0x01 ; 1 2721c: 85 e3 ldi r24, 0x35 ; 53 2721e: 96 e9 ldi r25, 0x96 ; 150 ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { temp_error_messagepgm(PSTR("MAXTEMP BED")); 27220: 0f 94 38 0d call 0x21a70 ; 0x21a70 27224: d4 cf rjmp .-88 ; 0x271ce 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); 27226: 40 91 bc 03 lds r20, 0x03BC ; 0x8003bc 2722a: 50 91 bd 03 lds r21, 0x03BD ; 0x8003bd 2722e: 60 91 be 03 lds r22, 0x03BE ; 0x8003be 27232: 70 91 bf 03 lds r23, 0x03BF ; 0x8003bf 27236: 00 e0 ldi r16, 0x00 ; 0 27238: 10 e0 ldi r17, 0x00 ; 0 2723a: 2c e0 ldi r18, 0x0C ; 12 2723c: 32 e4 ldi r19, 0x42 ; 66 2723e: 86 e6 ldi r24, 0x66 ; 102 27240: 92 e0 ldi r25, 0x02 ; 2 27242: e0 cf rjmp .-64 ; 0x27204 break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 27244: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 27248: 86 95 lsr r24 2724a: 86 95 lsr r24 2724c: 83 70 andi r24, 0x03 ; 3 2724e: 59 f0 breq .+22 ; 0x27266 27250: 81 30 cpi r24, 0x01 ; 1 27252: 09 f0 breq .+2 ; 0x27256 27254: 61 ce rjmp .-830 ; 0x26f18 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 27256: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2725a: 81 11 cpse r24, r1 2725c: b8 cf rjmp .-144 ; 0x271ce temp_error_messagepgm(PSTR("MAXTEMP BED")); 2725e: 61 e0 ldi r22, 0x01 ; 1 27260: 81 e5 ldi r24, 0x51 ; 81 27262: 96 e9 ldi r25, 0x96 ; 150 27264: dd cf rjmp .-70 ; 0x27220 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 27266: 60 91 cc 03 lds r22, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.424> 2726a: 62 95 swap r22 2726c: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 2726e: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 27272: 81 11 cpse r24, r1 27274: ac cf rjmp .-168 ; 0x271ce temp_error_messagepgm(PSTR("MAXTEMP"), e); 27276: 89 e4 ldi r24, 0x49 ; 73 27278: 96 e9 ldi r25, 0x96 ; 150 2727a: 0f 94 38 0d call 0x21a70 ; 0x21a70 prusa_statistics(93); 2727e: 8d e5 ldi r24, 0x5D ; 93 27280: a4 cf rjmp .-184 ; 0x271ca 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; 27282: 10 92 80 05 sts 0x0580, r1 ; 0x800580 27286: 21 cf rjmp .-446 ; 0x270ca // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 27288: 0f 94 0d 0b call 0x2161a ; 0x2161a 2728c: 71 cf rjmp .-286 ; 0x27170 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2728e: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 27292: 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; 27296: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb 2729a: 6a cf rjmp .-300 ; 0x27170 //! 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); 2729c: 8e e0 ldi r24, 0x0E ; 14 2729e: 96 e9 ldi r25, 0x96 ; 150 272a0: 0e 94 18 7d call 0xfa30 ; 0xfa30 if (get_message_level() == 0) { 272a4: 80 91 c0 03 lds r24, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.421> 272a8: 81 11 cpse r24, r1 272aa: 0c c0 rjmp .+24 ; 0x272c4 Sound_MakeCustom(200,0,true); 272ac: 41 e0 ldi r20, 0x01 ; 1 272ae: 70 e0 ldi r23, 0x00 ; 0 272b0: 60 e0 ldi r22, 0x00 ; 0 272b2: 88 ec ldi r24, 0xC8 ; 200 272b4: 90 e0 ldi r25, 0x00 ; 0 272b6: 0f 94 f3 24 call 0x249e6 ; 0x249e6 LCD_ALERTMESSAGERPGM(lcdMsg); 272ba: 62 e0 ldi r22, 0x02 ; 2 272bc: 87 ee ldi r24, 0xE7 ; 231 272be: 9a e6 ldi r25, 0x6A ; 106 272c0: 0e 94 17 d8 call 0x1b02e ; 0x1b02e } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 272c4: 80 91 65 02 lds r24, 0x0265 ; 0x800265 272c8: 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(); 272cc: 0f 94 01 0b call 0x21602 ; 0x21602 272d0: 60 93 07 17 sts 0x1707, r22 ; 0x801707 272d4: 70 93 08 17 sts 0x1708, r23 ; 0x801708 272d8: 80 93 09 17 sts 0x1709, r24 ; 0x801709 272dc: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a fan_measuring = false; 272e0: 10 92 b6 03 sts 0x03B6, r1 ; 0x8003b6 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 272e4: 0f 90 pop r0 272e6: 0f 90 pop r0 272e8: df 91 pop r29 272ea: cf 91 pop r28 272ec: 1f 91 pop r17 272ee: 0f 91 pop r16 272f0: ff 90 pop r15 272f2: ef 90 pop r14 272f4: df 90 pop r13 272f6: cf 90 pop r12 } #endif //FANCHECK checkExtruderAutoFans(); 272f8: 0c 94 56 78 jmp 0xf0ac ; 0xf0ac 272fc: 0f 90 pop r0 272fe: 0f 90 pop r0 27300: df 91 pop r29 27302: cf 91 pop r28 27304: 1f 91 pop r17 27306: 0f 91 pop r16 27308: ff 90 pop r15 2730a: ef 90 pop r14 2730c: df 90 pop r13 2730e: cf 90 pop r12 27310: 08 95 ret 00027312 : } #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; } 27312: 20 91 38 12 lds r18, 0x1238 ; 0x801238 27316: 30 91 39 12 lds r19, 0x1239 ; 0x801239 2731a: bc 01 movw r22, r24 2731c: c9 01 movw r24, r18 2731e: 82 5b subi r24, 0xB2 ; 178 27320: 9f 4e sbci r25, 0xEF ; 239 27322: 0f 94 45 a2 call 0x3448a ; 0x3448a 27326: 9c 01 movw r18, r24 27328: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 2732c: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb 27330: 81 e0 ldi r24, 0x01 ; 1 27332: 23 2b or r18, r19 27334: 09 f4 brne .+2 ; 0x27338 27336: 80 e0 ldi r24, 0x00 ; 0 27338: 08 95 ret 0002733a : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 2733a: 60 91 3e 0d lds r22, 0x0D3E ; 0x800d3e uint8_t _block_buffer_tail = block_buffer_tail; 2733e: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f uint16_t sdlen = 0; 27342: 30 e0 ldi r19, 0x00 ; 0 27344: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 27346: 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) 27348: 96 17 cp r25, r22 2734a: 61 f0 breq .+24 ; 0x27364 { sdlen += block_buffer[_block_buffer_tail].sdlen; 2734c: 89 9f mul r24, r25 2734e: f0 01 movw r30, r0 27350: 11 24 eor r1, r1 27352: e6 53 subi r30, 0x36 ; 54 27354: f9 4f sbci r31, 0xF9 ; 249 27356: 40 81 ld r20, Z 27358: 51 81 ldd r21, Z+1 ; 0x01 2735a: 24 0f add r18, r20 2735c: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2735e: 9f 5f subi r25, 0xFF ; 255 27360: 9f 70 andi r25, 0x0F ; 15 27362: f2 cf rjmp .-28 ; 0x27348 } return sdlen; } 27364: c9 01 movw r24, r18 27366: 08 95 ret 00027368 : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 27368: 30 91 3e 0d lds r19, 0x0D3E ; 0x800d3e 2736c: 20 91 3f 0d lds r18, 0x0D3F ; 0x800d3f 27370: 32 17 cp r19, r18 27372: 91 f0 breq .+36 ; 0x27398 // 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; 27374: 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) 27378: e1 11 cpse r30, r1 2737a: 01 c0 rjmp .+2 ; 0x2737e block_index = BLOCK_BUFFER_SIZE; 2737c: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 2737e: 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; 27380: 2e e6 ldi r18, 0x6E ; 110 27382: e2 9f mul r30, r18 27384: f0 01 movw r30, r0 27386: 11 24 eor r1, r1 27388: e6 53 subi r30, 0x36 ; 54 2738a: f9 4f sbci r31, 0xF9 ; 249 2738c: 20 81 ld r18, Z 2738e: 31 81 ldd r19, Z+1 ; 0x01 27390: 82 0f add r24, r18 27392: 93 1f adc r25, r19 27394: 91 83 std Z+1, r25 ; 0x01 27396: 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. } } 27398: 08 95 ret 0002739a : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 2739a: cf 92 push r12 2739c: df 92 push r13 2739e: ef 92 push r14 273a0: ff 92 push r15 273a2: 0f 93 push r16 273a4: 1f 93 push r17 273a6: cf 93 push r28 273a8: df 93 push r29 273aa: 0b e6 ldi r16, 0x6B ; 107 273ac: 1d e0 ldi r17, 0x0D ; 13 273ae: cb ea ldi r28, 0xAB ; 171 273b0: d4 e0 ldi r29, 0x04 ; 4 273b2: 8b eb ldi r24, 0xBB ; 187 273b4: c8 2e mov r12, r24 273b6: 84 e0 ldi r24, 0x04 ; 4 273b8: d8 2e mov r13, r24 273ba: 78 01 movw r14, r16 273bc: 0c 5f subi r16, 0xFC ; 252 273be: 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]; 273c0: f7 01 movw r30, r14 273c2: 60 a1 ldd r22, Z+32 ; 0x20 273c4: 71 a1 ldd r23, Z+33 ; 0x21 273c6: 82 a1 ldd r24, Z+34 ; 0x22 273c8: 93 a1 ldd r25, Z+35 ; 0x23 273ca: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 273ce: f7 01 movw r30, r14 273d0: 20 81 ld r18, Z 273d2: 31 81 ldd r19, Z+1 ; 0x01 273d4: 42 81 ldd r20, Z+2 ; 0x02 273d6: 53 81 ldd r21, Z+3 ; 0x03 273d8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 273dc: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 273e0: 69 93 st Y+, r22 273e2: 79 93 st Y+, r23 273e4: 89 93 st Y+, r24 273e6: 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++) 273e8: cc 16 cp r12, r28 273ea: dd 06 cpc r13, r29 273ec: 31 f7 brne .-52 ; 0x273ba max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 273ee: df 91 pop r29 273f0: cf 91 pop r28 273f2: 1f 91 pop r17 273f4: 0f 91 pop r16 273f6: ff 90 pop r15 273f8: ef 90 pop r14 273fa: df 90 pop r13 273fc: cf 90 pop r12 273fe: 08 95 ret 00027400 : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 27400: fc 01 movw r30, r24 27402: 40 81 ld r20, Z 27404: 51 81 ldd r21, Z+1 ; 0x01 27406: 62 81 ldd r22, Z+2 ; 0x02 27408: 73 81 ldd r23, Z+3 ; 0x03 2740a: 40 93 42 04 sts 0x0442, r20 ; 0x800442 2740e: 50 93 43 04 sts 0x0443, r21 ; 0x800443 27412: 60 93 44 04 sts 0x0444, r22 ; 0x800444 27416: 70 93 45 04 sts 0x0445, r23 ; 0x800445 #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 2741a: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 2741e: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 27422: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 27426: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 2742a: 60 81 ld r22, Z 2742c: 71 81 ldd r23, Z+1 ; 0x01 2742e: 82 81 ldd r24, Z+2 ; 0x02 27430: 93 81 ldd r25, Z+3 ; 0x03 27432: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 27436: 0f 94 a3 a8 call 0x35146 ; 0x35146 2743a: ec e3 ldi r30, 0x3C ; 60 2743c: f6 e0 ldi r31, 0x06 ; 6 2743e: 64 87 std Z+12, r22 ; 0x0c 27440: 75 87 std Z+13, r23 ; 0x0d 27442: 86 87 std Z+14, r24 ; 0x0e 27444: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 27446: 8f b7 in r24, 0x3f ; 63 27448: f8 94 cli count_position[E_AXIS] = e; 2744a: 44 85 ldd r20, Z+12 ; 0x0c 2744c: 55 85 ldd r21, Z+13 ; 0x0d 2744e: 66 85 ldd r22, Z+14 ; 0x0e 27450: 77 85 ldd r23, Z+15 ; 0x0f 27452: 40 93 58 06 sts 0x0658, r20 ; 0x800658 27456: 50 93 59 06 sts 0x0659, r21 ; 0x800659 2745a: 60 93 5a 06 sts 0x065A, r22 ; 0x80065a 2745e: 70 93 5b 06 sts 0x065B, r23 ; 0x80065b CRITICAL_SECTION_END; 27462: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 27464: 08 95 ret 00027466 : // 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; 27466: fc 01 movw r30, r24 27468: 40 81 ld r20, Z 2746a: 51 81 ldd r21, Z+1 ; 0x01 2746c: 62 81 ldd r22, Z+2 ; 0x02 2746e: 73 81 ldd r23, Z+3 ; 0x03 27470: 40 93 3e 04 sts 0x043E, r20 ; 0x80043e 27474: 50 93 3f 04 sts 0x043F, r21 ; 0x80043f 27478: 60 93 40 04 sts 0x0440, r22 ; 0x800440 2747c: 70 93 41 04 sts 0x0441, r23 ; 0x800441 #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 27480: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 27484: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 27488: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 2748c: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 27490: 60 81 ld r22, Z 27492: 71 81 ldd r23, Z+1 ; 0x01 27494: 82 81 ldd r24, Z+2 ; 0x02 27496: 93 81 ldd r25, Z+3 ; 0x03 27498: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2749c: 0f 94 a3 a8 call 0x35146 ; 0x35146 274a0: 60 93 44 06 sts 0x0644, r22 ; 0x800644 274a4: 70 93 45 06 sts 0x0645, r23 ; 0x800645 274a8: 80 93 46 06 sts 0x0646, r24 ; 0x800646 274ac: 90 93 47 06 sts 0x0647, r25 ; 0x800647 st_set_position(position); 274b0: 0d 94 c3 79 jmp 0x2f386 ; 0x2f386 000274b4 : // 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) { 274b4: 2f 92 push r2 274b6: 3f 92 push r3 274b8: 4f 92 push r4 274ba: 5f 92 push r5 274bc: 6f 92 push r6 274be: 7f 92 push r7 274c0: 8f 92 push r8 274c2: 9f 92 push r9 274c4: af 92 push r10 274c6: bf 92 push r11 274c8: cf 92 push r12 274ca: df 92 push r13 274cc: ef 92 push r14 274ce: ff 92 push r15 274d0: 0f 93 push r16 274d2: 1f 93 push r17 274d4: cf 93 push r28 274d6: df 93 push r29 274d8: cd b7 in r28, 0x3d ; 61 274da: de b7 in r29, 0x3e ; 62 274dc: c4 58 subi r28, 0x84 ; 132 274de: d1 09 sbc r29, r1 274e0: 0f b6 in r0, 0x3f ; 63 274e2: f8 94 cli 274e4: de bf out 0x3e, r29 ; 62 274e6: 0f be out 0x3f, r0 ; 63 274e8: cd bf out 0x3d, r28 ; 61 274ea: 69 a3 std Y+33, r22 ; 0x21 274ec: 7a a3 std Y+34, r23 ; 0x22 274ee: 8b a3 std Y+35, r24 ; 0x23 274f0: 9c a3 std Y+36, r25 ; 0x24 274f2: 2d a3 std Y+37, r18 ; 0x25 274f4: 3e a3 std Y+38, r19 ; 0x26 274f6: 4f a3 std Y+39, r20 ; 0x27 274f8: 58 a7 std Y+40, r21 ; 0x28 274fa: a7 96 adiw r28, 0x27 ; 39 274fc: ec ae std Y+60, r14 ; 0x3c 274fe: fd ae std Y+61, r15 ; 0x3d 27500: 0e af std Y+62, r16 ; 0x3e 27502: 1f af std Y+63, r17 ; 0x3f 27504: a7 97 sbiw r28, 0x27 ; 39 27506: a9 96 adiw r28, 0x29 ; 41 27508: df ae std Y+63, r13 ; 0x3f 2750a: ce ae std Y+62, r12 ; 0x3e 2750c: a9 97 sbiw r28, 0x29 ; 41 2750e: 89 ae std Y+57, r8 ; 0x39 27510: 99 aa std Y+49, r9 ; 0x31 27512: ad ae std Y+61, r10 ; 0x3d 27514: bd aa std Y+53, r11 ; 0x35 27516: c6 56 subi r28, 0x66 ; 102 27518: df 4f sbci r29, 0xFF ; 255 2751a: 08 81 ld r16, Y 2751c: 19 81 ldd r17, Y+1 ; 0x01 2751e: ca 59 subi r28, 0x9A ; 154 27520: 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); 27522: 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) 27526: 8f 5f subi r24, 0xFF ; 255 27528: a0 96 adiw r28, 0x20 ; 32 2752a: 8f af std Y+63, r24 ; 0x3f 2752c: a0 97 sbiw r28, 0x20 ; 32 2752e: 80 31 cpi r24, 0x10 ; 16 27530: 19 f4 brne .+6 ; 0x27538 block_index = 0; 27532: a0 96 adiw r28, 0x20 ; 32 27534: 1f ae std Y+63, r1 ; 0x3f 27536: 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) { 27538: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 2753c: a0 96 adiw r28, 0x20 ; 32 2753e: 2f ad ldd r18, Y+63 ; 0x3f 27540: a0 97 sbiw r28, 0x20 ; 32 27542: 82 13 cpse r24, r18 27544: 0f c0 rjmp .+30 ; 0x27564 do { manage_heater(); 27546: 0f 94 43 37 call 0x26e86 ; 0x26e86 // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 2754a: 80 e0 ldi r24, 0x00 ; 0 2754c: 0e 94 b0 8a call 0x11560 ; 0x11560 lcd_update(0); 27550: 80 e0 ldi r24, 0x00 ; 0 27552: 0e 94 54 6f call 0xdea8 ; 0xdea8 } while (block_buffer_tail == next_buffer_head); 27556: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 2755a: a0 96 adiw r28, 0x20 ; 32 2755c: 3f ad ldd r19, Y+63 ; 0x3f 2755e: a0 97 sbiw r28, 0x20 ; 32 27560: 83 17 cp r24, r19 27562: 89 f3 breq .-30 ; 0x27546 } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 27564: 40 91 42 0d lds r20, 0x0D42 ; 0x800d42 27568: a1 96 adiw r28, 0x21 ; 33 2756a: 4f af std Y+63, r20 ; 0x3f 2756c: a1 97 sbiw r28, 0x21 ; 33 2756e: 44 23 and r20, r20 27570: 11 f1 breq .+68 ; 0x275b6 // avoid planning the block early if aborted SERIAL_ECHO_START; 27572: 84 ee ldi r24, 0xE4 ; 228 27574: 92 ea ldi r25, 0xA2 ; 162 27576: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNRPGM(_n("Move aborted")); 2757a: 8a ed ldi r24, 0xDA ; 218 2757c: 9a e6 ldi r25, 0x6A ; 106 2757e: 0e 94 18 7d call 0xfa30 ; 0xfa30 // 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(); } 27582: cc 57 subi r28, 0x7C ; 124 27584: df 4f sbci r29, 0xFF ; 255 27586: 0f b6 in r0, 0x3f ; 63 27588: f8 94 cli 2758a: de bf out 0x3e, r29 ; 62 2758c: 0f be out 0x3f, r0 ; 63 2758e: cd bf out 0x3d, r28 ; 61 27590: df 91 pop r29 27592: cf 91 pop r28 27594: 1f 91 pop r17 27596: 0f 91 pop r16 27598: ff 90 pop r15 2759a: ef 90 pop r14 2759c: df 90 pop r13 2759e: cf 90 pop r12 275a0: bf 90 pop r11 275a2: af 90 pop r10 275a4: 9f 90 pop r9 275a6: 8f 90 pop r8 275a8: 7f 90 pop r7 275aa: 6f 90 pop r6 275ac: 5f 90 pop r5 275ae: 4f 90 pop r4 275b0: 3f 90 pop r3 275b2: 2f 90 pop r2 275b4: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 275b6: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 275ba: 29 2e mov r2, r25 275bc: 31 2c mov r3, r1 275be: 8e e6 ldi r24, 0x6E ; 110 275c0: 98 9f mul r25, r24 275c2: d0 01 movw r26, r0 275c4: 11 24 eor r1, r1 275c6: a3 96 adiw r28, 0x23 ; 35 275c8: bf af std Y+63, r27 ; 0x3f 275ca: ae af std Y+62, r26 ; 0x3e 275cc: 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; 275ce: cd 01 movw r24, r26 275d0: 82 5a subi r24, 0xA2 ; 162 275d2: 99 4f sbci r25, 0xF9 ; 249 275d4: fc 01 movw r30, r24 275d6: e9 5b subi r30, 0xB9 ; 185 275d8: ff 4f sbci r31, 0xFF ; 255 275da: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 275dc: 84 59 subi r24, 0x94 ; 148 275de: 9f 4f sbci r25, 0xFF ; 255 275e0: fc 01 movw r30, r24 275e2: 11 82 std Z+1, r1 ; 0x01 275e4: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 275e6: 01 15 cp r16, r1 275e8: 11 05 cpc r17, r1 275ea: 11 f4 brne .+4 ; 0x275f0 275ec: 0d 94 47 45 jmp 0x28a8e ; 0x28a8e memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 275f0: 80 e1 ldi r24, 0x10 ; 16 275f2: f8 01 movw r30, r16 275f4: aa 54 subi r26, 0x4A ; 74 275f6: b9 4f sbci r27, 0xF9 ; 249 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 275f8: 01 90 ld r0, Z+ 275fa: 0d 92 st X+, r0 275fc: 8a 95 dec r24 275fe: e1 f7 brne .-8 ; 0x275f8 // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 27600: 8e e6 ldi r24, 0x6E ; 110 27602: 82 9d mul r24, r2 27604: 80 01 movw r16, r0 27606: 83 9d mul r24, r3 27608: 10 0d add r17, r0 2760a: 11 24 eor r1, r1 2760c: 02 5a subi r16, 0xA2 ; 162 2760e: 19 4f sbci r17, 0xF9 ; 249 27610: f8 01 movw r30, r16 27612: e8 59 subi r30, 0x98 ; 152 27614: ff 4f sbci r31, 0xFF ; 255 27616: c4 56 subi r28, 0x64 ; 100 27618: df 4f sbci r29, 0xFF ; 255 2761a: 88 81 ld r24, Y 2761c: 99 81 ldd r25, Y+1 ; 0x01 2761e: cc 59 subi r28, 0x9C ; 156 27620: d0 40 sbci r29, 0x00 ; 0 27622: 91 83 std Z+1, r25 ; 0x01 27624: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 27626: 06 59 subi r16, 0x96 ; 150 27628: 1f 4f sbci r17, 0xFF ; 255 2762a: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 2762e: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 27632: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 27636: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 2763a: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 2763e: d8 01 movw r26, r16 27640: 6d 93 st X+, r22 27642: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 27644: 80 91 21 04 lds r24, 0x0421 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.442> 27648: 88 23 and r24, r24 2764a: a9 f0 breq .+42 ; 0x27676 { position[E_AXIS] = 0; 2764c: 10 92 48 06 sts 0x0648, r1 ; 0x800648 27650: 10 92 49 06 sts 0x0649, r1 ; 0x800649 27654: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a 27658: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 2765c: 10 92 42 04 sts 0x0442, r1 ; 0x800442 27660: 10 92 43 04 sts 0x0443, r1 ; 0x800443 27664: 10 92 44 04 sts 0x0444, r1 ; 0x800444 27668: 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; 2766c: 10 92 21 04 sts 0x0421, r1 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.442> plan_reset_next_e_sched = true; 27670: 81 e0 ldi r24, 0x01 ; 1 27672: 80 93 20 04 sts 0x0420, r24 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.443> } // Apply the machine correction matrix. world2machine(x, y); 27676: be 01 movw r22, r28 27678: 6b 5d subi r22, 0xDB ; 219 2767a: 7f 4f sbci r23, 0xFF ; 255 2767c: ce 01 movw r24, r28 2767e: 81 96 adiw r24, 0x21 ; 33 27680: 0e 94 d1 68 call 0xd1a2 ; 0xd1a2 // 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]); 27684: c9 a0 ldd r12, Y+33 ; 0x21 27686: da a0 ldd r13, Y+34 ; 0x22 27688: eb a0 ldd r14, Y+35 ; 0x23 2768a: fc a0 ldd r15, Y+36 ; 0x24 2768c: 20 91 6b 0d lds r18, 0x0D6B ; 0x800d6b 27690: 30 91 6c 0d lds r19, 0x0D6C ; 0x800d6c 27694: 40 91 6d 0d lds r20, 0x0D6D ; 0x800d6d 27698: 50 91 6e 0d lds r21, 0x0D6E ; 0x800d6e 2769c: c7 01 movw r24, r14 2769e: b6 01 movw r22, r12 276a0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 276a4: 0f 94 a3 a8 call 0x35146 ; 0x35146 276a8: c3 58 subi r28, 0x83 ; 131 276aa: df 4f sbci r29, 0xFF ; 255 276ac: 68 83 st Y, r22 276ae: 79 83 std Y+1, r23 ; 0x01 276b0: 8a 83 std Y+2, r24 ; 0x02 276b2: 9b 83 std Y+3, r25 ; 0x03 276b4: cd 57 subi r28, 0x7D ; 125 276b6: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 276b8: 8d a0 ldd r8, Y+37 ; 0x25 276ba: 9e a0 ldd r9, Y+38 ; 0x26 276bc: af a0 ldd r10, Y+39 ; 0x27 276be: b8 a4 ldd r11, Y+40 ; 0x28 276c0: 20 91 6f 0d lds r18, 0x0D6F ; 0x800d6f 276c4: 30 91 70 0d lds r19, 0x0D70 ; 0x800d70 276c8: 40 91 71 0d lds r20, 0x0D71 ; 0x800d71 276cc: 50 91 72 0d lds r21, 0x0D72 ; 0x800d72 276d0: c5 01 movw r24, r10 276d2: b4 01 movw r22, r8 276d4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 276d8: 0f 94 a3 a8 call 0x35146 ; 0x35146 276dc: cf 57 subi r28, 0x7F ; 127 276de: df 4f sbci r29, 0xFF ; 255 276e0: 68 83 st Y, r22 276e2: 79 83 std Y+1, r23 ; 0x01 276e4: 8a 83 std Y+2, r24 ; 0x02 276e6: 9b 83 std Y+3, r25 ; 0x03 276e8: c1 58 subi r28, 0x81 ; 129 276ea: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 276ec: 80 91 09 13 lds r24, 0x1309 ; 0x801309 276f0: 88 23 and r24, r24 276f2: 11 f4 brne .+4 ; 0x276f8 276f4: 0d 94 4e 45 jmp 0x28a9c ; 0x28a9c target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 276f8: a5 01 movw r20, r10 276fa: 94 01 movw r18, r8 276fc: c7 01 movw r24, r14 276fe: b6 01 movw r22, r12 27700: 0f 94 d6 91 call 0x323ac ; 0x323ac 27704: a7 96 adiw r28, 0x27 ; 39 27706: 2c ad ldd r18, Y+60 ; 0x3c 27708: 3d ad ldd r19, Y+61 ; 0x3d 2770a: 4e ad ldd r20, Y+62 ; 0x3e 2770c: 5f ad ldd r21, Y+63 ; 0x3f 2770e: a7 97 sbiw r28, 0x27 ; 39 27710: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 27714: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 27718: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 2771c: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 27720: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 27724: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 27728: 0f 94 a3 a8 call 0x35146 ; 0x35146 2772c: e5 96 adiw r28, 0x35 ; 53 2772e: 6c af std Y+60, r22 ; 0x3c 27730: 7d af std Y+61, r23 ; 0x3d 27732: 8e af std Y+62, r24 ; 0x3e 27734: 9f af std Y+63, r25 ; 0x3f 27736: 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]); 27738: a9 96 adiw r28, 0x29 ; 41 2773a: ee ad ldd r30, Y+62 ; 0x3e 2773c: ff ad ldd r31, Y+63 ; 0x3f 2773e: a9 97 sbiw r28, 0x29 ; 41 27740: 80 80 ld r8, Z 27742: 91 80 ldd r9, Z+1 ; 0x01 27744: a2 80 ldd r10, Z+2 ; 0x02 27746: b3 80 ldd r11, Z+3 ; 0x03 27748: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 2774c: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 27750: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 27754: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 27758: c5 01 movw r24, r10 2775a: b4 01 movw r22, r8 2775c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 27760: 0f 94 a3 a8 call 0x35146 ; 0x35146 27764: ad 96 adiw r28, 0x2d ; 45 27766: 6c af std Y+60, r22 ; 0x3c 27768: 7d af std Y+61, r23 ; 0x3d 2776a: 8e af std Y+62, r24 ; 0x3e 2776c: 9f af std Y+63, r25 ; 0x3f 2776e: 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]; 27770: 80 91 48 06 lds r24, 0x0648 ; 0x800648 27774: 90 91 49 06 lds r25, 0x0649 ; 0x800649 27778: a0 91 4a 06 lds r26, 0x064A ; 0x80064a 2777c: b0 91 4b 06 lds r27, 0x064B ; 0x80064b 27780: ad 96 adiw r28, 0x2d ; 45 27782: 4c ac ldd r4, Y+60 ; 0x3c 27784: 5d ac ldd r5, Y+61 ; 0x3d 27786: 6e ac ldd r6, Y+62 ; 0x3e 27788: 7f ac ldd r7, Y+63 ; 0x3f 2778a: ad 97 sbiw r28, 0x2d ; 45 2778c: 48 1a sub r4, r24 2778e: 59 0a sbc r5, r25 27790: 6a 0a sbc r6, r26 27792: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 27794: 80 91 3c 06 lds r24, 0x063C ; 0x80063c 27798: 90 91 3d 06 lds r25, 0x063D ; 0x80063d 2779c: a0 91 3e 06 lds r26, 0x063E ; 0x80063e 277a0: b0 91 3f 06 lds r27, 0x063F ; 0x80063f 277a4: c3 58 subi r28, 0x83 ; 131 277a6: df 4f sbci r29, 0xFF ; 255 277a8: c8 80 ld r12, Y 277aa: d9 80 ldd r13, Y+1 ; 0x01 277ac: ea 80 ldd r14, Y+2 ; 0x02 277ae: fb 80 ldd r15, Y+3 ; 0x03 277b0: cd 57 subi r28, 0x7D ; 125 277b2: d0 40 sbci r29, 0x00 ; 0 277b4: c8 1a sub r12, r24 277b6: d9 0a sbc r13, r25 277b8: ea 0a sbc r14, r26 277ba: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 277bc: 80 91 40 06 lds r24, 0x0640 ; 0x800640 277c0: 90 91 41 06 lds r25, 0x0641 ; 0x800641 277c4: a0 91 42 06 lds r26, 0x0642 ; 0x800642 277c8: b0 91 43 06 lds r27, 0x0643 ; 0x800643 277cc: cf 57 subi r28, 0x7F ; 127 277ce: df 4f sbci r29, 0xFF ; 255 277d0: 28 81 ld r18, Y 277d2: 39 81 ldd r19, Y+1 ; 0x01 277d4: 4a 81 ldd r20, Y+2 ; 0x02 277d6: 5b 81 ldd r21, Y+3 ; 0x03 277d8: c1 58 subi r28, 0x81 ; 129 277da: d0 40 sbci r29, 0x00 ; 0 277dc: 28 1b sub r18, r24 277de: 39 0b sbc r19, r25 277e0: 4a 0b sbc r20, r26 277e2: 5b 0b sbc r21, r27 277e4: 29 a7 std Y+41, r18 ; 0x29 277e6: 3a a7 std Y+42, r19 ; 0x2a 277e8: 4b a7 std Y+43, r20 ; 0x2b 277ea: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 277ec: 80 91 44 06 lds r24, 0x0644 ; 0x800644 277f0: 90 91 45 06 lds r25, 0x0645 ; 0x800645 277f4: a0 91 46 06 lds r26, 0x0646 ; 0x800646 277f8: b0 91 47 06 lds r27, 0x0647 ; 0x800647 277fc: e5 96 adiw r28, 0x35 ; 53 277fe: 2c ad ldd r18, Y+60 ; 0x3c 27800: 3d ad ldd r19, Y+61 ; 0x3d 27802: 4e ad ldd r20, Y+62 ; 0x3e 27804: 5f ad ldd r21, Y+63 ; 0x3f 27806: e5 97 sbiw r28, 0x35 ; 53 27808: 28 1b sub r18, r24 2780a: 39 0b sbc r19, r25 2780c: 4a 0b sbc r20, r26 2780e: 5b 0b sbc r21, r27 27810: 2d a7 std Y+45, r18 ; 0x2d 27812: 3e a7 std Y+46, r19 ; 0x2e 27814: 4f a7 std Y+47, r20 ; 0x2f 27816: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 27818: 41 14 cp r4, r1 2781a: 51 04 cpc r5, r1 2781c: 61 04 cpc r6, r1 2781e: 71 04 cpc r7, r1 27820: 09 f4 brne .+2 ; 0x27824 27822: 80 c0 rjmp .+256 ; 0x27924 { if((int)degHotend(active_extruder) 27828: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2782c: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 27830: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 27834: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 27838: 20 91 57 02 lds r18, 0x0257 ; 0x800257 2783c: 30 91 58 02 lds r19, 0x0258 ; 0x800258 27840: 62 17 cp r22, r18 27842: 73 07 cpc r23, r19 27844: 0c f5 brge .+66 ; 0x27888 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 27846: ad 96 adiw r28, 0x2d ; 45 27848: 8c ad ldd r24, Y+60 ; 0x3c 2784a: 9d ad ldd r25, Y+61 ; 0x3d 2784c: ae ad ldd r26, Y+62 ; 0x3e 2784e: bf ad ldd r27, Y+63 ; 0x3f 27850: ad 97 sbiw r28, 0x2d ; 45 27852: 80 93 48 06 sts 0x0648, r24 ; 0x800648 27856: 90 93 49 06 sts 0x0649, r25 ; 0x800649 2785a: a0 93 4a 06 sts 0x064A, r26 ; 0x80064a 2785e: b0 93 4b 06 sts 0x064B, r27 ; 0x80064b #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 27862: 80 92 42 04 sts 0x0442, r8 ; 0x800442 27866: 90 92 43 04 sts 0x0443, r9 ; 0x800443 2786a: a0 92 44 04 sts 0x0444, r10 ; 0x800444 2786e: b0 92 45 04 sts 0x0445, r11 ; 0x800445 #endif de = 0; // no difference SERIAL_ECHO_START; 27872: 84 ee ldi r24, 0xE4 ; 228 27874: 92 ea ldi r25, 0xA2 ; 162 27876: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 2787a: 80 ec ldi r24, 0xC0 ; 192 2787c: 9a e6 ldi r25, 0x6A ; 106 2787e: 0e 94 18 7d call 0xfa30 ; 0xfa30 { 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 27882: 41 2c mov r4, r1 27884: 51 2c mov r5, r1 27886: 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) 27888: c3 01 movw r24, r6 2788a: b2 01 movw r22, r4 2788c: 77 fe sbrs r7, 7 2788e: 07 c0 rjmp .+14 ; 0x2789e 27890: 66 27 eor r22, r22 27892: 77 27 eor r23, r23 27894: cb 01 movw r24, r22 27896: 64 19 sub r22, r4 27898: 75 09 sbc r23, r5 2789a: 86 09 sbc r24, r6 2789c: 97 09 sbc r25, r7 2789e: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 278a2: 4b 01 movw r8, r22 278a4: 5c 01 movw r10, r24 278a6: 20 e0 ldi r18, 0x00 ; 0 278a8: 30 e0 ldi r19, 0x00 ; 0 278aa: 48 ee ldi r20, 0xE8 ; 232 278ac: 53 e4 ldi r21, 0x43 ; 67 278ae: 60 91 77 0d lds r22, 0x0D77 ; 0x800d77 278b2: 70 91 78 0d lds r23, 0x0D78 ; 0x800d78 278b6: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 278ba: 90 91 7a 0d lds r25, 0x0D7A ; 0x800d7a 278be: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 278c2: 9b 01 movw r18, r22 278c4: ac 01 movw r20, r24 278c6: c5 01 movw r24, r10 278c8: b4 01 movw r22, r8 278ca: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 278ce: 18 16 cp r1, r24 278d0: 4c f5 brge .+82 ; 0x27924 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 278d2: ad 96 adiw r28, 0x2d ; 45 278d4: 2c ad ldd r18, Y+60 ; 0x3c 278d6: 3d ad ldd r19, Y+61 ; 0x3d 278d8: 4e ad ldd r20, Y+62 ; 0x3e 278da: 5f ad ldd r21, Y+63 ; 0x3f 278dc: ad 97 sbiw r28, 0x2d ; 45 278de: 20 93 48 06 sts 0x0648, r18 ; 0x800648 278e2: 30 93 49 06 sts 0x0649, r19 ; 0x800649 278e6: 40 93 4a 06 sts 0x064A, r20 ; 0x80064a 278ea: 50 93 4b 06 sts 0x064B, r21 ; 0x80064b #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 278ee: a9 96 adiw r28, 0x29 ; 41 278f0: ee ad ldd r30, Y+62 ; 0x3e 278f2: ff ad ldd r31, Y+63 ; 0x3f 278f4: a9 97 sbiw r28, 0x29 ; 41 278f6: 80 81 ld r24, Z 278f8: 91 81 ldd r25, Z+1 ; 0x01 278fa: a2 81 ldd r26, Z+2 ; 0x02 278fc: b3 81 ldd r27, Z+3 ; 0x03 278fe: 80 93 42 04 sts 0x0442, r24 ; 0x800442 27902: 90 93 43 04 sts 0x0443, r25 ; 0x800443 27906: a0 93 44 04 sts 0x0444, r26 ; 0x800444 2790a: b0 93 45 04 sts 0x0445, r27 ; 0x800445 #endif de = 0; // no difference SERIAL_ECHO_START; 2790e: 84 ee ldi r24, 0xE4 ; 228 27910: 92 ea ldi r25, 0xA2 ; 162 27912: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 27916: 82 ea ldi r24, 0xA2 ; 162 27918: 9a e6 ldi r25, 0x6A ; 106 2791a: 0e 94 18 7d call 0xfa30 ; 0xfa30 { 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 2791e: 41 2c mov r4, r1 27920: 51 2c mov r5, r1 27922: 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); 27924: 8e e6 ldi r24, 0x6E ; 110 27926: 82 9d mul r24, r2 27928: f0 01 movw r30, r0 2792a: 83 9d mul r24, r3 2792c: f0 0d add r31, r0 2792e: 11 24 eor r1, r1 27930: e2 5a subi r30, 0xA2 ; 162 27932: f9 4f sbci r31, 0xF9 ; 249 27934: d7 01 movw r26, r14 27936: c6 01 movw r24, r12 27938: f7 fe sbrs r15, 7 2793a: 07 c0 rjmp .+14 ; 0x2794a 2793c: 88 27 eor r24, r24 2793e: 99 27 eor r25, r25 27940: dc 01 movw r26, r24 27942: 8c 19 sub r24, r12 27944: 9d 09 sbc r25, r13 27946: ae 09 sbc r26, r14 27948: bf 09 sbc r27, r15 2794a: 80 83 st Z, r24 2794c: 91 83 std Z+1, r25 ; 0x01 2794e: a2 83 std Z+2, r26 ; 0x02 27950: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 27952: 8e e6 ldi r24, 0x6E ; 110 27954: 82 9d mul r24, r2 27956: f0 01 movw r30, r0 27958: 83 9d mul r24, r3 2795a: f0 0d add r31, r0 2795c: 11 24 eor r1, r1 2795e: e2 5a subi r30, 0xA2 ; 162 27960: f9 4f sbci r31, 0xF9 ; 249 27962: 89 a5 ldd r24, Y+41 ; 0x29 27964: 9a a5 ldd r25, Y+42 ; 0x2a 27966: ab a5 ldd r26, Y+43 ; 0x2b 27968: bc a5 ldd r27, Y+44 ; 0x2c 2796a: b7 ff sbrs r27, 7 2796c: 07 c0 rjmp .+14 ; 0x2797c 2796e: b0 95 com r27 27970: a0 95 com r26 27972: 90 95 com r25 27974: 81 95 neg r24 27976: 9f 4f sbci r25, 0xFF ; 255 27978: af 4f sbci r26, 0xFF ; 255 2797a: bf 4f sbci r27, 0xFF ; 255 2797c: 84 83 std Z+4, r24 ; 0x04 2797e: 95 83 std Z+5, r25 ; 0x05 27980: a6 83 std Z+6, r26 ; 0x06 27982: 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); 27984: 8e e6 ldi r24, 0x6E ; 110 27986: 82 9d mul r24, r2 27988: f0 01 movw r30, r0 2798a: 83 9d mul r24, r3 2798c: f0 0d add r31, r0 2798e: 11 24 eor r1, r1 27990: e2 5a subi r30, 0xA2 ; 162 27992: f9 4f sbci r31, 0xF9 ; 249 27994: 8d a5 ldd r24, Y+45 ; 0x2d 27996: 9e a5 ldd r25, Y+46 ; 0x2e 27998: af a5 ldd r26, Y+47 ; 0x2f 2799a: b8 a9 ldd r27, Y+48 ; 0x30 2799c: b7 ff sbrs r27, 7 2799e: 07 c0 rjmp .+14 ; 0x279ae 279a0: b0 95 com r27 279a2: a0 95 com r26 279a4: 90 95 com r25 279a6: 81 95 neg r24 279a8: 9f 4f sbci r25, 0xFF ; 255 279aa: af 4f sbci r26, 0xFF ; 255 279ac: bf 4f sbci r27, 0xFF ; 255 279ae: 80 87 std Z+8, r24 ; 0x08 279b0: 91 87 std Z+9, r25 ; 0x09 279b2: a2 87 std Z+10, r26 ; 0x0a 279b4: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 279b6: b3 01 movw r22, r6 279b8: a2 01 movw r20, r4 279ba: 77 fe sbrs r7, 7 279bc: 07 c0 rjmp .+14 ; 0x279cc 279be: 44 27 eor r20, r20 279c0: 55 27 eor r21, r21 279c2: ba 01 movw r22, r20 279c4: 44 19 sub r20, r4 279c6: 55 09 sbc r21, r5 279c8: 66 09 sbc r22, r6 279ca: 77 09 sbc r23, r7 279cc: 8e e6 ldi r24, 0x6E ; 110 279ce: 82 9d mul r24, r2 279d0: f0 01 movw r30, r0 279d2: 83 9d mul r24, r3 279d4: f0 0d add r31, r0 279d6: 11 24 eor r1, r1 279d8: e2 5a subi r30, 0xA2 ; 162 279da: f9 4f sbci r31, 0xF9 ; 249 279dc: 44 87 std Z+12, r20 ; 0x0c 279de: 55 87 std Z+13, r21 ; 0x0d 279e0: 66 87 std Z+14, r22 ; 0x0e 279e2: 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))); 279e4: 00 81 ld r16, Z 279e6: 11 81 ldd r17, Z+1 ; 0x01 279e8: 22 81 ldd r18, Z+2 ; 0x02 279ea: 33 81 ldd r19, Z+3 ; 0x03 279ec: 84 81 ldd r24, Z+4 ; 0x04 279ee: 95 81 ldd r25, Z+5 ; 0x05 279f0: a6 81 ldd r26, Z+6 ; 0x06 279f2: b7 81 ldd r27, Z+7 ; 0x07 279f4: 80 17 cp r24, r16 279f6: 91 07 cpc r25, r17 279f8: a2 07 cpc r26, r18 279fa: b3 07 cpc r27, r19 279fc: 14 f4 brge .+4 ; 0x27a02 279fe: d9 01 movw r26, r18 27a00: c8 01 movw r24, r16 27a02: ee e6 ldi r30, 0x6E ; 110 27a04: be 2e mov r11, r30 27a06: b2 9c mul r11, r2 27a08: f0 01 movw r30, r0 27a0a: b3 9c mul r11, r3 27a0c: f0 0d add r31, r0 27a0e: 11 24 eor r1, r1 27a10: e2 5a subi r30, 0xA2 ; 162 27a12: f9 4f sbci r31, 0xF9 ; 249 27a14: 80 84 ldd r8, Z+8 ; 0x08 27a16: 91 84 ldd r9, Z+9 ; 0x09 27a18: a2 84 ldd r10, Z+10 ; 0x0a 27a1a: b3 84 ldd r11, Z+11 ; 0x0b 27a1c: 88 15 cp r24, r8 27a1e: 99 05 cpc r25, r9 27a20: aa 05 cpc r26, r10 27a22: bb 05 cpc r27, r11 27a24: 14 f4 brge .+4 ; 0x27a2a 27a26: d5 01 movw r26, r10 27a28: c4 01 movw r24, r8 27a2a: 84 17 cp r24, r20 27a2c: 95 07 cpc r25, r21 27a2e: a6 07 cpc r26, r22 27a30: b7 07 cpc r27, r23 27a32: 14 f4 brge .+4 ; 0x27a38 27a34: db 01 movw r26, r22 27a36: ca 01 movw r24, r20 27a38: 4e e6 ldi r20, 0x6E ; 110 27a3a: 42 9d mul r20, r2 27a3c: f0 01 movw r30, r0 27a3e: 43 9d mul r20, r3 27a40: f0 0d add r31, r0 27a42: 11 24 eor r1, r1 27a44: e2 5a subi r30, 0xA2 ; 162 27a46: f9 4f sbci r31, 0xF9 ; 249 27a48: 80 8b std Z+16, r24 ; 0x10 27a4a: 91 8b std Z+17, r25 ; 0x11 27a4c: a2 8b std Z+18, r26 ; 0x12 27a4e: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 27a50: 06 97 sbiw r24, 0x06 ; 6 27a52: a1 05 cpc r26, r1 27a54: b1 05 cpc r27, r1 27a56: 0c f4 brge .+2 ; 0x27a5a 27a58: 94 cd rjmp .-1240 ; 0x27582 planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 27a5a: 80 91 55 12 lds r24, 0x1255 ; 0x801255 27a5e: df 01 movw r26, r30 27a60: aa 5b subi r26, 0xBA ; 186 27a62: bf 4f sbci r27, 0xFF ; 255 27a64: 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); 27a66: f7 fe sbrs r15, 7 27a68: 02 c0 rjmp .+4 ; 0x27a6e 27a6a: 0d 94 5e 45 jmp 0x28abc ; 0x28abc } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 27a6e: 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); 27a70: 89 a5 ldd r24, Y+41 ; 0x29 27a72: 9a a5 ldd r25, Y+42 ; 0x2a 27a74: ab a5 ldd r26, Y+43 ; 0x2b 27a76: bc a5 ldd r27, Y+44 ; 0x2c 27a78: b7 ff sbrs r27, 7 27a7a: 0b c0 rjmp .+22 ; 0x27a92 27a7c: 8e e6 ldi r24, 0x6E ; 110 27a7e: 82 9d mul r24, r2 27a80: f0 01 movw r30, r0 27a82: 83 9d mul r24, r3 27a84: f0 0d add r31, r0 27a86: 11 24 eor r1, r1 27a88: e2 5a subi r30, 0xA2 ; 162 27a8a: f9 4f sbci r31, 0xF9 ; 249 27a8c: 80 8d ldd r24, Z+24 ; 0x18 27a8e: 82 60 ori r24, 0x02 ; 2 27a90: 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); 27a92: 8d a5 ldd r24, Y+45 ; 0x2d 27a94: 9e a5 ldd r25, Y+46 ; 0x2e 27a96: af a5 ldd r26, Y+47 ; 0x2f 27a98: b8 a9 ldd r27, Y+48 ; 0x30 27a9a: b7 ff sbrs r27, 7 27a9c: 0b c0 rjmp .+22 ; 0x27ab4 27a9e: 8e e6 ldi r24, 0x6E ; 110 27aa0: 82 9d mul r24, r2 27aa2: f0 01 movw r30, r0 27aa4: 83 9d mul r24, r3 27aa6: f0 0d add r31, r0 27aa8: 11 24 eor r1, r1 27aaa: e2 5a subi r30, 0xA2 ; 162 27aac: f9 4f sbci r31, 0xF9 ; 249 27aae: 80 8d ldd r24, Z+24 ; 0x18 27ab0: 84 60 ori r24, 0x04 ; 4 27ab2: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 27ab4: 77 fe sbrs r7, 7 27ab6: 0b c0 rjmp .+22 ; 0x27ace 27ab8: 8e e6 ldi r24, 0x6E ; 110 27aba: 82 9d mul r24, r2 27abc: f0 01 movw r30, r0 27abe: 83 9d mul r24, r3 27ac0: f0 0d add r31, r0 27ac2: 11 24 eor r1, r1 27ac4: e2 5a subi r30, 0xA2 ; 162 27ac6: f9 4f sbci r31, 0xF9 ; 249 27ac8: 80 8d ldd r24, Z+24 ; 0x18 27aca: 88 60 ori r24, 0x08 ; 8 27acc: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 27ace: 01 2b or r16, r17 27ad0: 02 2b or r16, r18 27ad2: 03 2b or r16, r19 27ad4: 09 f0 breq .+2 ; 0x27ad8 27ad6: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 27ad8: 8e e6 ldi r24, 0x6E ; 110 27ada: 82 9d mul r24, r2 27adc: f0 01 movw r30, r0 27ade: 83 9d mul r24, r3 27ae0: f0 0d add r31, r0 27ae2: 11 24 eor r1, r1 27ae4: e2 5a subi r30, 0xA2 ; 162 27ae6: f9 4f sbci r31, 0xF9 ; 249 27ae8: 84 81 ldd r24, Z+4 ; 0x04 27aea: 95 81 ldd r25, Z+5 ; 0x05 27aec: a6 81 ldd r26, Z+6 ; 0x06 27aee: b7 81 ldd r27, Z+7 ; 0x07 27af0: 89 2b or r24, r25 27af2: 8a 2b or r24, r26 27af4: 8b 2b or r24, r27 27af6: 09 f0 breq .+2 ; 0x27afa 27af8: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 27afa: 8e e6 ldi r24, 0x6E ; 110 27afc: 82 9d mul r24, r2 27afe: f0 01 movw r30, r0 27b00: 83 9d mul r24, r3 27b02: f0 0d add r31, r0 27b04: 11 24 eor r1, r1 27b06: e2 5a subi r30, 0xA2 ; 162 27b08: f9 4f sbci r31, 0xF9 ; 249 27b0a: 80 85 ldd r24, Z+8 ; 0x08 27b0c: 91 85 ldd r25, Z+9 ; 0x09 27b0e: a2 85 ldd r26, Z+10 ; 0x0a 27b10: b3 85 ldd r27, Z+11 ; 0x0b 27b12: 89 2b or r24, r25 27b14: 8a 2b or r24, r26 27b16: 8b 2b or r24, r27 27b18: 09 f0 breq .+2 ; 0x27b1c 27b1a: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 27b1c: 8e e6 ldi r24, 0x6E ; 110 27b1e: 82 9d mul r24, r2 27b20: f0 01 movw r30, r0 27b22: 83 9d mul r24, r3 27b24: f0 0d add r31, r0 27b26: 11 24 eor r1, r1 27b28: e2 5a subi r30, 0xA2 ; 162 27b2a: f9 4f sbci r31, 0xF9 ; 249 27b2c: 84 85 ldd r24, Z+12 ; 0x0c 27b2e: 95 85 ldd r25, Z+13 ; 0x0d 27b30: a6 85 ldd r26, Z+14 ; 0x0e 27b32: b7 85 ldd r27, Z+15 ; 0x0f 27b34: 89 2b or r24, r25 27b36: 8a 2b or r24, r26 27b38: 8b 2b or r24, r27 27b3a: 09 f0 breq .+2 ; 0x27b3e 27b3c: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 27b3e: 8e e6 ldi r24, 0x6E ; 110 27b40: 82 9d mul r24, r2 27b42: f0 01 movw r30, r0 27b44: 83 9d mul r24, r3 27b46: f0 0d add r31, r0 27b48: 11 24 eor r1, r1 27b4a: e2 5a subi r30, 0xA2 ; 162 27b4c: f9 4f sbci r31, 0xF9 ; 249 27b4e: 24 85 ldd r18, Z+12 ; 0x0c 27b50: 35 85 ldd r19, Z+13 ; 0x0d 27b52: 46 85 ldd r20, Z+14 ; 0x0e 27b54: 57 85 ldd r21, Z+15 ; 0x0f 27b56: 2a 96 adiw r28, 0x0a ; 10 27b58: 2c af std Y+60, r18 ; 0x3c 27b5a: 3d af std Y+61, r19 ; 0x3d 27b5c: 4e af std Y+62, r20 ; 0x3e 27b5e: 5f af std Y+63, r21 ; 0x3f 27b60: 2a 97 sbiw r28, 0x0a ; 10 27b62: 23 2b or r18, r19 27b64: 24 2b or r18, r20 27b66: 25 2b or r18, r21 27b68: 09 f0 breq .+2 ; 0x27b6c 27b6a: ac c7 rjmp .+3928 ; 0x28ac4 { if(feed_rate 27b70: b0 90 a8 0d lds r11, 0x0DA8 ; 0x800da8 27b74: 00 91 a9 0d lds r16, 0x0DA9 ; 0x800da9 27b78: 10 91 aa 0d lds r17, 0x0DAA ; 0x800daa } else { if(feed_rate 27b8c: 18 16 cp r1, r24 27b8e: 24 f4 brge .+8 ; 0x27b98 27b90: a9 ae std Y+57, r10 ; 0x39 27b92: b9 aa std Y+49, r11 ; 0x31 27b94: 0d af std Y+61, r16 ; 0x3d 27b96: 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]; 27b98: c7 01 movw r24, r14 27b9a: b6 01 movw r22, r12 27b9c: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 27ba0: 20 91 6b 0d lds r18, 0x0D6B ; 0x800d6b 27ba4: 30 91 6c 0d lds r19, 0x0D6C ; 0x800d6c 27ba8: 40 91 6d 0d lds r20, 0x0D6D ; 0x800d6d 27bac: 50 91 6e 0d lds r21, 0x0D6E ; 0x800d6e 27bb0: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 27bb4: 4b 01 movw r8, r22 27bb6: 5c 01 movw r10, r24 27bb8: 89 82 std Y+1, r8 ; 0x01 27bba: 9a 82 std Y+2, r9 ; 0x02 27bbc: ab 82 std Y+3, r10 ; 0x03 27bbe: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 27bc0: 69 a5 ldd r22, Y+41 ; 0x29 27bc2: 7a a5 ldd r23, Y+42 ; 0x2a 27bc4: 8b a5 ldd r24, Y+43 ; 0x2b 27bc6: 9c a5 ldd r25, Y+44 ; 0x2c 27bc8: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 27bcc: 20 91 6f 0d lds r18, 0x0D6F ; 0x800d6f 27bd0: 30 91 70 0d lds r19, 0x0D70 ; 0x800d70 27bd4: 40 91 71 0d lds r20, 0x0D71 ; 0x800d71 27bd8: 50 91 72 0d lds r21, 0x0D72 ; 0x800d72 27bdc: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 27be0: 6b 01 movw r12, r22 27be2: 7c 01 movw r14, r24 27be4: cd 82 std Y+5, r12 ; 0x05 27be6: de 82 std Y+6, r13 ; 0x06 27be8: ef 82 std Y+7, r14 ; 0x07 27bea: 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]; 27bec: 6d a5 ldd r22, Y+45 ; 0x2d 27bee: 7e a5 ldd r23, Y+46 ; 0x2e 27bf0: 8f a5 ldd r24, Y+47 ; 0x2f 27bf2: 98 a9 ldd r25, Y+48 ; 0x30 27bf4: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 27bf8: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 27bfc: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 27c00: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 27c04: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 27c08: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 27c0c: 22 96 adiw r28, 0x02 ; 2 27c0e: 6c af std Y+60, r22 ; 0x3c 27c10: 7d af std Y+61, r23 ; 0x3d 27c12: 8e af std Y+62, r24 ; 0x3e 27c14: 9f af std Y+63, r25 ; 0x3f 27c16: 22 97 sbiw r28, 0x02 ; 2 27c18: 69 87 std Y+9, r22 ; 0x09 27c1a: 7a 87 std Y+10, r23 ; 0x0a 27c1c: 8b 87 std Y+11, r24 ; 0x0b 27c1e: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 27c20: c3 01 movw r24, r6 27c22: b2 01 movw r22, r4 27c24: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 27c28: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 27c2c: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 27c30: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 27c34: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 27c38: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 27c3c: 26 96 adiw r28, 0x06 ; 6 27c3e: 6c af std Y+60, r22 ; 0x3c 27c40: 7d af std Y+61, r23 ; 0x3d 27c42: 8e af std Y+62, r24 ; 0x3e 27c44: 9f af std Y+63, r25 ; 0x3f 27c46: 26 97 sbiw r28, 0x06 ; 6 27c48: 6d 87 std Y+13, r22 ; 0x0d 27c4a: 7e 87 std Y+14, r23 ; 0x0e 27c4c: 8f 87 std Y+15, r24 ; 0x0f 27c4e: 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 ) 27c50: 8e e6 ldi r24, 0x6E ; 110 27c52: 82 9d mul r24, r2 27c54: f0 01 movw r30, r0 27c56: 83 9d mul r24, r3 27c58: f0 0d add r31, r0 27c5a: 11 24 eor r1, r1 27c5c: e2 5a subi r30, 0xA2 ; 162 27c5e: f9 4f sbci r31, 0xF9 ; 249 27c60: 80 81 ld r24, Z 27c62: 91 81 ldd r25, Z+1 ; 0x01 27c64: a2 81 ldd r26, Z+2 ; 0x02 27c66: b3 81 ldd r27, Z+3 ; 0x03 27c68: 2e 96 adiw r28, 0x0e ; 14 27c6a: 8c af std Y+60, r24 ; 0x3c 27c6c: 9d af std Y+61, r25 ; 0x3d 27c6e: ae af std Y+62, r26 ; 0x3e 27c70: bf af std Y+63, r27 ; 0x3f 27c72: 2e 97 sbiw r28, 0x0e ; 14 27c74: 06 97 sbiw r24, 0x06 ; 6 27c76: a1 05 cpc r26, r1 27c78: b1 05 cpc r27, r1 27c7a: 0c f0 brlt .+2 ; 0x27c7e 27c7c: 2c c7 rjmp .+3672 ; 0x28ad6 27c7e: 84 81 ldd r24, Z+4 ; 0x04 27c80: 95 81 ldd r25, Z+5 ; 0x05 27c82: a6 81 ldd r26, Z+6 ; 0x06 27c84: b7 81 ldd r27, Z+7 ; 0x07 27c86: 06 97 sbiw r24, 0x06 ; 6 27c88: a1 05 cpc r26, r1 27c8a: b1 05 cpc r27, r1 27c8c: 0c f0 brlt .+2 ; 0x27c90 27c8e: 23 c7 rjmp .+3654 ; 0x28ad6 27c90: 80 85 ldd r24, Z+8 ; 0x08 27c92: 91 85 ldd r25, Z+9 ; 0x09 27c94: a2 85 ldd r26, Z+10 ; 0x0a 27c96: b3 85 ldd r27, Z+11 ; 0x0b 27c98: 06 97 sbiw r24, 0x06 ; 6 27c9a: a1 05 cpc r26, r1 27c9c: b1 05 cpc r27, r1 27c9e: 0c f0 brlt .+2 ; 0x27ca2 27ca0: 1a c7 rjmp .+3636 ; 0x28ad6 { block->millimeters = fabs(delta_mm[E_AXIS]); 27ca2: 26 96 adiw r28, 0x06 ; 6 27ca4: 8c ad ldd r24, Y+60 ; 0x3c 27ca6: 9d ad ldd r25, Y+61 ; 0x3d 27ca8: ae ad ldd r26, Y+62 ; 0x3e 27caa: bf ad ldd r27, Y+63 ; 0x3f 27cac: 26 97 sbiw r28, 0x06 ; 6 27cae: bf 77 andi r27, 0x7F ; 127 27cb0: 85 a7 std Z+45, r24 ; 0x2d 27cb2: 96 a7 std Z+46, r25 ; 0x2e 27cb4: a7 a7 std Z+47, r26 ; 0x2f 27cb6: 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 27cb8: 8e e6 ldi r24, 0x6E ; 110 27cba: 82 9d mul r24, r2 27cbc: f0 01 movw r30, r0 27cbe: 83 9d mul r24, r3 27cc0: f0 0d add r31, r0 27cc2: 11 24 eor r1, r1 27cc4: e2 5a subi r30, 0xA2 ; 162 27cc6: f9 4f sbci r31, 0xF9 ; 249 27cc8: 45 a4 ldd r4, Z+45 ; 0x2d 27cca: 56 a4 ldd r5, Z+46 ; 0x2e 27ccc: 67 a4 ldd r6, Z+47 ; 0x2f 27cce: 70 a8 ldd r7, Z+48 ; 0x30 27cd0: a3 01 movw r20, r6 27cd2: 92 01 movw r18, r4 27cd4: 60 e0 ldi r22, 0x00 ; 0 27cd6: 70 e0 ldi r23, 0x00 ; 0 27cd8: 80 e8 ldi r24, 0x80 ; 128 27cda: 9f e3 ldi r25, 0x3F ; 63 27cdc: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 27ce0: 29 ad ldd r18, Y+57 ; 0x39 27ce2: 39 a9 ldd r19, Y+49 ; 0x31 27ce4: 4d ad ldd r20, Y+61 ; 0x3d 27ce6: 5d a9 ldd r21, Y+53 ; 0x35 27ce8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 27cec: 6b 01 movw r12, r22 27cee: 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); 27cf0: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 27cf4: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 27cf8: 89 1b sub r24, r25 27cfa: 8f 70 andi r24, 0x0F ; 15 27cfc: 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)) { 27cfe: 82 50 subi r24, 0x02 ; 2 27d00: 86 30 cpi r24, 0x06 ; 6 27d02: 08 f0 brcs .+2 ; 0x27d06 27d04: 40 c0 rjmp .+128 ; 0x27d86 // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 27d06: a7 01 movw r20, r14 27d08: 96 01 movw r18, r12 27d0a: 60 e0 ldi r22, 0x00 ; 0 27d0c: 74 e2 ldi r23, 0x24 ; 36 27d0e: 84 e7 ldi r24, 0x74 ; 116 27d10: 99 e4 ldi r25, 0x49 ; 73 27d12: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 27d16: 0f 94 a3 a8 call 0x35146 ; 0x35146 27d1a: 4b 01 movw r8, r22 27d1c: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 27d1e: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 27d22: 90 91 ac 0d lds r25, 0x0DAC ; 0x800dac 27d26: a0 91 ad 0d lds r26, 0x0DAD ; 0x800dad 27d2a: b0 91 ae 0d lds r27, 0x0DAE ; 0x800dae 27d2e: 88 16 cp r8, r24 27d30: 99 06 cpc r9, r25 27d32: aa 06 cpc r10, r26 27d34: bb 06 cpc r11, r27 27d36: 38 f5 brcc .+78 ; 0x27d86 // 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)); 27d38: bc 01 movw r22, r24 27d3a: cd 01 movw r24, r26 27d3c: 68 19 sub r22, r8 27d3e: 79 09 sbc r23, r9 27d40: 8a 09 sbc r24, r10 27d42: 9b 09 sbc r25, r11 27d44: 66 0f add r22, r22 27d46: 77 1f adc r23, r23 27d48: 88 1f adc r24, r24 27d4a: 99 1f adc r25, r25 27d4c: ad ad ldd r26, Y+61 ; 0x3d 27d4e: 2a 2f mov r18, r26 27d50: 30 e0 ldi r19, 0x00 ; 0 27d52: 50 e0 ldi r21, 0x00 ; 0 27d54: 40 e0 ldi r20, 0x00 ; 0 27d56: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 27d5a: ca 01 movw r24, r20 27d5c: b9 01 movw r22, r18 27d5e: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 27d62: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 27d66: 68 0d add r22, r8 27d68: 79 1d adc r23, r9 27d6a: 8a 1d adc r24, r10 27d6c: 9b 1d adc r25, r11 27d6e: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 27d72: 9b 01 movw r18, r22 27d74: ac 01 movw r20, r24 27d76: 60 e0 ldi r22, 0x00 ; 0 27d78: 74 e2 ldi r23, 0x24 ; 36 27d7a: 84 e7 ldi r24, 0x74 ; 116 27d7c: 99 e4 ldi r25, 0x49 ; 73 27d7e: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 27d82: 6b 01 movw r12, r22 27d84: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 27d86: a3 01 movw r20, r6 27d88: 92 01 movw r18, r4 27d8a: c7 01 movw r24, r14 27d8c: b6 01 movw r22, r12 27d8e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 27d92: 6d ab std Y+53, r22 ; 0x35 27d94: 7e ab std Y+54, r23 ; 0x36 27d96: 8f ab std Y+55, r24 ; 0x37 27d98: 98 af std Y+56, r25 ; 0x38 27d9a: 8e e6 ldi r24, 0x6E ; 110 27d9c: 82 9d mul r24, r2 27d9e: 80 01 movw r16, r0 27da0: 83 9d mul r24, r3 27da2: 10 0d add r17, r0 27da4: 11 24 eor r1, r1 27da6: 02 5a subi r16, 0xA2 ; 162 27da8: 19 4f sbci r17, 0xF9 ; 249 27daa: 2d a9 ldd r18, Y+53 ; 0x35 27dac: 3e a9 ldd r19, Y+54 ; 0x36 27dae: 4f a9 ldd r20, Y+55 ; 0x37 27db0: 58 ad ldd r21, Y+56 ; 0x38 27db2: d8 01 movw r26, r16 27db4: 91 96 adiw r26, 0x21 ; 33 27db6: 2d 93 st X+, r18 27db8: 3d 93 st X+, r19 27dba: 4d 93 st X+, r20 27dbc: 5c 93 st X, r21 27dbe: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 27dc0: 50 96 adiw r26, 0x10 ; 16 27dc2: 6d 91 ld r22, X+ 27dc4: 7d 91 ld r23, X+ 27dc6: 8d 91 ld r24, X+ 27dc8: 9c 91 ld r25, X 27dca: 53 97 sbiw r26, 0x13 ; 19 27dcc: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 27dd0: 69 af std Y+57, r22 ; 0x39 27dd2: 7a af std Y+58, r23 ; 0x3a 27dd4: 8b af std Y+59, r24 ; 0x3b 27dd6: 9c af std Y+60, r25 ; 0x3c 27dd8: 9b 01 movw r18, r22 27dda: ac 01 movw r20, r24 27ddc: c7 01 movw r24, r14 27dde: b6 01 movw r22, r12 27de0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 27de4: 0f 94 44 a6 call 0x34c88 ; 0x34c88 27de8: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 27dec: 62 96 adiw r28, 0x12 ; 18 27dee: 6c af std Y+60, r22 ; 0x3c 27df0: 7d af std Y+61, r23 ; 0x3d 27df2: 8e af std Y+62, r24 ; 0x3e 27df4: 9f af std Y+63, r25 ; 0x3f 27df6: 62 97 sbiw r28, 0x12 ; 18 27df8: f8 01 movw r30, r16 27dfa: 66 ab std Z+54, r22 ; 0x36 27dfc: 77 ab std Z+55, r23 ; 0x37 27dfe: 80 af std Z+56, r24 ; 0x38 27e00: 91 af std Z+57, r25 ; 0x39 27e02: 9e 01 movw r18, r28 27e04: 2f 5f subi r18, 0xFF ; 255 27e06: 3f 4f sbci r19, 0xFF ; 255 27e08: 3a ab std Y+50, r19 ; 0x32 27e0a: 29 ab std Y+49, r18 ; 0x31 27e0c: ae 01 movw r20, r28 27e0e: 4f 5e subi r20, 0xEF ; 239 27e10: 5f 4f sbci r21, 0xFF ; 255 27e12: 6e 96 adiw r28, 0x1e ; 30 27e14: 5f af std Y+63, r21 ; 0x3f 27e16: 4e af std Y+62, r20 ; 0x3e 27e18: 6e 97 sbiw r28, 0x1e ; 30 27e1a: 8b e7 ldi r24, 0x7B ; 123 27e1c: 9d e0 ldi r25, 0x0D ; 13 27e1e: 68 96 adiw r28, 0x18 ; 24 27e20: 9f af std Y+63, r25 ; 0x3f 27e22: 8e af std Y+62, r24 ; 0x3e 27e24: 68 97 sbiw r28, 0x18 ; 24 27e26: 6c 96 adiw r28, 0x1c ; 28 27e28: 5f af std Y+63, r21 ; 0x3f 27e2a: 4e af std Y+62, r20 ; 0x3e 27e2c: 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 27e2e: 19 a6 std Y+41, r1 ; 0x29 27e30: 1d a6 std Y+45, r1 ; 0x2d 27e32: 00 e8 ldi r16, 0x80 ; 128 27e34: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 27e36: a9 a9 ldd r26, Y+49 ; 0x31 27e38: ba a9 ldd r27, Y+50 ; 0x32 27e3a: 2d 91 ld r18, X+ 27e3c: 3d 91 ld r19, X+ 27e3e: 4d 91 ld r20, X+ 27e40: 5d 91 ld r21, X+ 27e42: ba ab std Y+50, r27 ; 0x32 27e44: a9 ab std Y+49, r26 ; 0x31 27e46: c7 01 movw r24, r14 27e48: b6 01 movw r22, r12 27e4a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 27e4e: 6c 96 adiw r28, 0x1c ; 28 27e50: ee ad ldd r30, Y+62 ; 0x3e 27e52: ff ad ldd r31, Y+63 ; 0x3f 27e54: 6c 97 sbiw r28, 0x1c ; 28 27e56: 61 93 st Z+, r22 27e58: 71 93 st Z+, r23 27e5a: 81 93 st Z+, r24 27e5c: 91 93 st Z+, r25 27e5e: 6c 96 adiw r28, 0x1c ; 28 27e60: ff af std Y+63, r31 ; 0x3f 27e62: ee af std Y+62, r30 ; 0x3e 27e64: 6c 97 sbiw r28, 0x1c ; 28 if(fabs(current_speed[i]) > max_feedrate[i]) 27e66: 4b 01 movw r8, r22 27e68: 5c 01 movw r10, r24 27e6a: e8 94 clt 27e6c: b7 f8 bld r11, 7 27e6e: 68 96 adiw r28, 0x18 ; 24 27e70: ae ad ldd r26, Y+62 ; 0x3e 27e72: bf ad ldd r27, Y+63 ; 0x3f 27e74: 68 97 sbiw r28, 0x18 ; 24 27e76: 2d 91 ld r18, X+ 27e78: 3d 91 ld r19, X+ 27e7a: 4d 91 ld r20, X+ 27e7c: 5d 91 ld r21, X+ 27e7e: 68 96 adiw r28, 0x18 ; 24 27e80: bf af std Y+63, r27 ; 0x3f 27e82: ae af std Y+62, r26 ; 0x3e 27e84: 68 97 sbiw r28, 0x18 ; 24 27e86: 66 96 adiw r28, 0x16 ; 22 27e88: 2c af std Y+60, r18 ; 0x3c 27e8a: 3d af std Y+61, r19 ; 0x3d 27e8c: 4e af std Y+62, r20 ; 0x3e 27e8e: 5f af std Y+63, r21 ; 0x3f 27e90: 66 97 sbiw r28, 0x16 ; 22 27e92: c5 01 movw r24, r10 27e94: b4 01 movw r22, r8 27e96: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 27e9a: 18 16 cp r1, r24 27e9c: b4 f4 brge .+44 ; 0x27eca { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 27e9e: a5 01 movw r20, r10 27ea0: 94 01 movw r18, r8 27ea2: 66 96 adiw r28, 0x16 ; 22 27ea4: 6c ad ldd r22, Y+60 ; 0x3c 27ea6: 7d ad ldd r23, Y+61 ; 0x3d 27ea8: 8e ad ldd r24, Y+62 ; 0x3e 27eaa: 9f ad ldd r25, Y+63 ; 0x3f 27eac: 66 97 sbiw r28, 0x16 ; 22 27eae: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 27eb2: 4b 01 movw r8, r22 27eb4: 5c 01 movw r10, r24 27eb6: 29 a5 ldd r18, Y+41 ; 0x29 27eb8: 3d a5 ldd r19, Y+45 ; 0x2d 27eba: a8 01 movw r20, r16 27ebc: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 27ec0: 18 16 cp r1, r24 27ec2: 1c f0 brlt .+6 ; 0x27eca 27ec4: 89 a6 std Y+41, r8 ; 0x29 27ec6: 9d a6 std Y+45, r9 ; 0x2d 27ec8: 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++) 27eca: 6e 96 adiw r28, 0x1e ; 30 27ecc: ee ad ldd r30, Y+62 ; 0x3e 27ece: ff ad ldd r31, Y+63 ; 0x3f 27ed0: 6e 97 sbiw r28, 0x1e ; 30 27ed2: 29 a9 ldd r18, Y+49 ; 0x31 27ed4: 3a a9 ldd r19, Y+50 ; 0x32 27ed6: e2 17 cp r30, r18 27ed8: f3 07 cpc r31, r19 27eda: 09 f0 breq .+2 ; 0x27ede 27edc: ac cf rjmp .-168 ; 0x27e36 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 27ede: 20 e0 ldi r18, 0x00 ; 0 27ee0: 30 e0 ldi r19, 0x00 ; 0 27ee2: 40 e8 ldi r20, 0x80 ; 128 27ee4: 5f e3 ldi r21, 0x3F ; 63 27ee6: 69 a5 ldd r22, Y+41 ; 0x29 27ee8: 7d a5 ldd r23, Y+45 ; 0x2d 27eea: c8 01 movw r24, r16 27eec: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 27ef0: 87 ff sbrs r24, 7 27ef2: 50 c0 rjmp .+160 ; 0x27f94 27ef4: 6e 96 adiw r28, 0x1e ; 30 27ef6: ae ac ldd r10, Y+62 ; 0x3e 27ef8: bf ac ldd r11, Y+63 ; 0x3f 27efa: 6e 97 sbiw r28, 0x1e ; 30 27efc: 30 e1 ldi r19, 0x10 ; 16 27efe: a3 0e add r10, r19 27f00: b1 1c adc r11, r1 27f02: 6e 96 adiw r28, 0x1e ; 30 27f04: ce ac ldd r12, Y+62 ; 0x3e 27f06: df ac ldd r13, Y+63 ; 0x3f 27f08: 6e 97 sbiw r28, 0x1e ; 30 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 27f0a: d6 01 movw r26, r12 27f0c: 6d 91 ld r22, X+ 27f0e: 7d 91 ld r23, X+ 27f10: 8d 91 ld r24, X+ 27f12: 9d 91 ld r25, X+ 27f14: 6d 01 movw r12, r26 27f16: 7d 01 movw r14, r26 27f18: b4 e0 ldi r27, 0x04 ; 4 27f1a: eb 1a sub r14, r27 27f1c: f1 08 sbc r15, r1 27f1e: 29 a5 ldd r18, Y+41 ; 0x29 27f20: 3d a5 ldd r19, Y+45 ; 0x2d 27f22: a8 01 movw r20, r16 27f24: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 27f28: f7 01 movw r30, r14 27f2a: 60 83 st Z, r22 27f2c: 71 83 std Z+1, r23 ; 0x01 27f2e: 82 83 std Z+2, r24 ; 0x02 27f30: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 27f32: ac 14 cp r10, r12 27f34: bd 04 cpc r11, r13 27f36: 49 f7 brne .-46 ; 0x27f0a { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 27f38: 2e e6 ldi r18, 0x6E ; 110 27f3a: 22 9d mul r18, r2 27f3c: c0 01 movw r24, r0 27f3e: 23 9d mul r18, r3 27f40: 90 0d add r25, r0 27f42: 11 24 eor r1, r1 27f44: 9c 01 movw r18, r24 27f46: 22 5a subi r18, 0xA2 ; 162 27f48: 39 4f sbci r19, 0xF9 ; 249 27f4a: 79 01 movw r14, r18 27f4c: 29 a5 ldd r18, Y+41 ; 0x29 27f4e: 3d a5 ldd r19, Y+45 ; 0x2d 27f50: a8 01 movw r20, r16 27f52: 6d a9 ldd r22, Y+53 ; 0x35 27f54: 7e a9 ldd r23, Y+54 ; 0x36 27f56: 8f a9 ldd r24, Y+55 ; 0x37 27f58: 98 ad ldd r25, Y+56 ; 0x38 27f5a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 27f5e: d7 01 movw r26, r14 27f60: 91 96 adiw r26, 0x21 ; 33 27f62: 6d 93 st X+, r22 27f64: 7d 93 st X+, r23 27f66: 8d 93 st X+, r24 27f68: 9c 93 st X, r25 27f6a: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 27f6c: 62 96 adiw r28, 0x12 ; 18 27f6e: 6c ad ldd r22, Y+60 ; 0x3c 27f70: 7d ad ldd r23, Y+61 ; 0x3d 27f72: 8e ad ldd r24, Y+62 ; 0x3e 27f74: 9f ad ldd r25, Y+63 ; 0x3f 27f76: 62 97 sbiw r28, 0x12 ; 18 27f78: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 27f7c: 29 a5 ldd r18, Y+41 ; 0x29 27f7e: 3d a5 ldd r19, Y+45 ; 0x2d 27f80: a8 01 movw r20, r16 27f82: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 27f86: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 27f8a: f7 01 movw r30, r14 27f8c: 66 ab std Z+54, r22 ; 0x36 27f8e: 77 ab std Z+55, r23 ; 0x37 27f90: 80 af std Z+56, r24 ; 0x38 27f92: 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; 27f94: a3 01 movw r20, r6 27f96: 92 01 movw r18, r4 27f98: 69 ad ldd r22, Y+57 ; 0x39 27f9a: 7a ad ldd r23, Y+58 ; 0x3a 27f9c: 8b ad ldd r24, Y+59 ; 0x3b 27f9e: 9c ad ldd r25, Y+60 ; 0x3c 27fa0: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 27fa4: 69 a7 std Y+41, r22 ; 0x29 27fa6: 7a a7 std Y+42, r23 ; 0x2a 27fa8: 8b a7 std Y+43, r24 ; 0x2b 27faa: 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) 27fac: 2e 96 adiw r28, 0x0e ; 14 27fae: 2c ad ldd r18, Y+60 ; 0x3c 27fb0: 3d ad ldd r19, Y+61 ; 0x3d 27fb2: 4e ad ldd r20, Y+62 ; 0x3e 27fb4: 5f ad ldd r21, Y+63 ; 0x3f 27fb6: 2e 97 sbiw r28, 0x0e ; 14 27fb8: 23 2b or r18, r19 27fba: 24 2b or r18, r20 27fbc: 25 2b or r18, r21 27fbe: 09 f0 breq .+2 ; 0x27fc2 27fc0: b9 c5 rjmp .+2930 ; 0x28b34 27fc2: 8e e6 ldi r24, 0x6E ; 110 27fc4: 82 9d mul r24, r2 27fc6: 80 01 movw r16, r0 27fc8: 83 9d mul r24, r3 27fca: 10 0d add r17, r0 27fcc: 11 24 eor r1, r1 27fce: 02 5a subi r16, 0xA2 ; 162 27fd0: 19 4f sbci r17, 0xF9 ; 249 27fd2: f8 01 movw r30, r16 27fd4: 84 81 ldd r24, Z+4 ; 0x04 27fd6: 95 81 ldd r25, Z+5 ; 0x05 27fd8: a6 81 ldd r26, Z+6 ; 0x06 27fda: b7 81 ldd r27, Z+7 ; 0x07 27fdc: 89 2b or r24, r25 27fde: 8a 2b or r24, r26 27fe0: 8b 2b or r24, r27 27fe2: 09 f0 breq .+2 ; 0x27fe6 27fe4: a7 c5 rjmp .+2894 ; 0x28b34 27fe6: 80 85 ldd r24, Z+8 ; 0x08 27fe8: 91 85 ldd r25, Z+9 ; 0x09 27fea: a2 85 ldd r26, Z+10 ; 0x0a 27fec: b3 85 ldd r27, Z+11 ; 0x0b 27fee: 89 2b or r24, r25 27ff0: 8a 2b or r24, r26 27ff2: 8b 2b or r24, r27 27ff4: 09 f0 breq .+2 ; 0x27ff8 27ff6: 9e c5 rjmp .+2876 ; 0x28b34 { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 27ff8: 20 91 9f 0d lds r18, 0x0D9F ; 0x800d9f 27ffc: 30 91 a0 0d lds r19, 0x0DA0 ; 0x800da0 28000: 40 91 a1 0d lds r20, 0x0DA1 ; 0x800da1 28004: 50 91 a2 0d lds r21, 0x0DA2 ; 0x800da2 28008: 69 a5 ldd r22, Y+41 ; 0x29 2800a: 7a a5 ldd r23, Y+42 ; 0x2a 2800c: 8b a5 ldd r24, Y+43 ; 0x2b 2800e: 9c a5 ldd r25, Y+44 ; 0x2c 28010: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28014: 0f 94 44 a6 call 0x34c88 ; 0x34c88 28018: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 2801c: 2b 01 movw r4, r22 2801e: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 28020: f8 01 movw r30, r16 28022: e4 5b subi r30, 0xB4 ; 180 28024: ff 4f sbci r31, 0xFF ; 255 28026: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 28028: 6a 96 adiw r28, 0x1a ; 26 2802a: 1c ae std Y+60, r1 ; 0x3c 2802c: 1d ae std Y+61, r1 ; 0x3d 2802e: 1e ae std Y+62, r1 ; 0x3e 28030: 1f ae std Y+63, r1 ; 0x3f 28032: 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; 28034: 8e e6 ldi r24, 0x6E ; 110 28036: 82 9d mul r24, r2 28038: 80 01 movw r16, r0 2803a: 83 9d mul r24, r3 2803c: 10 0d add r17, r0 2803e: 11 24 eor r1, r1 28040: 02 5a subi r16, 0xA2 ; 162 28042: 19 4f sbci r17, 0xF9 ; 249 28044: f8 01 movw r30, r16 28046: ee 5b subi r30, 0xBE ; 190 28048: ff 4f sbci r31, 0xFF ; 255 2804a: 40 82 st Z, r4 2804c: 51 82 std Z+1, r5 ; 0x01 2804e: 62 82 std Z+2, r6 ; 0x02 28050: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 28052: c3 01 movw r24, r6 28054: b2 01 movw r22, r4 28056: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 2805a: 6b 01 movw r12, r22 2805c: 7c 01 movw r14, r24 2805e: 29 a5 ldd r18, Y+41 ; 0x29 28060: 3a a5 ldd r19, Y+42 ; 0x2a 28062: 4b a5 ldd r20, Y+43 ; 0x2b 28064: 5c a5 ldd r21, Y+44 ; 0x2c 28066: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 2806a: e1 96 adiw r28, 0x31 ; 49 2806c: 6c af std Y+60, r22 ; 0x3c 2806e: 7d af std Y+61, r23 ; 0x3d 28070: 8e af std Y+62, r24 ; 0x3e 28072: 9f af std Y+63, r25 ; 0x3f 28074: e1 97 sbiw r28, 0x31 ; 49 28076: f8 01 movw r30, r16 28078: 61 ab std Z+49, r22 ; 0x31 2807a: 72 ab std Z+50, r23 ; 0x32 2807c: 83 ab std Z+51, r24 ; 0x33 2807e: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 28080: 2d eb ldi r18, 0xBD ; 189 28082: 37 e3 ldi r19, 0x37 ; 55 28084: 46 e0 ldi r20, 0x06 ; 6 28086: 51 e4 ldi r21, 0x41 ; 65 28088: c7 01 movw r24, r14 2808a: b6 01 movw r22, r12 2808c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28090: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 28094: d8 01 movw r26, r16 28096: 54 96 adiw r26, 0x14 ; 20 28098: 6d 93 st X+, r22 2809a: 7d 93 st X+, r23 2809c: 8d 93 st X+, r24 2809e: 9c 93 st X, r25 280a0: 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; 280a2: 91 96 adiw r26, 0x21 ; 33 280a4: bc 91 ld r27, X 280a6: 27 96 adiw r28, 0x07 ; 7 280a8: bf af std Y+63, r27 ; 0x3f 280aa: 27 97 sbiw r28, 0x07 ; 7 280ac: f8 01 movw r30, r16 280ae: f2 a1 ldd r31, Z+34 ; 0x22 280b0: 2b 96 adiw r28, 0x0b ; 11 280b2: ff af std Y+63, r31 ; 0x3f 280b4: 2b 97 sbiw r28, 0x0b ; 11 280b6: d8 01 movw r26, r16 280b8: 93 96 adiw r26, 0x23 ; 35 280ba: bc 91 ld r27, X 280bc: 2f 96 adiw r28, 0x0f ; 15 280be: bf af std Y+63, r27 ; 0x3f 280c0: 2f 97 sbiw r28, 0x0f ; 15 280c2: f8 01 movw r30, r16 280c4: f4 a1 ldd r31, Z+36 ; 0x24 280c6: 63 96 adiw r28, 0x13 ; 19 280c8: ff af std Y+63, r31 ; 0x3f 280ca: 63 97 sbiw r28, 0x13 ; 19 280cc: 2f ea ldi r18, 0xAF ; 175 280ce: 3d e0 ldi r19, 0x0D ; 13 280d0: ed 96 adiw r28, 0x3d ; 61 280d2: 3f af std Y+63, r19 ; 0x3f 280d4: 2e af std Y+62, r18 ; 0x3e 280d6: ed 97 sbiw r28, 0x3d ; 61 280d8: 6e 96 adiw r28, 0x1e ; 30 280da: 4e ac ldd r4, Y+62 ; 0x3e 280dc: 5f ac ldd r5, Y+63 ; 0x3f 280de: 6e 97 sbiw r28, 0x1e ; 30 280e0: 30 e1 ldi r19, 0x10 ; 16 280e2: 43 0e add r4, r19 280e4: 51 1c adc r5, r1 280e6: 0f ea ldi r16, 0xAF ; 175 280e8: 1d e0 ldi r17, 0x0D ; 13 280ea: 6e 96 adiw r28, 0x1e ; 30 280ec: 6e ac ldd r6, Y+62 ; 0x3e 280ee: 7f ac ldd r7, Y+63 ; 0x3f 280f0: 6e 97 sbiw r28, 0x1e ; 30 280f2: 27 96 adiw r28, 0x07 ; 7 280f4: 4f ad ldd r20, Y+63 ; 0x3f 280f6: 27 97 sbiw r28, 0x07 ; 7 280f8: 49 a7 std Y+41, r20 ; 0x29 280fa: 2b 96 adiw r28, 0x0b ; 11 280fc: 5f ad ldd r21, Y+63 ; 0x3f 280fe: 2b 97 sbiw r28, 0x0b ; 11 28100: 5d a7 std Y+45, r21 ; 0x2d 28102: b9 af std Y+57, r27 ; 0x39 28104: f9 ab std Y+49, r31 ; 0x31 bool limited = false; 28106: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 28108: d3 01 movw r26, r6 2810a: 8d 90 ld r8, X+ 2810c: 9d 90 ld r9, X+ 2810e: ad 90 ld r10, X+ 28110: bd 90 ld r11, X+ 28112: 3d 01 movw r6, r26 28114: e8 94 clt 28116: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 28118: f8 01 movw r30, r16 2811a: c1 90 ld r12, Z+ 2811c: d1 90 ld r13, Z+ 2811e: e1 90 ld r14, Z+ 28120: f1 90 ld r15, Z+ 28122: 8f 01 movw r16, r30 28124: a5 01 movw r20, r10 28126: 94 01 movw r18, r8 28128: c7 01 movw r24, r14 2812a: b6 01 movw r22, r12 2812c: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 28130: 87 ff sbrs r24, 7 28132: 3a c0 rjmp .+116 ; 0x281a8 // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 28134: fd a9 ldd r31, Y+53 ; 0x35 28136: ff 23 and r31, r31 28138: 09 f4 brne .+2 ; 0x2813c 2813a: 7e c6 rjmp .+3324 ; 0x28e38 // 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; 2813c: 29 a5 ldd r18, Y+41 ; 0x29 2813e: 3d a5 ldd r19, Y+45 ; 0x2d 28140: 49 ad ldd r20, Y+57 ; 0x39 28142: 59 a9 ldd r21, Y+49 ; 0x31 28144: c5 01 movw r24, r10 28146: b4 01 movw r22, r8 28148: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2814c: 4b 01 movw r8, r22 2814e: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 28150: a7 01 movw r20, r14 28152: 96 01 movw r18, r12 28154: 27 96 adiw r28, 0x07 ; 7 28156: 6f ad ldd r22, Y+63 ; 0x3f 28158: 27 97 sbiw r28, 0x07 ; 7 2815a: 2b 96 adiw r28, 0x0b ; 11 2815c: 7f ad ldd r23, Y+63 ; 0x3f 2815e: 2b 97 sbiw r28, 0x0b ; 11 28160: 2f 96 adiw r28, 0x0f ; 15 28162: 8f ad ldd r24, Y+63 ; 0x3f 28164: 2f 97 sbiw r28, 0x0f ; 15 28166: 63 96 adiw r28, 0x13 ; 19 28168: 9f ad ldd r25, Y+63 ; 0x3f 2816a: 63 97 sbiw r28, 0x13 ; 19 2816c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28170: 6b 01 movw r12, r22 28172: 7c 01 movw r14, r24 if (jerk > mjerk) { 28174: ac 01 movw r20, r24 28176: 9b 01 movw r18, r22 28178: c5 01 movw r24, r10 2817a: b4 01 movw r22, r8 2817c: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 28180: 18 16 cp r1, r24 28182: 94 f4 brge .+36 ; 0x281a8 safe_speed *= mjerk / jerk; 28184: a5 01 movw r20, r10 28186: 94 01 movw r18, r8 28188: c7 01 movw r24, r14 2818a: b6 01 movw r22, r12 2818c: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 28190: 9b 01 movw r18, r22 28192: ac 01 movw r20, r24 28194: 69 a5 ldd r22, Y+41 ; 0x29 28196: 7d a5 ldd r23, Y+45 ; 0x2d 28198: 89 ad ldd r24, Y+57 ; 0x39 2819a: 99 a9 ldd r25, Y+49 ; 0x31 2819c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 281a0: 69 a7 std Y+41, r22 ; 0x29 281a2: 7d a7 std Y+45, r23 ; 0x2d 281a4: 89 af std Y+57, r24 ; 0x39 281a6: 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) { 281a8: 46 14 cp r4, r6 281aa: 57 04 cpc r5, r7 281ac: 09 f0 breq .+2 ; 0x281b0 281ae: ac cf rjmp .-168 ; 0x28108 } } } // Reset the block flag. block->flag = 0; 281b0: 8e e6 ldi r24, 0x6E ; 110 281b2: 82 9d mul r24, r2 281b4: f0 01 movw r30, r0 281b6: 83 9d mul r24, r3 281b8: f0 0d add r31, r0 281ba: 11 24 eor r1, r1 281bc: e2 5a subi r30, 0xA2 ; 162 281be: f9 4f sbci r31, 0xF9 ; 249 281c0: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 281c2: 80 91 20 04 lds r24, 0x0420 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.443> 281c6: 88 23 and r24, r24 281c8: 21 f0 breq .+8 ; 0x281d2 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 281ca: 80 e1 ldi r24, 0x10 ; 16 281cc: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 281ce: 10 92 20 04 sts 0x0420, r1 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.443> 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) { 281d2: 3d ad ldd r19, Y+61 ; 0x3d 281d4: 32 30 cpi r19, 0x02 ; 2 281d6: 08 f4 brcc .+2 ; 0x281da 281d8: 8f c6 rjmp .+3358 ; 0x28ef8 281da: 40 91 22 04 lds r20, 0x0422 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.444> 281de: 6b 96 adiw r28, 0x1b ; 27 281e0: 4f af std Y+63, r20 ; 0x3f 281e2: 6b 97 sbiw r28, 0x1b ; 27 281e4: 50 91 23 04 lds r21, 0x0423 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.444+0x1> 281e8: 6f 96 adiw r28, 0x1f ; 31 281ea: 5f af std Y+63, r21 ; 0x3f 281ec: 6f 97 sbiw r28, 0x1f ; 31 281ee: 00 91 24 04 lds r16, 0x0424 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.444+0x2> 281f2: 10 91 25 04 lds r17, 0x0425 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.444+0x3> 281f6: 27 e1 ldi r18, 0x17 ; 23 281f8: 37 eb ldi r19, 0xB7 ; 183 281fa: 41 ed ldi r20, 0xD1 ; 209 281fc: 58 e3 ldi r21, 0x38 ; 56 281fe: 6b 96 adiw r28, 0x1b ; 27 28200: 6f ad ldd r22, Y+63 ; 0x3f 28202: 6b 97 sbiw r28, 0x1b ; 27 28204: 6f 96 adiw r28, 0x1f ; 31 28206: 7f ad ldd r23, Y+63 ; 0x3f 28208: 6f 97 sbiw r28, 0x1f ; 31 2820a: c8 01 movw r24, r16 2820c: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 28210: 18 16 cp r1, r24 28212: 0c f0 brlt .+2 ; 0x28216 28214: 71 c6 rjmp .+3298 ; 0x28ef8 // 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); 28216: 6b 96 adiw r28, 0x1b ; 27 28218: 2f ad ldd r18, Y+63 ; 0x3f 2821a: 6b 97 sbiw r28, 0x1b ; 27 2821c: 6f 96 adiw r28, 0x1f ; 31 2821e: 3f ad ldd r19, Y+63 ; 0x3f 28220: 6f 97 sbiw r28, 0x1f ; 31 28222: a8 01 movw r20, r16 28224: 27 96 adiw r28, 0x07 ; 7 28226: 6f ad ldd r22, Y+63 ; 0x3f 28228: 27 97 sbiw r28, 0x07 ; 7 2822a: 2b 96 adiw r28, 0x0b ; 11 2822c: 7f ad ldd r23, Y+63 ; 0x3f 2822e: 2b 97 sbiw r28, 0x0b ; 11 28230: 2f 96 adiw r28, 0x0f ; 15 28232: 8f ad ldd r24, Y+63 ; 0x3f 28234: 2f 97 sbiw r28, 0x0f ; 15 28236: 63 96 adiw r28, 0x13 ; 19 28238: 9f ad ldd r25, Y+63 ; 0x3f 2823a: 63 97 sbiw r28, 0x13 ; 19 2823c: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 28240: 87 ff sbrs r24, 7 28242: 01 c6 rjmp .+3074 ; 0x28e46 28244: 6b 96 adiw r28, 0x1b ; 27 28246: 2f ad ldd r18, Y+63 ; 0x3f 28248: 6b 97 sbiw r28, 0x1b ; 27 2824a: 6f 96 adiw r28, 0x1f ; 31 2824c: 3f ad ldd r19, Y+63 ; 0x3f 2824e: 6f 97 sbiw r28, 0x1f ; 31 28250: a8 01 movw r20, r16 28252: 27 96 adiw r28, 0x07 ; 7 28254: 6f ad ldd r22, Y+63 ; 0x3f 28256: 27 97 sbiw r28, 0x07 ; 7 28258: 2b 96 adiw r28, 0x0b ; 11 2825a: 7f ad ldd r23, Y+63 ; 0x3f 2825c: 2b 97 sbiw r28, 0x0b ; 11 2825e: 2f 96 adiw r28, 0x0f ; 15 28260: 8f ad ldd r24, Y+63 ; 0x3f 28262: 2f 97 sbiw r28, 0x0f ; 15 28264: 63 96 adiw r28, 0x13 ; 19 28266: 9f ad ldd r25, Y+63 ; 0x3f 28268: 63 97 sbiw r28, 0x13 ; 19 2826a: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 2826e: eb 96 adiw r28, 0x3b ; 59 28270: 6c af std Y+60, r22 ; 0x3c 28272: 7d af std Y+61, r23 ; 0x3d 28274: 8e af std Y+62, r24 ; 0x3e 28276: 9f af std Y+63, r25 ; 0x3f 28278: 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; 2827a: 27 96 adiw r28, 0x07 ; 7 2827c: 8f ad ldd r24, Y+63 ; 0x3f 2827e: 27 97 sbiw r28, 0x07 ; 7 28280: 8d af std Y+61, r24 ; 0x3d 28282: 2b 96 adiw r28, 0x0b ; 11 28284: 9f ad ldd r25, Y+63 ; 0x3f 28286: 2b 97 sbiw r28, 0x0b ; 11 28288: 9d ab std Y+53, r25 ; 0x35 2828a: 2f 96 adiw r28, 0x0f ; 15 2828c: af ad ldd r26, Y+63 ; 0x3f 2828e: 2f 97 sbiw r28, 0x0f ; 15 28290: ae af std Y+62, r26 ; 0x3e 28292: 63 96 adiw r28, 0x13 ; 19 28294: bf ad ldd r27, Y+63 ; 0x3f 28296: 63 97 sbiw r28, 0x13 ; 19 28298: 23 96 adiw r28, 0x03 ; 3 2829a: bf af std Y+63, r27 ; 0x3f 2829c: 23 97 sbiw r28, 0x03 ; 3 2829e: 26 e2 ldi r18, 0x26 ; 38 282a0: 34 e0 ldi r19, 0x04 ; 4 282a2: e7 96 adiw r28, 0x37 ; 55 282a4: 3f af std Y+63, r19 ; 0x3f 282a6: 2e af std Y+62, r18 ; 0x3e 282a8: e7 97 sbiw r28, 0x37 ; 55 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 282aa: 41 2c mov r4, r1 282ac: 51 2c mov r5, r1 282ae: 30 e8 ldi r19, 0x80 ; 128 282b0: 63 2e mov r6, r19 282b2: 3f e3 ldi r19, 0x3F ; 63 282b4: 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]; 282b6: e7 96 adiw r28, 0x37 ; 55 282b8: ae ad ldd r26, Y+62 ; 0x3e 282ba: bf ad ldd r27, Y+63 ; 0x3f 282bc: e7 97 sbiw r28, 0x37 ; 55 282be: 8d 90 ld r8, X+ 282c0: 9d 90 ld r9, X+ 282c2: ad 90 ld r10, X+ 282c4: bd 90 ld r11, X+ 282c6: e7 96 adiw r28, 0x37 ; 55 282c8: bf af std Y+63, r27 ; 0x3f 282ca: ae af std Y+62, r26 ; 0x3e 282cc: e7 97 sbiw r28, 0x37 ; 55 float v_entry = current_speed [axis]; 282ce: 6e 96 adiw r28, 0x1e ; 30 282d0: ee ad ldd r30, Y+62 ; 0x3e 282d2: ff ad ldd r31, Y+63 ; 0x3f 282d4: 6e 97 sbiw r28, 0x1e ; 30 282d6: c1 90 ld r12, Z+ 282d8: d1 90 ld r13, Z+ 282da: e1 90 ld r14, Z+ 282dc: f1 90 ld r15, Z+ 282de: 6e 96 adiw r28, 0x1e ; 30 282e0: ff af std Y+63, r31 ; 0x3f 282e2: ee af std Y+62, r30 ; 0x3e 282e4: 6e 97 sbiw r28, 0x1e ; 30 if (prev_speed_larger) 282e6: 6b 96 adiw r28, 0x1b ; 27 282e8: 2f ad ldd r18, Y+63 ; 0x3f 282ea: 6b 97 sbiw r28, 0x1b ; 27 282ec: 6f 96 adiw r28, 0x1f ; 31 282ee: 3f ad ldd r19, Y+63 ; 0x3f 282f0: 6f 97 sbiw r28, 0x1f ; 31 282f2: a8 01 movw r20, r16 282f4: 27 96 adiw r28, 0x07 ; 7 282f6: 6f ad ldd r22, Y+63 ; 0x3f 282f8: 27 97 sbiw r28, 0x07 ; 7 282fa: 2b 96 adiw r28, 0x0b ; 11 282fc: 7f ad ldd r23, Y+63 ; 0x3f 282fe: 2b 97 sbiw r28, 0x0b ; 11 28300: 2f 96 adiw r28, 0x0f ; 15 28302: 8f ad ldd r24, Y+63 ; 0x3f 28304: 2f 97 sbiw r28, 0x0f ; 15 28306: 63 96 adiw r28, 0x13 ; 19 28308: 9f ad ldd r25, Y+63 ; 0x3f 2830a: 63 97 sbiw r28, 0x13 ; 19 2830c: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 28310: 87 ff sbrs r24, 7 28312: 0c c0 rjmp .+24 ; 0x2832c v_exit *= smaller_speed_factor; 28314: eb 96 adiw r28, 0x3b ; 59 28316: 2c ad ldd r18, Y+60 ; 0x3c 28318: 3d ad ldd r19, Y+61 ; 0x3d 2831a: 4e ad ldd r20, Y+62 ; 0x3e 2831c: 5f ad ldd r21, Y+63 ; 0x3f 2831e: eb 97 sbiw r28, 0x3b ; 59 28320: c5 01 movw r24, r10 28322: b4 01 movw r22, r8 28324: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28328: 4b 01 movw r8, r22 2832a: 5c 01 movw r10, r24 if (limited) { 2832c: a1 96 adiw r28, 0x21 ; 33 2832e: ff ad ldd r31, Y+63 ; 0x3f 28330: a1 97 sbiw r28, 0x21 ; 33 28332: ff 23 and r31, r31 28334: 81 f0 breq .+32 ; 0x28356 v_exit *= v_factor; 28336: a3 01 movw r20, r6 28338: 92 01 movw r18, r4 2833a: c5 01 movw r24, r10 2833c: b4 01 movw r22, r8 2833e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28342: 4b 01 movw r8, r22 28344: 5c 01 movw r10, r24 v_entry *= v_factor; 28346: a3 01 movw r20, r6 28348: 92 01 movw r18, r4 2834a: c7 01 movw r24, r14 2834c: b6 01 movw r22, r12 2834e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28352: 6b 01 movw r12, r22 28354: 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) ? 28356: a7 01 movw r20, r14 28358: 96 01 movw r18, r12 2835a: c5 01 movw r24, r10 2835c: b4 01 movw r22, r8 2835e: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 28362: 20 e0 ldi r18, 0x00 ; 0 28364: 30 e0 ldi r19, 0x00 ; 0 28366: 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) ? 28368: 18 16 cp r1, r24 2836a: 0c f0 brlt .+2 ; 0x2836e 2836c: a3 c5 rjmp .+2886 ; 0x28eb4 ((v_entry > 0.f || v_exit < 0.f) ? 2836e: c7 01 movw r24, r14 28370: b6 01 movw r22, r12 28372: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 28376: 18 16 cp r1, r24 28378: 4c f0 brlt .+18 ; 0x2838c 2837a: 20 e0 ldi r18, 0x00 ; 0 2837c: 30 e0 ldi r19, 0x00 ; 0 2837e: a9 01 movw r20, r18 28380: c5 01 movw r24, r10 28382: b4 01 movw r22, r8 28384: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 28388: 87 ff sbrs r24, 7 2838a: 85 c5 rjmp .+2826 ; 0x28e96 2838c: a7 01 movw r20, r14 2838e: 96 01 movw r18, r12 28390: c5 01 movw r24, r10 28392: 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) ? 28394: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 28398: 6b 01 movw r12, r22 2839a: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 2839c: ed 96 adiw r28, 0x3d ; 61 2839e: ae ad ldd r26, Y+62 ; 0x3e 283a0: bf ad ldd r27, Y+63 ; 0x3f 283a2: ed 97 sbiw r28, 0x3d ; 61 283a4: 8d 90 ld r8, X+ 283a6: 9d 90 ld r9, X+ 283a8: ad 90 ld r10, X+ 283aa: bd 90 ld r11, X+ 283ac: ed 96 adiw r28, 0x3d ; 61 283ae: bf af std Y+63, r27 ; 0x3f 283b0: ae af std Y+62, r26 ; 0x3e 283b2: ed 97 sbiw r28, 0x3d ; 61 283b4: a5 01 movw r20, r10 283b6: 94 01 movw r18, r8 283b8: c7 01 movw r24, r14 283ba: b6 01 movw r22, r12 283bc: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 283c0: 18 16 cp r1, r24 283c2: 94 f4 brge .+36 ; 0x283e8 v_factor *= cs.max_jerk[axis] / jerk; 283c4: a7 01 movw r20, r14 283c6: 96 01 movw r18, r12 283c8: c5 01 movw r24, r10 283ca: b4 01 movw r22, r8 283cc: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 283d0: 9b 01 movw r18, r22 283d2: ac 01 movw r20, r24 283d4: c3 01 movw r24, r6 283d6: b2 01 movw r22, r4 283d8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 283dc: 2b 01 movw r4, r22 283de: 3c 01 movw r6, r24 limited = true; 283e0: b1 e0 ldi r27, 0x01 ; 1 283e2: a1 96 adiw r28, 0x21 ; 33 283e4: bf af std Y+63, r27 ; 0x3f 283e6: 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) { 283e8: e6 e3 ldi r30, 0x36 ; 54 283ea: f4 e0 ldi r31, 0x04 ; 4 283ec: e7 96 adiw r28, 0x37 ; 55 283ee: 2e ad ldd r18, Y+62 ; 0x3e 283f0: 3f ad ldd r19, Y+63 ; 0x3f 283f2: e7 97 sbiw r28, 0x37 ; 55 283f4: e2 17 cp r30, r18 283f6: f3 07 cpc r31, r19 283f8: 09 f0 breq .+2 ; 0x283fc 283fa: 5d cf rjmp .-326 ; 0x282b6 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 283fc: a1 96 adiw r28, 0x21 ; 33 283fe: 3f ad ldd r19, Y+63 ; 0x3f 28400: a1 97 sbiw r28, 0x21 ; 33 28402: 33 23 and r19, r19 28404: 81 f0 breq .+32 ; 0x28426 vmax_junction *= v_factor; 28406: a3 01 movw r20, r6 28408: 92 01 movw r18, r4 2840a: 6d ad ldd r22, Y+61 ; 0x3d 2840c: 7d a9 ldd r23, Y+53 ; 0x35 2840e: 8e ad ldd r24, Y+62 ; 0x3e 28410: 23 96 adiw r28, 0x03 ; 3 28412: 9f ad ldd r25, Y+63 ; 0x3f 28414: 23 97 sbiw r28, 0x03 ; 3 28416: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2841a: 6d af std Y+61, r22 ; 0x3d 2841c: 7d ab std Y+53, r23 ; 0x35 2841e: 8e af std Y+62, r24 ; 0x3e 28420: 23 96 adiw r28, 0x03 ; 3 28422: 9f af std Y+63, r25 ; 0x3f 28424: 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; 28426: 24 ea ldi r18, 0xA4 ; 164 28428: 30 e7 ldi r19, 0x70 ; 112 2842a: 4d e7 ldi r20, 0x7D ; 125 2842c: 5f e3 ldi r21, 0x3F ; 63 2842e: 6d ad ldd r22, Y+61 ; 0x3d 28430: 7d a9 ldd r23, Y+53 ; 0x35 28432: 8e ad ldd r24, Y+62 ; 0x3e 28434: 23 96 adiw r28, 0x03 ; 3 28436: 9f ad ldd r25, Y+63 ; 0x3f 28438: 23 97 sbiw r28, 0x03 ; 3 2843a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2843e: 6b 01 movw r12, r22 28440: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 28442: ac 01 movw r20, r24 28444: 9b 01 movw r18, r22 28446: 60 91 a3 04 lds r22, 0x04A3 ; 0x8004a3 2844a: 70 91 a4 04 lds r23, 0x04A4 ; 0x8004a4 2844e: 80 91 a5 04 lds r24, 0x04A5 ; 0x8004a5 28452: 90 91 a6 04 lds r25, 0x04A6 ; 0x8004a6 28456: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2845a: 18 16 cp r1, r24 2845c: fc f4 brge .+62 ; 0x2849c 2845e: 29 a5 ldd r18, Y+41 ; 0x29 28460: 3d a5 ldd r19, Y+45 ; 0x2d 28462: 49 ad ldd r20, Y+57 ; 0x39 28464: 59 a9 ldd r21, Y+49 ; 0x31 28466: c7 01 movw r24, r14 28468: b6 01 movw r22, r12 2846a: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2846e: 87 ff sbrs r24, 7 28470: 15 c0 rjmp .+42 ; 0x2849c // 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; 28472: 8e e6 ldi r24, 0x6E ; 110 28474: 82 9d mul r24, r2 28476: f0 01 movw r30, r0 28478: 83 9d mul r24, r3 2847a: f0 0d add r31, r0 2847c: 11 24 eor r1, r1 2847e: e2 5a subi r30, 0xA2 ; 162 28480: f9 4f sbci r31, 0xF9 ; 249 28482: 85 a9 ldd r24, Z+53 ; 0x35 28484: 84 60 ori r24, 0x04 ; 4 28486: 85 ab std Z+53, r24 ; 0x35 28488: 49 a5 ldd r20, Y+41 ; 0x29 2848a: 4d af std Y+61, r20 ; 0x3d 2848c: 5d a5 ldd r21, Y+45 ; 0x2d 2848e: 5d ab std Y+53, r21 ; 0x35 28490: 89 ad ldd r24, Y+57 ; 0x39 28492: 8e af std Y+62, r24 ; 0x3e 28494: 99 a9 ldd r25, Y+49 ; 0x31 28496: 23 96 adiw r28, 0x03 ; 3 28498: 9f af std Y+63, r25 ; 0x3f 2849a: 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; 2849c: 8e e6 ldi r24, 0x6E ; 110 2849e: 82 9d mul r24, r2 284a0: 80 01 movw r16, r0 284a2: 83 9d mul r24, r3 284a4: 10 0d add r17, r0 284a6: 11 24 eor r1, r1 284a8: 02 5a subi r16, 0xA2 ; 162 284aa: 19 4f sbci r17, 0xF9 ; 249 284ac: 8d ad ldd r24, Y+61 ; 0x3d 284ae: 9d a9 ldd r25, Y+53 ; 0x35 284b0: ae ad ldd r26, Y+62 ; 0x3e 284b2: 23 96 adiw r28, 0x03 ; 3 284b4: bf ad ldd r27, Y+63 ; 0x3f 284b6: 23 97 sbiw r28, 0x03 ; 3 284b8: f8 01 movw r30, r16 284ba: 81 a7 std Z+41, r24 ; 0x29 284bc: 92 a7 std Z+42, r25 ; 0x2a 284be: a3 a7 std Z+43, r26 ; 0x2b 284c0: 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); 284c2: 29 a5 ldd r18, Y+41 ; 0x29 284c4: 3d a5 ldd r19, Y+45 ; 0x2d 284c6: 49 ad ldd r20, Y+57 ; 0x39 284c8: 59 a9 ldd r21, Y+49 ; 0x31 284ca: 69 a5 ldd r22, Y+41 ; 0x29 284cc: 7d a5 ldd r23, Y+45 ; 0x2d 284ce: 89 ad ldd r24, Y+57 ; 0x39 284d0: 99 a9 ldd r25, Y+49 ; 0x31 284d2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 284d6: 6b 01 movw r12, r22 284d8: 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); 284da: e1 96 adiw r28, 0x31 ; 49 284dc: 6c ad ldd r22, Y+60 ; 0x3c 284de: 7d ad ldd r23, Y+61 ; 0x3d 284e0: 8e ad ldd r24, Y+62 ; 0x3e 284e2: 9f ad ldd r25, Y+63 ; 0x3f 284e4: e1 97 sbiw r28, 0x31 ; 49 284e6: 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); 284e8: 9b 01 movw r18, r22 284ea: ac 01 movw r20, r24 284ec: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 284f0: d8 01 movw r26, r16 284f2: 9d 96 adiw r26, 0x2d ; 45 284f4: 2d 91 ld r18, X+ 284f6: 3d 91 ld r19, X+ 284f8: 4d 91 ld r20, X+ 284fa: 5c 91 ld r21, X 284fc: d0 97 sbiw r26, 0x30 ; 48 284fe: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28502: 9b 01 movw r18, r22 28504: ac 01 movw r20, r24 28506: c7 01 movw r24, r14 28508: b6 01 movw r22, r12 2850a: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2850e: 0f 94 34 a9 call 0x35268 ; 0x35268 28512: d6 2e mov r13, r22 28514: e7 2e mov r14, r23 28516: 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); 28518: 2d ad ldd r18, Y+61 ; 0x3d 2851a: 3d a9 ldd r19, Y+53 ; 0x35 2851c: 4e ad ldd r20, Y+62 ; 0x3e 2851e: 23 96 adiw r28, 0x03 ; 3 28520: 5f ad ldd r21, Y+63 ; 0x3f 28522: 23 97 sbiw r28, 0x03 ; 3 28524: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 28528: 18 16 cp r1, r24 2852a: 34 f0 brlt .+12 ; 0x28538 2852c: dd ae std Y+61, r13 ; 0x3d 2852e: ed aa std Y+53, r14 ; 0x35 28530: 0e af std Y+62, r16 ; 0x3e 28532: 23 96 adiw r28, 0x03 ; 3 28534: 1f af std Y+63, r17 ; 0x3f 28536: 23 97 sbiw r28, 0x03 ; 3 28538: 8e e6 ldi r24, 0x6E ; 110 2853a: 82 9d mul r24, r2 2853c: f0 01 movw r30, r0 2853e: 83 9d mul r24, r3 28540: f0 0d add r31, r0 28542: 11 24 eor r1, r1 28544: e2 5a subi r30, 0xA2 ; 162 28546: f9 4f sbci r31, 0xF9 ; 249 28548: 8d ad ldd r24, Y+61 ; 0x3d 2854a: 9d a9 ldd r25, Y+53 ; 0x35 2854c: ae ad ldd r26, Y+62 ; 0x3e 2854e: 23 96 adiw r28, 0x03 ; 3 28550: bf ad ldd r27, Y+63 ; 0x3f 28552: 23 97 sbiw r28, 0x03 ; 3 28554: 85 a3 std Z+37, r24 ; 0x25 28556: 96 a3 std Z+38, r25 ; 0x26 28558: a7 a3 std Z+39, r26 ; 0x27 2855a: 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; 2855c: f5 a8 ldd r15, Z+53 ; 0x35 2855e: 2d 2d mov r18, r13 28560: 3e 2d mov r19, r14 28562: a8 01 movw r20, r16 28564: 27 96 adiw r28, 0x07 ; 7 28566: 6f ad ldd r22, Y+63 ; 0x3f 28568: 27 97 sbiw r28, 0x07 ; 7 2856a: 2b 96 adiw r28, 0x0b ; 11 2856c: 7f ad ldd r23, Y+63 ; 0x3f 2856e: 2b 97 sbiw r28, 0x0b ; 11 28570: 2f 96 adiw r28, 0x0f ; 15 28572: 8f ad ldd r24, Y+63 ; 0x3f 28574: 2f 97 sbiw r28, 0x0f ; 15 28576: 63 96 adiw r28, 0x13 ; 19 28578: 9f ad ldd r25, Y+63 ; 0x3f 2857a: 63 97 sbiw r28, 0x13 ; 19 2857c: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 28580: 18 16 cp r1, r24 28582: 0c f4 brge .+2 ; 0x28586 28584: cf c4 rjmp .+2462 ; 0x28f24 28586: 83 e0 ldi r24, 0x03 ; 3 28588: 9e e6 ldi r25, 0x6E ; 110 2858a: 92 9d mul r25, r2 2858c: 80 01 movw r16, r0 2858e: 93 9d mul r25, r3 28590: 10 0d add r17, r0 28592: 11 24 eor r1, r1 28594: 02 5a subi r16, 0xA2 ; 162 28596: 19 4f sbci r17, 0xF9 ; 249 28598: f8 2a or r15, r24 2859a: f8 01 movw r30, r16 2859c: 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[] 2859e: 80 e1 ldi r24, 0x10 ; 16 285a0: fe 01 movw r30, r28 285a2: 71 96 adiw r30, 0x11 ; 17 285a4: a6 e2 ldi r26, 0x26 ; 38 285a6: b4 e0 ldi r27, 0x04 ; 4 285a8: 01 90 ld r0, Z+ 285aa: 0d 92 st X+, r0 285ac: 8a 95 dec r24 285ae: e1 f7 brne .-8 ; 0x285a8 previous_nominal_speed = block->nominal_speed; 285b0: 27 96 adiw r28, 0x07 ; 7 285b2: 8f ad ldd r24, Y+63 ; 0x3f 285b4: 27 97 sbiw r28, 0x07 ; 7 285b6: 2b 96 adiw r28, 0x0b ; 11 285b8: 9f ad ldd r25, Y+63 ; 0x3f 285ba: 2b 97 sbiw r28, 0x0b ; 11 285bc: 2f 96 adiw r28, 0x0f ; 15 285be: af ad ldd r26, Y+63 ; 0x3f 285c0: 2f 97 sbiw r28, 0x0f ; 15 285c2: 63 96 adiw r28, 0x13 ; 19 285c4: bf ad ldd r27, Y+63 ; 0x3f 285c6: 63 97 sbiw r28, 0x13 ; 19 285c8: 80 93 22 04 sts 0x0422, r24 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.444> 285cc: 90 93 23 04 sts 0x0423, r25 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.444+0x1> 285d0: a0 93 24 04 sts 0x0424, r26 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.444+0x2> 285d4: b0 93 25 04 sts 0x0425, r27 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.444+0x3> previous_safe_speed = safe_speed; 285d8: 89 a5 ldd r24, Y+41 ; 0x29 285da: 9d a5 ldd r25, Y+45 ; 0x2d 285dc: a9 ad ldd r26, Y+57 ; 0x39 285de: b9 a9 ldd r27, Y+49 ; 0x31 285e0: 80 93 a3 04 sts 0x04A3, r24 ; 0x8004a3 285e4: 90 93 a4 04 sts 0x04A4, r25 ; 0x8004a4 285e8: a0 93 a5 04 sts 0x04A5, r26 ; 0x8004a5 285ec: 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; 285f0: d8 01 movw r26, r16 285f2: d6 96 adiw r26, 0x36 ; 54 285f4: 6d 91 ld r22, X+ 285f6: 7d 91 ld r23, X+ 285f8: 8d 91 ld r24, X+ 285fa: 9c 91 ld r25, X 285fc: d9 97 sbiw r26, 0x39 ; 57 285fe: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 28602: 27 96 adiw r28, 0x07 ; 7 28604: 2f ad ldd r18, Y+63 ; 0x3f 28606: 27 97 sbiw r28, 0x07 ; 7 28608: 2b 96 adiw r28, 0x0b ; 11 2860a: 3f ad ldd r19, Y+63 ; 0x3f 2860c: 2b 97 sbiw r28, 0x0b ; 11 2860e: 2f 96 adiw r28, 0x0f ; 15 28610: 4f ad ldd r20, Y+63 ; 0x3f 28612: 2f 97 sbiw r28, 0x0f ; 15 28614: 63 96 adiw r28, 0x13 ; 19 28616: 5f ad ldd r21, Y+63 ; 0x3f 28618: 63 97 sbiw r28, 0x13 ; 19 2861a: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 2861e: 2b 01 movw r4, r22 28620: 3c 01 movw r6, r24 28622: f8 01 movw r30, r16 28624: e8 5b subi r30, 0xB8 ; 184 28626: ff 4f sbci r31, 0xFF ; 255 28628: 40 82 st Z, r4 2862a: 51 82 std Z+1, r5 ; 0x01 2862c: 62 82 std Z+2, r6 ; 0x02 2862e: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 28630: 34 96 adiw r30, 0x04 ; 4 28632: 80 81 ld r24, Z 28634: 88 23 and r24, r24 28636: 09 f4 brne .+2 ; 0x2863a 28638: 89 c0 rjmp .+274 ; 0x2874c // 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)) 2863a: 20 91 a7 04 lds r18, 0x04A7 ; 0x8004a7 2863e: 30 91 a8 04 lds r19, 0x04A8 ; 0x8004a8 28642: 40 91 a9 04 lds r20, 0x04A9 ; 0x8004a9 28646: 50 91 aa 04 lds r21, 0x04AA ; 0x8004aa 2864a: 6a 96 adiw r28, 0x1a ; 26 2864c: 6c ad ldd r22, Y+60 ; 0x3c 2864e: 7d ad ldd r23, Y+61 ; 0x3d 28650: 8e ad ldd r24, Y+62 ; 0x3e 28652: 9f ad ldd r25, Y+63 ; 0x3f 28654: 6a 97 sbiw r28, 0x1a ; 26 28656: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2865a: 4b 01 movw r8, r22 2865c: 5c 01 movw r10, r24 2865e: c0 90 77 0d lds r12, 0x0D77 ; 0x800d77 28662: d0 90 78 0d lds r13, 0x0D78 ; 0x800d78 28666: e0 90 79 0d lds r14, 0x0D79 ; 0x800d79 2866a: f0 90 7a 0d lds r15, 0x0D7A ; 0x800d7a block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 2866e: 0c 5a subi r16, 0xAC ; 172 28670: 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)) 28672: a7 01 movw r20, r14 28674: 96 01 movw r18, r12 28676: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 2867a: a3 01 movw r20, r6 2867c: 92 01 movw r18, r4 2867e: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 28682: f8 01 movw r30, r16 28684: 60 83 st Z, r22 28686: 71 83 std Z+1, r23 ; 0x01 28688: 82 83 std Z+2, r24 ; 0x02 2868a: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 2868c: 20 e0 ldi r18, 0x00 ; 0 2868e: 30 e0 ldi r19, 0x00 ; 0 28690: a9 01 movw r20, r18 28692: 6a 96 adiw r28, 0x1a ; 26 28694: 6c ad ldd r22, Y+60 ; 0x3c 28696: 7d ad ldd r23, Y+61 ; 0x3d 28698: 8e ad ldd r24, Y+62 ; 0x3e 2869a: 9f ad ldd r25, Y+63 ; 0x3f 2869c: 6a 97 sbiw r28, 0x1a ; 26 2869e: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 286a2: 18 16 cp r1, r24 286a4: 0c f0 brlt .+2 ; 0x286a8 286a6: 40 c4 rjmp .+2176 ; 0x28f28 advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 286a8: a5 01 movw r20, r10 286aa: 94 01 movw r18, r8 286ac: e1 96 adiw r28, 0x31 ; 49 286ae: 6c ad ldd r22, Y+60 ; 0x3c 286b0: 7d ad ldd r23, Y+61 ; 0x3d 286b2: 8e ad ldd r24, Y+62 ; 0x3e 286b4: 9f ad ldd r25, Y+63 ; 0x3f 286b6: e1 97 sbiw r28, 0x31 ; 49 286b8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 286bc: a7 01 movw r20, r14 286be: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 286c0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 286c4: 6b 01 movw r12, r22 286c6: 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; 286c8: 20 e0 ldi r18, 0x00 ; 0 286ca: 30 e4 ldi r19, 0x40 ; 64 286cc: 4c e1 ldi r20, 0x1C ; 28 286ce: 57 e4 ldi r21, 0x47 ; 71 286d0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 286d4: 18 16 cp r1, r24 286d6: 3c f4 brge .+14 ; 0x286e6 286d8: c1 2c mov r12, r1 286da: 20 e4 ldi r18, 0x40 ; 64 286dc: d2 2e mov r13, r18 286de: 2c e1 ldi r18, 0x1C ; 28 286e0: e2 2e mov r14, r18 286e2: 27 e4 ldi r18, 0x47 ; 71 286e4: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 286e6: a7 01 movw r20, r14 286e8: 96 01 movw r18, r12 286ea: 60 e0 ldi r22, 0x00 ; 0 286ec: 74 e2 ldi r23, 0x24 ; 36 286ee: 84 ef ldi r24, 0xF4 ; 244 286f0: 99 e4 ldi r25, 0x49 ; 73 286f2: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 286f6: 4b 01 movw r8, r22 286f8: 5c 01 movw r10, r24 if (advance_speed > 20000) { 286fa: 20 e0 ldi r18, 0x00 ; 0 286fc: 30 e4 ldi r19, 0x40 ; 64 286fe: 4c e9 ldi r20, 0x9C ; 156 28700: 56 e4 ldi r21, 0x46 ; 70 28702: c7 01 movw r24, r14 28704: b6 01 movw r22, r12 28706: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2870a: 18 16 cp r1, r24 2870c: 0c f0 brlt .+2 ; 0x28710 2870e: 17 c4 rjmp .+2094 ; 0x28f3e block->advance_rate = advance_rate * 4; 28710: 8e e6 ldi r24, 0x6E ; 110 28712: 82 9d mul r24, r2 28714: 80 01 movw r16, r0 28716: 83 9d mul r24, r3 28718: 10 0d add r17, r0 2871a: 11 24 eor r1, r1 2871c: 02 5a subi r16, 0xA2 ; 162 2871e: 19 4f sbci r17, 0xF9 ; 249 28720: 78 01 movw r14, r16 28722: fd e4 ldi r31, 0x4D ; 77 28724: ef 0e add r14, r31 28726: f1 1c adc r15, r1 28728: 20 e0 ldi r18, 0x00 ; 0 2872a: 30 e0 ldi r19, 0x00 ; 0 2872c: 40 e8 ldi r20, 0x80 ; 128 2872e: 50 e4 ldi r21, 0x40 ; 64 28730: c5 01 movw r24, r10 28732: b4 01 movw r22, r8 28734: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28738: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 2873c: d7 01 movw r26, r14 2873e: 6d 93 st X+, r22 28740: 7c 93 st X, r23 block->advance_step_loops = 4; 28742: f8 01 movw r30, r16 28744: ed 5a subi r30, 0xAD ; 173 28746: ff 4f sbci r31, 0xFF ; 255 28748: 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; 2874a: 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); 2874c: 09 a5 ldd r16, Y+41 ; 0x29 2874e: 1d a5 ldd r17, Y+45 ; 0x2d 28750: 29 ad ldd r18, Y+57 ; 0x39 28752: 39 a9 ldd r19, Y+49 ; 0x31 28754: 4d ad ldd r20, Y+61 ; 0x3d 28756: 5d a9 ldd r21, Y+53 ; 0x35 28758: 6e ad ldd r22, Y+62 ; 0x3e 2875a: 23 96 adiw r28, 0x03 ; 3 2875c: 7f ad ldd r23, Y+63 ; 0x3f 2875e: 23 97 sbiw r28, 0x03 ; 3 28760: a3 96 adiw r28, 0x23 ; 35 28762: 8e ad ldd r24, Y+62 ; 0x3e 28764: 9f ad ldd r25, Y+63 ; 0x3f 28766: a3 97 sbiw r28, 0x23 ; 35 28768: 82 5a subi r24, 0xA2 ; 162 2876a: 99 4f sbci r25, 0xF9 ; 249 2876c: 0f 94 0d 06 call 0x20c1a ; 0x20c1a if (block->step_event_count.wide <= 32767) 28770: 8e e6 ldi r24, 0x6E ; 110 28772: 82 9d mul r24, r2 28774: f0 01 movw r30, r0 28776: 83 9d mul r24, r3 28778: f0 0d add r31, r0 2877a: 11 24 eor r1, r1 2877c: e2 5a subi r30, 0xA2 ; 162 2877e: f9 4f sbci r31, 0xF9 ; 249 28780: 80 89 ldd r24, Z+16 ; 0x10 28782: 91 89 ldd r25, Z+17 ; 0x11 28784: a2 89 ldd r26, Z+18 ; 0x12 28786: b3 89 ldd r27, Z+19 ; 0x13 28788: 81 15 cp r24, r1 2878a: 90 48 sbci r25, 0x80 ; 128 2878c: a1 05 cpc r26, r1 2878e: b1 05 cpc r27, r1 28790: 18 f4 brcc .+6 ; 0x28798 block->flag |= BLOCK_FLAG_DDA_LOWRES; 28792: 85 a9 ldd r24, Z+53 ; 0x35 28794: 88 60 ori r24, 0x08 ; 8 28796: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28798: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2879a: 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; 2879c: 90 91 42 0d lds r25, 0x0D42 ; 0x800d42 287a0: 91 11 cpse r25, r1 287a2: 93 c4 rjmp .+2342 ; 0x290ca block_buffer_head = next_buffer_head; 287a4: a0 96 adiw r28, 0x20 ; 32 287a6: 3f ad ldd r19, Y+63 ; 0x3f 287a8: a0 97 sbiw r28, 0x20 ; 32 287aa: 30 93 3e 0d sts 0x0D3E, r19 ; 0x800d3e (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 287ae: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 287b0: c3 58 subi r28, 0x83 ; 131 287b2: df 4f sbci r29, 0xFF ; 255 287b4: 88 81 ld r24, Y 287b6: 99 81 ldd r25, Y+1 ; 0x01 287b8: aa 81 ldd r26, Y+2 ; 0x02 287ba: bb 81 ldd r27, Y+3 ; 0x03 287bc: cd 57 subi r28, 0x7D ; 125 287be: d0 40 sbci r29, 0x00 ; 0 287c0: 80 93 3c 06 sts 0x063C, r24 ; 0x80063c 287c4: 90 93 3d 06 sts 0x063D, r25 ; 0x80063d 287c8: a0 93 3e 06 sts 0x063E, r26 ; 0x80063e 287cc: b0 93 3f 06 sts 0x063F, r27 ; 0x80063f 287d0: cf 57 subi r28, 0x7F ; 127 287d2: df 4f sbci r29, 0xFF ; 255 287d4: 28 81 ld r18, Y 287d6: 39 81 ldd r19, Y+1 ; 0x01 287d8: 4a 81 ldd r20, Y+2 ; 0x02 287da: 5b 81 ldd r21, Y+3 ; 0x03 287dc: c1 58 subi r28, 0x81 ; 129 287de: d0 40 sbci r29, 0x00 ; 0 287e0: 20 93 40 06 sts 0x0640, r18 ; 0x800640 287e4: 30 93 41 06 sts 0x0641, r19 ; 0x800641 287e8: 40 93 42 06 sts 0x0642, r20 ; 0x800642 287ec: 50 93 43 06 sts 0x0643, r21 ; 0x800643 287f0: e5 96 adiw r28, 0x35 ; 53 287f2: 8c ad ldd r24, Y+60 ; 0x3c 287f4: 9d ad ldd r25, Y+61 ; 0x3d 287f6: ae ad ldd r26, Y+62 ; 0x3e 287f8: bf ad ldd r27, Y+63 ; 0x3f 287fa: e5 97 sbiw r28, 0x35 ; 53 287fc: 80 93 44 06 sts 0x0644, r24 ; 0x800644 28800: 90 93 45 06 sts 0x0645, r25 ; 0x800645 28804: a0 93 46 06 sts 0x0646, r26 ; 0x800646 28808: b0 93 47 06 sts 0x0647, r27 ; 0x800647 2880c: ad 96 adiw r28, 0x2d ; 45 2880e: 2c ad ldd r18, Y+60 ; 0x3c 28810: 3d ad ldd r19, Y+61 ; 0x3d 28812: 4e ad ldd r20, Y+62 ; 0x3e 28814: 5f ad ldd r21, Y+63 ; 0x3f 28816: ad 97 sbiw r28, 0x2d ; 45 28818: 20 93 48 06 sts 0x0648, r18 ; 0x800648 2881c: 30 93 49 06 sts 0x0649, r19 ; 0x800649 28820: 40 93 4a 06 sts 0x064A, r20 ; 0x80064a 28824: 50 93 4b 06 sts 0x064B, r21 ; 0x80064b #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 28828: 89 a1 ldd r24, Y+33 ; 0x21 2882a: 9a a1 ldd r25, Y+34 ; 0x22 2882c: ab a1 ldd r26, Y+35 ; 0x23 2882e: bc a1 ldd r27, Y+36 ; 0x24 28830: 80 93 36 04 sts 0x0436, r24 ; 0x800436 28834: 90 93 37 04 sts 0x0437, r25 ; 0x800437 28838: a0 93 38 04 sts 0x0438, r26 ; 0x800438 2883c: b0 93 39 04 sts 0x0439, r27 ; 0x800439 position_float[Y_AXIS] = y; 28840: 8d a1 ldd r24, Y+37 ; 0x25 28842: 9e a1 ldd r25, Y+38 ; 0x26 28844: af a1 ldd r26, Y+39 ; 0x27 28846: b8 a5 ldd r27, Y+40 ; 0x28 28848: 80 93 3a 04 sts 0x043A, r24 ; 0x80043a 2884c: 90 93 3b 04 sts 0x043B, r25 ; 0x80043b 28850: a0 93 3c 04 sts 0x043C, r26 ; 0x80043c 28854: b0 93 3d 04 sts 0x043D, r27 ; 0x80043d position_float[Z_AXIS] = z; 28858: a7 96 adiw r28, 0x27 ; 39 2885a: 8c ad ldd r24, Y+60 ; 0x3c 2885c: 9d ad ldd r25, Y+61 ; 0x3d 2885e: ae ad ldd r26, Y+62 ; 0x3e 28860: bf ad ldd r27, Y+63 ; 0x3f 28862: a7 97 sbiw r28, 0x27 ; 39 28864: 80 93 3e 04 sts 0x043E, r24 ; 0x80043e 28868: 90 93 3f 04 sts 0x043F, r25 ; 0x80043f 2886c: a0 93 40 04 sts 0x0440, r26 ; 0x800440 28870: b0 93 41 04 sts 0x0441, r27 ; 0x800441 position_float[E_AXIS] = e; 28874: a9 96 adiw r28, 0x29 ; 41 28876: ee ad ldd r30, Y+62 ; 0x3e 28878: ff ad ldd r31, Y+63 ; 0x3f 2887a: a9 97 sbiw r28, 0x29 ; 41 2887c: 80 81 ld r24, Z 2887e: 91 81 ldd r25, Z+1 ; 0x01 28880: a2 81 ldd r26, Z+2 ; 0x02 28882: b3 81 ldd r27, Z+3 ; 0x03 28884: 80 93 42 04 sts 0x0442, r24 ; 0x800442 28888: 90 93 43 04 sts 0x0443, r25 ; 0x800443 2888c: a0 93 44 04 sts 0x0444, r26 ; 0x800444 28890: 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; 28894: 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); 28898: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 2889c: 8f 19 sub r24, r15 2889e: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 288a0: 83 30 cpi r24, 0x03 ; 3 288a2: 40 f1 brcs .+80 ; 0x288f4 // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 288a4: 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) 288a8: 11 11 cpse r17, r1 288aa: 01 c0 rjmp .+2 ; 0x288ae block_index = BLOCK_BUFFER_SIZE; 288ac: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 288ae: 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; 288b0: fe e6 ldi r31, 0x6E ; 110 288b2: 1f 9f mul r17, r31 288b4: c0 01 movw r24, r0 288b6: 11 24 eor r1, r1 288b8: 9c 01 movw r18, r24 288ba: 22 5a subi r18, 0xA2 ; 162 288bc: 39 4f sbci r19, 0xF9 ; 249 288be: 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) 288c0: 11 11 cpse r17, r1 288c2: 01 c0 rjmp .+2 ; 0x288c6 block_index = BLOCK_BUFFER_SIZE; 288c4: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 288c6: 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)); 288c8: 3e e6 ldi r19, 0x6E ; 110 288ca: 13 9f mul r17, r19 288cc: c0 01 movw r24, r0 288ce: 11 24 eor r1, r1 288d0: ac 01 movw r20, r24 288d2: 42 5a subi r20, 0xA2 ; 162 288d4: 59 4f sbci r21, 0xF9 ; 249 288d6: 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)); 288d8: 9e e6 ldi r25, 0x6E ; 110 288da: 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) { 288dc: f1 16 cp r15, r17 288de: 69 f0 breq .+26 ; 0x288fa if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 288e0: d6 01 movw r26, r12 288e2: d5 96 adiw r26, 0x35 ; 53 288e4: 0c 91 ld r16, X 288e6: 02 ff sbrs r16, 2 288e8: 7e c3 rjmp .+1788 ; 0x28fe6 // 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); 288ea: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 288ee: 81 1b sub r24, r17 288f0: 8f 70 andi r24, 0x0F ; 15 288f2: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 288f4: 82 30 cpi r24, 0x02 ; 2 288f6: 08 f4 brcc .+2 ; 0x288fa 288f8: a3 c0 rjmp .+326 ; 0x28a40 // 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; 288fa: 3e e6 ldi r19, 0x6E ; 110 288fc: f3 9e mul r15, r19 288fe: c0 01 movw r24, r0 28900: 11 24 eor r1, r1 28902: ac 01 movw r20, r24 28904: 42 5a subi r20, 0xA2 ; 162 28906: 59 4f sbci r21, 0xF9 ; 249 28908: 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) 2890a: f3 94 inc r15 2890c: 50 e1 ldi r21, 0x10 ; 16 2890e: f5 12 cpse r15, r21 28910: 01 c0 rjmp .+2 ; 0x28914 block_index = 0; 28912: 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)); 28914: ae e6 ldi r26, 0x6E ; 110 28916: fa 9e mul r15, r26 28918: c0 01 movw r24, r0 2891a: 11 24 eor r1, r1 2891c: fc 01 movw r30, r24 2891e: e2 5a subi r30, 0xA2 ; 162 28920: f9 4f sbci r31, 0xF9 ; 249 28922: 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)); 28924: 8e e6 ldi r24, 0x6E ; 110 28926: 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) { 28928: d5 01 movw r26, r10 2892a: d5 96 adiw r26, 0x35 ; 53 2892c: 8c 91 ld r24, X 2892e: d5 97 sbiw r26, 0x35 ; 53 28930: 81 fd sbrc r24, 1 28932: 5a c0 rjmp .+180 ; 0x289e8 28934: 95 96 adiw r26, 0x25 ; 37 28936: 4d 90 ld r4, X+ 28938: 5d 90 ld r5, X+ 2893a: 6d 90 ld r6, X+ 2893c: 7c 90 ld r7, X 2893e: 98 97 sbiw r26, 0x28 ; 40 28940: f6 01 movw r30, r12 28942: 95 a0 ldd r9, Z+37 ; 0x25 28944: e6 a0 ldd r14, Z+38 ; 0x26 28946: 07 a1 ldd r16, Z+39 ; 0x27 28948: 10 a5 ldd r17, Z+40 ; 0x28 2894a: 29 2d mov r18, r9 2894c: 3e 2d mov r19, r14 2894e: a8 01 movw r20, r16 28950: c3 01 movw r24, r6 28952: b2 01 movw r22, r4 28954: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 28958: 87 ff sbrs r24, 7 2895a: 46 c0 rjmp .+140 ; 0x289e8 // 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); 2895c: a3 01 movw r20, r6 2895e: 92 01 movw r18, r4 28960: c3 01 movw r24, r6 28962: b2 01 movw r22, r4 28964: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28968: 2b 01 movw r4, r22 2896a: 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)); 2896c: d5 01 movw r26, r10 2896e: d1 96 adiw r26, 0x31 ; 49 28970: 6d 91 ld r22, X+ 28972: 7d 91 ld r23, X+ 28974: 8d 91 ld r24, X+ 28976: 9c 91 ld r25, X 28978: d4 97 sbiw r26, 0x34 ; 52 2897a: 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); 2897c: 9b 01 movw r18, r22 2897e: ac 01 movw r20, r24 28980: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 28984: f5 01 movw r30, r10 28986: 25 a5 ldd r18, Z+45 ; 0x2d 28988: 36 a5 ldd r19, Z+46 ; 0x2e 2898a: 47 a5 ldd r20, Z+47 ; 0x2f 2898c: 50 a9 ldd r21, Z+48 ; 0x30 2898e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28992: 9b 01 movw r18, r22 28994: ac 01 movw r20, r24 28996: c3 01 movw r24, r6 28998: b2 01 movw r22, r4 2899a: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2899e: 0f 94 34 a9 call 0x35268 ; 0x35268 289a2: 2b 01 movw r4, r22 289a4: 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)); 289a6: 9b 01 movw r18, r22 289a8: ac 01 movw r20, r24 289aa: 69 2d mov r22, r9 289ac: 7e 2d mov r23, r14 289ae: c8 01 movw r24, r16 289b0: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 289b4: 87 ff sbrs r24, 7 289b6: 03 c0 rjmp .+6 ; 0x289be 289b8: 49 2c mov r4, r9 289ba: 5e 2c mov r5, r14 289bc: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 289be: 92 01 movw r18, r4 289c0: a3 01 movw r20, r6 289c2: 69 2d mov r22, r9 289c4: 7e 2d mov r23, r14 289c6: c8 01 movw r24, r16 289c8: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 289cc: 88 23 and r24, r24 289ce: 61 f0 breq .+24 ; 0x289e8 289d0: d6 01 movw r26, r12 289d2: d5 96 adiw r26, 0x35 ; 53 289d4: 2c 91 ld r18, X current->entry_speed = entry_speed; 289d6: c2 01 movw r24, r4 289d8: d3 01 movw r26, r6 289da: f6 01 movw r30, r12 289dc: 85 a3 std Z+37, r24 ; 0x25 289de: 96 a3 std Z+38, r25 ; 0x26 289e0: a7 a3 std Z+39, r26 ; 0x27 289e2: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 289e4: 21 60 ori r18, 0x01 ; 1 289e6: 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) { 289e8: d5 01 movw r26, r10 289ea: d5 96 adiw r26, 0x35 ; 53 289ec: 8c 91 ld r24, X 289ee: d5 97 sbiw r26, 0x35 ; 53 289f0: f6 01 movw r30, r12 289f2: 95 a9 ldd r25, Z+53 ; 0x35 289f4: 89 2b or r24, r25 289f6: 80 ff sbrs r24, 0 289f8: 14 c0 rjmp .+40 ; 0x28a22 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 289fa: 05 a1 ldd r16, Z+37 ; 0x25 289fc: 16 a1 ldd r17, Z+38 ; 0x26 289fe: 27 a1 ldd r18, Z+39 ; 0x27 28a00: 30 a5 ldd r19, Z+40 ; 0x28 28a02: 95 96 adiw r26, 0x25 ; 37 28a04: 4d 91 ld r20, X+ 28a06: 5d 91 ld r21, X+ 28a08: 6d 91 ld r22, X+ 28a0a: 7c 91 ld r23, X 28a0c: 98 97 sbiw r26, 0x28 ; 40 28a0e: c5 01 movw r24, r10 28a10: 0f 94 0d 06 call 0x20c1a ; 0x20c1a // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 28a14: d5 01 movw r26, r10 28a16: d5 96 adiw r26, 0x35 ; 53 28a18: 8c 91 ld r24, X 28a1a: d5 97 sbiw r26, 0x35 ; 53 28a1c: 8e 7f andi r24, 0xFE ; 254 28a1e: d5 96 adiw r26, 0x35 ; 53 28a20: 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) 28a22: f3 94 inc r15 28a24: b0 e1 ldi r27, 0x10 ; 16 28a26: fb 12 cpse r15, r27 28a28: 01 c0 rjmp .+2 ; 0x28a2c block_index = 0; 28a2a: 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)); 28a2c: f8 9c mul r15, r8 28a2e: c0 01 movw r24, r0 28a30: 11 24 eor r1, r1 28a32: 82 5a subi r24, 0xA2 ; 162 28a34: 99 4f sbci r25, 0xF9 ; 249 } while (block_index != block_buffer_head); 28a36: 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; 28a3a: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 28a3c: f2 12 cpse r15, r18 28a3e: 43 c3 rjmp .+1670 ; 0x290c6 } // 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); 28a40: 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) 28a44: 81 11 cpse r24, r1 28a46: 01 c0 rjmp .+2 ; 0x28a4a block_index = BLOCK_BUFFER_SIZE; 28a48: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 28a4a: 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); 28a4c: ee e6 ldi r30, 0x6E ; 110 28a4e: 8e 9f mul r24, r30 28a50: c0 01 movw r24, r0 28a52: 11 24 eor r1, r1 28a54: 9c 01 movw r18, r24 28a56: 22 5a subi r18, 0xA2 ; 162 28a58: 39 4f sbci r19, 0xF9 ; 249 28a5a: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 28a5c: d9 01 movw r26, r18 28a5e: 95 96 adiw r26, 0x25 ; 37 28a60: 4d 91 ld r20, X+ 28a62: 5d 91 ld r21, X+ 28a64: 6d 91 ld r22, X+ 28a66: 7c 91 ld r23, X 28a68: 98 97 sbiw r26, 0x28 ; 40 28a6a: 09 a5 ldd r16, Y+41 ; 0x29 28a6c: 1d a5 ldd r17, Y+45 ; 0x2d 28a6e: 29 ad ldd r18, Y+57 ; 0x39 28a70: 39 a9 ldd r19, Y+49 ; 0x31 28a72: c7 01 movw r24, r14 28a74: 0f 94 0d 06 call 0x20c1a ; 0x20c1a current->flag &= ~BLOCK_FLAG_RECALCULATE; 28a78: f7 01 movw r30, r14 28a7a: 85 a9 ldd r24, Z+53 ; 0x35 28a7c: 8e 7f andi r24, 0xFE ; 254 28a7e: 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(); 28a80: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 28a84: 82 60 ori r24, 0x02 ; 2 28a86: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 28a8a: 0d 94 c1 3a jmp 0x27582 ; 0x27582 // 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)); 28a8e: aa 54 subi r26, 0x4A ; 74 28a90: b9 4f sbci r27, 0xF9 ; 249 28a92: 80 e1 ldi r24, 0x10 ; 16 28a94: e1 e6 ldi r30, 0x61 ; 97 28a96: f2 e1 ldi r31, 0x12 ; 18 28a98: 0d 94 fc 3a jmp 0x275f8 ; 0x275f8 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]); 28a9c: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 28aa0: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 28aa4: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 28aa8: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 28aac: a7 96 adiw r28, 0x27 ; 39 28aae: 6c ad ldd r22, Y+60 ; 0x3c 28ab0: 7d ad ldd r23, Y+61 ; 0x3d 28ab2: 8e ad ldd r24, Y+62 ; 0x3e 28ab4: 9f ad ldd r25, Y+63 ; 0x3f 28ab6: a7 97 sbiw r28, 0x27 ; 39 28ab8: 0d 94 92 3b jmp 0x27724 ; 0x27724 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); 28abc: 81 e0 ldi r24, 0x01 ; 1 28abe: 80 8f std Z+24, r24 ; 0x18 28ac0: 0d 94 38 3d jmp 0x27a70 ; 0x27a70 { if(feed_rate 28ac8: b0 90 a4 0d lds r11, 0x0DA4 ; 0x800da4 28acc: 00 91 a5 0d lds r16, 0x0DA5 ; 0x800da5 28ad0: 10 91 a6 0d lds r17, 0x0DA6 ; 0x800da6 28ad4: 53 c8 rjmp .-3930 ; 0x27b7c 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])); 28ad6: c5 01 movw r24, r10 28ad8: b4 01 movw r22, r8 28ada: 0f 94 07 9f call 0x33e0e ; 0x33e0e 28ade: 4b 01 movw r8, r22 28ae0: 5c 01 movw r10, r24 28ae2: c7 01 movw r24, r14 28ae4: b6 01 movw r22, r12 28ae6: 0f 94 07 9f call 0x33e0e ; 0x33e0e 28aea: 9b 01 movw r18, r22 28aec: ac 01 movw r20, r24 28aee: c5 01 movw r24, r10 28af0: b4 01 movw r22, r8 28af2: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 28af6: 6b 01 movw r12, r22 28af8: 7c 01 movw r14, r24 28afa: 22 96 adiw r28, 0x02 ; 2 28afc: 6c ad ldd r22, Y+60 ; 0x3c 28afe: 7d ad ldd r23, Y+61 ; 0x3d 28b00: 8e ad ldd r24, Y+62 ; 0x3e 28b02: 9f ad ldd r25, Y+63 ; 0x3f 28b04: 22 97 sbiw r28, 0x02 ; 2 28b06: 0f 94 07 9f call 0x33e0e ; 0x33e0e 28b0a: 9b 01 movw r18, r22 28b0c: ac 01 movw r20, r24 28b0e: c7 01 movw r24, r14 28b10: b6 01 movw r22, r12 28b12: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 28b16: 0f 94 34 a9 call 0x35268 ; 0x35268 28b1a: 2e e6 ldi r18, 0x6E ; 110 28b1c: 22 9d mul r18, r2 28b1e: f0 01 movw r30, r0 28b20: 23 9d mul r18, r3 28b22: f0 0d add r31, r0 28b24: 11 24 eor r1, r1 28b26: e2 5a subi r30, 0xA2 ; 162 28b28: f9 4f sbci r31, 0xF9 ; 249 28b2a: 65 a7 std Z+45, r22 ; 0x2d 28b2c: 76 a7 std Z+46, r23 ; 0x2e 28b2e: 87 a7 std Z+47, r24 ; 0x2f 28b30: 90 ab std Z+48, r25 ; 0x30 28b32: c2 c8 rjmp .-3708 ; 0x27cb8 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 28b34: 2a 96 adiw r28, 0x0a ; 10 28b36: 2c ad ldd r18, Y+60 ; 0x3c 28b38: 3d ad ldd r19, Y+61 ; 0x3d 28b3a: 4e ad ldd r20, Y+62 ; 0x3e 28b3c: 5f ad ldd r21, Y+63 ; 0x3f 28b3e: 2a 97 sbiw r28, 0x0a ; 10 28b40: 23 2b or r18, r19 28b42: 24 2b or r18, r20 28b44: 25 2b or r18, r21 28b46: 09 f4 brne .+2 ; 0x28b4a 28b48: 0e c1 rjmp .+540 ; 0x28d66 28b4a: 60 91 9b 0d lds r22, 0x0D9B ; 0x800d9b 28b4e: 70 91 9c 0d lds r23, 0x0D9C ; 0x800d9c 28b52: 80 91 9d 0d lds r24, 0x0D9D ; 0x800d9d 28b56: 90 91 9e 0d lds r25, 0x0D9E ; 0x800d9e 28b5a: 29 a5 ldd r18, Y+41 ; 0x29 28b5c: 3a a5 ldd r19, Y+42 ; 0x2a 28b5e: 4b a5 ldd r20, Y+43 ; 0x2b 28b60: 5c a5 ldd r21, Y+44 ; 0x2c 28b62: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28b66: 0f 94 44 a6 call 0x34c88 ; 0x34c88 28b6a: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 28b6e: 2b 01 movw r4, r22 28b70: 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 28b72: 80 91 a7 04 lds r24, 0x04A7 ; 0x8004a7 28b76: 90 91 a8 04 lds r25, 0x04A8 ; 0x8004a8 28b7a: a0 91 a9 04 lds r26, 0x04A9 ; 0x8004a9 28b7e: b0 91 aa 04 lds r27, 0x04AA ; 0x8004aa 28b82: 8d a7 std Y+45, r24 ; 0x2d 28b84: 9e a7 std Y+46, r25 ; 0x2e 28b86: af a7 std Y+47, r26 ; 0x2f 28b88: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 28b8a: 20 e0 ldi r18, 0x00 ; 0 28b8c: 30 e0 ldi r19, 0x00 ; 0 28b8e: a9 01 movw r20, r18 28b90: bc 01 movw r22, r24 28b92: cd 01 movw r24, r26 28b94: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 28b98: 18 16 cp r1, r24 28b9a: 0c f0 brlt .+2 ; 0x28b9e 28b9c: ed c0 rjmp .+474 ; 0x28d78 * 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 28b9e: 20 e0 ldi r18, 0x00 ; 0 28ba0: 30 e0 ldi r19, 0x00 ; 0 28ba2: a9 01 movw r20, r18 28ba4: 26 96 adiw r28, 0x06 ; 6 28ba6: 6c ad ldd r22, Y+60 ; 0x3c 28ba8: 7d ad ldd r23, Y+61 ; 0x3d 28baa: 8e ad ldd r24, Y+62 ; 0x3e 28bac: 9f ad ldd r25, Y+63 ; 0x3f 28bae: 26 97 sbiw r28, 0x06 ; 6 28bb0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 28bb4: 87 fd sbrc r24, 7 28bb6: e0 c0 rjmp .+448 ; 0x28d78 && fabs(delta_mm[Z_AXIS]) < 0.5; 28bb8: 22 96 adiw r28, 0x02 ; 2 28bba: 6c ad ldd r22, Y+60 ; 0x3c 28bbc: 7d ad ldd r23, Y+61 ; 0x3d 28bbe: 8e ad ldd r24, Y+62 ; 0x3e 28bc0: 9f ad ldd r25, Y+63 ; 0x3f 28bc2: 22 97 sbiw r28, 0x02 ; 2 28bc4: 9f 77 andi r25, 0x7F ; 127 28bc6: 20 e0 ldi r18, 0x00 ; 0 28bc8: 30 e0 ldi r19, 0x00 ; 0 28bca: 40 e0 ldi r20, 0x00 ; 0 28bcc: 5f e3 ldi r21, 0x3F ; 63 28bce: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 28bd2: 87 ff sbrs r24, 7 28bd4: d1 c0 rjmp .+418 ; 0x28d78 * * 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 28bd6: 8e e6 ldi r24, 0x6E ; 110 28bd8: 82 9d mul r24, r2 28bda: 80 01 movw r16, r0 28bdc: 83 9d mul r24, r3 28bde: 10 0d add r17, r0 28be0: 11 24 eor r1, r1 28be2: 06 55 subi r16, 0x56 ; 86 28be4: 19 4f sbci r17, 0xF9 ; 249 28be6: 81 e0 ldi r24, 0x01 ; 1 28be8: d8 01 movw r26, r16 28bea: 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]) 28bec: 20 91 36 04 lds r18, 0x0436 ; 0x800436 28bf0: 30 91 37 04 lds r19, 0x0437 ; 0x800437 28bf4: 40 91 38 04 lds r20, 0x0438 ; 0x800438 28bf8: 50 91 39 04 lds r21, 0x0439 ; 0x800439 28bfc: 69 a1 ldd r22, Y+33 ; 0x21 28bfe: 7a a1 ldd r23, Y+34 ; 0x22 28c00: 8b a1 ldd r24, Y+35 ; 0x23 28c02: 9c a1 ldd r25, Y+36 ; 0x24 28c04: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 28c08: 69 ab std Y+49, r22 ; 0x31 28c0a: 7a ab std Y+50, r23 ; 0x32 28c0c: 8b ab std Y+51, r24 ; 0x33 28c0e: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 28c10: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 28c14: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 28c18: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 28c1c: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 28c20: 6d a1 ldd r22, Y+37 ; 0x25 28c22: 7e a1 ldd r23, Y+38 ; 0x26 28c24: 8f a1 ldd r24, Y+39 ; 0x27 28c26: 98 a5 ldd r25, Y+40 ; 0x28 28c28: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 28c2c: 4b 01 movw r8, r22 28c2e: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 28c30: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 28c34: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 28c38: 40 91 40 04 lds r20, 0x0440 ; 0x800440 28c3c: 50 91 41 04 lds r21, 0x0441 ; 0x800441 28c40: a7 96 adiw r28, 0x27 ; 39 28c42: 6c ad ldd r22, Y+60 ; 0x3c 28c44: 7d ad ldd r23, Y+61 ; 0x3d 28c46: 8e ad ldd r24, Y+62 ; 0x3e 28c48: 9f ad ldd r25, Y+63 ; 0x3f 28c4a: a7 97 sbiw r28, 0x27 ; 39 28c4c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 28c50: 6b 01 movw r12, r22 28c52: 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]) 28c54: 29 a9 ldd r18, Y+49 ; 0x31 28c56: 3a a9 ldd r19, Y+50 ; 0x32 28c58: 4b a9 ldd r20, Y+51 ; 0x33 28c5a: 5c a9 ldd r21, Y+52 ; 0x34 28c5c: ca 01 movw r24, r20 28c5e: b9 01 movw r22, r18 28c60: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28c64: 69 ab std Y+49, r22 ; 0x31 28c66: 7a ab std Y+50, r23 ; 0x32 28c68: 8b ab std Y+51, r24 ; 0x33 28c6a: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 28c6c: a5 01 movw r20, r10 28c6e: 94 01 movw r18, r8 28c70: c5 01 movw r24, r10 28c72: b4 01 movw r22, r8 28c74: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28c78: 9b 01 movw r18, r22 28c7a: ac 01 movw r20, r24 28c7c: 69 a9 ldd r22, Y+49 ; 0x31 28c7e: 7a a9 ldd r23, Y+50 ; 0x32 28c80: 8b a9 ldd r24, Y+51 ; 0x33 28c82: 9c a9 ldd r25, Y+52 ; 0x34 28c84: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 28c88: 4b 01 movw r8, r22 28c8a: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 28c8c: a7 01 movw r20, r14 28c8e: 96 01 movw r18, r12 28c90: c7 01 movw r24, r14 28c92: b6 01 movw r22, r12 28c94: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28c98: 9b 01 movw r18, r22 28c9a: ac 01 movw r20, r24 28c9c: c5 01 movw r24, r10 28c9e: b4 01 movw r22, r8 28ca0: 0f 94 66 a5 call 0x34acc ; 0x34acc <__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]) 28ca4: 0f 94 34 a9 call 0x35268 ; 0x35268 28ca8: 6b 01 movw r12, r22 28caa: 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]); 28cac: 20 91 42 04 lds r18, 0x0442 ; 0x800442 28cb0: 30 91 43 04 lds r19, 0x0443 ; 0x800443 28cb4: 40 91 44 04 lds r20, 0x0444 ; 0x800444 28cb8: 50 91 45 04 lds r21, 0x0445 ; 0x800445 28cbc: a9 96 adiw r28, 0x29 ; 41 28cbe: ee ad ldd r30, Y+62 ; 0x3e 28cc0: ff ad ldd r31, Y+63 ; 0x3f 28cc2: a9 97 sbiw r28, 0x29 ; 41 28cc4: 60 81 ld r22, Z 28cc6: 71 81 ldd r23, Z+1 ; 0x01 28cc8: 82 81 ldd r24, Z+2 ; 0x02 28cca: 93 81 ldd r25, Z+3 ; 0x03 28ccc: 0f 94 65 a5 call 0x34aca ; 0x34aca <__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; 28cd0: a7 01 movw r20, r14 28cd2: 96 01 movw r18, r12 28cd4: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 28cd8: 6a 96 adiw r28, 0x1a ; 26 28cda: 6c af std Y+60, r22 ; 0x3c 28cdc: 7d af std Y+61, r23 ; 0x3d 28cde: 8e af std Y+62, r24 ; 0x3e 28ce0: 9f af std Y+63, r25 ; 0x3f 28ce2: 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) 28ce4: 20 e0 ldi r18, 0x00 ; 0 28ce6: 30 e0 ldi r19, 0x00 ; 0 28ce8: 40 e4 ldi r20, 0x40 ; 64 28cea: 50 e4 ldi r21, 0x40 ; 64 28cec: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 28cf0: 18 16 cp r1, r24 28cf2: 0c f4 brge .+2 ; 0x28cf6 28cf4: 9e c0 rjmp .+316 ; 0x28e32 block->use_advance_lead = false; else if (e_D_ratio > 0) { 28cf6: 20 e0 ldi r18, 0x00 ; 0 28cf8: 30 e0 ldi r19, 0x00 ; 0 28cfa: a9 01 movw r20, r18 28cfc: 6a 96 adiw r28, 0x1a ; 26 28cfe: 6c ad ldd r22, Y+60 ; 0x3c 28d00: 7d ad ldd r23, Y+61 ; 0x3d 28d02: 8e ad ldd r24, Y+62 ; 0x3e 28d04: 9f ad ldd r25, Y+63 ; 0x3f 28d06: 6a 97 sbiw r28, 0x1a ; 26 28d08: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 28d0c: 18 16 cp r1, r24 28d0e: 0c f0 brlt .+2 ; 0x28d12 28d10: 42 c0 rjmp .+132 ; 0x28d96 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 28d12: 6a 96 adiw r28, 0x1a ; 26 28d14: 2c ad ldd r18, Y+60 ; 0x3c 28d16: 3d ad ldd r19, Y+61 ; 0x3d 28d18: 4e ad ldd r20, Y+62 ; 0x3e 28d1a: 5f ad ldd r21, Y+63 ; 0x3f 28d1c: 6a 97 sbiw r28, 0x1a ; 26 28d1e: 6d a5 ldd r22, Y+45 ; 0x2d 28d20: 7e a5 ldd r23, Y+46 ; 0x2e 28d22: 8f a5 ldd r24, Y+47 ; 0x2f 28d24: 98 a9 ldd r25, Y+48 ; 0x30 28d26: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28d2a: 9b 01 movw r18, r22 28d2c: ac 01 movw r20, r24 28d2e: 60 91 bb 0d lds r22, 0x0DBB ; 0x800dbb 28d32: 70 91 bc 0d lds r23, 0x0DBC ; 0x800dbc 28d36: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 28d3a: 90 91 be 0d lds r25, 0x0DBE ; 0x800dbe 28d3e: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 28d42: 29 a5 ldd r18, Y+41 ; 0x29 28d44: 3a a5 ldd r19, Y+42 ; 0x2a 28d46: 4b a5 ldd r20, Y+43 ; 0x2b 28d48: 5c a5 ldd r21, Y+44 ; 0x2c 28d4a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28d4e: 0f 94 44 a6 call 0x34c88 ; 0x34c88 28d52: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 28d56: 64 15 cp r22, r4 28d58: 75 05 cpc r23, r5 28d5a: 86 05 cpc r24, r6 28d5c: 97 05 cpc r25, r7 28d5e: d8 f4 brcc .+54 ; 0x28d96 28d60: 2b 01 movw r4, r22 28d62: 3c 01 movw r6, r24 28d64: 18 c0 rjmp .+48 ; 0x28d96 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 28d66: 60 91 27 0e lds r22, 0x0E27 ; 0x800e27 28d6a: 70 91 28 0e lds r23, 0x0E28 ; 0x800e28 28d6e: 80 91 29 0e lds r24, 0x0E29 ; 0x800e29 28d72: 90 91 2a 0e lds r25, 0x0E2A ; 0x800e2a 28d76: f1 ce rjmp .-542 ; 0x28b5a * * 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 28d78: 8e e6 ldi r24, 0x6E ; 110 28d7a: 82 9d mul r24, r2 28d7c: f0 01 movw r30, r0 28d7e: 83 9d mul r24, r3 28d80: f0 0d add r31, r0 28d82: 11 24 eor r1, r1 28d84: e6 55 subi r30, 0x56 ; 86 28d86: f9 4f sbci r31, 0xF9 ; 249 28d88: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 28d8a: 6a 96 adiw r28, 0x1a ; 26 28d8c: 1c ae std Y+60, r1 ; 0x3c 28d8e: 1d ae std Y+61, r1 ; 0x3d 28d90: 1e ae std Y+62, r1 ; 0x3e 28d92: 1f ae std Y+63, r1 ; 0x3f 28d94: 6a 97 sbiw r28, 0x1a ; 26 28d96: 10 e0 ldi r17, 0x00 ; 0 28d98: 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) 28d9a: a3 96 adiw r28, 0x23 ; 35 28d9c: ee ad ldd r30, Y+62 ; 0x3e 28d9e: ff ad ldd r31, Y+63 ; 0x3f 28da0: a3 97 sbiw r28, 0x23 ; 35 28da2: e0 0f add r30, r16 28da4: f1 1f adc r31, r17 28da6: e2 5a subi r30, 0xA2 ; 162 28da8: f9 4f sbci r31, 0xF9 ; 249 28daa: c0 80 ld r12, Z 28dac: d1 80 ldd r13, Z+1 ; 0x01 28dae: e2 80 ldd r14, Z+2 ; 0x02 28db0: f3 80 ldd r15, Z+3 ; 0x03 28db2: c1 14 cp r12, r1 28db4: d1 04 cpc r13, r1 28db6: e1 04 cpc r14, r1 28db8: f1 04 cpc r15, r1 28dba: a1 f1 breq .+104 ; 0x28e24 28dbc: f8 01 movw r30, r16 28dbe: e5 55 subi r30, 0x55 ; 85 28dc0: fb 4f sbci r31, 0xFB ; 251 28dc2: 60 81 ld r22, Z 28dc4: 71 81 ldd r23, Z+1 ; 0x01 28dc6: 82 81 ldd r24, Z+2 ; 0x02 28dc8: 93 81 ldd r25, Z+3 ; 0x03 28dca: 64 15 cp r22, r4 28dcc: 75 05 cpc r23, r5 28dce: 86 05 cpc r24, r6 28dd0: 97 05 cpc r25, r7 28dd2: 40 f5 brcc .+80 ; 0x28e24 { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 28dd4: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 28dd8: 29 ad ldd r18, Y+57 ; 0x39 28dda: 3a ad ldd r19, Y+58 ; 0x3a 28ddc: 4b ad ldd r20, Y+59 ; 0x3b 28dde: 5c ad ldd r21, Y+60 ; 0x3c 28de0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 28de4: 4b 01 movw r8, r22 28de6: 5c 01 movw r10, r24 28de8: c7 01 movw r24, r14 28dea: b6 01 movw r22, r12 28dec: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 28df0: 9b 01 movw r18, r22 28df2: ac 01 movw r20, r24 28df4: c5 01 movw r24, r10 28df6: b4 01 movw r22, r8 28df8: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 28dfc: 6b 01 movw r12, r22 28dfe: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 28e00: c3 01 movw r24, r6 28e02: b2 01 movw r22, r4 28e04: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 28e08: 9b 01 movw r18, r22 28e0a: ac 01 movw r20, r24 28e0c: c7 01 movw r24, r14 28e0e: b6 01 movw r22, r12 28e10: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 28e14: 87 ff sbrs r24, 7 28e16: 06 c0 rjmp .+12 ; 0x28e24 28e18: c7 01 movw r24, r14 28e1a: b6 01 movw r22, r12 28e1c: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 28e20: 2b 01 movw r4, r22 28e22: 3c 01 movw r6, r24 28e24: 0c 5f subi r16, 0xFC ; 252 28e26: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 28e28: 00 31 cpi r16, 0x10 ; 16 28e2a: 11 05 cpc r17, r1 28e2c: 09 f0 breq .+2 ; 0x28e30 28e2e: b5 cf rjmp .-150 ; 0x28d9a 28e30: 01 c9 rjmp .-3582 ; 0x28034 // 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; 28e32: d8 01 movw r26, r16 28e34: 1c 92 st X, r1 28e36: af cf rjmp .-162 ; 0x28d96 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 28e38: c9 a6 std Y+41, r12 ; 0x29 28e3a: dd a6 std Y+45, r13 ; 0x2d 28e3c: e9 ae std Y+57, r14 ; 0x39 28e3e: f9 aa std Y+49, r15 ; 0x31 limited = true; 28e40: 21 e0 ldi r18, 0x01 ; 1 28e42: 2d ab std Y+53, r18 ; 0x35 28e44: b1 c9 rjmp .-3230 ; 0x281a8 // 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); 28e46: 27 96 adiw r28, 0x07 ; 7 28e48: 2f ad ldd r18, Y+63 ; 0x3f 28e4a: 27 97 sbiw r28, 0x07 ; 7 28e4c: 2b 96 adiw r28, 0x0b ; 11 28e4e: 3f ad ldd r19, Y+63 ; 0x3f 28e50: 2b 97 sbiw r28, 0x0b ; 11 28e52: 2f 96 adiw r28, 0x0f ; 15 28e54: 4f ad ldd r20, Y+63 ; 0x3f 28e56: 2f 97 sbiw r28, 0x0f ; 15 28e58: 63 96 adiw r28, 0x13 ; 19 28e5a: 5f ad ldd r21, Y+63 ; 0x3f 28e5c: 63 97 sbiw r28, 0x13 ; 19 28e5e: 6b 96 adiw r28, 0x1b ; 27 28e60: 6f ad ldd r22, Y+63 ; 0x3f 28e62: 6b 97 sbiw r28, 0x1b ; 27 28e64: 6f 96 adiw r28, 0x1f ; 31 28e66: 7f ad ldd r23, Y+63 ; 0x3f 28e68: 6f 97 sbiw r28, 0x1f ; 31 28e6a: c8 01 movw r24, r16 28e6c: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 28e70: eb 96 adiw r28, 0x3b ; 59 28e72: 6c af std Y+60, r22 ; 0x3c 28e74: 7d af std Y+61, r23 ; 0x3d 28e76: 8e af std Y+62, r24 ; 0x3e 28e78: 9f af std Y+63, r25 ; 0x3f 28e7a: 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; 28e7c: 6b 96 adiw r28, 0x1b ; 27 28e7e: ef ad ldd r30, Y+63 ; 0x3f 28e80: 6b 97 sbiw r28, 0x1b ; 27 28e82: ed af std Y+61, r30 ; 0x3d 28e84: 6f 96 adiw r28, 0x1f ; 31 28e86: ff ad ldd r31, Y+63 ; 0x3f 28e88: 6f 97 sbiw r28, 0x1f ; 31 28e8a: fd ab std Y+53, r31 ; 0x35 28e8c: 0e af std Y+62, r16 ; 0x3e 28e8e: 23 96 adiw r28, 0x03 ; 3 28e90: 1f af std Y+63, r17 ; 0x3f 28e92: 23 97 sbiw r28, 0x03 ; 3 28e94: 04 ca rjmp .-3064 ; 0x2829e (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 28e96: f7 fa bst r15, 7 28e98: f0 94 com r15 28e9a: f7 f8 bld r15, 7 28e9c: f0 94 com r15 28e9e: a5 01 movw r20, r10 28ea0: 94 01 movw r18, r8 28ea2: c7 01 movw r24, r14 28ea4: b6 01 movw r22, r12 28ea6: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 28eaa: 87 ff sbrs r24, 7 28eac: 77 ca rjmp .-2834 ; 0x2839c // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 28eae: 75 01 movw r14, r10 28eb0: 64 01 movw r12, r8 28eb2: 74 ca rjmp .-2840 ; 0x2839c // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 28eb4: c7 01 movw r24, r14 28eb6: b6 01 movw r22, r12 28eb8: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 28ebc: 87 fd sbrc r24, 7 28ebe: 09 c0 rjmp .+18 ; 0x28ed2 28ec0: 20 e0 ldi r18, 0x00 ; 0 28ec2: 30 e0 ldi r19, 0x00 ; 0 28ec4: a9 01 movw r20, r18 28ec6: c5 01 movw r24, r10 28ec8: b4 01 movw r22, r8 28eca: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 28ece: 18 16 cp r1, r24 28ed0: 2c f4 brge .+10 ; 0x28edc 28ed2: a5 01 movw r20, r10 28ed4: 94 01 movw r18, r8 28ed6: c7 01 movw r24, r14 28ed8: b6 01 movw r22, r12 28eda: 5c ca rjmp .-2888 ; 0x28394 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 28edc: b7 fa bst r11, 7 28ede: b0 94 com r11 28ee0: b7 f8 bld r11, 7 28ee2: b0 94 com r11 28ee4: a7 01 movw r20, r14 28ee6: 96 01 movw r18, r12 28ee8: c5 01 movw r24, r10 28eea: b4 01 movw r22, r8 28eec: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 28ef0: 18 16 cp r1, r24 28ef2: 0c f0 brlt .+2 ; 0x28ef6 28ef4: 53 ca rjmp .-2906 ; 0x2839c 28ef6: db cf rjmp .-74 ; 0x28eae // 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; 28ef8: 8e e6 ldi r24, 0x6E ; 110 28efa: 82 9d mul r24, r2 28efc: f0 01 movw r30, r0 28efe: 83 9d mul r24, r3 28f00: f0 0d add r31, r0 28f02: 11 24 eor r1, r1 28f04: e2 5a subi r30, 0xA2 ; 162 28f06: f9 4f sbci r31, 0xF9 ; 249 28f08: 85 a9 ldd r24, Z+53 ; 0x35 28f0a: 84 60 ori r24, 0x04 ; 4 28f0c: 85 ab std Z+53, r24 ; 0x35 28f0e: a9 a5 ldd r26, Y+41 ; 0x29 28f10: ad af std Y+61, r26 ; 0x3d 28f12: bd a5 ldd r27, Y+45 ; 0x2d 28f14: bd ab std Y+53, r27 ; 0x35 28f16: e9 ad ldd r30, Y+57 ; 0x39 28f18: ee af std Y+62, r30 ; 0x3e 28f1a: f9 a9 ldd r31, Y+49 ; 0x31 28f1c: 23 96 adiw r28, 0x03 ; 3 28f1e: ff af std Y+63, r31 ; 0x3f 28f20: 23 97 sbiw r28, 0x03 ; 3 28f22: bc ca rjmp .-2696 ; 0x2849c // 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; 28f24: 81 e0 ldi r24, 0x01 ; 1 28f26: 30 cb rjmp .-2464 ; 0x28588 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]; 28f28: 20 91 bb 0d lds r18, 0x0DBB ; 0x800dbb 28f2c: 30 91 bc 0d lds r19, 0x0DBC ; 0x800dbc 28f30: 40 91 bd 0d lds r20, 0x0DBD ; 0x800dbd 28f34: 50 91 be 0d lds r21, 0x0DBE ; 0x800dbe 28f38: c7 01 movw r24, r14 28f3a: b6 01 movw r22, r12 28f3c: c1 cb rjmp .-2174 ; 0x286c0 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) { 28f3e: 20 e0 ldi r18, 0x00 ; 0 28f40: 30 e4 ldi r19, 0x40 ; 64 28f42: 4c e1 ldi r20, 0x1C ; 28 28f44: 56 e4 ldi r21, 0x46 ; 70 28f46: c7 01 movw r24, r14 28f48: b6 01 movw r22, r12 28f4a: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 28f4e: 18 16 cp r1, r24 28f50: d4 f4 brge .+52 ; 0x28f86 block->advance_rate = advance_rate * 2; 28f52: 8e e6 ldi r24, 0x6E ; 110 28f54: 82 9d mul r24, r2 28f56: 80 01 movw r16, r0 28f58: 83 9d mul r24, r3 28f5a: 10 0d add r17, r0 28f5c: 11 24 eor r1, r1 28f5e: 02 5a subi r16, 0xA2 ; 162 28f60: 19 4f sbci r17, 0xF9 ; 249 28f62: 78 01 movw r14, r16 28f64: bd e4 ldi r27, 0x4D ; 77 28f66: eb 0e add r14, r27 28f68: f1 1c adc r15, r1 28f6a: a5 01 movw r20, r10 28f6c: 94 01 movw r18, r8 28f6e: c5 01 movw r24, r10 28f70: b4 01 movw r22, r8 28f72: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 28f76: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 28f7a: f7 01 movw r30, r14 28f7c: 71 83 std Z+1, r23 ; 0x01 28f7e: 60 83 st Z, r22 block->advance_step_loops = 2; 28f80: 36 96 adiw r30, 0x06 ; 6 28f82: 82 e0 ldi r24, 0x02 ; 2 28f84: e2 cb rjmp .-2108 ; 0x2874a } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 28f86: 20 e0 ldi r18, 0x00 ; 0 28f88: 3f ef ldi r19, 0xFF ; 255 28f8a: 4f e7 ldi r20, 0x7F ; 127 28f8c: 57 e4 ldi r21, 0x47 ; 71 28f8e: c5 01 movw r24, r10 28f90: b4 01 movw r22, r8 28f92: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 28f96: 87 ff sbrs r24, 7 28f98: 19 c0 rjmp .+50 ; 0x28fcc block->advance_rate = advance_rate; 28f9a: 8e e6 ldi r24, 0x6E ; 110 28f9c: 82 9d mul r24, r2 28f9e: 80 01 movw r16, r0 28fa0: 83 9d mul r24, r3 28fa2: 10 0d add r17, r0 28fa4: 11 24 eor r1, r1 28fa6: 05 55 subi r16, 0x55 ; 85 28fa8: 19 4f sbci r17, 0xF9 ; 249 28faa: c5 01 movw r24, r10 28fac: b4 01 movw r22, r8 28fae: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 28fb2: d8 01 movw r26, r16 28fb4: 6d 93 st X+, r22 28fb6: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 28fb8: 8e e6 ldi r24, 0x6E ; 110 28fba: 82 9d mul r24, r2 28fbc: f0 01 movw r30, r0 28fbe: 83 9d mul r24, r3 28fc0: f0 0d add r31, r0 28fc2: 11 24 eor r1, r1 28fc4: ef 54 subi r30, 0x4F ; 79 28fc6: f9 4f sbci r31, 0xF9 ; 249 28fc8: 81 e0 ldi r24, 0x01 ; 1 28fca: bf cb rjmp .-2178 ; 0x2874a { // 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; 28fcc: 8e e6 ldi r24, 0x6E ; 110 28fce: 82 9d mul r24, r2 28fd0: f0 01 movw r30, r0 28fd2: 83 9d mul r24, r3 28fd4: f0 0d add r31, r0 28fd6: 11 24 eor r1, r1 28fd8: e5 55 subi r30, 0x55 ; 85 28fda: f9 4f sbci r31, 0xF9 ; 249 28fdc: 8f ef ldi r24, 0xFF ; 255 28fde: 9f ef ldi r25, 0xFF ; 255 28fe0: 91 83 std Z+1, r25 ; 0x01 28fe2: 80 83 st Z, r24 28fe4: e9 cf rjmp .-46 ; 0x28fb8 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) { 28fe6: f6 01 movw r30, r12 28fe8: 71 a4 ldd r7, Z+41 ; 0x29 28fea: 82 a4 ldd r8, Z+42 ; 0x2a 28fec: 93 a4 ldd r9, Z+43 ; 0x2b 28fee: e4 a4 ldd r14, Z+44 ; 0x2c 28ff0: 27 2d mov r18, r7 28ff2: 38 2d mov r19, r8 28ff4: 49 2d mov r20, r9 28ff6: 5e 2d mov r21, r14 28ff8: 65 a1 ldd r22, Z+37 ; 0x25 28ffa: 76 a1 ldd r23, Z+38 ; 0x26 28ffc: 87 a1 ldd r24, Z+39 ; 0x27 28ffe: 90 a5 ldd r25, Z+40 ; 0x28 29000: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 29004: 88 23 and r24, r24 29006: 09 f4 brne .+2 ; 0x2900a 29008: 51 c0 rjmp .+162 ; 0x290ac // 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) ? 2900a: 01 fd sbrc r16, 1 2900c: 44 c0 rjmp .+136 ; 0x29096 2900e: d5 01 movw r26, r10 29010: 95 96 adiw r26, 0x25 ; 37 29012: 2d 90 ld r2, X+ 29014: 3d 90 ld r3, X+ 29016: 4d 90 ld r4, X+ 29018: 5c 90 ld r5, X 2901a: 98 97 sbiw r26, 0x28 ; 40 2901c: a2 01 movw r20, r4 2901e: 91 01 movw r18, r2 29020: 67 2d mov r22, r7 29022: 78 2d mov r23, r8 29024: 89 2d mov r24, r9 29026: 9e 2d mov r25, r14 29028: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2902c: 18 16 cp r1, r24 2902e: 9c f5 brge .+102 ; 0x29096 // 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); 29030: a2 01 movw r20, r4 29032: 91 01 movw r18, r2 29034: c2 01 movw r24, r4 29036: b1 01 movw r22, r2 29038: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2903c: 1b 01 movw r2, r22 2903e: 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)); 29040: f6 01 movw r30, r12 29042: 61 a9 ldd r22, Z+49 ; 0x31 29044: 72 a9 ldd r23, Z+50 ; 0x32 29046: 83 a9 ldd r24, Z+51 ; 0x33 29048: 94 a9 ldd r25, Z+52 ; 0x34 2904a: 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); 2904c: 9b 01 movw r18, r22 2904e: ac 01 movw r20, r24 29050: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 29054: d6 01 movw r26, r12 29056: 9d 96 adiw r26, 0x2d ; 45 29058: 2d 91 ld r18, X+ 2905a: 3d 91 ld r19, X+ 2905c: 4d 91 ld r20, X+ 2905e: 5c 91 ld r21, X 29060: d0 97 sbiw r26, 0x30 ; 48 29062: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 29066: 9b 01 movw r18, r22 29068: ac 01 movw r20, r24 2906a: c2 01 movw r24, r4 2906c: b1 01 movw r22, r2 2906e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 29072: 0f 94 34 a9 call 0x35268 ; 0x35268 29076: 2b 01 movw r4, r22 29078: 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)); 2907a: 9b 01 movw r18, r22 2907c: ac 01 movw r20, r24 2907e: 67 2d mov r22, r7 29080: 78 2d mov r23, r8 29082: 89 2d mov r24, r9 29084: 9e 2d mov r25, r14 29086: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2908a: 87 fd sbrc r24, 7 2908c: 04 c0 rjmp .+8 ; 0x29096 2908e: 74 2c mov r7, r4 29090: 85 2c mov r8, r5 29092: 9a 2c mov r9, r10 29094: 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) ? 29096: 87 2d mov r24, r7 29098: 98 2d mov r25, r8 2909a: a9 2d mov r26, r9 2909c: be 2d mov r27, r14 2909e: f6 01 movw r30, r12 290a0: 85 a3 std Z+37, r24 ; 0x25 290a2: 96 a3 std Z+38, r25 ; 0x26 290a4: a7 a3 std Z+39, r26 ; 0x27 290a6: 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; 290a8: 01 60 ori r16, 0x01 ; 1 290aa: 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) 290ac: 11 11 cpse r17, r1 290ae: 01 c0 rjmp .+2 ; 0x290b2 block_index = BLOCK_BUFFER_SIZE; 290b0: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 290b2: 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)); 290b4: 16 9d mul r17, r6 290b6: c0 01 movw r24, r0 290b8: 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; 290ba: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 290bc: 9c 01 movw r18, r24 290be: 22 5a subi r18, 0xA2 ; 162 290c0: 39 4f sbci r19, 0xF9 ; 249 290c2: 69 01 movw r12, r18 290c4: 0b cc rjmp .-2026 ; 0x288dc 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)); 290c6: 6c 01 movw r12, r24 290c8: 2f cc rjmp .-1954 ; 0x28928 290ca: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 290cc: 0d 94 c1 3a jmp 0x27582 ; 0x27582 000290d0 : 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(){ 290d0: 4f 92 push r4 290d2: 5f 92 push r5 290d4: 6f 92 push r6 290d6: 7f 92 push r7 290d8: 8f 92 push r8 290da: 9f 92 push r9 290dc: af 92 push r10 290de: bf 92 push r11 290e0: cf 92 push r12 290e2: df 92 push r13 290e4: ef 92 push r14 290e6: ff 92 push r15 290e8: cf 93 push r28 290ea: df 93 push r29 290ec: cd b7 in r28, 0x3d ; 61 290ee: de b7 in r29, 0x3e ; 62 290f0: 2c 97 sbiw r28, 0x0c ; 12 290f2: 0f b6 in r0, 0x3f ; 63 290f4: f8 94 cli 290f6: de bf out 0x3e, r29 ; 62 290f8: 0f be out 0x3f, r0 ; 63 290fa: 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]); 290fc: c0 90 69 12 lds r12, 0x1269 ; 0x801269 29100: d0 90 6a 12 lds r13, 0x126A ; 0x80126a 29104: e0 90 6b 12 lds r14, 0x126B ; 0x80126b 29108: f0 90 6c 12 lds r15, 0x126C ; 0x80126c 2910c: 80 91 65 12 lds r24, 0x1265 ; 0x801265 29110: 90 91 66 12 lds r25, 0x1266 ; 0x801266 29114: a0 91 67 12 lds r26, 0x1267 ; 0x801267 29118: b0 91 68 12 lds r27, 0x1268 ; 0x801268 2911c: 40 91 61 12 lds r20, 0x1261 ; 0x801261 29120: 50 91 62 12 lds r21, 0x1262 ; 0x801262 29124: 60 91 63 12 lds r22, 0x1263 ; 0x801263 29128: 70 91 64 12 lds r23, 0x1264 ; 0x801264 2912c: 4d 83 std Y+5, r20 ; 0x05 2912e: 5e 83 std Y+6, r21 ; 0x06 29130: 6f 83 std Y+7, r22 ; 0x07 29132: 78 87 std Y+8, r23 ; 0x08 29134: 89 83 std Y+1, r24 ; 0x01 29136: 9a 83 std Y+2, r25 ; 0x02 29138: ab 83 std Y+3, r26 ; 0x03 2913a: 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); 2913c: be 01 movw r22, r28 2913e: 6f 5f subi r22, 0xFF ; 255 29140: 7f 4f sbci r23, 0xFF ; 255 29142: ce 01 movw r24, r28 29144: 05 96 adiw r24, 0x05 ; 5 29146: 0e 94 d1 68 call 0xd1a2 ; 0xd1a2 position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 2914a: 4d 80 ldd r4, Y+5 ; 0x05 2914c: 5e 80 ldd r5, Y+6 ; 0x06 2914e: 6f 80 ldd r6, Y+7 ; 0x07 29150: 78 84 ldd r7, Y+8 ; 0x08 29152: 20 91 6b 0d lds r18, 0x0D6B ; 0x800d6b 29156: 30 91 6c 0d lds r19, 0x0D6C ; 0x800d6c 2915a: 40 91 6d 0d lds r20, 0x0D6D ; 0x800d6d 2915e: 50 91 6e 0d lds r21, 0x0D6E ; 0x800d6e 29162: c3 01 movw r24, r6 29164: b2 01 movw r22, r4 29166: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2916a: 0f 94 a3 a8 call 0x35146 ; 0x35146 2916e: 60 93 3c 06 sts 0x063C, r22 ; 0x80063c 29172: 70 93 3d 06 sts 0x063D, r23 ; 0x80063d 29176: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e 2917a: 90 93 3f 06 sts 0x063F, r25 ; 0x80063f position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 2917e: 89 80 ldd r8, Y+1 ; 0x01 29180: 9a 80 ldd r9, Y+2 ; 0x02 29182: ab 80 ldd r10, Y+3 ; 0x03 29184: bc 80 ldd r11, Y+4 ; 0x04 29186: 20 91 6f 0d lds r18, 0x0D6F ; 0x800d6f 2918a: 30 91 70 0d lds r19, 0x0D70 ; 0x800d70 2918e: 40 91 71 0d lds r20, 0x0D71 ; 0x800d71 29192: 50 91 72 0d lds r21, 0x0D72 ; 0x800d72 29196: c5 01 movw r24, r10 29198: b4 01 movw r22, r8 2919a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2919e: 0f 94 a3 a8 call 0x35146 ; 0x35146 291a2: 60 93 40 06 sts 0x0640, r22 ; 0x800640 291a6: 70 93 41 06 sts 0x0641, r23 ; 0x800641 291aa: 80 93 42 06 sts 0x0642, r24 ; 0x800642 291ae: 90 93 43 06 sts 0x0643, r25 ; 0x800643 #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 291b2: 80 91 09 13 lds r24, 0x1309 ; 0x801309 291b6: 88 23 and r24, r24 291b8: 09 f4 brne .+2 ; 0x291bc 291ba: 8c c0 rjmp .+280 ; 0x292d4 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 291bc: a5 01 movw r20, r10 291be: 94 01 movw r18, r8 291c0: c3 01 movw r24, r6 291c2: b2 01 movw r22, r4 291c4: 0f 94 d6 91 call 0x323ac ; 0x323ac 291c8: 9b 01 movw r18, r22 291ca: ac 01 movw r20, r24 291cc: c7 01 movw r24, r14 291ce: b6 01 movw r22, r12 291d0: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 291d4: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 291d8: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 291dc: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 291e0: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 lround(z*cs.axis_steps_per_mm[Z_AXIS]); 291e4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__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 ? 291e8: 0f 94 a3 a8 call 0x35146 ; 0x35146 291ec: 60 93 44 06 sts 0x0644, r22 ; 0x800644 291f0: 70 93 45 06 sts 0x0645, r23 ; 0x800645 291f4: 80 93 46 06 sts 0x0646, r24 ; 0x800646 291f8: 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]); 291fc: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 29200: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 29204: a0 91 6f 12 lds r26, 0x126F ; 0x80126f 29208: b0 91 70 12 lds r27, 0x1270 ; 0x801270 2920c: 89 87 std Y+9, r24 ; 0x09 2920e: 9a 87 std Y+10, r25 ; 0x0a 29210: ab 87 std Y+11, r26 ; 0x0b 29212: bc 87 std Y+12, r27 ; 0x0c 29214: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 29218: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 2921c: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 29220: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 29224: bc 01 movw r22, r24 29226: cd 01 movw r24, r26 29228: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2922c: 0f 94 a3 a8 call 0x35146 ; 0x35146 29230: 60 93 48 06 sts 0x0648, r22 ; 0x800648 29234: 70 93 49 06 sts 0x0649, r23 ; 0x800649 29238: 80 93 4a 06 sts 0x064A, r24 ; 0x80064a 2923c: 90 93 4b 06 sts 0x064B, r25 ; 0x80064b #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 29240: 40 92 36 04 sts 0x0436, r4 ; 0x800436 29244: 50 92 37 04 sts 0x0437, r5 ; 0x800437 29248: 60 92 38 04 sts 0x0438, r6 ; 0x800438 2924c: 70 92 39 04 sts 0x0439, r7 ; 0x800439 position_float[Y_AXIS] = y; 29250: 80 92 3a 04 sts 0x043A, r8 ; 0x80043a 29254: 90 92 3b 04 sts 0x043B, r9 ; 0x80043b 29258: a0 92 3c 04 sts 0x043C, r10 ; 0x80043c 2925c: b0 92 3d 04 sts 0x043D, r11 ; 0x80043d position_float[Z_AXIS] = z; 29260: c0 92 3e 04 sts 0x043E, r12 ; 0x80043e 29264: d0 92 3f 04 sts 0x043F, r13 ; 0x80043f 29268: e0 92 40 04 sts 0x0440, r14 ; 0x800440 2926c: f0 92 41 04 sts 0x0441, r15 ; 0x800441 position_float[E_AXIS] = e; 29270: 89 85 ldd r24, Y+9 ; 0x09 29272: 9a 85 ldd r25, Y+10 ; 0x0a 29274: ab 85 ldd r26, Y+11 ; 0x0b 29276: bc 85 ldd r27, Y+12 ; 0x0c 29278: 80 93 42 04 sts 0x0442, r24 ; 0x800442 2927c: 90 93 43 04 sts 0x0443, r25 ; 0x800443 29280: a0 93 44 04 sts 0x0444, r26 ; 0x800444 29284: b0 93 45 04 sts 0x0445, r27 ; 0x800445 #endif st_set_position(position); 29288: 0f 94 c3 79 call 0x2f386 ; 0x2f386 previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 2928c: 10 92 22 04 sts 0x0422, r1 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.444> 29290: 10 92 23 04 sts 0x0423, r1 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.444+0x1> 29294: 10 92 24 04 sts 0x0424, r1 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.444+0x2> 29298: 10 92 25 04 sts 0x0425, r1 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.444+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 2929c: e6 e2 ldi r30, 0x26 ; 38 2929e: f4 e0 ldi r31, 0x04 ; 4 292a0: 80 e1 ldi r24, 0x10 ; 16 292a2: df 01 movw r26, r30 292a4: 1d 92 st X+, r1 292a6: 8a 95 dec r24 292a8: e9 f7 brne .-6 ; 0x292a4 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]); } 292aa: 2c 96 adiw r28, 0x0c ; 12 292ac: 0f b6 in r0, 0x3f ; 63 292ae: f8 94 cli 292b0: de bf out 0x3e, r29 ; 62 292b2: 0f be out 0x3f, r0 ; 63 292b4: cd bf out 0x3d, r28 ; 61 292b6: df 91 pop r29 292b8: cf 91 pop r28 292ba: ff 90 pop r15 292bc: ef 90 pop r14 292be: df 90 pop r13 292c0: cf 90 pop r12 292c2: bf 90 pop r11 292c4: af 90 pop r10 292c6: 9f 90 pop r9 292c8: 8f 90 pop r8 292ca: 7f 90 pop r7 292cc: 6f 90 pop r6 292ce: 5f 90 pop r5 292d0: 4f 90 pop r4 292d2: 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]); 292d4: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 292d8: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 292dc: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 292e0: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 292e4: c7 01 movw r24, r14 292e6: b6 01 movw r22, r12 292e8: 7d cf rjmp .-262 ; 0x291e4 000292ea : 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) { 292ea: 8f 92 push r8 292ec: 9f 92 push r9 292ee: af 92 push r10 292f0: bf 92 push r11 292f2: cf 92 push r12 292f4: df 92 push r13 292f6: ef 92 push r14 292f8: ff 92 push r15 292fa: 0f 93 push r16 292fc: 1f 93 push r17 292fe: 4b 01 movw r8, r22 29300: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 29302: e9 e2 ldi r30, 0x29 ; 41 29304: f6 e0 ldi r31, 0x06 ; 6 29306: e0 84 ldd r14, Z+8 ; 0x08 29308: f1 84 ldd r15, Z+9 ; 0x09 2930a: 02 85 ldd r16, Z+10 ; 0x0a 2930c: 13 85 ldd r17, Z+11 ; 0x0b 2930e: 24 81 ldd r18, Z+4 ; 0x04 29310: 35 81 ldd r19, Z+5 ; 0x05 29312: 46 81 ldd r20, Z+6 ; 0x06 29314: 57 81 ldd r21, Z+7 ; 0x07 29316: 60 81 ld r22, Z 29318: 71 81 ldd r23, Z+1 ; 0x01 2931a: 82 81 ldd r24, Z+2 ; 0x02 2931c: 93 81 ldd r25, Z+3 ; 0x03 2931e: 1f 92 push r1 29320: 1f 92 push r1 29322: 1f 92 push r1 29324: 1f 92 push r1 29326: e5 e3 ldi r30, 0x35 ; 53 29328: ce 2e mov r12, r30 2932a: e6 e0 ldi r30, 0x06 ; 6 2932c: de 2e mov r13, r30 2932e: 0f 94 5a 3a call 0x274b4 ; 0x274b4 29332: 0f 90 pop r0 29334: 0f 90 pop r0 29336: 0f 90 pop r0 29338: 0f 90 pop r0 } 2933a: 1f 91 pop r17 2933c: 0f 91 pop r16 2933e: ff 90 pop r15 29340: ef 90 pop r14 29342: df 90 pop r13 29344: cf 90 pop r12 29346: bf 90 pop r11 29348: af 90 pop r10 2934a: 9f 90 pop r9 2934c: 8f 90 pop r8 2934e: 08 95 ret 00029350 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 29350: 8f 92 push r8 29352: 9f 92 push r9 29354: af 92 push r10 29356: bf 92 push r11 29358: cf 92 push r12 2935a: df 92 push r13 2935c: ef 92 push r14 2935e: ff 92 push r15 29360: 0f 93 push r16 29362: 1f 93 push r17 29364: 4b 01 movw r8, r22 29366: 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); 29368: e1 e6 ldi r30, 0x61 ; 97 2936a: f2 e1 ldi r31, 0x12 ; 18 2936c: e0 84 ldd r14, Z+8 ; 0x08 2936e: f1 84 ldd r15, Z+9 ; 0x09 29370: 02 85 ldd r16, Z+10 ; 0x0a 29372: 13 85 ldd r17, Z+11 ; 0x0b 29374: 24 81 ldd r18, Z+4 ; 0x04 29376: 35 81 ldd r19, Z+5 ; 0x05 29378: 46 81 ldd r20, Z+6 ; 0x06 2937a: 57 81 ldd r21, Z+7 ; 0x07 2937c: 60 81 ld r22, Z 2937e: 71 81 ldd r23, Z+1 ; 0x01 29380: 82 81 ldd r24, Z+2 ; 0x02 29382: 93 81 ldd r25, Z+3 ; 0x03 29384: 1f 92 push r1 29386: 1f 92 push r1 29388: 1f 92 push r1 2938a: 1f 92 push r1 2938c: ed e6 ldi r30, 0x6D ; 109 2938e: ce 2e mov r12, r30 29390: e2 e1 ldi r30, 0x12 ; 18 29392: de 2e mov r13, r30 29394: 0f 94 5a 3a call 0x274b4 ; 0x274b4 29398: 0f 90 pop r0 2939a: 0f 90 pop r0 2939c: 0f 90 pop r0 2939e: 0f 90 pop r0 } 293a0: 1f 91 pop r17 293a2: 0f 91 pop r16 293a4: ff 90 pop r15 293a6: ef 90 pop r14 293a8: df 90 pop r13 293aa: cf 90 pop r12 293ac: bf 90 pop r11 293ae: af 90 pop r10 293b0: 9f 90 pop r9 293b2: 8f 90 pop r8 293b4: 08 95 ret 000293b6 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 293b6: 2f 92 push r2 293b8: 3f 92 push r3 293ba: 4f 92 push r4 293bc: 5f 92 push r5 293be: 6f 92 push r6 293c0: 7f 92 push r7 293c2: 9f 92 push r9 293c4: af 92 push r10 293c6: bf 92 push r11 293c8: cf 92 push r12 293ca: df 92 push r13 293cc: ef 92 push r14 293ce: ff 92 push r15 293d0: 0f 93 push r16 293d2: 1f 93 push r17 293d4: cf 93 push r28 293d6: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 293d8: 70 91 71 12 lds r23, 0x1271 ; 0x801271 293dc: 71 11 cpse r23, r1 293de: 04 c0 rjmp .+8 ; 0x293e8 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x32> 293e0: 70 91 72 12 lds r23, 0x1272 ; 0x801272 293e4: 77 23 and r23, r23 293e6: 99 f0 breq .+38 ; 0x2940e <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+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(); } 293e8: df 91 pop r29 293ea: cf 91 pop r28 293ec: 1f 91 pop r17 293ee: 0f 91 pop r16 293f0: ff 90 pop r15 293f2: ef 90 pop r14 293f4: df 90 pop r13 293f6: cf 90 pop r12 293f8: bf 90 pop r11 293fa: af 90 pop r10 293fc: 9f 90 pop r9 293fe: 7f 90 pop r7 29400: 6f 90 pop r6 29402: 5f 90 pop r5 29404: 4f 90 pop r4 29406: 3f 90 pop r3 29408: 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(); 2940a: 0c 94 76 63 jmp 0xc6ec ; 0xc6ec 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) 2940e: 70 91 96 03 lds r23, 0x0396 ; 0x800396 29412: 71 11 cpse r23, r1 29414: 09 c0 rjmp .+18 ; 0x29428 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 29416: 70 91 77 02 lds r23, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.386> check_endstops = check; 2941a: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.386> { _md->endstopsEnabledPrevious = enable_endstops(false); 2941e: 70 93 97 03 sts 0x0397, r23 ; 0x800397 _md->initialized = true; 29422: 71 e0 ldi r23, 0x01 ; 1 29424: 70 93 96 03 sts 0x0396, r23 ; 0x800396 29428: 19 01 movw r2, r18 2942a: 6a 01 movw r12, r20 2942c: c6 2f mov r28, r22 2942e: d9 2f mov r29, r25 29430: 98 2e mov r9, r24 } if (lcd_encoder != 0) 29432: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 29436: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 2943a: 89 2b or r24, r25 2943c: 09 f4 brne .+2 ; 0x29440 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x8a> 2943e: 71 c0 rjmp .+226 ; 0x29522 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x16c> { refresh_cmd_timeout(); 29440: 0e 94 9c 65 call 0xcb38 ; 0xcb38 } FORCE_INLINE bool planner_queue_full() { uint8_t next_block_index = block_buffer_head; 29444: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e if (++ next_block_index == BLOCK_BUFFER_SIZE) 29448: 8f 5f subi r24, 0xFF ; 255 2944a: 80 31 cpi r24, 0x10 ; 16 2944c: 09 f4 brne .+2 ; 0x29450 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x9a> next_block_index = 0; 2944e: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 29450: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f if (! planner_queue_full()) 29454: 98 17 cp r25, r24 29456: 09 f4 brne .+2 ; 0x2945a <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0xa4> 29458: 64 c0 rjmp .+200 ; 0x29522 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x16c> { current_position[axis] += lcd_encoder; 2945a: 84 e0 ldi r24, 0x04 ; 4 2945c: c8 9f mul r28, r24 2945e: 80 01 movw r16, r0 29460: 11 24 eor r1, r1 29462: f8 01 movw r30, r16 29464: ef 59 subi r30, 0x9F ; 159 29466: fd 4e sbci r31, 0xED ; 237 29468: 5f 01 movw r10, r30 2946a: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 2946e: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 29472: 07 2e mov r0, r23 29474: 00 0c add r0, r0 29476: 88 0b sbc r24, r24 29478: 99 0b sbc r25, r25 2947a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2947e: f5 01 movw r30, r10 29480: 20 81 ld r18, Z 29482: 31 81 ldd r19, Z+1 ; 0x01 29484: 42 81 ldd r20, Z+2 ; 0x02 29486: 53 81 ldd r21, Z+3 ; 0x03 29488: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2948c: 2b 01 movw r4, r22 2948e: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 29490: b6 01 movw r22, r12 29492: dd 0c add r13, r13 29494: 88 0b sbc r24, r24 29496: 99 0b sbc r25, r25 29498: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2949c: 6b 01 movw r12, r22 2949e: 7c 01 movw r14, r24 294a0: ac 01 movw r20, r24 294a2: 9b 01 movw r18, r22 294a4: c3 01 movw r24, r6 294a6: b2 01 movw r22, r4 294a8: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 294ac: f5 01 movw r30, r10 294ae: 87 fd sbrc r24, 7 294b0: 7d c0 rjmp .+250 ; 0x295ac <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x1f6> if (lcd_encoder != 0) { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; 294b2: 40 82 st Z, r4 294b4: 51 82 std Z+1, r5 ; 0x01 294b6: 62 82 std Z+2, r6 ; 0x02 294b8: 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; 294ba: b1 01 movw r22, r2 294bc: 33 0c add r3, r3 294be: 88 0b sbc r24, r24 294c0: 99 0b sbc r25, r25 294c2: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 294c6: 2b 01 movw r4, r22 294c8: 3c 01 movw r6, r24 294ca: c8 01 movw r24, r16 294cc: 8f 59 subi r24, 0x9F ; 159 294ce: 9d 4e sbci r25, 0xED ; 237 294d0: 7c 01 movw r14, r24 294d2: a3 01 movw r20, r6 294d4: 92 01 movw r18, r4 294d6: fc 01 movw r30, r24 294d8: 60 81 ld r22, Z 294da: 71 81 ldd r23, Z+1 ; 0x01 294dc: 82 81 ldd r24, Z+2 ; 0x02 294de: 93 81 ldd r25, Z+3 ; 0x03 294e0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 294e4: 18 16 cp r1, r24 294e6: 2c f4 brge .+10 ; 0x294f2 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x13c> 294e8: f7 01 movw r30, r14 294ea: 40 82 st Z, r4 294ec: 51 82 std Z+1, r5 ; 0x01 294ee: 62 82 std Z+2, r6 ; 0x02 294f0: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 294f2: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 294f6: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 294fa: 65 e6 ldi r22, 0x65 ; 101 294fc: 72 e1 ldi r23, 0x12 ; 18 294fe: 81 e6 ldi r24, 0x61 ; 97 29500: 92 e1 ldi r25, 0x12 ; 18 29502: 0e 94 79 69 call 0xd2f2 ; 0xd2f2 plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 29506: f8 01 movw r30, r16 29508: e0 52 subi r30, 0x20 ; 32 2950a: fd 4f sbci r31, 0xFD ; 253 2950c: 60 81 ld r22, Z 2950e: 71 81 ldd r23, Z+1 ; 0x01 29510: 82 81 ldd r24, Z+2 ; 0x02 29512: 93 81 ldd r25, Z+3 ; 0x03 29514: 0e 94 a0 65 call 0xcb40 ; 0xcb40 29518: 0f 94 a8 49 call 0x29350 ; 0x29350 lcd_draw_update = 1; 2951c: 81 e0 ldi r24, 0x01 ; 1 2951e: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } } if (lcd_draw_update) 29522: 80 91 59 02 lds r24, 0x0259 ; 0x800259 29526: 88 23 and r24, r24 29528: 11 f1 breq .+68 ; 0x2956e <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x1b8> { lcd_set_cursor(0, 1); 2952a: 61 e0 ldi r22, 0x01 ; 1 2952c: 80 e0 ldi r24, 0x00 ; 0 2952e: 0e 94 b5 6f call 0xdf6a ; 0xdf6a menu_draw_float31(name, current_position[axis]); 29532: 84 e0 ldi r24, 0x04 ; 4 29534: c8 9f mul r28, r24 29536: f0 01 movw r30, r0 29538: 11 24 eor r1, r1 2953a: ef 59 subi r30, 0x9F ; 159 2953c: 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); 2953e: 83 81 ldd r24, Z+3 ; 0x03 29540: 8f 93 push r24 29542: 82 81 ldd r24, Z+2 ; 0x02 29544: 8f 93 push r24 29546: 81 81 ldd r24, Z+1 ; 0x01 29548: 8f 93 push r24 2954a: 80 81 ld r24, Z 2954c: 8f 93 push r24 2954e: df 93 push r29 29550: 9f 92 push r9 29552: 8d e1 ldi r24, 0x1D ; 29 29554: 93 e8 ldi r25, 0x83 ; 131 29556: 9f 93 push r25 29558: 8f 93 push r24 2955a: 0e 94 66 6f call 0xdecc ; 0xdecc 2955e: ed b7 in r30, 0x3d ; 61 29560: fe b7 in r31, 0x3e ; 62 29562: 38 96 adiw r30, 0x08 ; 8 29564: 0f b6 in r0, 0x3f ; 63 29566: f8 94 cli 29568: fe bf out 0x3e, r31 ; 62 2956a: 0f be out 0x3f, r0 ; 63 2956c: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 2956e: 80 91 c4 03 lds r24, 0x03C4 ; 0x8003c4 29572: 81 11 cpse r24, r1 29574: 04 c0 rjmp .+8 ; 0x2957e <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x1c8> 29576: 80 91 95 03 lds r24, 0x0395 ; 0x800395 2957a: 88 23 and r24, r24 2957c: 21 f0 breq .+8 ; 0x29586 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x1d0> 2957e: 80 91 97 03 lds r24, 0x0397 ; 0x800397 29582: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.386> menu_back_if_clicked(); } 29586: df 91 pop r29 29588: cf 91 pop r28 2958a: 1f 91 pop r17 2958c: 0f 91 pop r16 2958e: ff 90 pop r15 29590: ef 90 pop r14 29592: df 90 pop r13 29594: cf 90 pop r12 29596: bf 90 pop r11 29598: af 90 pop r10 2959a: 9f 90 pop r9 2959c: 7f 90 pop r7 2959e: 6f 90 pop r6 295a0: 5f 90 pop r5 295a2: 4f 90 pop r4 295a4: 3f 90 pop r3 295a6: 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(); 295a8: 0c 94 61 74 jmp 0xe8c2 ; 0xe8c2 { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 295ac: c0 82 st Z, r12 295ae: d1 82 std Z+1, r13 ; 0x01 295b0: e2 82 std Z+2, r14 ; 0x02 295b2: f3 82 std Z+3, r15 ; 0x03 295b4: 82 cf rjmp .-252 ; 0x294ba <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.407]+0x104> 000295b6 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 295b6: 4f 92 push r4 295b8: 5f 92 push r5 295ba: 6f 92 push r6 295bc: 7f 92 push r7 295be: 8f 92 push r8 295c0: 9f 92 push r9 295c2: af 92 push r10 295c4: bf 92 push r11 295c6: cf 92 push r12 295c8: df 92 push r13 295ca: ef 92 push r14 295cc: ff 92 push r15 295ce: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 295d0: 80 e0 ldi r24, 0x00 ; 0 295d2: 0f 94 39 18 call 0x23072 ; 0x23072 295d6: 60 93 3c 06 sts 0x063C, r22 ; 0x80063c 295da: 70 93 3d 06 sts 0x063D, r23 ; 0x80063d 295de: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e 295e2: 90 93 3f 06 sts 0x063F, r25 ; 0x80063f position[Y_AXIS] = st_get_position(Y_AXIS); 295e6: 81 e0 ldi r24, 0x01 ; 1 295e8: 0f 94 39 18 call 0x23072 ; 0x23072 295ec: 60 93 40 06 sts 0x0640, r22 ; 0x800640 295f0: 70 93 41 06 sts 0x0641, r23 ; 0x800641 295f4: 80 93 42 06 sts 0x0642, r24 ; 0x800642 295f8: 90 93 43 06 sts 0x0643, r25 ; 0x800643 position[Z_AXIS] = st_get_position(Z_AXIS); 295fc: 82 e0 ldi r24, 0x02 ; 2 295fe: 0f 94 39 18 call 0x23072 ; 0x23072 29602: 60 93 44 06 sts 0x0644, r22 ; 0x800644 29606: 70 93 45 06 sts 0x0645, r23 ; 0x800645 2960a: 80 93 46 06 sts 0x0646, r24 ; 0x800646 2960e: 90 93 47 06 sts 0x0647, r25 ; 0x800647 position[E_AXIS] = st_get_position(E_AXIS); 29612: 83 e0 ldi r24, 0x03 ; 3 29614: 0f 94 39 18 call 0x23072 ; 0x23072 29618: 60 93 48 06 sts 0x0648, r22 ; 0x800648 2961c: 70 93 49 06 sts 0x0649, r23 ; 0x800649 29620: 80 93 4a 06 sts 0x064A, r24 ; 0x80064a 29624: 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); 29628: 80 e0 ldi r24, 0x00 ; 0 2962a: 0f 94 47 18 call 0x2308e ; 0x2308e 2962e: 60 93 61 12 sts 0x1261, r22 ; 0x801261 29632: 70 93 62 12 sts 0x1262, r23 ; 0x801262 29636: 80 93 63 12 sts 0x1263, r24 ; 0x801263 2963a: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 2963e: 81 e0 ldi r24, 0x01 ; 1 29640: 0f 94 47 18 call 0x2308e ; 0x2308e 29644: 60 93 65 12 sts 0x1265, r22 ; 0x801265 29648: 70 93 66 12 sts 0x1266, r23 ; 0x801266 2964c: 80 93 67 12 sts 0x1267, r24 ; 0x801267 29650: 90 93 68 12 sts 0x1268, r25 ; 0x801268 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 29654: 82 e0 ldi r24, 0x02 ; 2 29656: 0f 94 47 18 call 0x2308e ; 0x2308e 2965a: 60 93 69 12 sts 0x1269, r22 ; 0x801269 2965e: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 29662: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 29666: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c current_position[E_AXIS] = st_get_position_mm(E_AXIS); 2966a: 83 e0 ldi r24, 0x03 ; 3 2966c: 0f 94 47 18 call 0x2308e ; 0x2308e 29670: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 29674: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 29678: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 2967c: 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) { 29680: 80 91 09 13 lds r24, 0x1309 ; 0x801309 29684: 88 23 and r24, r24 29686: 31 f1 breq .+76 ; 0x296d4 #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]); 29688: 20 91 65 12 lds r18, 0x1265 ; 0x801265 2968c: 30 91 66 12 lds r19, 0x1266 ; 0x801266 29690: 40 91 67 12 lds r20, 0x1267 ; 0x801267 29694: 50 91 68 12 lds r21, 0x1268 ; 0x801268 29698: 60 91 61 12 lds r22, 0x1261 ; 0x801261 2969c: 70 91 62 12 lds r23, 0x1262 ; 0x801262 296a0: 80 91 63 12 lds r24, 0x1263 ; 0x801263 296a4: 90 91 64 12 lds r25, 0x1264 ; 0x801264 296a8: 0f 94 d6 91 call 0x323ac ; 0x323ac 296ac: 9b 01 movw r18, r22 296ae: ac 01 movw r20, r24 296b0: 60 91 69 12 lds r22, 0x1269 ; 0x801269 296b4: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 296b8: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 296bc: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 296c0: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 296c4: 60 93 69 12 sts 0x1269, r22 ; 0x801269 296c8: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 296cc: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 296d0: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 296d4: c0 91 a2 04 lds r28, 0x04A2 ; 0x8004a2 296d8: cc 23 and r28, r28 296da: 09 f4 brne .+2 ; 0x296de 296dc: 9a c0 rjmp .+308 ; 0x29812 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 296de: c0 ff sbrs r28, 0 296e0: 34 c0 rjmp .+104 ; 0x2974a // Then add the offset. x -= world2machine_shift[0]; 296e2: 20 91 9a 04 lds r18, 0x049A ; 0x80049a 296e6: 30 91 9b 04 lds r19, 0x049B ; 0x80049b 296ea: 40 91 9c 04 lds r20, 0x049C ; 0x80049c 296ee: 50 91 9d 04 lds r21, 0x049D ; 0x80049d 296f2: 60 91 61 12 lds r22, 0x1261 ; 0x801261 296f6: 70 91 62 12 lds r23, 0x1262 ; 0x801262 296fa: 80 91 63 12 lds r24, 0x1263 ; 0x801263 296fe: 90 91 64 12 lds r25, 0x1264 ; 0x801264 29702: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 29706: 60 93 61 12 sts 0x1261, r22 ; 0x801261 2970a: 70 93 62 12 sts 0x1262, r23 ; 0x801262 2970e: 80 93 63 12 sts 0x1263, r24 ; 0x801263 29712: 90 93 64 12 sts 0x1264, r25 ; 0x801264 y -= world2machine_shift[1]; 29716: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 2971a: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 2971e: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 29722: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 29726: 60 91 65 12 lds r22, 0x1265 ; 0x801265 2972a: 70 91 66 12 lds r23, 0x1266 ; 0x801266 2972e: 80 91 67 12 lds r24, 0x1267 ; 0x801267 29732: 90 91 68 12 lds r25, 0x1268 ; 0x801268 29736: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2973a: 60 93 65 12 sts 0x1265, r22 ; 0x801265 2973e: 70 93 66 12 sts 0x1266, r23 ; 0x801266 29742: 80 93 67 12 sts 0x1267, r24 ; 0x801267 29746: 90 93 68 12 sts 0x1268, r25 ; 0x801268 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 2974a: c1 ff sbrs r28, 1 2974c: 62 c0 rjmp .+196 ; 0x29812 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 2974e: 80 90 61 12 lds r8, 0x1261 ; 0x801261 29752: 90 90 62 12 lds r9, 0x1262 ; 0x801262 29756: a0 90 63 12 lds r10, 0x1263 ; 0x801263 2975a: b0 90 64 12 lds r11, 0x1264 ; 0x801264 2975e: c0 90 65 12 lds r12, 0x1265 ; 0x801265 29762: d0 90 66 12 lds r13, 0x1266 ; 0x801266 29766: e0 90 67 12 lds r14, 0x1267 ; 0x801267 2976a: 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; 2976e: 20 91 92 04 lds r18, 0x0492 ; 0x800492 29772: 30 91 93 04 lds r19, 0x0493 ; 0x800493 29776: 40 91 94 04 lds r20, 0x0494 ; 0x800494 2977a: 50 91 95 04 lds r21, 0x0495 ; 0x800495 2977e: c5 01 movw r24, r10 29780: b4 01 movw r22, r8 29782: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 29786: 2b 01 movw r4, r22 29788: 3c 01 movw r6, r24 2978a: 20 91 96 04 lds r18, 0x0496 ; 0x800496 2978e: 30 91 97 04 lds r19, 0x0497 ; 0x800497 29792: 40 91 98 04 lds r20, 0x0498 ; 0x800498 29796: 50 91 99 04 lds r21, 0x0499 ; 0x800499 2979a: c7 01 movw r24, r14 2979c: b6 01 movw r22, r12 2979e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 297a2: 9b 01 movw r18, r22 297a4: ac 01 movw r20, r24 297a6: c3 01 movw r24, r6 297a8: b2 01 movw r22, r4 297aa: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 297ae: 2b 01 movw r4, r22 297b0: 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; 297b2: 20 91 8a 04 lds r18, 0x048A ; 0x80048a 297b6: 30 91 8b 04 lds r19, 0x048B ; 0x80048b 297ba: 40 91 8c 04 lds r20, 0x048C ; 0x80048c 297be: 50 91 8d 04 lds r21, 0x048D ; 0x80048d 297c2: c5 01 movw r24, r10 297c4: b4 01 movw r22, r8 297c6: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 297ca: 4b 01 movw r8, r22 297cc: 5c 01 movw r10, r24 297ce: 20 91 8e 04 lds r18, 0x048E ; 0x80048e 297d2: 30 91 8f 04 lds r19, 0x048F ; 0x80048f 297d6: 40 91 90 04 lds r20, 0x0490 ; 0x800490 297da: 50 91 91 04 lds r21, 0x0491 ; 0x800491 297de: c7 01 movw r24, r14 297e0: b6 01 movw r22, r12 297e2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 297e6: 9b 01 movw r18, r22 297e8: ac 01 movw r20, r24 297ea: c5 01 movw r24, r10 297ec: b4 01 movw r22, r8 297ee: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 297f2: 60 93 61 12 sts 0x1261, r22 ; 0x801261 297f6: 70 93 62 12 sts 0x1262, r23 ; 0x801262 297fa: 80 93 63 12 sts 0x1263, r24 ; 0x801263 297fe: 90 93 64 12 sts 0x1264, r25 ; 0x801264 y = out_y; 29802: 40 92 65 12 sts 0x1265, r4 ; 0x801265 29806: 50 92 66 12 sts 0x1266, r5 ; 0x801266 2980a: 60 92 67 12 sts 0x1267, r6 ; 0x801267 2980e: 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(); 29812: 0e 94 09 67 call 0xce12 ; 0xce12 #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 29816: 80 e1 ldi r24, 0x10 ; 16 29818: e1 e6 ldi r30, 0x61 ; 97 2981a: f2 e1 ldi r31, 0x12 ; 18 2981c: a6 e3 ldi r26, 0x36 ; 54 2981e: b4 e0 ldi r27, 0x04 ; 4 29820: 01 90 ld r0, Z+ 29822: 0d 92 st X+, r0 29824: 8a 95 dec r24 29826: e1 f7 brne .-8 ; 0x29820 #endif } 29828: cf 91 pop r28 2982a: ff 90 pop r15 2982c: ef 90 pop r14 2982e: df 90 pop r13 29830: cf 90 pop r12 29832: bf 90 pop r11 29834: af 90 pop r10 29836: 9f 90 pop r9 29838: 8f 90 pop r8 2983a: 7f 90 pop r7 2983c: 6f 90 pop r6 2983e: 5f 90 pop r5 29840: 4f 90 pop r4 29842: 08 95 ret 00029844 : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 29844: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 29848: 8d 7f andi r24, 0xFD ; 253 2984a: 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(); 2984e: 0f 94 db 4a call 0x295b6 ; 0x295b6 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 29852: 81 e0 ldi r24, 0x01 ; 1 29854: 80 93 42 0d sts 0x0D42, r24 ; 0x800d42 } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 29858: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 2985c: 8d 7f andi r24, 0xFD ; 253 2985e: 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); 29862: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 29866: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f while (blocks_queued()) plan_discard_current_block(); 2986a: 98 17 cp r25, r24 2986c: 69 f0 breq .+26 ; 0x29888 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) { 2986e: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 29872: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 29876: 98 17 cp r25, r24 29878: a1 f3 breq .-24 ; 0x29862 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2987a: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 2987e: 8f 5f subi r24, 0xFF ; 255 29880: 8f 70 andi r24, 0x0F ; 15 29882: 80 93 3f 0d sts 0x0D3F, r24 ; 0x800d3f 29886: ed cf rjmp .-38 ; 0x29862 current_block = NULL; 29888: 10 92 52 12 sts 0x1252, r1 ; 0x801252 2988c: 10 92 51 12 sts 0x1251, r1 ; 0x801251 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 29890: 8f ef ldi r24, 0xFF ; 255 29892: 9f ef ldi r25, 0xFF ; 255 29894: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.438+0x1> 29898: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.438> current_adv_steps = 0; 2989c: 10 92 49 04 sts 0x0449, r1 ; 0x800449 <_ZL17current_adv_steps.lto_priv.440+0x1> 298a0: 10 92 48 04 sts 0x0448, r1 ; 0x800448 <_ZL17current_adv_steps.lto_priv.440> #endif st_reset_timer(); 298a4: 0f 94 a5 18 call 0x2314a ; 0x2314a ENABLE_STEPPER_DRIVER_INTERRUPT(); 298a8: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 298ac: 82 60 ori r24, 0x02 ; 2 298ae: 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; 298b2: 10 92 22 04 sts 0x0422, r1 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.444> 298b6: 10 92 23 04 sts 0x0423, r1 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.444+0x1> 298ba: 10 92 24 04 sts 0x0424, r1 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.444+0x2> 298be: 10 92 25 04 sts 0x0425, r1 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.444+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 298c2: e6 e2 ldi r30, 0x26 ; 38 298c4: f4 e0 ldi r31, 0x04 ; 4 298c6: 80 e1 ldi r24, 0x10 ; 16 298c8: df 01 movw r26, r30 298ca: 1d 92 st X+, r1 298cc: 8a 95 dec r24 298ce: e9 f7 brne .-6 ; 0x298ca // Reset position sync requests plan_reset_next_e_queue = false; 298d0: 10 92 21 04 sts 0x0421, r1 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.442> plan_reset_next_e_sched = false; 298d4: 10 92 20 04 sts 0x0420, r1 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.443> } 298d8: 08 95 ret 000298da : pat9125_PID2 = 0xff; return 0; } static void pat9125_wr_reg(uint8_t addr, uint8_t data) { 298da: cf 93 push r28 298dc: df 93 push r29 298de: d8 2f mov r29, r24 298e0: c6 2f mov r28, r22 return 1; } uint8_t swi2c_writeByte_A8(uint8_t dev_addr, uint8_t addr, uint8_t* pbyte) { swi2c_start(); 298e2: 0f 94 bd 14 call 0x2297a ; 0x2297a swi2c_write(SWI2C_WMSK | ((dev_addr & SWI2C_DMSK) << SWI2C_ASHF)); 298e6: 8a ee ldi r24, 0xEA ; 234 298e8: 0f 94 4c 14 call 0x22898 ; 0x22898 if (!swi2c_wait_ack()) { swi2c_stop(); return 0; } 298ec: 0f 94 78 14 call 0x228f0 ; 0x228f0 298f0: 81 11 cpse r24, r1 298f2: 0a c0 rjmp .+20 ; 0x29908 298f4: 0f 94 ad 14 call 0x2295a ; 0x2295a goto error; #endif return; error: pat9125_PID1 = 0xff; 298f8: 8f ef ldi r24, 0xFF ; 255 298fa: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = 0xff; 298fe: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 return; } 29902: df 91 pop r29 29904: cf 91 pop r28 29906: 08 95 ret swi2c_write(addr & 0xff); 29908: 8d 2f mov r24, r29 2990a: 0f 94 4c 14 call 0x22898 ; 0x22898 if (!swi2c_wait_ack()) return 0; 2990e: 0f 94 78 14 call 0x228f0 ; 0x228f0 29912: 88 23 and r24, r24 29914: 89 f3 breq .-30 ; 0x298f8 swi2c_write(*pbyte); 29916: 8c 2f mov r24, r28 29918: 0f 94 4c 14 call 0x22898 ; 0x22898 if (!swi2c_wait_ack()) return 0; 2991c: 0f 94 78 14 call 0x228f0 ; 0x228f0 29920: 88 23 and r24, r24 29922: 51 f3 breq .-44 ; 0x298f8 29924: df 91 pop r29 29926: cf 91 pop r28 swi2c_stop(); 29928: 0d 94 ad 14 jmp 0x2295a ; 0x2295a 0002992c : } return 0; } static uint8_t pat9125_rd_reg(uint8_t addr) { 2992c: 0f 93 push r16 2992e: 1f 93 push r17 29930: cf 93 push r28 29932: 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(); 29934: 0f 94 bd 14 call 0x2297a ; 0x2297a swi2c_write(SWI2C_WMSK | ((dev_addr & SWI2C_DMSK) << SWI2C_ASHF)); 29938: 8a ee ldi r24, 0xEA ; 234 2993a: 0f 94 4c 14 call 0x22898 ; 0x22898 if (!swi2c_wait_ack()) { swi2c_stop(); return 0; } 2993e: 0f 94 78 14 call 0x228f0 ; 0x228f0 29942: 81 11 cpse r24, r1 29944: 09 c0 rjmp .+18 ; 0x29958 29946: 0f 94 ad 14 call 0x2295a ; 0x2295a goto error; #endif return data; error: pat9125_PID1 = 0xff; 2994a: 8f ef ldi r24, 0xFF ; 255 2994c: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = 0xff; 29950: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 return 0; 29954: c0 e0 ldi r28, 0x00 ; 0 29956: 1e c0 rjmp .+60 ; 0x29994 swi2c_write(addr & 0xff); 29958: 8c 2f mov r24, r28 2995a: 0f 94 4c 14 call 0x22898 ; 0x22898 if (!swi2c_wait_ack()) return 0; 2995e: 0f 94 78 14 call 0x228f0 ; 0x228f0 29962: 88 23 and r24, r24 29964: 91 f3 breq .-28 ; 0x2994a swi2c_stop(); 29966: 0f 94 ad 14 call 0x2295a ; 0x2295a swi2c_start(); 2996a: 0f 94 bd 14 call 0x2297a ; 0x2297a swi2c_write(SWI2C_RMSK | ((dev_addr & SWI2C_DMSK) << SWI2C_ASHF)); 2996e: 8b ee ldi r24, 0xEB ; 235 29970: 0f 94 4c 14 call 0x22898 ; 0x22898 if (!swi2c_wait_ack()) return 0; 29974: 0f 94 78 14 call 0x228f0 ; 0x228f0 29978: 88 23 and r24, r24 2997a: 39 f3 breq .-50 ; 0x2994a return ack; } static uint8_t swi2c_read(void) { WRITE(SWI2C_SDA, 1); 2997c: 59 9a sbi 0x0b, 1 ; 11 2997e: 88 e0 ldi r24, 0x08 ; 8 29980: 8a 95 dec r24 29982: f1 f7 brne .-4 ; 0x29980 __delay(); SET_INPUT(SWI2C_SDA); 29984: 51 98 cbi 0x0a, 1 ; 10 uint8_t data = 0; for (uint8_t bit = 8; bit-- > 0;) 29986: 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; 29988: c0 e0 ldi r28, 0x00 ; 0 for (uint8_t bit = 8; bit-- > 0;) 2998a: 81 50 subi r24, 0x01 ; 1 2998c: 40 f4 brcc .+16 ; 0x2999e __delay(); data |= (READ(SWI2C_SDA)) << bit; WRITE(SWI2C_SCL, 0); __delay(); } SET_OUTPUT(SWI2C_SDA); 2998e: 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(); 29990: 0f 94 ad 14 call 0x2295a ; 0x2295a } 29994: 8c 2f mov r24, r28 29996: cf 91 pop r28 29998: 1f 91 pop r17 2999a: 0f 91 pop r16 2999c: 08 95 ret __delay(); SET_INPUT(SWI2C_SDA); uint8_t data = 0; for (uint8_t bit = 8; bit-- > 0;) { WRITE(SWI2C_SCL, 1); 2999e: 2f b7 in r18, 0x3f ; 63 299a0: f8 94 cli 299a2: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 299a6: 94 60 ori r25, 0x04 ; 4 299a8: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 299ac: 2f bf out 0x3f, r18 ; 63 299ae: 98 e0 ldi r25, 0x08 ; 8 299b0: 9a 95 dec r25 299b2: f1 f7 brne .-4 ; 0x299b0 __delay(); data |= (READ(SWI2C_SDA)) << bit; 299b4: 99 b1 in r25, 0x09 ; 9 299b6: 91 fb bst r25, 1 299b8: 00 27 eor r16, r16 299ba: 00 f9 bld r16, 0 299bc: 10 e0 ldi r17, 0x00 ; 0 299be: 98 01 movw r18, r16 299c0: 08 2e mov r0, r24 299c2: 01 c0 rjmp .+2 ; 0x299c6 299c4: 22 0f add r18, r18 299c6: 0a 94 dec r0 299c8: ea f7 brpl .-6 ; 0x299c4 299ca: c2 2b or r28, r18 WRITE(SWI2C_SCL, 0); 299cc: 2f b7 in r18, 0x3f ; 63 299ce: f8 94 cli 299d0: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 299d4: 9b 7f andi r25, 0xFB ; 251 299d6: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 299da: 2f bf out 0x3f, r18 ; 63 299dc: 98 e0 ldi r25, 0x08 ; 8 299de: 9a 95 dec r25 299e0: f1 f7 brne .-4 ; 0x299de 299e2: d3 cf rjmp .-90 ; 0x2998a 000299e4 : pat9125_wr_reg(addr, data); return pat9125_rd_reg(addr) == data; } static uint8_t pat9125_wr_seq(const uint8_t* seq) { 299e4: 0f 93 push r16 299e6: 1f 93 push r17 299e8: cf 93 push r28 299ea: df 93 push r29 299ec: 8c 01 movw r16, r24 for (;;) { const uint8_t addr = pgm_read_byte(seq++); 299ee: f8 01 movw r30, r16 299f0: d4 91 lpm r29, Z if (addr == 0xff) 299f2: df 3f cpi r29, 0xFF ; 255 299f4: 99 f0 breq .+38 ; 0x29a1c break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 299f6: 31 96 adiw r30, 0x01 ; 1 299f8: c4 91 lpm r28, Z return; } static uint8_t pat9125_wr_reg_verify(uint8_t addr, uint8_t data) { pat9125_wr_reg(addr, data); 299fa: 6c 2f mov r22, r28 299fc: 8d 2f mov r24, r29 299fe: 0f 94 6d 4c call 0x298da ; 0x298da return pat9125_rd_reg(addr) == data; 29a02: 8d 2f mov r24, r29 29a04: 0f 94 96 4c call 0x2992c ; 0x2992c { for (;;) { const uint8_t addr = pgm_read_byte(seq++); if (addr == 0xff) break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 29a08: 0e 5f subi r16, 0xFE ; 254 29a0a: 1f 4f sbci r17, 0xFF ; 255 29a0c: c8 17 cp r28, r24 29a0e: 79 f3 breq .-34 ; 0x299ee // Verification of the register write failed. return 0; 29a10: 80 e0 ldi r24, 0x00 ; 0 } return 1; } 29a12: df 91 pop r29 29a14: cf 91 pop r28 29a16: 1f 91 pop r17 29a18: 0f 91 pop r16 29a1a: 08 95 ret break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) // Verification of the register write failed. return 0; } return 1; 29a1c: 81 e0 ldi r24, 0x01 ; 1 29a1e: f9 cf rjmp .-14 ; 0x29a12 00029a20 : return 1; } uint8_t pat9125_update(void) { 29a20: cf 93 push r28 29a22: df 93 push r29 if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 29a24: 80 91 66 0d lds r24, 0x0D66 ; 0x800d66 29a28: 81 33 cpi r24, 0x31 ; 49 29a2a: 21 f0 breq .+8 ; 0x29a34 pat9125_x += iDX; pat9125_y += iDY; } return 1; } return 0; 29a2c: 80 e0 ldi r24, 0x00 ; 0 } 29a2e: df 91 pop r29 29a30: cf 91 pop r28 29a32: 08 95 ret return 1; } uint8_t pat9125_update(void) { if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 29a34: 80 91 65 0d lds r24, 0x0D65 ; 0x800d65 29a38: 81 39 cpi r24, 0x91 ; 145 29a3a: c1 f7 brne .-16 ; 0x29a2c { uint8_t ucMotion = pat9125_rd_reg(PAT9125_MOTION); 29a3c: 82 e0 ldi r24, 0x02 ; 2 29a3e: 0f 94 96 4c call 0x2992c ; 0x2992c 29a42: c8 2f mov r28, r24 pat9125_b = pat9125_rd_reg(PAT9125_FRAME); 29a44: 87 e1 ldi r24, 0x17 ; 23 29a46: 0f 94 96 4c call 0x2992c ; 0x2992c 29a4a: 80 93 63 0d sts 0x0D63, r24 ; 0x800d63 pat9125_s = pat9125_rd_reg(PAT9125_SHUTTER); 29a4e: 84 e1 ldi r24, 0x14 ; 20 29a50: 0f 94 96 4c call 0x2992c ; 0x2992c 29a54: 80 93 64 0d sts 0x0D64, r24 ; 0x800d64 if (pat9125_PID1 == 0xff) return 0; 29a58: 80 91 66 0d lds r24, 0x0D66 ; 0x800d66 29a5c: 8f 3f cpi r24, 0xFF ; 255 29a5e: 31 f3 breq .-52 ; 0x29a2c if (ucMotion & 0x80) 29a60: c7 ff sbrs r28, 7 29a62: 36 c0 rjmp .+108 ; 0x29ad0 { uint16_t ucXL = pat9125_rd_reg(PAT9125_DELTA_XL); 29a64: 83 e0 ldi r24, 0x03 ; 3 29a66: 0f 94 96 4c call 0x2992c ; 0x2992c 29a6a: d8 2f mov r29, r24 uint16_t ucYL = pat9125_rd_reg(PAT9125_DELTA_YL); 29a6c: 84 e0 ldi r24, 0x04 ; 4 29a6e: 0f 94 96 4c call 0x2992c ; 0x2992c 29a72: c8 2f mov r28, r24 uint16_t ucXYH = pat9125_rd_reg(PAT9125_DELTA_XYH); 29a74: 82 e1 ldi r24, 0x12 ; 18 29a76: 0f 94 96 4c call 0x2992c ; 0x2992c if (pat9125_PID1 == 0xff) return 0; 29a7a: 90 91 66 0d lds r25, 0x0D66 ; 0x800d66 29a7e: 9f 3f cpi r25, 0xFF ; 255 29a80: a9 f2 breq .-86 ; 0x29a2c 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); 29a82: 90 e0 ldi r25, 0x00 ; 0 if (pat9125_PID1 == 0xff) return 0; int16_t iDX = ucXL | ((ucXYH << 4) & 0xf00); 29a84: 9c 01 movw r18, r24 29a86: 44 e0 ldi r20, 0x04 ; 4 29a88: 22 0f add r18, r18 29a8a: 33 1f adc r19, r19 29a8c: 4a 95 dec r20 29a8e: e1 f7 brne .-8 ; 0x29a88 29a90: 22 27 eor r18, r18 29a92: 3f 70 andi r19, 0x0F ; 15 29a94: 2d 2b or r18, r29 int16_t iDY = ucYL | ((ucXYH << 8) & 0xf00); 29a96: 98 2f mov r25, r24 29a98: 88 27 eor r24, r24 29a9a: 88 27 eor r24, r24 29a9c: 9f 70 andi r25, 0x0F ; 15 29a9e: 8c 2b or r24, r28 if (iDX & 0x800) iDX -= 4096; 29aa0: 33 fd sbrc r19, 3 29aa2: 30 51 subi r19, 0x10 ; 16 if (iDY & 0x800) iDY -= 4096; 29aa4: 93 fd sbrc r25, 3 29aa6: 90 51 subi r25, 0x10 ; 16 pat9125_x += iDX; 29aa8: 40 91 89 03 lds r20, 0x0389 ; 0x800389 29aac: 50 91 8a 03 lds r21, 0x038A ; 0x80038a 29ab0: 24 0f add r18, r20 29ab2: 35 1f adc r19, r21 29ab4: 30 93 8a 03 sts 0x038A, r19 ; 0x80038a 29ab8: 20 93 89 03 sts 0x0389, r18 ; 0x800389 pat9125_y += iDY; 29abc: 20 91 38 0e lds r18, 0x0E38 ; 0x800e38 29ac0: 30 91 39 0e lds r19, 0x0E39 ; 0x800e39 29ac4: 82 0f add r24, r18 29ac6: 93 1f adc r25, r19 29ac8: 90 93 39 0e sts 0x0E39, r25 ; 0x800e39 29acc: 80 93 38 0e sts 0x0E38, r24 ; 0x800e38 } return 1; 29ad0: 81 e0 ldi r24, 0x01 ; 1 29ad2: ad cf rjmp .-166 ; 0x29a2e 00029ad4 : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 29ad4: 81 e0 ldi r24, 0x01 ; 1 29ad6: 0c 94 93 70 jmp 0xe126 ; 0xe126 00029ada : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 29ada: 0f 93 push r16 29adc: 1f 93 push r17 29ade: cf 93 push r28 29ae0: 8c 01 movw r16, r24 29ae2: c6 2f mov r28, r22 lcd_update_enable(false); 29ae4: 80 e0 ldi r24, 0x00 ; 0 29ae6: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_clear(); 29aea: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 1, pgmS); 29aee: a8 01 movw r20, r16 29af0: 61 e0 ldi r22, 0x01 ; 1 29af2: 80 e0 ldi r24, 0x00 ; 0 29af4: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 29af8: 80 e2 ldi r24, 0x20 ; 32 29afa: 0e 94 fd 70 call 0xe1fa ; 0xe1fa lcd_print(' '); lcd_print(slot + 1); 29afe: 6c 2f mov r22, r28 29b00: 70 e0 ldi r23, 0x00 ; 0 29b02: 6f 5f subi r22, 0xFF ; 255 29b04: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 29b06: 07 2e mov r0, r23 29b08: 00 0c add r0, r0 29b0a: 88 0b sbc r24, r24 29b0c: 99 0b sbc r25, r25 } 29b0e: cf 91 pop r28 29b10: 1f 91 pop r17 29b12: 0f 91 pop r16 29b14: 0c 94 36 72 jmp 0xe46c ; 0xe46c 00029b18 : 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); 29b18: 82 ed ldi r24, 0xD2 ; 210 29b1a: 9e e0 ldi r25, 0x0E ; 14 29b1c: 0e 94 d7 78 call 0xf1ae ; 0xf1ae eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 29b20: 83 ed ldi r24, 0xD3 ; 211 29b22: 9e e0 ldi r25, 0x0E ; 14 29b24: 0c 94 ca 78 jmp 0xf194 ; 0xf194 00029b28 : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 29b28: 41 e0 ldi r20, 0x01 ; 1 29b2a: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 29b2e: 81 11 cpse r24, r1 29b30: 01 c0 rjmp .+2 ; 0x29b34 29b32: 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'); 29b34: 40 5d subi r20, 0xD0 ; 208 29b36: 62 e0 ldi r22, 0x02 ; 2 29b38: 83 e0 ldi r24, 0x03 ; 3 29b3a: 0e 94 6e 70 call 0xe0dc ; 0xe0dc class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 29b3e: 41 e0 ldi r20, 0x01 ; 1 29b40: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 29b44: 81 11 cpse r24, r1 29b46: 01 c0 rjmp .+2 ; 0x29b4a 29b48: 40 e0 ldi r20, 0x00 ; 0 lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 29b4a: 40 5d subi r20, 0xD0 ; 208 29b4c: 62 e0 ldi r22, 0x02 ; 2 29b4e: 88 e0 ldi r24, 0x08 ; 8 29b50: 0e 94 6e 70 call 0xe0dc ; 0xe0dc // print active/changing filament slot lcd_set_cursor(10, 2); 29b54: 62 e0 ldi r22, 0x02 ; 2 29b56: 8a e0 ldi r24, 0x0A ; 10 29b58: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcdui_print_extruder(); 29b5c: 0f 94 29 05 call 0x20a52 ; 0x20a52 // Print active extruder temperature lcd_set_cursor(16, 2); 29b60: 62 e0 ldi r22, 0x02 ; 2 29b62: 80 e1 ldi r24, 0x10 ; 16 29b64: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 29b68: 20 e0 ldi r18, 0x00 ; 0 29b6a: 30 e0 ldi r19, 0x00 ; 0 29b6c: 40 e0 ldi r20, 0x00 ; 0 29b6e: 5f e3 ldi r21, 0x3F ; 63 29b70: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 29b74: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 29b78: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 29b7c: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 29b80: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 29b84: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 29b88: 7f 93 push r23 29b8a: 6f 93 push r22 29b8c: 86 ed ldi r24, 0xD6 ; 214 29b8e: 98 e8 ldi r25, 0x88 ; 136 29b90: 9f 93 push r25 29b92: 8f 93 push r24 29b94: 0e 94 66 6f call 0xdecc ; 0xdecc 29b98: 0f 90 pop r0 29b9a: 0f 90 pop r0 29b9c: 0f 90 pop r0 29b9e: 0f 90 pop r0 } 29ba0: 08 95 ret 00029ba2 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 29ba2: 8a 30 cpi r24, 0x0A ; 10 29ba4: 20 f0 brcs .+8 ; 0x29bae 29ba6: 80 31 cpi r24, 0x10 ; 16 29ba8: 20 f4 brcc .+8 ; 0x29bb2 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 29baa: 89 5a subi r24, 0xA9 ; 169 29bac: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 29bae: 80 5d subi r24, 0xD0 ; 208 29bb0: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 29bb2: 80 e0 ldi r24, 0x00 ; 0 } } 29bb4: 08 95 ret 00029bb6 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 29bb6: 0f 93 push r16 29bb8: 1f 93 push r17 29bba: cf 93 push r28 29bbc: df 93 push r29 29bbe: 08 2f mov r16, r24 29bc0: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 29bc2: 90 e0 ldi r25, 0x00 ; 0 29bc4: 24 e0 ldi r18, 0x04 ; 4 29bc6: 95 95 asr r25 29bc8: 87 95 ror r24 29bca: 2a 95 dec r18 29bcc: e1 f7 brne .-8 ; 0x29bc6 uint8_t charsOut = 1; 29bce: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 29bd0: 00 97 sbiw r24, 0x00 ; 0 29bd2: 21 f0 breq .+8 ; 0x29bdc *dst = Nibble2Char(v); 29bd4: 0f 94 d1 4d call 0x29ba2 ; 0x29ba2 29bd8: 89 93 st Y+, r24 ++dst; charsOut = 2; 29bda: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 29bdc: 80 2f mov r24, r16 29bde: 8f 70 andi r24, 0x0F ; 15 29be0: 0f 94 d1 4d call 0x29ba2 ; 0x29ba2 29be4: 88 83 st Y, r24 return charsOut; } 29be6: 81 2f mov r24, r17 29be8: df 91 pop r29 29bea: cf 91 pop r28 29bec: 1f 91 pop r17 29bee: 0f 91 pop r16 29bf0: 08 95 ret 00029bf2 : } 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) { 29bf2: 80 33 cpi r24, 0x30 ; 48 29bf4: 30 f0 brcs .+12 ; 0x29c02 29bf6: 8a 33 cpi r24, 0x3A ; 58 29bf8: 30 f0 brcs .+12 ; 0x29c06 29bfa: 9f e9 ldi r25, 0x9F ; 159 29bfc: 98 0f add r25, r24 29bfe: 96 30 cpi r25, 0x06 ; 6 29c00: 20 f0 brcs .+8 ; 0x29c0a case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 29c02: 80 e0 ldi r24, 0x00 ; 0 } } 29c04: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 29c06: 80 53 subi r24, 0x30 ; 48 29c08: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 29c0a: 87 55 subi r24, 0x57 ; 87 29c0c: 08 95 ret 00029c0e : /// 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 { 29c0e: cf 93 push r28 29c10: df 93 push r29 29c12: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 29c14: 68 81 ld r22, Y 29c16: 80 e0 ldi r24, 0x00 ; 0 29c18: 0f 94 e6 00 call 0x201cc ; 0x201cc crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 29c1c: 69 81 ldd r22, Y+1 ; 0x01 29c1e: 0f 94 e6 00 call 0x201cc ; 0x201cc crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 29c22: 6a 81 ldd r22, Y+2 ; 0x02 29c24: 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]); 29c26: 0f 94 e6 00 call 0x201cc ; 0x201cc 29c2a: 6c 2f mov r22, r28 return crc; } 29c2c: df 91 pop r29 29c2e: cf 91 pop r28 29c30: 0d 94 e6 00 jmp 0x201cc ; 0x201cc 00029c34 : 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 { 29c34: cf 93 push r28 29c36: df 93 push r29 29c38: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 29c3a: 0f 94 07 4e call 0x29c0e ; 0x29c0e crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 29c3e: 6d 81 ldd r22, Y+5 ; 0x05 29c40: 0f 94 e6 00 call 0x201cc ; 0x201cc crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 29c44: 6e 81 ldd r22, Y+6 ; 0x06 29c46: cf 81 ldd r28, Y+7 ; 0x07 29c48: 0f 94 e6 00 call 0x201cc ; 0x201cc 29c4c: 6c 2f mov r22, r28 return crc; } 29c4e: df 91 pop r29 29c50: cf 91 pop r28 29c52: 0d 94 e6 00 jmp 0x201cc ; 0x201cc 00029c56 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 29c56: cf 93 push r28 29c58: df 93 push r29 29c5a: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 29c5c: 68 83 st Y, r22 29c5e: 49 83 std Y+1, r20 ; 0x01 29c60: 1b 82 std Y+3, r1 ; 0x03 29c62: 1a 82 std Y+2, r1 ; 0x02 29c64: 0f 94 07 4e call 0x29c0e ; 0x29c0e 29c68: 8c 83 std Y+4, r24 ; 0x04 } 29c6a: df 91 pop r29 29c6c: cf 91 pop r28 29c6e: 08 95 ret 00029c70 : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 29c70: 14 9a sbi 0x02, 4 ; 2 } 29c72: 08 95 ret 00029c74 : 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) { 29c74: cf 92 push r12 29c76: df 92 push r13 29c78: ef 92 push r14 29c7a: ff 92 push r15 29c7c: cf 93 push r28 29c7e: df 93 push r29 29c80: 69 01 movw r12, r18 29c82: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 29c84: c1 e6 ldi r28, 0x61 ; 97 29c86: d2 e1 ldi r29, 0x12 ; 18 29c88: 9b 01 movw r18, r22 29c8a: ac 01 movw r20, r24 29c8c: 6c 85 ldd r22, Y+12 ; 0x0c 29c8e: 7d 85 ldd r23, Y+13 ; 0x0d 29c90: 8e 85 ldd r24, Y+14 ; 0x0e 29c92: 9f 85 ldd r25, Y+15 ; 0x0f 29c94: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 29c98: 6c 87 std Y+12, r22 ; 0x0c 29c9a: 7d 87 std Y+13, r23 ; 0x0d 29c9c: 8e 87 std Y+14, r24 ; 0x0e 29c9e: 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); 29ca0: c7 01 movw r24, r14 29ca2: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 29ca4: df 91 pop r29 29ca6: cf 91 pop r28 29ca8: ff 90 pop r15 29caa: ef 90 pop r14 29cac: df 90 pop r13 29cae: 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); 29cb0: 0d 94 a8 49 jmp 0x29350 ; 0x29350 00029cb4 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 29cb4: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 29cb8: 0d 94 5b 18 jmp 0x230b6 ; 0x230b6 00029cbc : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 29cbc: cf 93 push r28 29cbe: df 93 push r29 29cc0: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 29cc2: 84 ee ldi r24, 0xE4 ; 228 29cc4: 92 ea ldi r25, 0xA2 ; 162 29cc6: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_MMU2(); 29cca: 80 ed ldi r24, 0xD0 ; 208 29ccc: 98 e8 ldi r25, 0x88 ; 136 29cce: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNRPGM(msg); 29cd2: ce 01 movw r24, r28 } 29cd4: df 91 pop r29 29cd6: 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); 29cd8: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 00029cdc : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 29cdc: 81 e0 ldi r24, 0x01 ; 1 29cde: 90 91 fe 16 lds r25, 0x16FE ; 0x8016fe 29ce2: 91 11 cpse r25, r1 29ce4: 01 c0 rjmp .+2 ; 0x29ce8 29ce6: 80 e0 ldi r24, 0x00 ; 0 } 29ce8: 08 95 ret 00029cea : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29cea: 89 32 cpi r24, 0x29 ; 41 29cec: 20 e8 ldi r18, 0x80 ; 128 29cee: 92 07 cpc r25, r18 29cf0: 09 f4 brne .+2 ; 0x29cf4 29cf2: 97 c0 rjmp .+302 ; 0x29e22 29cf4: 08 f0 brcs .+2 ; 0x29cf8 29cf6: 48 c0 rjmp .+144 ; 0x29d88 29cf8: 86 30 cpi r24, 0x06 ; 6 29cfa: 60 e8 ldi r22, 0x80 ; 128 29cfc: 96 07 cpc r25, r22 29cfe: 09 f4 brne .+2 ; 0x29d02 29d00: 9a c0 rjmp .+308 ; 0x29e36 29d02: 30 f5 brcc .+76 ; 0x29d50 29d04: 83 30 cpi r24, 0x03 ; 3 29d06: 40 e8 ldi r20, 0x80 ; 128 29d08: 94 07 cpc r25, r20 29d0a: 09 f4 brne .+2 ; 0x29d0e 29d0c: 80 c0 rjmp .+256 ; 0x29e0e 29d0e: a8 f4 brcc .+42 ; 0x29d3a 29d10: 81 30 cpi r24, 0x01 ; 1 29d12: 20 e8 ldi r18, 0x80 ; 128 29d14: 92 07 cpc r25, r18 29d16: 09 f4 brne .+2 ; 0x29d1a 29d18: 17 c1 rjmp .+558 ; 0x29f48 29d1a: 82 30 cpi r24, 0x02 ; 2 29d1c: 40 e8 ldi r20, 0x80 ; 128 29d1e: 94 07 cpc r25, r20 29d20: 09 f4 brne .+2 ; 0x29d24 29d22: 73 c0 rjmp .+230 ; 0x29e0a 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); 29d24: 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)) { 29d26: 86 ff sbrs r24, 6 29d28: 8e c0 rjmp .+284 ; 0x29e46 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); 29d2a: 22 27 eor r18, r18 29d2c: 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) { 29d2e: 21 15 cp r18, r1 29d30: 32 4c sbci r19, 0xC2 ; 194 29d32: 09 f0 breq .+2 ; 0x29d36 29d34: 9e c0 rjmp .+316 ; 0x29e72 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 29d36: 8e e1 ldi r24, 0x1E ; 30 29d38: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29d3a: 84 30 cpi r24, 0x04 ; 4 29d3c: 60 e8 ldi r22, 0x80 ; 128 29d3e: 96 07 cpc r25, r22 29d40: 09 f4 brne .+2 ; 0x29d44 29d42: 67 c0 rjmp .+206 ; 0x29e12 29d44: 85 30 cpi r24, 0x05 ; 5 29d46: 20 e8 ldi r18, 0x80 ; 128 29d48: 92 07 cpc r25, r18 29d4a: 61 f7 brne .-40 ; 0x29d24 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); 29d4c: 84 e2 ldi r24, 0x24 ; 36 29d4e: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29d50: 8a 30 cpi r24, 0x0A ; 10 29d52: 40 e8 ldi r20, 0x80 ; 128 29d54: 94 07 cpc r25, r20 29d56: 09 f4 brne .+2 ; 0x29d5a 29d58: 5e c0 rjmp .+188 ; 0x29e16 29d5a: 58 f4 brcc .+22 ; 0x29d72 29d5c: 88 30 cpi r24, 0x08 ; 8 29d5e: 20 e8 ldi r18, 0x80 ; 128 29d60: 92 07 cpc r25, r18 29d62: 09 f4 brne .+2 ; 0x29d66 29d64: 6e c0 rjmp .+220 ; 0x29e42 29d66: 89 30 cpi r24, 0x09 ; 9 29d68: 40 e8 ldi r20, 0x80 ; 128 29d6a: 94 07 cpc r25, r20 29d6c: d9 f6 brne .-74 ; 0x29d24 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); 29d6e: 85 e0 ldi r24, 0x05 ; 5 29d70: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29d72: 8c 30 cpi r24, 0x0C ; 12 29d74: 60 e8 ldi r22, 0x80 ; 128 29d76: 96 07 cpc r25, r22 29d78: 09 f4 brne .+2 ; 0x29d7c 29d7a: 51 c0 rjmp .+162 ; 0x29e1e 29d7c: 8d 30 cpi r24, 0x0D ; 13 29d7e: 20 e8 ldi r18, 0x80 ; 128 29d80: 92 07 cpc r25, r18 29d82: 81 f6 brne .-96 ; 0x29d24 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); 29d84: 81 e2 ldi r24, 0x21 ; 33 29d86: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29d88: 8f 32 cpi r24, 0x2F ; 47 29d8a: 40 e8 ldi r20, 0x80 ; 128 29d8c: 94 07 cpc r25, r20 29d8e: 09 f4 brne .+2 ; 0x29d92 29d90: 56 c0 rjmp .+172 ; 0x29e3e 29d92: e0 f4 brcc .+56 ; 0x29dcc 29d94: 8c 32 cpi r24, 0x2C ; 44 29d96: 20 e8 ldi r18, 0x80 ; 128 29d98: 92 07 cpc r25, r18 29d9a: 09 f4 brne .+2 ; 0x29d9e 29d9c: 4e c0 rjmp .+156 ; 0x29e3a 29d9e: 58 f4 brcc .+22 ; 0x29db6 29da0: 8a 32 cpi r24, 0x2A ; 42 29da2: 60 e8 ldi r22, 0x80 ; 128 29da4: 96 07 cpc r25, r22 29da6: c9 f1 breq .+114 ; 0x29e1a 29da8: 8b 32 cpi r24, 0x2B ; 43 29daa: 20 e8 ldi r18, 0x80 ; 128 29dac: 92 07 cpc r25, r18 29dae: 09 f0 breq .+2 ; 0x29db2 29db0: b9 cf rjmp .-142 ; 0x29d24 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); 29db2: 86 e2 ldi r24, 0x26 ; 38 29db4: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29db6: 8d 32 cpi r24, 0x2D ; 45 29db8: 40 e8 ldi r20, 0x80 ; 128 29dba: 94 07 cpc r25, r20 29dbc: d1 f1 breq .+116 ; 0x29e32 29dbe: 8e 32 cpi r24, 0x2E ; 46 29dc0: 60 e8 ldi r22, 0x80 ; 128 29dc2: 96 07 cpc r25, r22 29dc4: 09 f0 breq .+2 ; 0x29dc8 29dc6: ae cf rjmp .-164 ; 0x29d24 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); 29dc8: 82 e2 ldi r24, 0x22 ; 34 29dca: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29dcc: 87 38 cpi r24, 0x87 ; 135 29dce: 20 e8 ldi r18, 0x80 ; 128 29dd0: 92 07 cpc r25, r18 29dd2: 49 f1 breq .+82 ; 0x29e26 29dd4: 58 f4 brcc .+22 ; 0x29dec 29dd6: 87 34 cpi r24, 0x47 ; 71 29dd8: 60 e8 ldi r22, 0x80 ; 128 29dda: 96 07 cpc r25, r22 29ddc: 29 f0 breq .+10 ; 0x29de8 29dde: 8b 34 cpi r24, 0x4B ; 75 29de0: 20 e8 ldi r18, 0x80 ; 128 29de2: 92 07 cpc r25, r18 29de4: 09 f0 breq .+2 ; 0x29de8 29de6: 9e cf rjmp .-196 ; 0x29d24 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); 29de8: 84 e0 ldi r24, 0x04 ; 4 29dea: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29dec: 87 30 cpi r24, 0x07 ; 7 29dee: 41 e8 ldi r20, 0x81 ; 129 29df0: 94 07 cpc r25, r20 29df2: d9 f0 breq .+54 ; 0x29e2a 29df4: 8b 30 cpi r24, 0x0B ; 11 29df6: 61 e8 ldi r22, 0x81 ; 129 29df8: 96 07 cpc r25, r22 29dfa: c9 f0 breq .+50 ; 0x29e2e 29dfc: 8b 38 cpi r24, 0x8B ; 139 29dfe: 20 e8 ldi r18, 0x80 ; 128 29e00: 92 07 cpc r25, r18 29e02: 09 f0 breq .+2 ; 0x29e06 29e04: 8f cf rjmp .-226 ; 0x29d24 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); 29e06: 89 e0 ldi r24, 0x09 ; 9 29e08: 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); 29e0a: 81 e0 ldi r24, 0x01 ; 1 29e0c: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 29e0e: 82 e0 ldi r24, 0x02 ; 2 29e10: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 29e12: 83 e0 ldi r24, 0x03 ; 3 29e14: 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); 29e16: 86 e0 ldi r24, 0x06 ; 6 29e18: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 29e1a: 87 e0 ldi r24, 0x07 ; 7 29e1c: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 29e1e: 8a e2 ldi r24, 0x2A ; 42 29e20: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 29e22: 8b e2 ldi r24, 0x2B ; 43 29e24: 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); 29e26: 88 e0 ldi r24, 0x08 ; 8 29e28: 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); 29e2a: 8a e0 ldi r24, 0x0A ; 10 29e2c: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 29e2e: 8b e0 ldi r24, 0x0B ; 11 29e30: 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); 29e32: 83 e2 ldi r24, 0x23 ; 35 29e34: 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); 29e36: 85 e2 ldi r24, 0x25 ; 37 29e38: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 29e3a: 87 e2 ldi r24, 0x27 ; 39 29e3c: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 29e3e: 88 e2 ldi r24, 0x28 ; 40 29e40: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 29e42: 89 e2 ldi r24, 0x29 ; 41 29e44: 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)) { 29e46: 87 ff sbrs r24, 7 29e48: 07 c0 rjmp .+14 ; 0x29e58 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); 29e4a: 22 27 eor r18, r18 29e4c: 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) { 29e4e: 21 15 cp r18, r1 29e50: 32 4c sbci r19, 0xC2 ; 194 29e52: a1 f5 brne .+104 ; 0x29ebc return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 29e54: 8f e1 ldi r24, 0x1F ; 31 29e56: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 29e58: 22 27 eor r18, r18 29e5a: 31 70 andi r19, 0x01 ; 1 29e5c: 90 ff sbrs r25, 0 29e5e: 52 c0 rjmp .+164 ; 0x29f04 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); 29e60: ac 01 movw r20, r24 29e62: 44 27 eor r20, r20 29e64: 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) { 29e66: 41 15 cp r20, r1 29e68: 52 4c sbci r21, 0xC2 ; 194 29e6a: 09 f0 breq .+2 ; 0x29e6e 29e6c: 4b c0 rjmp .+150 ; 0x29f04 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 29e6e: 80 e2 ldi r24, 0x20 ; 32 29e70: 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; 29e72: 9c 01 movw r18, r24 29e74: 22 27 eor r18, r18 29e76: 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)) { 29e78: 23 2b or r18, r19 29e7a: 09 f0 breq .+2 ; 0x29e7e 29e7c: 67 c0 rjmp .+206 ; 0x29f4c 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; 29e7e: 9c 01 movw r18, r24 29e80: 22 27 eor r18, r18 29e82: 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)) { 29e84: 23 2b or r18, r19 29e86: 09 f0 breq .+2 ; 0x29e8a 29e88: 63 c0 rjmp .+198 ; 0x29f50 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; 29e8a: 9c 01 movw r18, r24 29e8c: 22 27 eor r18, r18 29e8e: 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)) { 29e90: 23 2b or r18, r19 29e92: 09 f0 breq .+2 ; 0x29e96 29e94: 5f c0 rjmp .+190 ; 0x29f54 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; 29e96: 9c 01 movw r18, r24 29e98: 22 27 eor r18, r18 29e9a: 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)) { 29e9c: 23 2b or r18, r19 29e9e: 09 f0 breq .+2 ; 0x29ea2 29ea0: 5b c0 rjmp .+182 ; 0x29f58 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; 29ea2: 9c 01 movw r18, r24 29ea4: 22 27 eor r18, r18 29ea6: 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)) { 29ea8: 23 2b or r18, r19 29eaa: 09 f0 breq .+2 ; 0x29eae 29eac: 57 c0 rjmp .+174 ; 0x29f5c 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; 29eae: 88 27 eor r24, r24 29eb0: 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)) { 29eb2: 89 2b or r24, r25 29eb4: 09 f4 brne .+2 ; 0x29eb8 29eb6: 68 c0 rjmp .+208 ; 0x29f88 return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 29eb8: 8f e0 ldi r24, 0x0F ; 15 29eba: 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; 29ebc: 9c 01 movw r18, r24 29ebe: 22 27 eor r18, r18 29ec0: 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)) { 29ec2: 23 2b or r18, r19 29ec4: 09 f0 breq .+2 ; 0x29ec8 29ec6: 4c c0 rjmp .+152 ; 0x29f60 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; 29ec8: 9c 01 movw r18, r24 29eca: 22 27 eor r18, r18 29ecc: 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)) { 29ece: 23 2b or r18, r19 29ed0: 09 f0 breq .+2 ; 0x29ed4 29ed2: 48 c0 rjmp .+144 ; 0x29f64 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; 29ed4: 9c 01 movw r18, r24 29ed6: 22 27 eor r18, r18 29ed8: 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)) { 29eda: 23 2b or r18, r19 29edc: 09 f0 breq .+2 ; 0x29ee0 29ede: 44 c0 rjmp .+136 ; 0x29f68 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; 29ee0: 9c 01 movw r18, r24 29ee2: 22 27 eor r18, r18 29ee4: 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)) { 29ee6: 23 2b or r18, r19 29ee8: 09 f0 breq .+2 ; 0x29eec 29eea: 40 c0 rjmp .+128 ; 0x29f6c 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; 29eec: 9c 01 movw r18, r24 29eee: 22 27 eor r18, r18 29ef0: 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)) { 29ef2: 23 2b or r18, r19 29ef4: e9 f5 brne .+122 ; 0x29f70 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; 29ef6: 88 27 eor r24, r24 29ef8: 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)) { 29efa: 89 2b or r24, r25 29efc: 09 f4 brne .+2 ; 0x29f00 29efe: 44 c0 rjmp .+136 ; 0x29f88 return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 29f00: 80 e1 ldi r24, 0x10 ; 16 29f02: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 29f04: 23 2b or r18, r19 29f06: 09 f4 brne .+2 ; 0x29f0a 29f08: 3f c0 rjmp .+126 ; 0x29f88 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; 29f0a: 9c 01 movw r18, r24 29f0c: 22 27 eor r18, r18 29f0e: 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)) { 29f10: 23 2b or r18, r19 29f12: 81 f5 brne .+96 ; 0x29f74 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; 29f14: 9c 01 movw r18, r24 29f16: 22 27 eor r18, r18 29f18: 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)) { 29f1a: 23 2b or r18, r19 29f1c: 69 f5 brne .+90 ; 0x29f78 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; 29f1e: 9c 01 movw r18, r24 29f20: 22 27 eor r18, r18 29f22: 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)) { 29f24: 23 2b or r18, r19 29f26: 51 f5 brne .+84 ; 0x29f7c 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; 29f28: 9c 01 movw r18, r24 29f2a: 22 27 eor r18, r18 29f2c: 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)) { 29f2e: 23 2b or r18, r19 29f30: 39 f5 brne .+78 ; 0x29f80 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; 29f32: 9c 01 movw r18, r24 29f34: 22 27 eor r18, r18 29f36: 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)) { 29f38: 23 2b or r18, r19 29f3a: 21 f5 brne .+72 ; 0x29f84 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; 29f3c: 88 27 eor r24, r24 29f3e: 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)) { 29f40: 89 2b or r24, r25 29f42: 11 f1 breq .+68 ; 0x29f88 return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 29f44: 81 e1 ldi r24, 0x11 ; 17 29f46: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 29f48: 80 e0 ldi r24, 0x00 ; 0 29f4a: 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); 29f4c: 82 e1 ldi r24, 0x12 ; 18 29f4e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 29f50: 85 e1 ldi r24, 0x15 ; 21 29f52: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 29f54: 88 e1 ldi r24, 0x18 ; 24 29f56: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 29f58: 8b e1 ldi r24, 0x1B ; 27 29f5a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 29f5c: 8c e0 ldi r24, 0x0C ; 12 29f5e: 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); 29f60: 83 e1 ldi r24, 0x13 ; 19 29f62: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 29f64: 86 e1 ldi r24, 0x16 ; 22 29f66: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 29f68: 89 e1 ldi r24, 0x19 ; 25 29f6a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 29f6c: 8c e1 ldi r24, 0x1C ; 28 29f6e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 29f70: 8d e0 ldi r24, 0x0D ; 13 29f72: 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); 29f74: 84 e1 ldi r24, 0x14 ; 20 29f76: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 29f78: 87 e1 ldi r24, 0x17 ; 23 29f7a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 29f7c: 8a e1 ldi r24, 0x1A ; 26 29f7e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 29f80: 8d e1 ldi r24, 0x1D ; 29 29f82: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 29f84: 8e e0 ldi r24, 0x0E ; 14 29f86: 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); 29f88: 8c e2 ldi r24, 0x2C ; 44 } 29f8a: 08 95 ret 00029f8c : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 29f8c: cf 92 push r12 29f8e: df 92 push r13 29f90: ef 92 push r14 29f92: ff 92 push r15 29f94: 0f 93 push r16 29f96: 1f 93 push r17 29f98: cf 93 push r28 29f9a: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 29f9c: 20 91 d2 12 lds r18, 0x12D2 ; 0x8012d2 29fa0: 30 91 d3 12 lds r19, 0x12D3 ; 0x8012d3 29fa4: 21 30 cpi r18, 0x01 ; 1 29fa6: 31 05 cpc r19, r1 29fa8: 39 f4 brne .+14 ; 0x29fb8 29faa: 20 91 fb 12 lds r18, 0x12FB ; 0x8012fb 29fae: 21 30 cpi r18, 0x01 ; 1 29fb0: 19 f4 brne .+6 ; 0x29fb8 // 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; 29fb2: 22 e0 ldi r18, 0x02 ; 2 29fb4: 20 93 89 04 sts 0x0489, r18 ; 0x800489 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 29fb8: 0f 94 75 4e call 0x29cea ; 0x29cea 29fbc: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 29fbe: 80 91 89 04 lds r24, 0x0489 ; 0x800489 29fc2: 81 30 cpi r24, 0x01 ; 1 29fc4: 09 f4 brne .+2 ; 0x29fc8 29fc6: 64 c0 rjmp .+200 ; 0x2a090 29fc8: 60 f0 brcs .+24 ; 0x29fe2 29fca: 82 30 cpi r24, 0x02 ; 2 29fcc: 09 f4 brne .+2 ; 0x29fd0 29fce: f4 c0 rjmp .+488 ; 0x2a1b8 ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 29fd0: df 91 pop r29 29fd2: cf 91 pop r28 29fd4: 1f 91 pop r17 29fd6: 0f 91 pop r16 29fd8: ff 90 pop r15 29fda: ef 90 pop r14 29fdc: df 90 pop r13 29fde: cf 90 pop r12 29fe0: 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); 29fe2: 84 e0 ldi r24, 0x04 ; 4 29fe4: 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); 29fe8: 0d 2f mov r16, r29 29fea: 10 e0 ldi r17, 0x00 ; 0 29fec: f8 01 movw r30, r16 29fee: e6 5c subi r30, 0xC6 ; 198 29ff0: f6 47 sbci r31, 0x76 ; 118 29ff2: 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); 29ff4: fc 2e mov r15, r28 29ff6: f2 94 swap r15 29ff8: 6f e0 ldi r22, 0x0F ; 15 29ffa: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 29ffc: 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); 29ffe: 80 e0 ldi r24, 0x00 ; 0 2a000: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_clear(); 2a004: 0e 94 81 70 call 0xe102 ; 0xe102 // 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); 2a008: 00 0f add r16, r16 2a00a: 11 1f adc r17, r17 2a00c: f8 01 movw r30, r16 2a00e: e9 59 subi r30, 0x99 ; 153 2a010: f6 47 sbci r31, 0x76 ; 118 2a012: c5 90 lpm r12, Z+ 2a014: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 2a016: 0a 5c subi r16, 0xCA ; 202 2a018: 1f 45 sbci r17, 0x5F ; 95 2a01a: f8 01 movw r30, r16 2a01c: 85 91 lpm r24, Z+ 2a01e: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 2a020: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2a024: df 92 push r13 2a026: cf 92 push r12 2a028: 9f 93 push r25 2a02a: 8f 93 push r24 2a02c: 83 ed ldi r24, 0xD3 ; 211 2a02e: 99 e8 ldi r25, 0x89 ; 137 2a030: 9f 93 push r25 2a032: 8f 93 push r24 2a034: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_show_choices_prompt_P(two_choices ? LCD_LEFT_BUTTON_CHOICE : LCD_MIDDLE_BUTTON_CHOICE, _T(PrusaErrorButtonTitle(button_op_middle)), two_choices ? PrusaErrorButtonMore() : _T(PrusaErrorButtonTitle(button_op_right)), two_choices ? 18 : 9, two_choices ? nullptr : PrusaErrorButtonMore()); } void ReportErrorHookSensorLineRender(){ // Render static characters in third line lcd_puts_at_P(0, 2, PSTR("FI: FS: > " LCD_STR_THERMOMETER " " LCD_STR_DEGREE)); 2a038: 41 ec ldi r20, 0xC1 ; 193 2a03a: 50 ea ldi r21, 0xA0 ; 160 2a03c: 62 e0 ldi r22, 0x02 ; 2 2a03e: 80 e0 ldi r24, 0x00 ; 0 2a040: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 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()); 2a044: 0f 90 pop r0 2a046: 0f 90 pop r0 2a048: 0f 90 pop r0 2a04a: 0f 90 pop r0 2a04c: 0f 90 pop r0 2a04e: 0f 90 pop r0 2a050: f1 10 cpse r15, r1 2a052: c6 c0 rjmp .+396 ; 0x2a1e0 2a054: 10 e0 ldi r17, 0x00 ; 0 2a056: 00 e0 ldi r16, 0x00 ; 0 2a058: 42 e1 ldi r20, 0x12 ; 18 2a05a: e4 2e mov r14, r20 2a05c: 50 ea ldi r21, 0xA0 ; 160 2a05e: c5 2e mov r12, r21 2a060: 5a e6 ldi r21, 0x6A ; 106 2a062: 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); 2a064: ec 2f mov r30, r28 2a066: f0 e0 ldi r31, 0x00 ; 0 2a068: ee 0f add r30, r30 2a06a: ff 1f adc r31, r31 2a06c: e1 54 subi r30, 0x41 ; 65 2a06e: f6 47 sbci r31, 0x76 ; 118 2a070: 85 91 lpm r24, Z+ 2a072: 94 91 lpm r25, Z 2a074: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2a078: bc 01 movw r22, r24 2a07a: 81 e0 ldi r24, 0x01 ; 1 2a07c: f1 10 cpse r15, r1 2a07e: 01 c0 rjmp .+2 ; 0x2a082 2a080: 80 e0 ldi r24, 0x00 ; 0 2a082: 2e 2d mov r18, r14 2a084: a6 01 movw r20, r12 2a086: 0e 94 5c dd call 0x1bab8 ; 0x1bab8 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 2a08a: 81 e0 ldi r24, 0x01 ; 1 2a08c: 80 93 89 04 sts 0x0489, r24 ; 0x800489 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 2a090: 81 e0 ldi r24, 0x01 ; 1 2a092: 80 93 5c 06 sts 0x065C, r24 ; 0x80065c <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.446> ReportErrorHookDynamicRender(); // Render dynamic characters 2a096: 0f 94 94 4d call 0x29b28 ; 0x29b28 sound_wait_for_user(); 2a09a: 0f 94 89 25 call 0x24b12 ; 0x24b12 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); 2a09e: 0d 2f mov r16, r29 2a0a0: 10 e0 ldi r17, 0x00 ; 0 2a0a2: f8 01 movw r30, r16 2a0a4: e6 5c subi r30, 0xC6 ; 198 2a0a6: f6 47 sbci r31, 0x76 ; 118 2a0a8: 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); 2a0aa: dc 2f mov r29, r28 2a0ac: d2 95 swap r29 2a0ae: 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; 2a0b0: 80 91 81 04 lds r24, 0x0481 ; 0x800481 2a0b4: 81 11 cpse r24, r1 2a0b6: 09 c0 rjmp .+18 ; 0x2a0ca 2a0b8: 81 e0 ldi r24, 0x01 ; 1 2a0ba: d1 11 cpse r29, r1 2a0bc: 01 c0 rjmp .+2 ; 0x2a0c0 2a0be: 80 e0 ldi r24, 0x00 ; 0 2a0c0: 80 93 80 04 sts 0x0480, r24 ; 0x800480 2a0c4: 81 e0 ldi r24, 0x01 ; 1 2a0c6: 80 93 81 04 sts 0x0481, r24 ; 0x800481 static int8_t choice_selected = -1; if (reset_button_selection) { 2a0ca: 80 91 7f 04 lds r24, 0x047F ; 0x80047f 2a0ce: 88 23 and r24, r24 2a0d0: 41 f0 breq .+16 ; 0x2a0e2 // 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; 2a0d2: 81 e0 ldi r24, 0x01 ; 1 2a0d4: d1 11 cpse r29, r1 2a0d6: 01 c0 rjmp .+2 ; 0x2a0da 2a0d8: 80 e0 ldi r24, 0x00 ; 0 2a0da: 80 93 80 04 sts 0x0480, r24 ; 0x800480 choice_selected = -1; reset_button_selection = 0; 2a0de: 10 92 7f 04 sts 0x047F, r1 ; 0x80047f } // Check if knob was rotated if (lcd_encoder) { 2a0e2: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 2a0e6: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 2a0ea: 21 15 cp r18, r1 2a0ec: 31 05 cpc r19, r1 2a0ee: b9 f1 breq .+110 ; 0x2a15e 2a0f0: 80 91 80 04 lds r24, 0x0480 ; 0x800480 if (two_choices == false) { // third_choice is not nullptr, safe to dereference 2a0f4: dd 23 and r29, r29 2a0f6: 61 f0 breq .+24 ; 0x2a110 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2a0f8: 37 ff sbrs r19, 7 2a0fa: 06 c0 rjmp .+12 ; 0x2a108 2a0fc: 88 23 and r24, r24 2a0fe: 69 f0 breq .+26 ; 0x2a11a // Rotating knob counter clockwise current_selection--; 2a100: 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; 2a102: 80 93 80 04 sts 0x0480, r24 ; 0x800480 2a106: 09 c0 rjmp .+18 ; 0x2a11a 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) { 2a108: 82 30 cpi r24, 0x02 ; 2 2a10a: 39 f0 breq .+14 ; 0x2a11a // Rotating knob clockwise current_selection++; 2a10c: 8f 5f subi r24, 0xFF ; 255 2a10e: f9 cf rjmp .-14 ; 0x2a102 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2a110: 37 ff sbrs r19, 7 2a112: 41 c0 rjmp .+130 ; 0x2a196 2a114: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 2a116: 10 92 80 04 sts 0x0480, r1 ; 0x800480 //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 2a11a: 80 91 80 04 lds r24, 0x0480 ; 0x800480 2a11e: 4e e3 ldi r20, 0x3E ; 62 2a120: 81 11 cpse r24, r1 2a122: 40 e2 ldi r20, 0x20 ; 32 2a124: 63 e0 ldi r22, 0x03 ; 3 2a126: 80 e0 ldi r24, 0x00 ; 0 2a128: 0e 94 6e 70 call 0xe0dc ; 0xe0dc 2a12c: 80 91 80 04 lds r24, 0x0480 ; 0x800480 if (two_choices == false) 2a130: dd 23 and r29, r29 2a132: b1 f1 breq .+108 ; 0x2a1a0 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 2a134: 4e e3 ldi r20, 0x3E ; 62 2a136: 81 30 cpi r24, 0x01 ; 1 2a138: 09 f0 breq .+2 ; 0x2a13c 2a13a: 40 e2 ldi r20, 0x20 ; 32 2a13c: 63 e0 ldi r22, 0x03 ; 3 2a13e: 89 e0 ldi r24, 0x09 ; 9 2a140: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 2a144: 80 91 80 04 lds r24, 0x0480 ; 0x800480 2a148: 82 30 cpi r24, 0x02 ; 2 2a14a: 61 f5 brne .+88 ; 0x2a1a4 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 2a14c: 4e e3 ldi r20, 0x3E ; 62 2a14e: 63 e0 ldi r22, 0x03 ; 3 2a150: 82 e1 ldi r24, 0x12 ; 18 2a152: 0e 94 6e 70 call 0xe0dc ; 0xe0dc } // Consume rotation event lcd_encoder = 0; 2a156: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 2a15a: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } // Check if knob was clicked and consume the event if (lcd_clicked()) { 2a15e: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 2a162: 88 23 and r24, r24 2a164: 09 f4 brne .+2 ; 0x2a168 2a166: 34 cf rjmp .-408 ; 0x29fd0 choice_selected = current_selection; 2a168: 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 2a16c: d1 11 cpse r29, r1 2a16e: 1c c0 rjmp .+56 ; 0x2a1a8 2a170: 81 30 cpi r24, 0x01 ; 1 2a172: 89 f5 brne .+98 ; 0x2a1d6 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); 2a174: f8 01 movw r30, r16 2a176: ee 0f add r30, r30 2a178: ff 1f adc r31, r31 2a17a: e0 52 subi r30, 0x20 ; 32 2a17c: f7 47 sbci r31, 0x77 ; 119 2a17e: 85 91 lpm r24, Z+ 2a180: 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))); 2a182: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2a186: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 2a18a: 81 e0 ldi r24, 0x01 ; 1 2a18c: 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; 2a190: 10 92 89 04 sts 0x0489, r1 ; 0x800489 2a194: 1d cf rjmp .-454 ; 0x29fd0 } } 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) { 2a196: 81 30 cpi r24, 0x01 ; 1 2a198: 09 f4 brne .+2 ; 0x2a19c 2a19a: bf cf rjmp .-130 ; 0x2a11a // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 2a19c: 81 e0 ldi r24, 0x01 ; 1 2a19e: b1 cf rjmp .-158 ; 0x2a102 { 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 ? '>': ' '); 2a1a0: 81 30 cpi r24, 0x01 ; 1 2a1a2: a1 f2 breq .-88 ; 0x2a14c 2a1a4: 40 e2 ldi r20, 0x20 ; 32 2a1a6: d3 cf rjmp .-90 ; 0x2a14e // 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 2a1a8: 82 30 cpi r24, 0x02 ; 2 2a1aa: 21 f3 breq .-56 ; 0x2a174 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 2a1ac: 81 30 cpi r24, 0x01 ; 1 2a1ae: 99 f4 brne .+38 ; 0x2a1d6 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 2a1b0: d0 93 44 0d sts 0x0D44, r29 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 2a1b4: 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); 2a1b8: 81 e0 ldi r24, 0x01 ; 1 2a1ba: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_return_to_status(); 2a1be: 0f 94 18 05 call 0x20a30 ; 0x20a30 2a1c2: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL10beep_timer.lto_priv.497> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 2a1c6: 10 92 c1 04 sts 0x04C1, r1 ; 0x8004c1 <_ZL6bFirst.lto_priv.498> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 2a1ca: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.446> KEEPALIVE_STATE(IN_HANDLER); 2a1ce: 82 e0 ldi r24, 0x02 ; 2 2a1d0: 80 93 78 02 sts 0x0278, r24 ; 0x800278 2a1d4: dd cf rjmp .-70 ; 0x2a190 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); 2a1d6: cf 70 andi r28, 0x0F ; 15 2a1d8: c0 93 44 0d sts 0x0D44, r28 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 2a1dc: 81 e0 ldi r24, 0x01 ; 1 2a1de: ea cf rjmp .-44 ; 0x2a1b4 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); 2a1e0: ef 2d mov r30, r15 2a1e2: f0 e0 ldi r31, 0x00 ; 0 2a1e4: ee 0f add r30, r30 2a1e6: ff 1f adc r31, r31 2a1e8: e1 54 subi r30, 0x41 ; 65 2a1ea: f6 47 sbci r31, 0x76 ; 118 2a1ec: 85 91 lpm r24, Z+ 2a1ee: 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()); 2a1f0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2a1f4: 6c 01 movw r12, r24 2a1f6: 00 ea ldi r16, 0xA0 ; 160 2a1f8: 1a e6 ldi r17, 0x6A ; 106 2a1fa: 99 e0 ldi r25, 0x09 ; 9 2a1fc: e9 2e mov r14, r25 2a1fe: 32 cf rjmp .-412 ; 0x2a064 0002a200 : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 2a200: 0f 94 75 4e call 0x29cea ; 0x29cea // 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); 2a204: e8 2f mov r30, r24 2a206: f0 e0 ldi r31, 0x00 ; 0 2a208: ee 0f add r30, r30 2a20a: ff 1f adc r31, r31 2a20c: e9 59 subi r30, 0x99 ; 153 2a20e: f6 47 sbci r31, 0x76 ; 118 2a210: 25 91 lpm r18, Z+ 2a212: 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) ) { 2a214: 23 33 cpi r18, 0x33 ; 51 2a216: 81 e0 ldi r24, 0x01 ; 1 2a218: 38 07 cpc r19, r24 2a21a: 08 f0 brcs .+2 ; 0x2a21e 2a21c: 41 c0 rjmp .+130 ; 0x2a2a0 2a21e: 2d 32 cpi r18, 0x2D ; 45 2a220: 81 e0 ldi r24, 0x01 ; 1 2a222: 38 07 cpc r19, r24 2a224: 78 f5 brcc .+94 ; 0x2a284 2a226: 2e 37 cpi r18, 0x7E ; 126 2a228: 31 05 cpc r19, r1 2a22a: 09 f4 brne .+2 ; 0x2a22e 2a22c: 83 c0 rjmp .+262 ; 0x2a334 2a22e: f0 f4 brcc .+60 ; 0x2a26c 2a230: 2c 36 cpi r18, 0x6C ; 108 2a232: 31 05 cpc r19, r1 2a234: 09 f4 brne .+2 ; 0x2a238 2a236: 85 c0 rjmp .+266 ; 0x2a342 2a238: 30 f4 brcc .+12 ; 0x2a246 2a23a: 25 36 cpi r18, 0x65 ; 101 2a23c: 31 05 cpc r19, r1 2a23e: 08 f0 brcs .+2 ; 0x2a242 2a240: 79 c0 rjmp .+242 ; 0x2a334 default: break; } return Buttons::NoButton; 2a242: 8f ef ldi r24, 0xFF ; 255 2a244: 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) ) { 2a246: 24 37 cpi r18, 0x74 ; 116 2a248: 31 05 cpc r19, r1 2a24a: 09 f4 brne .+2 ; 0x2a24e 2a24c: 73 c0 rjmp .+230 ; 0x2a334 2a24e: 2d 37 cpi r18, 0x7D ; 125 2a250: 31 05 cpc r19, r1 2a252: 19 f0 breq .+6 ; 0x2a25a 2a254: 23 37 cpi r18, 0x73 ; 115 2a256: 31 05 cpc r19, r1 2a258: a1 f7 brne .-24 ; 0x2a242 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 2a25a: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> 2a25e: 81 30 cpi r24, 0x01 ; 1 2a260: 09 f4 brne .+2 ; 0x2a264 2a262: 6d c0 rjmp .+218 ; 0x2a33e 2a264: 87 30 cpi r24, 0x07 ; 7 2a266: 69 f7 brne .-38 ; 0x2a242 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 2a268: 88 e0 ldi r24, 0x08 ; 8 2a26a: 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) ) { 2a26c: 23 3d cpi r18, 0xD3 ; 211 2a26e: 31 05 cpc r19, r1 2a270: 09 f4 brne .+2 ; 0x2a274 2a272: 6e c0 rjmp .+220 ; 0x2a350 2a274: 50 f4 brcc .+20 ; 0x2a28a 2a276: 29 3c cpi r18, 0xC9 ; 201 2a278: 31 05 cpc r19, r1 2a27a: 09 f4 brne .+2 ; 0x2a27e 2a27c: 69 c0 rjmp .+210 ; 0x2a350 2a27e: 2a 3c cpi r18, 0xCA ; 202 2a280: 31 05 cpc r19, r1 2a282: f9 f6 brne .-66 ; 0x2a242 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) { 2a284: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> 2a288: 67 c0 rjmp .+206 ; 0x2a358 // 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) ) { 2a28a: 2d 3d cpi r18, 0xDD ; 221 2a28c: 31 05 cpc r19, r1 2a28e: 09 f4 brne .+2 ; 0x2a292 2a290: 5f c0 rjmp .+190 ; 0x2a350 2a292: 2e 3d cpi r18, 0xDE ; 222 2a294: 31 05 cpc r19, r1 2a296: b1 f3 breq .-20 ; 0x2a284 2a298: 24 3d cpi r18, 0xD4 ; 212 2a29a: 31 05 cpc r19, r1 2a29c: 91 f6 brne .-92 ; 0x2a242 2a29e: f2 cf rjmp .-28 ; 0x2a284 2a2a0: 25 3f cpi r18, 0xF5 ; 245 2a2a2: 81 e0 ldi r24, 0x01 ; 1 2a2a4: 38 07 cpc r19, r24 2a2a6: 09 f4 brne .+2 ; 0x2a2aa 2a2a8: 5c c0 rjmp .+184 ; 0x2a362 2a2aa: f8 f4 brcc .+62 ; 0x2a2ea 2a2ac: 26 34 cpi r18, 0x46 ; 70 2a2ae: 81 e0 ldi r24, 0x01 ; 1 2a2b0: 38 07 cpc r19, r24 2a2b2: 58 f4 brcc .+22 ; 0x2a2ca 2a2b4: 21 34 cpi r18, 0x41 ; 65 2a2b6: 81 e0 ldi r24, 0x01 ; 1 2a2b8: 38 07 cpc r19, r24 2a2ba: 20 f7 brcc .-56 ; 0x2a284 2a2bc: 27 53 subi r18, 0x37 ; 55 2a2be: 31 40 sbci r19, 0x01 ; 1 2a2c0: 25 30 cpi r18, 0x05 ; 5 2a2c2: 31 05 cpc r19, r1 2a2c4: 08 f0 brcs .+2 ; 0x2a2c8 2a2c6: bd cf rjmp .-134 ; 0x2a242 2a2c8: dd cf rjmp .-70 ; 0x2a284 2a2ca: 21 59 subi r18, 0x91 ; 145 2a2cc: 31 40 sbci r19, 0x01 ; 1 2a2ce: 22 30 cpi r18, 0x02 ; 2 2a2d0: 31 05 cpc r19, r1 2a2d2: 08 f0 brcs .+2 ; 0x2a2d6 2a2d4: b6 cf rjmp .-148 ; 0x2a242 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 2a2d6: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> 2a2da: 83 30 cpi r24, 0x03 ; 3 2a2dc: 09 f4 brne .+2 ; 0x2a2e0 2a2de: 3f c0 rjmp .+126 ; 0x2a35e 2a2e0: 89 30 cpi r24, 0x09 ; 9 2a2e2: 09 f0 breq .+2 ; 0x2a2e6 2a2e4: ae cf rjmp .-164 ; 0x2a242 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 2a2e6: 87 e0 ldi r24, 0x07 ; 7 2a2e8: 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) ) { 2a2ea: 29 3f cpi r18, 0xF9 ; 249 2a2ec: 81 e0 ldi r24, 0x01 ; 1 2a2ee: 38 07 cpc r19, r24 2a2f0: 49 f2 breq .-110 ; 0x2a284 2a2f2: 70 f4 brcc .+28 ; 0x2a310 2a2f4: 27 3f cpi r18, 0xF7 ; 247 2a2f6: 81 e0 ldi r24, 0x01 ; 1 2a2f8: 38 07 cpc r19, r24 2a2fa: 21 f2 breq .-120 ; 0x2a284 2a2fc: 60 f7 brcc .-40 ; 0x2a2d6 break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 2a2fe: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> 2a302: 83 30 cpi r24, 0x03 ; 3 2a304: 61 f1 breq .+88 ; 0x2a35e 2a306: 88 30 cpi r24, 0x08 ; 8 2a308: 09 f0 breq .+2 ; 0x2a30c 2a30a: 9b cf rjmp .-202 ; 0x2a242 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 2a30c: 86 e0 ldi r24, 0x06 ; 6 2a30e: 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) ) { 2a310: 2b 3f cpi r18, 0xFB ; 251 2a312: 81 e0 ldi r24, 0x01 ; 1 2a314: 38 07 cpc r19, r24 2a316: a9 f0 breq .+42 ; 0x2a342 2a318: 68 f0 brcs .+26 ; 0x2a334 2a31a: 2c 3f cpi r18, 0xFC ; 252 2a31c: 31 40 sbci r19, 0x01 ; 1 2a31e: 09 f0 breq .+2 ; 0x2a322 2a320: 90 cf rjmp .-224 ; 0x2a242 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 2a322: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> 2a326: 85 30 cpi r24, 0x05 ; 5 2a328: 89 f0 breq .+34 ; 0x2a34c 2a32a: 86 30 cpi r24, 0x06 ; 6 2a32c: 09 f0 breq .+2 ; 0x2a330 2a32e: 89 cf rjmp .-238 ; 0x2a242 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 2a330: 85 e0 ldi r24, 0x05 ; 5 2a332: 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) { 2a334: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> 2a338: 81 30 cpi r24, 0x01 ; 1 2a33a: 09 f0 breq .+2 ; 0x2a33e 2a33c: 82 cf rjmp .-252 ; 0x2a242 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; 2a33e: 81 e0 ldi r24, 0x01 ; 1 2a340: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 2a342: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> 2a346: 82 30 cpi r24, 0x02 ; 2 2a348: d1 f3 breq .-12 ; 0x2a33e 2a34a: 7b cf rjmp .-266 ; 0x2a242 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 2a34c: 84 e0 ldi r24, 0x04 ; 4 2a34e: 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) { 2a350: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> 2a354: 82 30 cpi r24, 0x02 ; 2 2a356: 61 f0 breq .+24 ; 0x2a370 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) { 2a358: 83 30 cpi r24, 0x03 ; 3 2a35a: 09 f0 breq .+2 ; 0x2a35e 2a35c: 72 cf rjmp .-284 ; 0x2a242 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; 2a35e: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 2a360: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 2a362: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> 2a366: 82 30 cpi r24, 0x02 ; 2 2a368: 29 f0 breq .+10 ; 0x2a374 2a36a: 84 30 cpi r24, 0x04 ; 4 2a36c: 09 f0 breq .+2 ; 0x2a370 2a36e: 69 cf rjmp .-302 ; 0x2a242 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; 2a370: 82 e0 ldi r24, 0x02 ; 2 2a372: 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; 2a374: 80 e0 ldi r24, 0x00 ; 0 2a376: 08 95 ret 0002a378 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.373]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 2a378: cf 93 push r28 2a37a: df 93 push r29 2a37c: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 2a37e: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2a382: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2a386: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2a38a: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2a38e: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 2a392: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 2a396: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 2a39a: c9 01 movw r24, r18 2a39c: 86 1b sub r24, r22 2a39e: 97 0b sbc r25, r23 2a3a0: 06 97 sbiw r24, 0x06 ; 6 2a3a2: 24 f0 brlt .+8 ; 0x2a3ac (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.373]+0x34> void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 2a3a4: ce 01 movw r24, r28 2a3a6: 0e 94 0a 8d call 0x11a14 ; 0x11a14 2a3aa: e9 cf rjmp .-46 ; 0x2a37e (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.373]+0x6> f(); safe_delay_keep_alive(delay); } } 2a3ac: df 91 pop r29 2a3ae: cf 91 pop r28 2a3b0: 08 95 ret 0002a3b2 : } //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) { 2a3b2: cf 93 push r28 2a3b4: df 93 push r29 2a3b6: 00 d0 rcall .+0 ; 0x2a3b8 2a3b8: 00 d0 rcall .+0 ; 0x2a3ba 2a3ba: 1f 92 push r1 2a3bc: cd b7 in r28, 0x3d ; 61 2a3be: 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)) 2a3c0: 87 30 cpi r24, 0x07 ; 7 2a3c2: 50 f5 brcc .+84 ; 0x2a418 2a3c4: 67 30 cpi r22, 0x07 ; 7 2a3c6: 40 f5 brcc .+80 ; 0x2a418 return false; uint8_t valid_points_mask[7] = { 2a3c8: 97 e0 ldi r25, 0x07 ; 7 2a3ca: ed eb ldi r30, 0xBD ; 189 2a3cc: f2 e0 ldi r31, 0x02 ; 2 2a3ce: de 01 movw r26, r28 2a3d0: 11 96 adiw r26, 0x01 ; 1 2a3d2: 01 90 ld r0, Z+ 2a3d4: 0d 92 st X+, r0 2a3d6: 9a 95 dec r25 2a3d8: e1 f7 brne .-8 ; 0x2a3d2 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 2a3da: 46 e0 ldi r20, 0x06 ; 6 2a3dc: 50 e0 ldi r21, 0x00 ; 0 2a3de: fa 01 movw r30, r20 2a3e0: e6 1b sub r30, r22 2a3e2: f1 09 sbc r31, r1 2a3e4: 21 e0 ldi r18, 0x01 ; 1 2a3e6: 30 e0 ldi r19, 0x00 ; 0 2a3e8: 2c 0f add r18, r28 2a3ea: 3d 1f adc r19, r29 2a3ec: e2 0f add r30, r18 2a3ee: f3 1f adc r31, r19 2a3f0: 20 81 ld r18, Z 2a3f2: 30 e0 ldi r19, 0x00 ; 0 2a3f4: 48 1b sub r20, r24 2a3f6: 51 09 sbc r21, r1 2a3f8: c9 01 movw r24, r18 2a3fa: 02 c0 rjmp .+4 ; 0x2a400 2a3fc: 95 95 asr r25 2a3fe: 87 95 ror r24 2a400: 4a 95 dec r20 2a402: e2 f7 brpl .-8 ; 0x2a3fc 2a404: 81 70 andi r24, 0x01 ; 1 } 2a406: 27 96 adiw r28, 0x07 ; 7 2a408: 0f b6 in r0, 0x3f ; 63 2a40a: f8 94 cli 2a40c: de bf out 0x3e, r29 ; 62 2a40e: 0f be out 0x3f, r0 ; 63 2a410: cd bf out 0x3d, r28 ; 61 2a412: df 91 pop r29 2a414: cf 91 pop r28 2a416: 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; 2a418: 80 e0 ldi r24, 0x00 ; 0 2a41a: f5 cf rjmp .-22 ; 0x2a406 0002a41c : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 2a41c: 0f 93 push r16 2a41e: 1f 93 push r17 2a420: cf 93 push r28 2a422: df 93 push r29 2a424: 00 d0 rcall .+0 ; 0x2a426 2a426: 1f 92 push r1 2a428: cd b7 in r28, 0x3d ; 61 2a42a: de b7 in r29, 0x3e ; 62 2a42c: 9b 01 movw r18, r22 2a42e: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 2a430: 01 e6 ldi r16, 0x61 ; 97 2a432: 12 e1 ldi r17, 0x12 ; 18 2a434: f8 01 movw r30, r16 2a436: 60 85 ldd r22, Z+8 ; 0x08 2a438: 71 85 ldd r23, Z+9 ; 0x09 2a43a: 82 85 ldd r24, Z+10 ; 0x0a 2a43c: 93 85 ldd r25, Z+11 ; 0x0b 2a43e: 69 83 std Y+1, r22 ; 0x01 2a440: 7a 83 std Y+2, r23 ; 0x02 2a442: 8b 83 std Y+3, r24 ; 0x03 2a444: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 2a446: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2a44a: f8 01 movw r30, r16 2a44c: 60 87 std Z+8, r22 ; 0x08 2a44e: 71 87 std Z+9, r23 ; 0x09 2a450: 82 87 std Z+10, r24 ; 0x0a 2a452: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 2a454: 65 e5 ldi r22, 0x55 ; 85 2a456: 75 e5 ldi r23, 0x55 ; 85 2a458: 85 e5 ldi r24, 0x55 ; 85 2a45a: 91 e4 ldi r25, 0x41 ; 65 2a45c: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 2a460: 0f 94 5b 18 call 0x230b6 ; 0x230b6 current_position[Z_AXIS] = curpos_z; 2a464: 89 81 ldd r24, Y+1 ; 0x01 2a466: 9a 81 ldd r25, Y+2 ; 0x02 2a468: ab 81 ldd r26, Y+3 ; 0x03 2a46a: bc 81 ldd r27, Y+4 ; 0x04 2a46c: f8 01 movw r30, r16 2a46e: 80 87 std Z+8, r24 ; 0x08 2a470: 91 87 std Z+9, r25 ; 0x09 2a472: a2 87 std Z+10, r26 ; 0x0a 2a474: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 2a476: ce 01 movw r24, r28 2a478: 01 96 adiw r24, 0x01 ; 1 2a47a: 0f 94 33 3a call 0x27466 ; 0x27466 } 2a47e: 0f 90 pop r0 2a480: 0f 90 pop r0 2a482: 0f 90 pop r0 2a484: 0f 90 pop r0 2a486: df 91 pop r29 2a488: cf 91 pop r28 2a48a: 1f 91 pop r17 2a48c: 0f 91 pop r16 2a48e: 08 95 ret 0002a490 : 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])); 2a490: 60 91 26 06 lds r22, 0x0626 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.451> 2a494: 70 91 27 06 lds r23, 0x0627 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.451+0x1> 2a498: 07 2e mov r0, r23 2a49a: 00 0c add r0, r0 2a49c: 88 0b sbc r24, r24 2a49e: 99 0b sbc r25, r25 2a4a0: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2a4a4: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 2a4a8: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 2a4ac: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 2a4b0: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 2a4b4: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 2a4b8: 0f 94 0e 52 call 0x2a41c ; 0x2a41c babystepLoadZ = 0; 2a4bc: 10 92 27 06 sts 0x0627, r1 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.451+0x1> 2a4c0: 10 92 26 06 sts 0x0626, r1 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.451> } 2a4c4: 08 95 ret 0002a4c6 : // 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() { 2a4c6: 2f 92 push r2 2a4c8: 3f 92 push r3 2a4ca: 4f 92 push r4 2a4cc: 5f 92 push r5 2a4ce: 6f 92 push r6 2a4d0: 7f 92 push r7 2a4d2: 8f 92 push r8 2a4d4: 9f 92 push r9 2a4d6: af 92 push r10 2a4d8: bf 92 push r11 2a4da: cf 92 push r12 2a4dc: df 92 push r13 2a4de: ef 92 push r14 2a4e0: ff 92 push r15 2a4e2: 0f 93 push r16 2a4e4: 1f 93 push r17 2a4e6: cf 93 push r28 2a4e8: df 93 push r29 2a4ea: 00 d0 rcall .+0 ; 0x2a4ec 2a4ec: 00 d0 rcall .+0 ; 0x2a4ee 2a4ee: cd b7 in r28, 0x3d ; 61 2a4f0: de b7 in r29, 0x3e ; 62 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2a4f2: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.386> 2a4f6: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 2a4f8: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.386> 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); 2a4fc: 80 e0 ldi r24, 0x00 ; 0 2a4fe: 0f 94 e1 22 call 0x245c2 ; 0x245c2 2a502: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 2a504: 0e 94 9c 65 call 0xcb38 ; 0xcb38 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 2a508: 85 e1 ldi r24, 0x15 ; 21 2a50a: 92 e6 ldi r25, 0x62 ; 98 2a50c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2a510: 0e 94 94 de call 0x1bd28 ; 0x1bd28 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 2a514: 4c e9 ldi r20, 0x9C ; 156 2a516: 5a e6 ldi r21, 0x6A ; 106 2a518: 63 e0 ldi r22, 0x03 ; 3 2a51a: 80 e0 ldi r24, 0x00 ; 0 2a51c: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 2a520: 81 e0 ldi r24, 0x01 ; 1 2a522: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.386> // 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; 2a526: 80 e0 ldi r24, 0x00 ; 0 2a528: 90 e0 ldi r25, 0x00 ; 0 2a52a: a0 ea ldi r26, 0xA0 ; 160 2a52c: b0 e4 ldi r27, 0x40 ; 64 2a52e: 80 93 69 12 sts 0x1269, r24 ; 0x801269 2a532: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 2a536: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 2a53a: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c go_to_current(homing_feedrate[Z_AXIS]/60); 2a53e: 65 e5 ldi r22, 0x55 ; 85 2a540: 75 e5 ldi r23, 0x55 ; 85 2a542: 85 e5 ldi r24, 0x55 ; 85 2a544: 91 e4 ldi r25, 0x41 ; 65 2a546: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 2a54a: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.386> check_Z_crash(); #endif enable_endstops(false); // Move XY to first point current_position[X_AXIS] = BED_X0; 2a54e: 80 e0 ldi r24, 0x00 ; 0 2a550: 90 e0 ldi r25, 0x00 ; 0 2a552: a0 e8 ldi r26, 0x80 ; 128 2a554: bf e3 ldi r27, 0x3F ; 63 2a556: 80 93 61 12 sts 0x1261, r24 ; 0x801261 2a55a: 90 93 62 12 sts 0x1262, r25 ; 0x801262 2a55e: a0 93 63 12 sts 0x1263, r26 ; 0x801263 2a562: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = BED_Y0; 2a566: 80 93 65 12 sts 0x1265, r24 ; 0x801265 2a56a: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2a56e: a0 93 67 12 sts 0x1267, r26 ; 0x801267 2a572: b0 93 68 12 sts 0x1268, r27 ; 0x801268 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 2a576: 65 e6 ldi r22, 0x65 ; 101 2a578: 72 e1 ldi r23, 0x12 ; 18 2a57a: 81 e6 ldi r24, 0x61 ; 97 2a57c: 92 e1 ldi r25, 0x12 ; 18 2a57e: 0e 94 79 69 call 0xd2f2 ; 0xd2f2 go_to_current(homing_feedrate[X_AXIS]/60); 2a582: 60 e0 ldi r22, 0x00 ; 0 2a584: 70 e0 ldi r23, 0x00 ; 0 2a586: 88 e4 ldi r24, 0x48 ; 72 2a588: 92 e4 ldi r25, 0x42 ; 66 2a58a: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 set_destination_to_current(); 2a58e: 0e 94 09 67 call 0xce12 ; 0xce12 homeaxis(Z_AXIS); 2a592: 82 e0 ldi r24, 0x02 ; 2 2a594: 0f 94 0c 7a call 0x2f418 ; 0x2f418 if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 2a598: 43 e0 ldi r20, 0x03 ; 3 2a59a: 60 e0 ldi r22, 0x00 ; 0 2a59c: 70 e0 ldi r23, 0x00 ; 0 2a59e: 80 e2 ldi r24, 0x20 ; 32 2a5a0: 91 ec ldi r25, 0xC1 ; 193 2a5a2: 0f 94 4b 7c call 0x2f896 ; 0x2f896 2a5a6: 81 11 cpse r24, r1 2a5a8: 06 c0 rjmp .+12 ; 0x2a5b6 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)); 2a5aa: 82 e6 ldi r24, 0x62 ; 98 2a5ac: 96 e5 ldi r25, 0x56 ; 86 2a5ae: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2a5b2: 0e 94 7e 83 call 0x106fc ; 0x106fc 2a5b6: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2a5ba: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2a5be: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2a5c2: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2a5c6: 80 93 0a 13 sts 0x130A, r24 ; 0x80130a 2a5ca: 90 93 0b 13 sts 0x130B, r25 ; 0x80130b 2a5ce: a0 93 0c 13 sts 0x130C, r26 ; 0x80130c 2a5d2: b0 93 0d 13 sts 0x130D, r27 ; 0x80130d 2a5d6: e2 e0 ldi r30, 0x02 ; 2 2a5d8: f0 e0 ldi r31, 0x00 ; 0 2a5da: fa 83 std Y+2, r31 ; 0x02 2a5dc: 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; 2a5de: c1 2c mov r12, r1 2a5e0: d1 2c mov r13, r1 2a5e2: 30 ea ldi r19, 0xA0 ; 160 2a5e4: e3 2e mov r14, r19 2a5e6: 30 e4 ldi r19, 0x40 ; 64 2a5e8: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 2a5ea: 43 e0 ldi r20, 0x03 ; 3 2a5ec: 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 2a5ee: 52 e0 ldi r21, 0x02 ; 2 2a5f0: 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); 2a5f2: 0b ec ldi r16, 0xCB ; 203 2a5f4: 18 e8 ldi r17, 0x88 ; 136 2a5f6: 67 e0 ldi r22, 0x07 ; 7 2a5f8: 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(); 2a5fa: 0e 94 9c 65 call 0xcb38 ; 0xcb38 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 2a5fe: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2a602: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2a606: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2a60a: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c go_to_current(homing_feedrate[Z_AXIS]/60); 2a60e: 65 e5 ldi r22, 0x55 ; 85 2a610: 75 e5 ldi r23, 0x55 ; 85 2a612: 85 e5 ldi r24, 0x55 ; 85 2a614: 91 e4 ldi r25, 0x41 ; 65 2a616: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 2a61a: 29 81 ldd r18, Y+1 ; 0x01 2a61c: 21 50 subi r18, 0x01 ; 1 2a61e: 82 2f mov r24, r18 2a620: 6b 2d mov r22, r11 2a622: 0f 94 ed a4 call 0x349da ; 0x349da <__udivmodqi4> 2a626: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 2a628: 82 2f mov r24, r18 2a62a: 0f 94 f9 a4 call 0x349f2 ; 0x349f2 <__divmodqi4> 2a62e: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 2a630: 80 ff sbrs r24, 0 2a632: 03 c0 rjmp .+6 ; 0x2a63a 2a634: f9 2d mov r31, r9 2a636: f8 19 sub r31, r8 2a638: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 2a63a: 88 2d mov r24, r8 2a63c: 88 0f add r24, r24 2a63e: 88 0d add r24, r8 2a640: 0e 94 3b 5f call 0xbe76 ; 0xbe76 2a644: 60 93 61 12 sts 0x1261, r22 ; 0x801261 2a648: 70 93 62 12 sts 0x1262, r23 ; 0x801262 2a64c: 80 93 63 12 sts 0x1263, r24 ; 0x801263 2a650: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = BED_Y(iy * 3); 2a654: 87 2d mov r24, r7 2a656: 88 0f add r24, r24 2a658: 87 0d add r24, r7 2a65a: 0e 94 3b 5f call 0xbe76 ; 0xbe76 2a65e: 60 93 65 12 sts 0x1265, r22 ; 0x801265 2a662: 70 93 66 12 sts 0x1266, r23 ; 0x801266 2a666: 80 93 67 12 sts 0x1267, r24 ; 0x801267 2a66a: 90 93 68 12 sts 0x1268, r25 ; 0x801268 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 2a66e: 65 e6 ldi r22, 0x65 ; 101 2a670: 72 e1 ldi r23, 0x12 ; 18 2a672: 81 e6 ldi r24, 0x61 ; 97 2a674: 92 e1 ldi r25, 0x12 ; 18 2a676: 0e 94 79 69 call 0xd2f2 ; 0xd2f2 go_to_current(homing_feedrate[X_AXIS]/60); 2a67a: 60 e0 ldi r22, 0x00 ; 0 2a67c: 70 e0 ldi r23, 0x00 ; 0 2a67e: 88 e4 ldi r24, 0x48 ; 72 2a680: 92 e4 ldi r25, 0x42 ; 66 2a682: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 2a686: 63 e0 ldi r22, 0x03 ; 3 2a688: 80 e0 ldi r24, 0x00 ; 0 2a68a: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%d/9"),mesh_point+1); 2a68e: 8a 81 ldd r24, Y+2 ; 0x02 2a690: 8f 93 push r24 2a692: 99 81 ldd r25, Y+1 ; 0x01 2a694: 9f 93 push r25 2a696: 1f 93 push r17 2a698: 0f 93 push r16 2a69a: 0e 94 66 6f call 0xdecc ; 0xdecc #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 2a69e: 43 e0 ldi r20, 0x03 ; 3 2a6a0: 60 e0 ldi r22, 0x00 ; 0 2a6a2: 70 e0 ldi r23, 0x00 ; 0 2a6a4: 80 e2 ldi r24, 0x20 ; 32 2a6a6: 91 ec ldi r25, 0xC1 ; 193 2a6a8: 0f 94 4b 7c call 0x2f896 ; 0x2f896 2a6ac: 58 2e mov r5, r24 2a6ae: 0f 90 pop r0 2a6b0: 0f 90 pop r0 2a6b2: 0f 90 pop r0 2a6b4: 0f 90 pop r0 2a6b6: 88 23 and r24, r24 2a6b8: 09 f4 brne .+2 ; 0x2a6bc 2a6ba: 77 cf rjmp .-274 ; 0x2a5aa 2a6bc: a7 9c mul r10, r7 2a6be: f0 01 movw r30, r0 2a6c0: 11 24 eor r1, r1 2a6c2: e8 0d add r30, r8 2a6c4: f1 1d adc r31, r1 2a6c6: ee 0f add r30, r30 2a6c8: ff 1f adc r31, r31 2a6ca: ee 0f add r30, r30 2a6cc: ff 1f adc r31, r31 2a6ce: e7 5f subi r30, 0xF7 ; 247 2a6d0: fc 4e sbci r31, 0xEC ; 236 2a6d2: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2a6d6: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2a6da: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2a6de: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2a6e2: 81 83 std Z+1, r24 ; 0x01 2a6e4: 92 83 std Z+2, r25 ; 0x02 2a6e6: a3 83 std Z+3, r26 ; 0x03 2a6e8: b4 83 std Z+4, r27 ; 0x04 2a6ea: e9 81 ldd r30, Y+1 ; 0x01 2a6ec: fa 81 ldd r31, Y+2 ; 0x02 2a6ee: 31 96 adiw r30, 0x01 ; 1 2a6f0: fa 83 std Y+2, r31 ; 0x02 2a6f2: 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) { 2a6f4: 3a 97 sbiw r30, 0x0a ; 10 2a6f6: 09 f0 breq .+2 ; 0x2a6fa 2a6f8: 80 cf rjmp .-256 ; 0x2a5fa mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 2a6fa: 60 90 0a 13 lds r6, 0x130A ; 0x80130a 2a6fe: 70 90 0b 13 lds r7, 0x130B ; 0x80130b 2a702: 80 90 0c 13 lds r8, 0x130C ; 0x80130c 2a706: 90 90 0d 13 lds r9, 0x130D ; 0x80130d float zmax = zmin; 2a70a: 46 2c mov r4, r6 2a70c: a7 2c mov r10, r7 2a70e: b8 2c mov r11, r8 2a710: 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]; 2a712: 1e 82 std Y+6, r1 ; 0x06 2a714: 1d 82 std Y+5, r1 ; 0x05 2a716: 09 e0 ldi r16, 0x09 ; 9 2a718: 13 e1 ldi r17, 0x13 ; 19 2a71a: 8d 81 ldd r24, Y+5 ; 0x05 2a71c: 9e 81 ldd r25, Y+6 ; 0x06 2a71e: 86 5f subi r24, 0xF6 ; 246 2a720: 9c 4e sbci r25, 0xEC ; 236 2a722: 9a 83 std Y+2, r25 ; 0x02 2a724: 89 83 std Y+1, r24 ; 0x01 2a726: 93 e0 ldi r25, 0x03 ; 3 2a728: 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]); 2a72a: e9 81 ldd r30, Y+1 ; 0x01 2a72c: fa 81 ldd r31, Y+2 ; 0x02 2a72e: c1 90 ld r12, Z+ 2a730: d1 90 ld r13, Z+ 2a732: e1 90 ld r14, Z+ 2a734: f1 90 ld r15, Z+ 2a736: fa 83 std Y+2, r31 ; 0x02 2a738: e9 83 std Y+1, r30 ; 0x01 2a73a: 93 01 movw r18, r6 2a73c: a4 01 movw r20, r8 2a73e: c7 01 movw r24, r14 2a740: b6 01 movw r22, r12 2a742: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2a746: 18 16 cp r1, r24 2a748: 14 f0 brlt .+4 ; 0x2a74e 2a74a: 36 01 movw r6, r12 2a74c: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 2a74e: 24 2d mov r18, r4 2a750: 3a 2d mov r19, r10 2a752: 4b 2d mov r20, r11 2a754: 52 2d mov r21, r2 2a756: c7 01 movw r24, r14 2a758: b6 01 movw r22, r12 2a75a: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2a75e: 87 fd sbrc r24, 7 2a760: 04 c0 rjmp .+8 ; 0x2a76a 2a762: 4c 2c mov r4, r12 2a764: ad 2c mov r10, r13 2a766: be 2c mov r11, r14 2a768: 2f 2c mov r2, r15 2a76a: 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) { 2a76c: 31 10 cpse r3, r1 2a76e: dd cf rjmp .-70 ; 0x2a72a 2a770: 8d 81 ldd r24, Y+5 ; 0x05 2a772: 9e 81 ldd r25, Y+6 ; 0x06 2a774: 4c 96 adiw r24, 0x1c ; 28 2a776: 9e 83 std Y+6, r25 ; 0x06 2a778: 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) 2a77a: 84 35 cpi r24, 0x54 ; 84 2a77c: 91 05 cpc r25, r1 2a77e: 59 f6 brne .-106 ; 0x2a716 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) { 2a780: 93 01 movw r18, r6 2a782: a4 01 movw r20, r8 2a784: 64 2d mov r22, r4 2a786: 7a 2d mov r23, r10 2a788: 8b 2d mov r24, r11 2a78a: 92 2d mov r25, r2 2a78c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2a790: 20 e0 ldi r18, 0x00 ; 0 2a792: 30 e0 ldi r19, 0x00 ; 0 2a794: 40 e4 ldi r20, 0x40 ; 64 2a796: 50 e4 ldi r21, 0x40 ; 64 2a798: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2a79c: 18 16 cp r1, r24 2a79e: 2c f5 brge .+74 ; 0x2a7ea // 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!"); 2a7a0: 8e ea ldi r24, 0xAE ; 174 2a7a2: 98 e8 ldi r25, 0x88 ; 136 2a7a4: 0e 94 18 7d call 0xfa30 ; 0xfa30 // 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; 2a7a8: 51 2c mov r5, r1 2a7aa: fc 81 ldd r31, Y+4 ; 0x04 2a7ac: f0 93 77 02 sts 0x0277, r31 ; 0x800277 <_ZL14check_endstops.lto_priv.386> go_home_with_z_lift(); result = true; end: enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2a7b0: 8b 81 ldd r24, Y+3 ; 0x03 2a7b2: 0f 94 e1 22 call 0x245c2 ; 0x245c2 #ifdef TMC2130 tmc2130_home_exit(); #endif return result; } 2a7b6: 85 2d mov r24, r5 2a7b8: 26 96 adiw r28, 0x06 ; 6 2a7ba: 0f b6 in r0, 0x3f ; 63 2a7bc: f8 94 cli 2a7be: de bf out 0x3e, r29 ; 62 2a7c0: 0f be out 0x3f, r0 ; 63 2a7c2: cd bf out 0x3d, r28 ; 61 2a7c4: df 91 pop r29 2a7c6: cf 91 pop r28 2a7c8: 1f 91 pop r17 2a7ca: 0f 91 pop r16 2a7cc: ff 90 pop r15 2a7ce: ef 90 pop r14 2a7d0: df 90 pop r13 2a7d2: cf 90 pop r12 2a7d4: bf 90 pop r11 2a7d6: af 90 pop r10 2a7d8: 9f 90 pop r9 2a7da: 8f 90 pop r8 2a7dc: 7f 90 pop r7 2a7de: 6f 90 pop r6 2a7e0: 5f 90 pop r5 2a7e2: 4f 90 pop r4 2a7e4: 3f 90 pop r3 2a7e6: 2f 90 pop r2 2a7e8: 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) 2a7ea: 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; 2a7ec: 85 ec ldi r24, 0xC5 ; 197 2a7ee: e8 2e mov r14, r24 2a7f0: 8f e0 ldi r24, 0x0F ; 15 2a7f2: f8 2e mov r15, r24 2a7f4: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 2a7f6: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 2a7f8: 9d 81 ldd r25, Y+5 ; 0x05 2a7fa: 91 11 cpse r25, r1 2a7fc: 03 c0 rjmp .+6 ; 0x2a804 2a7fe: e9 81 ldd r30, Y+1 ; 0x01 2a800: ee 23 and r30, r30 2a802: 29 f1 breq .+74 ; 0x2a84e continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 2a804: 20 91 0a 13 lds r18, 0x130A ; 0x80130a 2a808: 30 91 0b 13 lds r19, 0x130B ; 0x80130b 2a80c: 40 91 0c 13 lds r20, 0x130C ; 0x80130c 2a810: 50 91 0d 13 lds r21, 0x130D ; 0x80130d 2a814: f6 01 movw r30, r12 2a816: 61 81 ldd r22, Z+1 ; 0x01 2a818: 72 81 ldd r23, Z+2 ; 0x02 2a81a: 83 81 ldd r24, Z+3 ; 0x03 2a81c: 94 81 ldd r25, Z+4 ; 0x04 2a81e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 2a822: 20 e0 ldi r18, 0x00 ; 0 2a824: 30 e0 ldi r19, 0x00 ; 0 2a826: 48 ec ldi r20, 0xC8 ; 200 2a828: 52 e4 ldi r21, 0x42 ; 66 2a82a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2a82e: 20 e0 ldi r18, 0x00 ; 0 2a830: 30 e0 ldi r19, 0x00 ; 0 2a832: 40 e0 ldi r20, 0x00 ; 0 2a834: 5f e3 ldi r21, 0x3F ; 63 2a836: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2a83a: 0f 94 0d a7 call 0x34e1a ; 0x34e1a 2a83e: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2a842: c7 01 movw r24, r14 2a844: 0f 94 80 a4 call 0x34900 ; 0x34900 SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 2a848: f2 e0 ldi r31, 0x02 ; 2 2a84a: ef 0e add r14, r31 2a84c: f1 1c adc r15, r1 2a84e: 84 e0 ldi r24, 0x04 ; 4 2a850: c8 0e add r12, r24 2a852: d1 1c adc r13, r1 2a854: 9d 81 ldd r25, Y+5 ; 0x05 2a856: 9f 5f subi r25, 0xFF ; 255 2a858: 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) { 2a85a: 93 30 cpi r25, 0x03 ; 3 2a85c: 69 f6 brne .-102 ; 0x2a7f8 2a85e: 04 5e subi r16, 0xE4 ; 228 2a860: 1f 4f sbci r17, 0xFF ; 255 2a862: e9 81 ldd r30, Y+1 ; 0x01 2a864: ef 5f subi r30, 0xFF ; 255 2a866: 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) 2a868: e3 30 cpi r30, 0x03 ; 3 2a86a: 21 f6 brne .-120 ; 0x2a7f4 #endif addr += 2; } } mbl.reset(); 2a86c: 0f 94 41 7c call 0x2f882 ; 0x2f882 go_home_with_z_lift(); 2a870: 0e 94 98 6a call 0xd530 ; 0xd530 2a874: 9a cf rjmp .-204 ; 0x2a7aa 0002a876 : * 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) { 2a876: 2f 92 push r2 2a878: 3f 92 push r3 2a87a: 4f 92 push r4 2a87c: 5f 92 push r5 2a87e: 6f 92 push r6 2a880: 7f 92 push r7 2a882: 8f 92 push r8 2a884: 9f 92 push r9 2a886: af 92 push r10 2a888: bf 92 push r11 2a88a: cf 92 push r12 2a88c: df 92 push r13 2a88e: ef 92 push r14 2a890: ff 92 push r15 2a892: 0f 93 push r16 2a894: 1f 93 push r17 2a896: cf 93 push r28 2a898: df 93 push r29 2a89a: cd b7 in r28, 0x3d ; 61 2a89c: de b7 in r29, 0x3e ; 62 2a89e: c2 54 subi r28, 0x42 ; 66 2a8a0: d1 09 sbc r29, r1 2a8a2: 0f b6 in r0, 0x3f ; 63 2a8a4: f8 94 cli 2a8a6: de bf out 0x3e, r29 ; 62 2a8a8: 0f be out 0x3f, r0 ; 63 2a8aa: cd bf out 0x3d, r28 ; 61 2a8ac: 4c 01 movw r8, r24 2a8ae: 5b 01 movw r10, r22 2a8b0: 6a 01 movw r12, r20 2a8b2: 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) {} 2a8b4: 19 82 std Y+1, r1 ; 0x01 2a8b6: 1c 82 std Y+4, r1 ; 0x04 2a8b8: 1c 8e std Y+28, r1 ; 0x1c 2a8ba: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 2a8bc: 67 2b or r22, r23 2a8be: 21 f5 brne .+72 ; 0x2a908 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 2a8c0: 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; 2a8c2: ce 01 movw r24, r28 2a8c4: 4c 96 adiw r24, 0x1c ; 28 2a8c6: 0e 94 06 7a call 0xf40c ; 0xf40c 2a8ca: ce 01 movw r24, r28 2a8cc: 01 96 adiw r24, 0x01 ; 1 2a8ce: 0e 94 06 7a call 0xf40c ; 0xf40c } return open(parent, dname, oflag); fail: return false; } 2a8d2: 81 2f mov r24, r17 2a8d4: ce 5b subi r28, 0xBE ; 190 2a8d6: df 4f sbci r29, 0xFF ; 255 2a8d8: 0f b6 in r0, 0x3f ; 63 2a8da: f8 94 cli 2a8dc: de bf out 0x3e, r29 ; 62 2a8de: 0f be out 0x3f, r0 ; 63 2a8e0: cd bf out 0x3d, r28 ; 61 2a8e2: df 91 pop r29 2a8e4: cf 91 pop r28 2a8e6: 1f 91 pop r17 2a8e8: 0f 91 pop r16 2a8ea: ff 90 pop r15 2a8ec: ef 90 pop r14 2a8ee: df 90 pop r13 2a8f0: cf 90 pop r12 2a8f2: bf 90 pop r11 2a8f4: af 90 pop r10 2a8f6: 9f 90 pop r9 2a8f8: 8f 90 pop r8 2a8fa: 7f 90 pop r7 2a8fc: 6f 90 pop r6 2a8fe: 5f 90 pop r5 2a900: 4f 90 pop r4 2a902: 3f 90 pop r3 2a904: 2f 90 pop r2 2a906: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 2a908: fc 01 movw r30, r24 2a90a: 83 81 ldd r24, Z+3 ; 0x03 2a90c: 81 11 cpse r24, r1 2a90e: d8 cf rjmp .-80 ; 0x2a8c0 if (*path == '/') { 2a910: fa 01 movw r30, r20 2a912: 80 81 ld r24, Z 2a914: 8f 32 cpi r24, 0x2F ; 47 2a916: c1 f4 brne .+48 ; 0x2a948 2a918: ca 01 movw r24, r20 2a91a: 6c 01 movw r12, r24 2a91c: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 2a91e: f6 01 movw r30, r12 2a920: 20 81 ld r18, Z 2a922: 2f 32 cpi r18, 0x2F ; 47 2a924: d1 f3 breq .-12 ; 0x2a91a 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; 2a926: f5 01 movw r30, r10 2a928: 83 81 ldd r24, Z+3 ; 0x03 2a92a: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 2a92c: 82 30 cpi r24, 0x02 ; 2 2a92e: 60 f0 brcs .+24 ; 0x2a948 if (!dir2.openRoot(dirFile->vol_)) goto fail; 2a930: 61 8d ldd r22, Z+25 ; 0x19 2a932: 72 8d ldd r23, Z+26 ; 0x1a 2a934: ce 01 movw r24, r28 2a936: 4c 96 adiw r24, 0x1c ; 28 2a938: 0f 94 69 29 call 0x252d2 ; 0x252d2 parent = &dir2; 2a93c: 8e 01 movw r16, r28 2a93e: 04 5e subi r16, 0xE4 ; 228 2a940: 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; 2a942: 81 11 cpse r24, r1 2a944: 02 c0 rjmp .+4 ; 0x2a94a 2a946: bc cf rjmp .-136 ; 0x2a8c0 // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 2a948: 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; 2a94a: ce 01 movw r24, r28 2a94c: 01 96 adiw r24, 0x01 ; 1 2a94e: 7c 01 movw r14, r24 2a950: 3c 01 movw r6, r24 2a952: 2e 01 movw r4, r28 2a954: 9c e1 ldi r25, 0x1C ; 28 2a956: 49 0e add r4, r25 2a958: 51 1c adc r5, r1 2a95a: 23 96 adiw r28, 0x03 ; 3 2a95c: ef ae std Y+63, r14 ; 0x3f 2a95e: 23 97 sbiw r28, 0x03 ; 3 2a960: 2f 2c mov r2, r15 2a962: fe 01 movw r30, r28 2a964: f7 96 adiw r30, 0x37 ; 55 2a966: cf 01 movw r24, r30 2a968: 0b 96 adiw r24, 0x0b ; 11 2a96a: 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++] = ' '; 2a96c: 20 e2 ldi r18, 0x20 ; 32 2a96e: 21 93 st Z+, r18 2a970: e8 17 cp r30, r24 2a972: f9 07 cpc r31, r25 2a974: d9 f7 brne .-10 ; 0x2a96c 2a976: 96 01 movw r18, r12 i = 0; 2a978: 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 2a97a: 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 != '/') { 2a97c: d9 01 movw r26, r18 2a97e: 8d 91 ld r24, X+ 2a980: 88 23 and r24, r24 2a982: 49 f1 breq .+82 ; 0x2a9d6 2a984: 8f 32 cpi r24, 0x2F ; 47 2a986: 39 f1 breq .+78 ; 0x2a9d6 c = *str++; 2a988: 28 2f mov r18, r24 if (c == '.') { 2a98a: 8e 32 cpi r24, 0x2E ; 46 2a98c: 39 f4 brne .+14 ; 0x2a99c if (n == 10) goto fail; // only one dot allowed 2a98e: 6a 30 cpi r22, 0x0A ; 10 2a990: 09 f4 brne .+2 ; 0x2a994 2a992: 96 cf rjmp .-212 ; 0x2a8c0 n = 10; // max index for full 8.3 name i = 8; // place for extension 2a994: 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 2a996: 6a e0 ldi r22, 0x0A ; 10 2a998: 9d 01 movw r18, r26 2a99a: f0 cf rjmp .-32 ; 0x2a97c 2a99c: ee e8 ldi r30, 0x8E ; 142 2a99e: fc e8 ldi r31, 0x8C ; 140 //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; 2a9a0: 34 91 lpm r19, Z 2a9a2: 33 23 and r19, r19 2a9a4: 21 f0 breq .+8 ; 0x2a9ae 2a9a6: 31 96 adiw r30, 0x01 ; 1 2a9a8: 83 13 cpse r24, r19 2a9aa: fa cf rjmp .-12 ; 0x2a9a0 2a9ac: 89 cf rjmp .-238 ; 0x2a8c0 // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 2a9ae: 69 17 cp r22, r25 2a9b0: 08 f4 brcc .+2 ; 0x2a9b4 2a9b2: 86 cf rjmp .-244 ; 0x2a8c0 2a9b4: 3f ed ldi r19, 0xDF ; 223 2a9b6: 38 0f add r19, r24 2a9b8: 3e 35 cpi r19, 0x5E ; 94 2a9ba: 08 f0 brcs .+2 ; 0x2a9be 2a9bc: 81 cf rjmp .-254 ; 0x2a8c0 // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 2a9be: 3f e9 ldi r19, 0x9F ; 159 2a9c0: 38 0f add r19, r24 2a9c2: 3a 31 cpi r19, 0x1A ; 26 2a9c4: 10 f4 brcc .+4 ; 0x2a9ca 2a9c6: 20 ee ldi r18, 0xE0 ; 224 2a9c8: 28 0f add r18, r24 2a9ca: fa 01 movw r30, r20 2a9cc: e9 0f add r30, r25 2a9ce: f1 1d adc r31, r1 2a9d0: 20 83 st Z, r18 2a9d2: 9f 5f subi r25, 0xFF ; 255 2a9d4: e1 cf rjmp .-62 ; 0x2a998 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 2a9d6: 8f a9 ldd r24, Y+55 ; 0x37 2a9d8: 80 32 cpi r24, 0x20 ; 32 2a9da: 09 f4 brne .+2 ; 0x2a9de 2a9dc: 71 cf rjmp .-286 ; 0x2a8c0 2a9de: 69 01 movw r12, r18 while (*path == '/') path++; 2a9e0: f9 01 movw r30, r18 2a9e2: 80 81 ld r24, Z 2a9e4: 2f 5f subi r18, 0xFF ; 255 2a9e6: 3f 4f sbci r19, 0xFF ; 255 2a9e8: 8f 32 cpi r24, 0x2F ; 47 2a9ea: c9 f3 breq .-14 ; 0x2a9de if (!*path) break; 2a9ec: 88 23 and r24, r24 2a9ee: d9 f0 breq .+54 ; 0x2aa26 if (!sub->open(parent, dname, O_READ)) goto fail; 2a9f0: 21 e0 ldi r18, 0x01 ; 1 2a9f2: b8 01 movw r22, r16 2a9f4: c7 01 movw r24, r14 2a9f6: 0f 94 d7 2d call 0x25bae ; 0x25bae 2a9fa: 88 23 and r24, r24 2a9fc: 09 f4 brne .+2 ; 0x2aa00 2a9fe: 60 cf rjmp .-320 ; 0x2a8c0 if (parent != dirFile) parent->close(); 2aa00: 0a 15 cp r16, r10 2aa02: 1b 05 cpc r17, r11 2aa04: 19 f0 breq .+6 ; 0x2aa0c 2aa06: c8 01 movw r24, r16 2aa08: 0f 94 10 2c call 0x25820 ; 0x25820 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 2aa0c: 94 2d mov r25, r4 2aa0e: 85 2d mov r24, r5 2aa10: 6e 14 cp r6, r14 2aa12: 7f 04 cpc r7, r15 2aa14: 21 f0 breq .+8 ; 0x2aa1e 2aa16: 23 96 adiw r28, 0x03 ; 3 2aa18: 9f ad ldd r25, Y+63 ; 0x3f 2aa1a: 23 97 sbiw r28, 0x03 ; 3 2aa1c: 82 2d mov r24, r2 2aa1e: 87 01 movw r16, r14 2aa20: e9 2e mov r14, r25 2aa22: f8 2e mov r15, r24 2aa24: 9e cf rjmp .-196 ; 0x2a962 } return open(parent, dname, oflag); 2aa26: 23 2d mov r18, r3 2aa28: b8 01 movw r22, r16 2aa2a: c4 01 movw r24, r8 2aa2c: 0f 94 d7 2d call 0x25bae ; 0x25bae 2aa30: 18 2f mov r17, r24 2aa32: 47 cf rjmp .-370 ; 0x2a8c2 0002aa34 : } // 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; 2aa34: ef e6 ldi r30, 0x6F ; 111 2aa36: f6 e1 ldi r31, 0x16 ; 22 2aa38: 40 81 ld r20, Z 2aa3a: 51 81 ldd r21, Z+1 ; 0x01 2aa3c: 62 81 ldd r22, Z+2 ; 0x02 2aa3e: 73 81 ldd r23, Z+3 ; 0x03 2aa40: 48 0f add r20, r24 2aa42: 59 1f adc r21, r25 2aa44: 61 1d adc r22, r1 2aa46: 71 1d adc r23, r1 2aa48: 40 83 st Z, r20 2aa4a: 51 83 std Z+1, r21 ; 0x01 2aa4c: 62 83 std Z+2, r22 ; 0x02 2aa4e: 73 83 std Z+3, r23 ; 0x03 } 2aa50: 08 95 ret 0002aa52 : 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){ 2aa52: 2f 92 push r2 2aa54: 3f 92 push r3 2aa56: 4f 92 push r4 2aa58: 5f 92 push r5 2aa5a: 6f 92 push r6 2aa5c: 7f 92 push r7 2aa5e: 8f 92 push r8 2aa60: 9f 92 push r9 2aa62: af 92 push r10 2aa64: bf 92 push r11 2aa66: cf 92 push r12 2aa68: df 92 push r13 2aa6a: ef 92 push r14 2aa6c: ff 92 push r15 2aa6e: 0f 93 push r16 2aa70: 1f 93 push r17 2aa72: cf 93 push r28 2aa74: df 93 push r29 2aa76: 00 d0 rcall .+0 ; 0x2aa78 2aa78: 1f 92 push r1 2aa7a: 1f 92 push r1 2aa7c: cd b7 in r28, 0x3d ; 61 2aa7e: de b7 in r29, 0x3e ; 62 2aa80: 1c 01 movw r2, r24 2aa82: 2a 01 movw r4, r20 2aa84: 3b 01 movw r6, r22 2aa86: 00 e2 ldi r16, 0x20 ; 32 2aa88: 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){ 2aa8a: 19 82 std Y+1, r1 ; 0x01 2aa8c: 99 81 ldd r25, Y+1 ; 0x01 2aa8e: 89 2f mov r24, r25 2aa90: 90 e0 ldi r25, 0x00 ; 0 2aa92: 9b 83 std Y+3, r25 ; 0x03 2aa94: 8a 83 std Y+2, r24 ; 0x02 2aa96: 80 17 cp r24, r16 2aa98: 91 07 cpc r25, r17 2aa9a: 9c f5 brge .+102 ; 0x2ab02 if (points[j] > points[j + 1]) 2aa9c: 88 0f add r24, r24 2aa9e: 99 1f adc r25, r25 2aaa0: 88 0f add r24, r24 2aaa2: 99 1f adc r25, r25 2aaa4: 9d 83 std Y+5, r25 ; 0x05 2aaa6: 8c 83 std Y+4, r24 ; 0x04 2aaa8: 82 0d add r24, r2 2aaaa: 93 1d adc r25, r3 2aaac: 9b 83 std Y+3, r25 ; 0x03 2aaae: 8a 83 std Y+2, r24 ; 0x02 2aab0: fc 01 movw r30, r24 2aab2: c0 80 ld r12, Z 2aab4: d1 80 ldd r13, Z+1 ; 0x01 2aab6: e2 80 ldd r14, Z+2 ; 0x02 2aab8: f3 80 ldd r15, Z+3 ; 0x03 2aaba: 8c 81 ldd r24, Y+4 ; 0x04 2aabc: 9d 81 ldd r25, Y+5 ; 0x05 2aabe: 04 96 adiw r24, 0x04 ; 4 2aac0: 82 0d add r24, r2 2aac2: 93 1d adc r25, r3 2aac4: 9d 83 std Y+5, r25 ; 0x05 2aac6: 8c 83 std Y+4, r24 ; 0x04 2aac8: fc 01 movw r30, r24 2aaca: 80 80 ld r8, Z 2aacc: 91 80 ldd r9, Z+1 ; 0x01 2aace: a2 80 ldd r10, Z+2 ; 0x02 2aad0: b3 80 ldd r11, Z+3 ; 0x03 2aad2: a5 01 movw r20, r10 2aad4: 94 01 movw r18, r8 2aad6: c7 01 movw r24, r14 2aad8: b6 01 movw r22, r12 2aada: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2aade: 18 16 cp r1, r24 2aae0: 64 f4 brge .+24 ; 0x2aafa SWAP(points[j], points[j + 1]); 2aae2: ea 81 ldd r30, Y+2 ; 0x02 2aae4: fb 81 ldd r31, Y+3 ; 0x03 2aae6: 80 82 st Z, r8 2aae8: 91 82 std Z+1, r9 ; 0x01 2aaea: a2 82 std Z+2, r10 ; 0x02 2aaec: b3 82 std Z+3, r11 ; 0x03 2aaee: ec 81 ldd r30, Y+4 ; 0x04 2aaf0: fd 81 ldd r31, Y+5 ; 0x05 2aaf2: c0 82 st Z, r12 2aaf4: d1 82 std Z+1, r13 ; 0x01 2aaf6: e2 82 std Z+2, r14 ; 0x02 2aaf8: 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){ 2aafa: f9 81 ldd r31, Y+1 ; 0x01 2aafc: ff 5f subi r31, 0xFF ; 255 2aafe: f9 83 std Y+1, r31 ; 0x01 2ab00: c5 cf rjmp .-118 ; 0x2aa8c 2ab02: 01 50 subi r16, 0x01 ; 1 2ab04: 11 09 sbc r17, r1 2ab06: 08 f6 brcc .-126 ; 0x2aa8a /// 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]; 2ab08: f1 01 movw r30, r2 2ab0a: e0 5c subi r30, 0xC0 ; 192 2ab0c: 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); 2ab0e: 20 81 ld r18, Z 2ab10: 31 81 ldd r19, Z+1 ; 0x01 2ab12: 42 81 ldd r20, Z+2 ; 0x02 2ab14: 53 81 ldd r21, Z+3 ; 0x03 2ab16: c3 01 movw r24, r6 2ab18: b2 01 movw r22, r4 2ab1a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2ab1e: 6b 01 movw r12, r22 2ab20: 7c 01 movw r14, r24 2ab22: 20 e0 ldi r18, 0x00 ; 0 2ab24: 30 e0 ldi r19, 0x00 ; 0 2ab26: 40 e0 ldi r20, 0x00 ; 0 2ab28: 5f eb ldi r21, 0xBF ; 191 2ab2a: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2ab2e: 87 fd sbrc r24, 7 2ab30: 10 c0 rjmp .+32 ; 0x2ab52 2ab32: 20 e0 ldi r18, 0x00 ; 0 2ab34: 30 e0 ldi r19, 0x00 ; 0 2ab36: 40 e0 ldi r20, 0x00 ; 0 2ab38: 5f e3 ldi r21, 0x3F ; 63 2ab3a: c7 01 movw r24, r14 2ab3c: b6 01 movw r22, r12 2ab3e: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2ab42: 18 16 cp r1, r24 2ab44: 5c f4 brge .+22 ; 0x2ab5c 2ab46: c1 2c mov r12, r1 2ab48: d1 2c mov r13, r1 2ab4a: e1 2c mov r14, r1 2ab4c: 8f e3 ldi r24, 0x3F ; 63 2ab4e: f8 2e mov r15, r24 2ab50: 05 c0 rjmp .+10 ; 0x2ab5c 2ab52: c1 2c mov r12, r1 2ab54: d1 2c mov r13, r1 2ab56: e1 2c mov r14, r1 2ab58: 9f eb ldi r25, 0xBF ; 191 2ab5a: f9 2e mov r15, r25 } 2ab5c: c7 01 movw r24, r14 2ab5e: b6 01 movw r22, r12 2ab60: 0f 90 pop r0 2ab62: 0f 90 pop r0 2ab64: 0f 90 pop r0 2ab66: 0f 90 pop r0 2ab68: 0f 90 pop r0 2ab6a: df 91 pop r29 2ab6c: cf 91 pop r28 2ab6e: 1f 91 pop r17 2ab70: 0f 91 pop r16 2ab72: ff 90 pop r15 2ab74: ef 90 pop r14 2ab76: df 90 pop r13 2ab78: cf 90 pop r12 2ab7a: bf 90 pop r11 2ab7c: af 90 pop r10 2ab7e: 9f 90 pop r9 2ab80: 8f 90 pop r8 2ab82: 7f 90 pop r7 2ab84: 6f 90 pop r6 2ab86: 5f 90 pop r5 2ab88: 4f 90 pop r4 2ab8a: 3f 90 pop r3 2ab8c: 2f 90 pop r2 2ab8e: 08 95 ret 0002ab90 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2ab90: 0f 94 01 0b call 0x21602 ; 0x21602 2ab94: 60 93 a1 12 sts 0x12A1, r22 ; 0x8012a1 2ab98: 70 93 a2 12 sts 0x12A2, r23 ; 0x8012a2 2ab9c: 80 93 a3 12 sts 0x12A3, r24 ; 0x8012a3 2aba0: 90 93 a4 12 sts 0x12A4, r25 ; 0x8012a4 } 2aba4: 08 95 ret 0002aba6 : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2aba6: 80 91 e7 12 lds r24, 0x12E7 ; 0x8012e7 2abaa: 88 23 and r24, r24 2abac: 69 f0 breq .+26 ; 0x2abc8 2abae: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 2abb2: 88 23 and r24, r24 2abb4: 49 f0 breq .+18 ; 0x2abc8 SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2abb6: 8b e5 ldi r24, 0x5B ; 91 2abb8: 92 ea ldi r25, 0xA2 ; 162 2abba: 0e 94 18 7d call 0xfa30 ; 0xfa30 retryAttempts--; 2abbe: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 2abc2: 81 50 subi r24, 0x01 ; 1 2abc4: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 } } 2abc8: 08 95 ret 0002abca : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2abca: 9f 92 push r9 2abcc: af 92 push r10 2abce: bf 92 push r11 2abd0: cf 92 push r12 2abd2: df 92 push r13 2abd4: ef 92 push r14 2abd6: ff 92 push r15 2abd8: 0f 93 push r16 2abda: 1f 93 push r17 2abdc: cf 93 push r28 2abde: df 93 push r29 2abe0: cd b7 in r28, 0x3d ; 61 2abe2: de b7 in r29, 0x3e ; 62 2abe4: e0 97 sbiw r28, 0x30 ; 48 2abe6: 0f b6 in r0, 0x3f ; 63 2abe8: f8 94 cli 2abea: de bf out 0x3e, r29 ; 62 2abec: 0f be out 0x3f, r0 ; 63 2abee: cd bf out 0x3d, r28 ; 61 2abf0: 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()]; 2abf2: e0 90 cf 12 lds r14, 0x12CF ; 0x8012cf 2abf6: fe 01 movw r30, r28 2abf8: 31 96 adiw r30, 0x01 ; 1 2abfa: 21 e0 ldi r18, 0x01 ; 1 2abfc: 30 e0 ldi r19, 0x00 ; 0 2abfe: 5f 01 movw r10, r30 2ac00: f1 2c mov r15, r1 2ac02: 40 e1 ldi r20, 0x10 ; 16 2ac04: c4 2e mov r12, r20 2ac06: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2ac08: 50 e2 ldi r21, 0x20 ; 32 2ac0a: 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()]; 2ac0c: c7 01 movw r24, r14 2ac0e: 82 1b sub r24, r18 2ac10: 93 0b sbc r25, r19 2ac12: b6 01 movw r22, r12 2ac14: 0f 94 1b a5 call 0x34a36 ; 0x34a36 <__divmodhi4> 2ac18: dc 01 movw r26, r24 2ac1a: bb 27 eor r27, r27 2ac1c: ae 56 subi r26, 0x6E ; 110 2ac1e: bd 4e sbci r27, 0xED ; 237 2ac20: 9d 96 adiw r26, 0x2d ; 45 2ac22: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2ac24: 48 2f mov r20, r24 2ac26: 50 e0 ldi r21, 0x00 ; 0 2ac28: 94 e0 ldi r25, 0x04 ; 4 2ac2a: 55 95 asr r21 2ac2c: 47 95 ror r20 2ac2e: 9a 95 dec r25 2ac30: e1 f7 brne .-8 ; 0x2ac2a lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2ac32: 96 ef ldi r25, 0xF6 ; 246 2ac34: 94 0f add r25, r20 2ac36: 96 30 cpi r25, 0x06 ; 6 2ac38: a8 f1 brcs .+106 ; 0x2aca4 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2ac3a: 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); 2ac3c: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2ac3e: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2ac40: 96 ef ldi r25, 0xF6 ; 246 2ac42: 98 0f add r25, r24 2ac44: 96 30 cpi r25, 0x06 ; 6 2ac46: 80 f1 brcs .+96 ; 0x2aca8 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2ac48: 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); 2ac4a: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2ac4c: 92 82 std Z+2, r9 ; 0x02 2ac4e: 2f 5f subi r18, 0xFF ; 255 2ac50: 3f 4f sbci r19, 0xFF ; 255 2ac52: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2ac54: 21 31 cpi r18, 0x11 ; 17 2ac56: 31 05 cpc r19, r1 2ac58: c9 f6 brne .-78 ; 0x2ac0c 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 2ac5a: 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); 2ac5c: 84 ee ldi r24, 0xE4 ; 228 2ac5e: 92 ea ldi r25, 0xA2 ; 162 2ac60: 0e 94 1f 7b call 0xf63e ; 0xf63e 2ac64: 8e ed ldi r24, 0xDE ; 222 2ac66: 92 ea ldi r25, 0xA2 ; 162 2ac68: 0e 94 1f 7b call 0xf63e ; 0xf63e 2ac6c: c8 01 movw r24, r16 2ac6e: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOPGM(", last bytes: "); 2ac72: 86 e8 ldi r24, 0x86 ; 134 2ac74: 92 ea ldi r25, 0xA2 ; 162 2ac76: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN(lrb); 2ac7a: c5 01 movw r24, r10 2ac7c: 0e 94 1d 86 call 0x10c3a ; 0x10c3a } 2ac80: e0 96 adiw r28, 0x30 ; 48 2ac82: 0f b6 in r0, 0x3f ; 63 2ac84: f8 94 cli 2ac86: de bf out 0x3e, r29 ; 62 2ac88: 0f be out 0x3f, r0 ; 63 2ac8a: cd bf out 0x3d, r28 ; 61 2ac8c: df 91 pop r29 2ac8e: cf 91 pop r28 2ac90: 1f 91 pop r17 2ac92: 0f 91 pop r16 2ac94: ff 90 pop r15 2ac96: ef 90 pop r14 2ac98: df 90 pop r13 2ac9a: cf 90 pop r12 2ac9c: bf 90 pop r11 2ac9e: af 90 pop r10 2aca0: 9f 90 pop r9 2aca2: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2aca4: 49 5a subi r20, 0xA9 ; 169 2aca6: ca cf rjmp .-108 ; 0x2ac3c 2aca8: 89 5a subi r24, 0xA9 ; 169 2acaa: cf cf rjmp .-98 ; 0x2ac4a 0002acac : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2acac: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2acae: 90 91 a6 12 lds r25, 0x12A6 ; 0x8012a6 2acb2: 9a 30 cpi r25, 0x0A ; 10 2acb4: 11 f4 brne .+4 ; 0x2acba cause = ss; 2acb6: 60 93 a5 12 sts 0x12A5, r22 ; 0x8012a5 } --occurrences; 2acba: 91 50 subi r25, 0x01 ; 1 2acbc: 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)) { 2acc0: 91 11 cpse r25, r1 2acc2: 0d c0 rjmp .+26 ; 0x2acde 2acc4: c9 01 movw r24, r18 LogError(msg_P); 2acc6: 0f 94 e5 55 call 0x2abca ; 0x2abca SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2acca: 87 e7 ldi r24, 0x77 ; 119 2accc: 92 ea ldi r25, 0xA2 ; 162 2acce: 0e 94 18 7d call 0xfa30 ; 0xfa30 /// @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; } 2acd2: 8a e0 ldi r24, 0x0A ; 10 2acd4: 80 93 a6 12 sts 0x12A6, r24 ; 0x8012a6 2acd8: 80 91 a5 12 lds r24, 0x12A5 ; 0x8012a5 2acdc: 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 2acde: 80 e0 ldi r24, 0x00 ; 0 } } 2ace0: 08 95 ret 0002ace2 : } *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) { 2ace2: cf 93 push r28 2ace4: df 93 push r29 2ace6: cd b7 in r28, 0x3d ; 61 2ace8: de b7 in r29, 0x3e ; 62 2acea: 2e 97 sbiw r28, 0x0e ; 14 2acec: 0f b6 in r0, 0x3f ; 63 2acee: f8 94 cli 2acf0: de bf out 0x3e, r29 ; 62 2acf2: 0f be out 0x3f, r0 ; 63 2acf4: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2acf6: 2e e3 ldi r18, 0x3E ; 62 2acf8: 30 e0 ldi r19, 0x00 ; 0 2acfa: 3a 83 std Y+2, r19 ; 0x02 2acfc: 29 83 std Y+1, r18 ; 0x01 2acfe: fe 01 movw r30, r28 2ad00: 33 96 adiw r30, 0x03 ; 3 2ad02: 2c e0 ldi r18, 0x0C ; 12 2ad04: df 01 movw r26, r30 2ad06: 1d 92 st X+, r1 2ad08: 2a 95 dec r18 2ad0a: e9 f7 brne .-6 ; 0x2ad06 2ad0c: de 01 movw r26, r28 2ad0e: 12 96 adiw r26, 0x02 ; 2 2ad10: 48 2f mov r20, r24 2ad12: fc 01 movw r30, r24 2ad14: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2ad16: 8e 2f mov r24, r30 2ad18: 84 1b sub r24, r20 2ad1a: 86 17 cp r24, r22 2ad1c: 40 f4 brcc .+16 ; 0x2ad2e uint8_t b = txbuff[i]; 2ad1e: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2ad20: 90 ee ldi r25, 0xE0 ; 224 2ad22: 98 0f add r25, r24 2ad24: 90 36 cpi r25, 0x60 ; 96 2ad26: 08 f0 brcs .+2 ; 0x2ad2a b = '.'; 2ad28: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2ad2a: 8d 93 st X+, r24 2ad2c: f4 cf rjmp .-24 ; 0x2ad16 } tmp[size + 1] = 0; 2ad2e: f9 01 movw r30, r18 2ad30: e6 0f add r30, r22 2ad32: f1 1d adc r31, r1 2ad34: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2ad36: 4e e0 ldi r20, 0x0E ; 14 2ad38: 50 e0 ldi r21, 0x00 ; 0 2ad3a: 6a ee ldi r22, 0xEA ; 234 2ad3c: 72 ea ldi r23, 0xA2 ; 162 2ad3e: ce 01 movw r24, r28 2ad40: 01 96 adiw r24, 0x01 ; 1 2ad42: 0f 94 1d a2 call 0x3443a ; 0x3443a 2ad46: 89 2b or r24, r25 2ad48: 59 f4 brne .+22 ; 0x2ad60 2ad4a: 4e e0 ldi r20, 0x0E ; 14 2ad4c: 50 e0 ldi r21, 0x00 ; 0 2ad4e: be 01 movw r22, r28 2ad50: 6f 5f subi r22, 0xFF ; 255 2ad52: 7f 4f sbci r23, 0xFF ; 255 2ad54: 82 e8 ldi r24, 0x82 ; 130 2ad56: 92 e1 ldi r25, 0x12 ; 18 2ad58: 0f 94 b0 aa call 0x35560 ; 0x35560 2ad5c: 89 2b or r24, r25 2ad5e: 61 f0 breq .+24 ; 0x2ad78 // 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); 2ad60: 84 ee ldi r24, 0xE4 ; 228 2ad62: 92 ea ldi r25, 0xA2 ; 162 2ad64: 0e 94 1f 7b call 0xf63e ; 0xf63e 2ad68: 8e ed ldi r24, 0xDE ; 222 2ad6a: 92 ea ldi r25, 0xA2 ; 162 2ad6c: 0e 94 1f 7b call 0xf63e ; 0xf63e 2ad70: ce 01 movw r24, r28 2ad72: 01 96 adiw r24, 0x01 ; 1 2ad74: 0e 94 1d 86 call 0x10c3a ; 0x10c3a } strncpy(lastMsg, tmp, rqs); 2ad78: 4e e0 ldi r20, 0x0E ; 14 2ad7a: 50 e0 ldi r21, 0x00 ; 0 2ad7c: be 01 movw r22, r28 2ad7e: 6f 5f subi r22, 0xFF ; 255 2ad80: 7f 4f sbci r23, 0xFF ; 255 2ad82: 82 e8 ldi r24, 0x82 ; 130 2ad84: 92 e1 ldi r25, 0x12 ; 18 2ad86: 0f 94 be aa call 0x3557c ; 0x3557c } 2ad8a: 2e 96 adiw r28, 0x0e ; 14 2ad8c: 0f b6 in r0, 0x3f ; 63 2ad8e: f8 94 cli 2ad90: de bf out 0x3e, r29 ; 62 2ad92: 0f be out 0x3f, r0 ; 63 2ad94: cd bf out 0x3d, r28 ; 61 2ad96: df 91 pop r29 2ad98: cf 91 pop r28 2ad9a: 08 95 ret 0002ad9c : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2ad9c: cf 92 push r12 2ad9e: df 92 push r13 2ada0: ef 92 push r14 2ada2: ff 92 push r15 2ada4: 1f 93 push r17 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: 62 97 sbiw r28, 0x12 ; 18 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 2adba: 4e 87 std Y+14, r20 ; 0x0e 2adbc: 5f 87 std Y+15, r21 ; 0x0f 2adbe: 68 8b std Y+16, r22 ; 0x10 2adc0: 79 8b std Y+17, r23 ; 0x11 2adc2: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2adc4: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2adc6: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2adc8: 51 11 cpse r21, r1 2adca: 31 c0 rjmp .+98 ; 0x2ae2e *dst = '0'; 2adcc: 80 e3 ldi r24, 0x30 ; 48 2adce: 8a 83 std Y+2, r24 ; 0x02 return 1; 2add0: 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); 2add2: e1 e0 ldi r30, 0x01 ; 1 2add4: e1 0f add r30, r17 2add6: 81 e0 ldi r24, 0x01 ; 1 2add8: 90 e0 ldi r25, 0x00 ; 0 2adda: 8c 0f add r24, r28 2addc: 9d 1f adc r25, r29 2adde: 8e 0f add r24, r30 2ade0: 91 1d adc r25, r1 2ade2: fc 01 movw r30, r24 2ade4: 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 2ade6: 9a e2 ldi r25, 0x2A ; 42 2ade8: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2adea: 81 11 cpse r24, r1 2adec: 27 c0 rjmp .+78 ; 0x2ae3c *dst = '0'; 2adee: 80 e3 ldi r24, 0x30 ; 48 2adf0: 81 83 std Z+1, r24 ; 0x01 return 1; 2adf2: 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); 2adf4: 1e 5f subi r17, 0xFE ; 254 2adf6: 18 0f add r17, r24 txbuff[i] = '\n'; 2adf8: e1 e0 ldi r30, 0x01 ; 1 2adfa: f0 e0 ldi r31, 0x00 ; 0 2adfc: ec 0f add r30, r28 2adfe: fd 1f adc r31, r29 2ae00: e1 0f add r30, r17 2ae02: f1 1d adc r31, r1 2ae04: 8a e0 ldi r24, 0x0A ; 10 2ae06: 80 83 st Z, r24 ++i; 2ae08: 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); 2ae0a: fe 01 movw r30, r28 2ae0c: 31 96 adiw r30, 0x01 ; 1 2ae0e: 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--){ 2ae10: 6f 01 movw r12, r30 2ae12: c1 0e add r12, r17 2ae14: d1 1c adc r13, r1 2ae16: ec 14 cp r14, r12 2ae18: fd 04 cpc r15, r13 2ae1a: b1 f0 breq .+44 ; 0x2ae48 fputc(*buffer, uart2io); 2ae1c: f7 01 movw r30, r14 2ae1e: 81 91 ld r24, Z+ 2ae20: 7f 01 movw r14, r30 2ae22: 64 e7 ldi r22, 0x74 ; 116 2ae24: 72 e1 ldi r23, 0x12 ; 18 2ae26: 90 e0 ldi r25, 0x00 ; 0 2ae28: 0f 94 a6 a2 call 0x3454c ; 0x3454c 2ae2c: f4 cf rjmp .-24 ; 0x2ae16 2ae2e: be 01 movw r22, r28 2ae30: 6e 5f subi r22, 0xFE ; 254 2ae32: 7f 4f sbci r23, 0xFF ; 255 2ae34: 0f 94 db 4d call 0x29bb6 ; 0x29bb6 2ae38: 18 2f mov r17, r24 2ae3a: cb cf rjmp .-106 ; 0x2add2 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); 2ae3c: bf 01 movw r22, r30 2ae3e: 6f 5f subi r22, 0xFF ; 255 2ae40: 7f 4f sbci r23, 0xFF ; 255 2ae42: 0f 94 db 4d call 0x29bb6 ; 0x29bb6 2ae46: d6 cf rjmp .-84 ; 0x2adf4 LogRequestMsg(txbuff, len); 2ae48: 61 2f mov r22, r17 2ae4a: ce 01 movw r24, r28 2ae4c: 01 96 adiw r24, 0x01 ; 1 2ae4e: 0f 94 71 56 call 0x2ace2 ; 0x2ace2 RecordUARTActivity(); 2ae52: 0f 94 c8 55 call 0x2ab90 ; 0x2ab90 } 2ae56: 62 96 adiw r28, 0x12 ; 18 2ae58: 0f b6 in r0, 0x3f ; 63 2ae5a: f8 94 cli 2ae5c: de bf out 0x3e, r29 ; 62 2ae5e: 0f be out 0x3f, r0 ; 63 2ae60: cd bf out 0x3d, r28 ; 61 2ae62: df 91 pop r29 2ae64: cf 91 pop r28 2ae66: 1f 91 pop r17 2ae68: ff 90 pop r15 2ae6a: ef 90 pop r14 2ae6c: df 90 pop r13 2ae6e: cf 90 pop r12 2ae70: 08 95 ret 0002ae72 : 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) { 2ae72: 8f 92 push r8 2ae74: 9f 92 push r9 2ae76: af 92 push r10 2ae78: bf 92 push r11 2ae7a: df 92 push r13 2ae7c: ef 92 push r14 2ae7e: ff 92 push r15 2ae80: 0f 93 push r16 2ae82: 1f 93 push r17 2ae84: cf 93 push r28 2ae86: df 93 push r29 2ae88: cd b7 in r28, 0x3d ; 61 2ae8a: de b7 in r29, 0x3e ; 62 2ae8c: 67 97 sbiw r28, 0x17 ; 23 2ae8e: 0f b6 in r0, 0x3f ; 63 2ae90: f8 94 cli 2ae92: de bf out 0x3e, r29 ; 62 2ae94: 0f be out 0x3f, r0 ; 63 2ae96: cd bf out 0x3d, r28 ; 61 2ae98: 18 2f mov r17, r24 2ae9a: 7b 01 movw r14, r22 2ae9c: 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()) { 2ae9e: 07 e5 ldi r16, 0x57 ; 87 2aea0: 0b 8b std Y+19, r16 ; 0x13 2aea2: 8c 8b std Y+20, r24 ; 0x14 2aea4: 7e 8b std Y+22, r23 ; 0x16 2aea6: 6d 8b std Y+21, r22 ; 0x15 2aea8: ce 01 movw r24, r28 2aeaa: 43 96 adiw r24, 0x13 ; 19 2aeac: 0f 94 07 4e call 0x29c0e ; 0x29c0e 2aeb0: 8f 8b std Y+23, r24 ; 0x17 2aeb2: 0e 87 std Y+14, r16 ; 0x0e 2aeb4: 1f 87 std Y+15, r17 ; 0x0f 2aeb6: f9 8a std Y+17, r15 ; 0x11 2aeb8: e8 8a std Y+16, r14 ; 0x10 2aeba: ce 01 movw r24, r28 2aebc: 0e 96 adiw r24, 0x0e ; 14 2aebe: 0f 94 07 4e call 0x29c0e ; 0x29c0e 2aec2: 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; 2aec4: 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) { 2aec6: 11 11 cpse r17, r1 2aec8: 27 c0 rjmp .+78 ; 0x2af18 *dst = '0'; 2aeca: 80 e3 ldi r24, 0x30 ; 48 2aecc: 8a 83 std Y+2, r24 ; 0x02 return 1; 2aece: 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); 2aed0: e1 e0 ldi r30, 0x01 ; 1 2aed2: e8 0f add r30, r24 dst[i] = ' '; 2aed4: 21 e0 ldi r18, 0x01 ; 1 2aed6: 30 e0 ldi r19, 0x00 ; 0 2aed8: 2c 0f add r18, r28 2aeda: 3d 1f adc r19, r29 2aedc: 2e 0f add r18, r30 2aede: 31 1d adc r19, r1 2aee0: f9 01 movw r30, r18 2aee2: 90 e2 ldi r25, 0x20 ; 32 2aee4: 90 83 st Z, r25 return i + 1; 2aee6: 02 e0 ldi r16, 0x02 ; 2 2aee8: 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); 2aeea: aa 24 eor r10, r10 2aeec: a3 94 inc r10 2aeee: b1 2c mov r11, r1 2aef0: ac 0e add r10, r28 2aef2: bd 1e adc r11, r29 2aef4: a0 0e add r10, r16 2aef6: 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) { 2aef8: e1 14 cp r14, r1 2aefa: f1 04 cpc r15, r1 2aefc: 39 f1 breq .+78 ; 0x2af4c *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2aefe: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2af00: c7 01 movw r24, r14 2af02: 88 27 eor r24, r24 2af04: 90 7f andi r25, 0xF0 ; 240 2af06: 89 2b or r24, r25 2af08: 71 f4 brne .+28 ; 0x2af26 value <<= 4U; 2af0a: 24 e0 ldi r18, 0x04 ; 4 2af0c: ee 0c add r14, r14 2af0e: ff 1c adc r15, r15 2af10: 2a 95 dec r18 2af12: e1 f7 brne .-8 ; 0x2af0c --charsOut; 2af14: 11 50 subi r17, 0x01 ; 1 2af16: f4 cf rjmp .-24 ; 0x2af00 2af18: be 01 movw r22, r28 2af1a: 6e 5f subi r22, 0xFE ; 254 2af1c: 7f 4f sbci r23, 0xFF ; 255 2af1e: 81 2f mov r24, r17 2af20: 0f 94 db 4d call 0x29bb6 ; 0x29bb6 2af24: d5 cf rjmp .-86 ; 0x2aed0 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2af26: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2af28: 88 2d mov r24, r8 2af2a: 8a 19 sub r24, r10 2af2c: 81 17 cp r24, r17 2af2e: 90 f4 brcc .+36 ; 0x2af54 uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2af30: 8f 2d mov r24, r15 2af32: 82 95 swap r24 2af34: 8f 70 andi r24, 0x0F ; 15 2af36: 94 e0 ldi r25, 0x04 ; 4 2af38: ee 0c add r14, r14 2af3a: ff 1c adc r15, r15 2af3c: 9a 95 dec r25 2af3e: e1 f7 brne .-8 ; 0x2af38 2af40: 0f 94 d1 4d call 0x29ba2 ; 0x29ba2 2af44: f4 01 movw r30, r8 2af46: 81 93 st Z+, r24 2af48: 4f 01 movw r8, r30 2af4a: ee cf rjmp .-36 ; 0x2af28 } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2af4c: 80 e3 ldi r24, 0x30 ; 48 2af4e: f5 01 movw r30, r10 2af50: 80 83 st Z, r24 return 1; 2af52: 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); 2af54: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2af56: e1 e0 ldi r30, 0x01 ; 1 2af58: f0 e0 ldi r31, 0x00 ; 0 2af5a: ec 0f add r30, r28 2af5c: fd 1f adc r31, r29 2af5e: e1 0f add r30, r17 2af60: f1 1d adc r31, r1 2af62: 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 2af64: 9a e2 ldi r25, 0x2A ; 42 2af66: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2af68: 81 11 cpse r24, r1 2af6a: 21 c0 rjmp .+66 ; 0x2afae *dst = '0'; 2af6c: 80 e3 ldi r24, 0x30 ; 48 2af6e: 81 83 std Z+1, r24 ; 0x01 return 1; 2af70: 81 e0 ldi r24, 0x01 ; 1 2af72: 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); 2af74: 18 0f add r17, r24 txbuff[i] = '\n'; 2af76: e1 e0 ldi r30, 0x01 ; 1 2af78: f0 e0 ldi r31, 0x00 ; 0 2af7a: ec 0f add r30, r28 2af7c: fd 1f adc r31, r29 2af7e: e1 0f add r30, r17 2af80: f1 1d adc r31, r1 2af82: 8a e0 ldi r24, 0x0A ; 10 2af84: 80 83 st Z, r24 ++i; 2af86: 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); 2af88: 9e 01 movw r18, r28 2af8a: 2f 5f subi r18, 0xFF ; 255 2af8c: 3f 4f sbci r19, 0xFF ; 255 2af8e: 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--){ 2af90: 59 01 movw r10, r18 2af92: a1 0e add r10, r17 2af94: b1 1c adc r11, r1 2af96: ea 14 cp r14, r10 2af98: fb 04 cpc r15, r11 2af9a: 79 f0 breq .+30 ; 0x2afba fputc(*buffer, uart2io); 2af9c: f7 01 movw r30, r14 2af9e: 81 91 ld r24, Z+ 2afa0: 7f 01 movw r14, r30 2afa2: 64 e7 ldi r22, 0x74 ; 116 2afa4: 72 e1 ldi r23, 0x12 ; 18 2afa6: 90 e0 ldi r25, 0x00 ; 0 2afa8: 0f 94 a6 a2 call 0x3454c ; 0x3454c 2afac: f4 cf rjmp .-24 ; 0x2af96 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); 2afae: bf 01 movw r22, r30 2afb0: 6f 5f subi r22, 0xFF ; 255 2afb2: 7f 4f sbci r23, 0xFF ; 255 2afb4: 0f 94 db 4d call 0x29bb6 ; 0x29bb6 2afb8: dc cf rjmp .-72 ; 0x2af72 LogRequestMsg(txbuff, len); 2afba: 61 2f mov r22, r17 2afbc: ce 01 movw r24, r28 2afbe: 01 96 adiw r24, 0x01 ; 1 2afc0: 0f 94 71 56 call 0x2ace2 ; 0x2ace2 RecordUARTActivity(); 2afc4: 0f 94 c8 55 call 0x2ab90 ; 0x2ab90 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2afc8: d0 92 95 12 sts 0x1295, r13 ; 0x801295 } 2afcc: 67 96 adiw r28, 0x17 ; 23 2afce: 0f b6 in r0, 0x3f ; 63 2afd0: f8 94 cli 2afd2: de bf out 0x3e, r29 ; 62 2afd4: 0f be out 0x3f, r0 ; 63 2afd6: cd bf out 0x3d, r28 ; 61 2afd8: df 91 pop r29 2afda: cf 91 pop r28 2afdc: 1f 91 pop r17 2afde: 0f 91 pop r16 2afe0: ff 90 pop r15 2afe2: ef 90 pop r14 2afe4: df 90 pop r13 2afe6: bf 90 pop r11 2afe8: af 90 pop r10 2afea: 9f 90 pop r9 2afec: 8f 90 pop r8 2afee: 08 95 ret 0002aff0 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2aff0: 20 91 e0 12 lds r18, 0x12E0 ; 0x8012e0 2aff4: 2f 5f subi r18, 0xFF ; 255 2aff6: 20 93 e0 12 sts 0x12E0, r18 ; 0x8012e0 if (regIndex >= initRegs8Count) { 2affa: 22 30 cpi r18, 0x02 ; 2 2affc: 78 f4 brcc .+30 ; 0x2b01c return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2affe: 30 e0 ldi r19, 0x00 ; 0 2b000: f9 01 movw r30, r18 2b002: eb 58 subi r30, 0x8B ; 139 2b004: fd 45 sbci r31, 0x5D ; 93 2b006: 84 91 lpm r24, Z 2b008: 22 52 subi r18, 0x22 ; 34 2b00a: 3d 4e sbci r19, 0xED ; 237 2b00c: f9 01 movw r30, r18 2b00e: 60 81 ld r22, Z 2b010: 70 e0 ldi r23, 0x00 ; 0 2b012: 49 e0 ldi r20, 0x09 ; 9 2b014: 0f 94 39 57 call 0x2ae72 ; 0x2ae72 } return false; 2b018: 80 e0 ldi r24, 0x00 ; 0 2b01a: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2b01c: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2b01e: 08 95 ret 0002b020 : } /// 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){ 2b020: 2f 92 push r2 2b022: 3f 92 push r3 2b024: 4f 92 push r4 2b026: 5f 92 push r5 2b028: 6f 92 push r6 2b02a: 7f 92 push r7 2b02c: 8f 92 push r8 2b02e: 9f 92 push r9 2b030: af 92 push r10 2b032: bf 92 push r11 2b034: cf 92 push r12 2b036: df 92 push r13 2b038: ef 92 push r14 2b03a: ff 92 push r15 2b03c: 0f 93 push r16 2b03e: 1f 93 push r17 2b040: cf 93 push r28 2b042: df 93 push r29 2b044: 00 d0 rcall .+0 ; 0x2b046 2b046: 1f 92 push r1 2b048: 1f 92 push r1 2b04a: cd b7 in r28, 0x3d ; 61 2b04c: de b7 in r29, 0x3e ; 62 2b04e: 2b 01 movw r4, r22 2b050: 1a 01 movw r2, r20 2b052: f1 2c mov r15, r1 2b054: 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; 2b056: 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; 2b058: 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; 2b05a: 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){ 2b05c: 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); 2b05e: 66 24 eor r6, r6 2b060: 63 94 inc r6 2b062: 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){ 2b064: 70 e0 ldi r23, 0x00 ; 0 2b066: 60 e0 ldi r22, 0x00 ; 0 2b068: 97 01 movw r18, r14 2b06a: 22 5a subi r18, 0xA2 ; 162 2b06c: 39 4f sbci r19, 0xF9 ; 249 2b06e: 3a 83 std Y+2, r19 ; 0x02 2b070: 29 83 std Y+1, r18 ; 0x01 2b072: 86 2e mov r8, r22 2b074: c9 80 ldd r12, Y+1 ; 0x01 2b076: da 80 ldd r13, Y+2 ; 0x02 2b078: c6 0e add r12, r22 2b07a: d7 1e adc r13, r23 2b07c: 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; 2b07e: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 2b080: 40 e0 ldi r20, 0x00 ; 0 2b082: 30 e0 ldi r19, 0x00 ; 0 2b084: 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; 2b086: ae ef ldi r26, 0xFE ; 254 2b088: a4 0f add r26, r20 2b08a: 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; 2b08c: 44 23 and r20, r20 2b08e: 19 f0 breq .+6 ; 0x2b096 2b090: 4b 30 cpi r20, 0x0B ; 11 2b092: 09 f0 breq .+2 ; 0x2b096 2b094: 7d c0 rjmp .+250 ; 0x2b190 2b096: ae ef ldi r26, 0xFE ; 254 2b098: a2 0f add r26, r18 2b09a: a8 30 cpi r26, 0x08 ; 8 2b09c: 08 f4 brcc .+2 ; 0x2b0a0 2b09e: 7a c0 rjmp .+244 ; 0x2b194 2b0a0: 2f 5f subi r18, 0xFF ; 255 2b0a2: 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){ 2b0a4: 2c 30 cpi r18, 0x0C ; 12 2b0a6: 31 05 cpc r19, r1 2b0a8: 89 f7 brne .-30 ; 0x2b08c /// 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){ 2b0aa: 4f 5f subi r20, 0xFF ; 255 2b0ac: 20 e2 ldi r18, 0x20 ; 32 2b0ae: c2 0e add r12, r18 2b0b0: d1 1c adc r13, r1 2b0b2: 32 96 adiw r30, 0x02 ; 2 2b0b4: 4c 30 cpi r20, 0x0C ; 12 2b0b6: 29 f7 brne .-54 ; 0x2b082 // 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){ 2b0b8: 3c 81 ldd r19, Y+4 ; 0x04 2b0ba: 30 17 cp r19, r16 2b0bc: 18 f4 brcc .+6 ; 0x2b0c4 2b0be: 0c 83 std Y+4, r16 ; 0x04 2b0c0: 5d 83 std Y+5, r21 ; 0x05 2b0c2: 18 2d mov r17, r8 2b0c4: 6f 5f subi r22, 0xFF ; 255 2b0c6: 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){ 2b0c8: 64 31 cpi r22, 0x14 ; 20 2b0ca: 71 05 cpc r23, r1 2b0cc: 91 f6 brne .-92 ; 0x2b072 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){ 2b0ce: 5f 5f subi r21, 0xFF ; 255 2b0d0: a0 e2 ldi r26, 0x20 ; 32 2b0d2: ea 0e add r14, r26 2b0d4: f1 1c adc r15, r1 2b0d6: 54 31 cpi r21, 0x14 ; 20 2b0d8: 29 f6 brne .-118 ; 0x2b064 // 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); 2b0da: ec 81 ldd r30, Y+4 ; 0x04 2b0dc: 6e 2f mov r22, r30 2b0de: 70 e0 ldi r23, 0x00 ; 0 2b0e0: 90 e0 ldi r25, 0x00 ; 0 2b0e2: 80 e0 ldi r24, 0x00 ; 0 2b0e4: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2b0e8: 23 ec ldi r18, 0xC3 ; 195 2b0ea: 35 ef ldi r19, 0xF5 ; 245 2b0ec: 48 ea ldi r20, 0xA8 ; 168 2b0ee: 5f e3 ldi r21, 0x3F ; 63 2b0f0: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 2b0f4: 9f 93 push r25 2b0f6: 8f 93 push r24 2b0f8: 7f 93 push r23 2b0fa: 6f 93 push r22 2b0fc: fd 81 ldd r31, Y+5 ; 0x05 2b0fe: 6f 2f mov r22, r31 2b100: 70 e0 ldi r23, 0x00 ; 0 2b102: 90 e0 ldi r25, 0x00 ; 0 2b104: 80 e0 ldi r24, 0x00 ; 0 2b106: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2b10a: 20 e0 ldi r18, 0x00 ; 0 2b10c: 30 e0 ldi r19, 0x00 ; 0 2b10e: 40 eb ldi r20, 0xB0 ; 176 2b110: 50 e4 ldi r21, 0x40 ; 64 2b112: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2b116: 9f 93 push r25 2b118: 8f 93 push r24 2b11a: 7f 93 push r23 2b11c: 6f 93 push r22 2b11e: 61 2f mov r22, r17 2b120: 70 e0 ldi r23, 0x00 ; 0 2b122: 90 e0 ldi r25, 0x00 ; 0 2b124: 80 e0 ldi r24, 0x00 ; 0 2b126: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2b12a: 20 e0 ldi r18, 0x00 ; 0 2b12c: 30 e0 ldi r19, 0x00 ; 0 2b12e: 40 eb ldi r20, 0xB0 ; 176 2b130: 50 e4 ldi r21, 0x40 ; 64 2b132: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2b136: 9f 93 push r25 2b138: 8f 93 push r24 2b13a: 7f 93 push r23 2b13c: 6f 93 push r22 2b13e: 82 ec ldi r24, 0xC2 ; 194 2b140: 9d e9 ldi r25, 0x9D ; 157 2b142: 9f 93 push r25 2b144: 8f 93 push r24 2b146: 0f 94 00 a3 call 0x34600 ; 0x34600 *pc = max_c; 2b14a: f2 01 movw r30, r4 2b14c: 10 83 st Z, r17 *pr = max_r; 2b14e: 2d 81 ldd r18, Y+5 ; 0x05 2b150: f1 01 movw r30, r2 2b152: 20 83 st Z, r18 2b154: 0f b6 in r0, 0x3f ; 63 2b156: f8 94 cli 2b158: de bf out 0x3e, r29 ; 62 2b15a: 0f be out 0x3f, r0 ; 63 2b15c: cd bf out 0x3d, r28 ; 61 return max_match; } 2b15e: 8c 81 ldd r24, Y+4 ; 0x04 2b160: 0f 90 pop r0 2b162: 0f 90 pop r0 2b164: 0f 90 pop r0 2b166: 0f 90 pop r0 2b168: 0f 90 pop r0 2b16a: df 91 pop r29 2b16c: cf 91 pop r28 2b16e: 1f 91 pop r17 2b170: 0f 91 pop r16 2b172: ff 90 pop r15 2b174: ef 90 pop r14 2b176: df 90 pop r13 2b178: cf 90 pop r12 2b17a: bf 90 pop r11 2b17c: af 90 pop r10 2b17e: 9f 90 pop r9 2b180: 8f 90 pop r8 2b182: 7f 90 pop r7 2b184: 6f 90 pop r6 2b186: 5f 90 pop r5 2b188: 4f 90 pop r4 2b18a: 3f 90 pop r3 2b18c: 2f 90 pop r2 2b18e: 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; 2b190: 22 23 and r18, r18 2b192: 11 f0 breq .+4 ; 0x2b198 2b194: 2b 30 cpi r18, 0x0B ; 11 2b196: 21 f4 brne .+8 ; 0x2b1a0 2b198: ab 81 ldd r26, Y+3 ; 0x03 2b19a: a8 30 cpi r26, 0x08 ; 8 2b19c: 08 f0 brcs .+2 ; 0x2b1a0 2b19e: 80 cf rjmp .-256 ; 0x2b0a0 const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 2b1a0: 99 24 eor r9, r9 2b1a2: 93 94 inc r9 2b1a4: d6 01 movw r26, r12 2b1a6: a2 0f add r26, r18 2b1a8: b3 1f adc r27, r19 2b1aa: ac 91 ld r26, X 2b1ac: a1 31 cpi r26, 0x11 ; 17 2b1ae: 08 f4 brcc .+2 ; 0x2b1b2 2b1b0: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 2b1b2: a0 80 ld r10, Z 2b1b4: b1 80 ldd r11, Z+1 ; 0x01 2b1b6: d3 01 movw r26, r6 2b1b8: 02 2e mov r0, r18 2b1ba: 02 c0 rjmp .+4 ; 0x2b1c0 2b1bc: aa 0f add r26, r26 2b1be: bb 1f adc r27, r27 2b1c0: 0a 94 dec r0 2b1c2: e2 f7 brpl .-8 ; 0x2b1bc 2b1c4: aa 21 and r26, r10 2b1c6: bb 21 and r27, r11 2b1c8: bb 24 eor r11, r11 2b1ca: b3 94 inc r11 2b1cc: ab 2b or r26, r27 2b1ce: 09 f4 brne .+2 ; 0x2b1d2 2b1d0: b1 2c mov r11, r1 if (high_pix == high_pat) 2b1d2: 9b 10 cpse r9, r11 2b1d4: 65 cf rjmp .-310 ; 0x2b0a0 match++; 2b1d6: 0f 5f subi r16, 0xFF ; 255 2b1d8: 63 cf rjmp .-314 ; 0x2b0a0 0002b1da : * \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) { 2b1da: 8f 92 push r8 2b1dc: 9f 92 push r9 2b1de: af 92 push r10 2b1e0: bf 92 push r11 2b1e2: cf 92 push r12 2b1e4: df 92 push r13 2b1e6: ef 92 push r14 2b1e8: ff 92 push r15 2b1ea: cf 93 push r28 2b1ec: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2b1ee: 24 e4 ldi r18, 0x44 ; 68 2b1f0: 36 e1 ldi r19, 0x16 ; 22 2b1f2: 30 93 44 0e sts 0x0E44, r19 ; 0x800e44 2b1f6: 20 93 43 0e sts 0x0E43, r18 ; 0x800e43 fatType_ = 0; 2b1fa: 10 92 60 16 sts 0x1660, r1 ; 0x801660 allocSearchStart_ = 2; 2b1fe: 42 e0 ldi r20, 0x02 ; 2 2b200: 50 e0 ldi r21, 0x00 ; 0 2b202: 60 e0 ldi r22, 0x00 ; 0 2b204: 70 e0 ldi r23, 0x00 ; 0 2b206: 40 93 49 16 sts 0x1649, r20 ; 0x801649 2b20a: 50 93 4a 16 sts 0x164A, r21 ; 0x80164a 2b20e: 60 93 4b 16 sts 0x164B, r22 ; 0x80164b 2b212: 70 93 4c 16 sts 0x164C, r23 ; 0x80164c cacheDirty_ = 0; // cacheFlush() will write block if true 2b216: 10 92 42 0e sts 0x0E42, r1 ; 0x800e42 cacheMirrorBlock_ = 0; 2b21a: 10 92 3e 0e sts 0x0E3E, r1 ; 0x800e3e 2b21e: 10 92 3f 0e sts 0x0E3F, r1 ; 0x800e3f 2b222: 10 92 40 0e sts 0x0E40, r1 ; 0x800e40 2b226: 10 92 41 0e sts 0x0E41, r1 ; 0x800e41 cacheBlockNumber_ = 0XFFFFFFFF; 2b22a: 4f ef ldi r20, 0xFF ; 255 2b22c: 5f ef ldi r21, 0xFF ; 255 2b22e: ba 01 movw r22, r20 2b230: 40 93 3a 0e sts 0x0E3A, r20 ; 0x800e3a 2b234: 50 93 3b 0e sts 0x0E3B, r21 ; 0x800e3b 2b238: 60 93 3c 0e sts 0x0E3C, r22 ; 0x800e3c 2b23c: 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) { 2b240: 88 23 and r24, r24 2b242: 09 f4 brne .+2 ; 0x2b246 2b244: 70 c0 rjmp .+224 ; 0x2b326 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2b246: 40 e0 ldi r20, 0x00 ; 0 2b248: 60 e0 ldi r22, 0x00 ; 0 2b24a: 70 e0 ldi r23, 0x00 ; 0 2b24c: cb 01 movw r24, r22 2b24e: 0f 94 ad 27 call 0x24f5a ; 0x24f5a 2b252: 81 11 cpse r24, r1 2b254: 0d c0 rjmp .+26 ; 0x2b270 fatType_ = 32; } return true; fail: return false; 2b256: c0 e0 ldi r28, 0x00 ; 0 } 2b258: 8c 2f mov r24, r28 2b25a: df 91 pop r29 2b25c: cf 91 pop r28 2b25e: ff 90 pop r15 2b260: ef 90 pop r14 2b262: df 90 pop r13 2b264: cf 90 pop r12 2b266: bf 90 pop r11 2b268: af 90 pop r10 2b26a: 9f 90 pop r9 2b26c: 8f 90 pop r8 2b26e: 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 || 2b270: 80 91 04 10 lds r24, 0x1004 ; 0x801004 2b274: 8f 77 andi r24, 0x7F ; 127 2b276: 79 f7 brne .-34 ; 0x2b256 2b278: 80 91 10 10 lds r24, 0x1010 ; 0x801010 2b27c: 90 91 11 10 lds r25, 0x1011 ; 0x801011 2b280: a0 91 12 10 lds r26, 0x1012 ; 0x801012 2b284: b0 91 13 10 lds r27, 0x1013 ; 0x801013 2b288: 84 36 cpi r24, 0x64 ; 100 2b28a: 91 05 cpc r25, r1 2b28c: a1 05 cpc r26, r1 2b28e: b1 05 cpc r27, r1 2b290: 10 f3 brcs .-60 ; 0x2b256 p->totalSectors < 100 || p->firstSector == 0) { 2b292: c0 90 0c 10 lds r12, 0x100C ; 0x80100c 2b296: d0 90 0d 10 lds r13, 0x100D ; 0x80100d 2b29a: e0 90 0e 10 lds r14, 0x100E ; 0x80100e 2b29e: 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 || 2b2a2: c1 14 cp r12, r1 2b2a4: d1 04 cpc r13, r1 2b2a6: e1 04 cpc r14, r1 2b2a8: f1 04 cpc r15, r1 2b2aa: a9 f2 breq .-86 ; 0x2b256 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2b2ac: 40 e0 ldi r20, 0x00 ; 0 2b2ae: c7 01 movw r24, r14 2b2b0: b6 01 movw r22, r12 2b2b2: 0f 94 ad 27 call 0x24f5a ; 0x24f5a 2b2b6: c8 2f mov r28, r24 2b2b8: 88 23 and r24, r24 2b2ba: 69 f2 breq .-102 ; 0x2b256 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2b2bc: 80 91 51 0e lds r24, 0x0E51 ; 0x800e51 2b2c0: 90 91 52 0e lds r25, 0x0E52 ; 0x800e52 2b2c4: 81 15 cp r24, r1 2b2c6: 92 40 sbci r25, 0x02 ; 2 2b2c8: 31 f6 brne .-116 ; 0x2b256 fbs->fatCount == 0 || 2b2ca: 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 || 2b2ce: aa 23 and r26, r26 2b2d0: 11 f2 breq .-124 ; 0x2b256 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2b2d2: 60 91 54 0e lds r22, 0x0E54 ; 0x800e54 2b2d6: 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 || 2b2da: 61 15 cp r22, r1 2b2dc: 71 05 cpc r23, r1 2b2de: 09 f4 brne .+2 ; 0x2b2e2 2b2e0: ba cf rjmp .-140 ; 0x2b256 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2b2e2: 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 || 2b2e6: 22 23 and r18, r18 2b2e8: 09 f4 brne .+2 ; 0x2b2ec 2b2ea: b5 cf rjmp .-150 ; 0x2b256 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2b2ec: a0 93 5b 16 sts 0x165B, r26 ; 0x80165b blocksPerCluster_ = fbs->sectorsPerCluster; 2b2f0: 20 93 4d 16 sts 0x164D, r18 ; 0x80164d // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2b2f4: 90 e0 ldi r25, 0x00 ; 0 2b2f6: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2b2f8: 30 e0 ldi r19, 0x00 ; 0 2b2fa: e1 e0 ldi r30, 0x01 ; 1 2b2fc: f0 e0 ldi r31, 0x00 ; 0 2b2fe: d8 2f mov r29, r24 2b300: af 01 movw r20, r30 2b302: 08 2e mov r0, r24 2b304: 02 c0 rjmp .+4 ; 0x2b30a 2b306: 44 0f add r20, r20 2b308: 55 1f adc r21, r21 2b30a: 0a 94 dec r0 2b30c: e2 f7 brpl .-8 ; 0x2b306 2b30e: 24 17 cp r18, r20 2b310: 35 07 cpc r19, r21 2b312: 69 f0 breq .+26 ; 0x2b32e 2b314: 41 e0 ldi r20, 0x01 ; 1 2b316: 48 0f add r20, r24 2b318: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2b31a: 89 30 cpi r24, 0x09 ; 9 2b31c: 91 05 cpc r25, r1 2b31e: 79 f7 brne .-34 ; 0x2b2fe 2b320: 40 93 56 16 sts 0x1656, r20 ; 0x801656 2b324: 98 cf rjmp .-208 ; 0x2b256 * 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; 2b326: c1 2c mov r12, r1 2b328: d1 2c mov r13, r1 2b32a: 76 01 movw r14, r12 2b32c: bf cf rjmp .-130 ; 0x2b2ac 2b32e: 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 ? 2b332: 20 91 5c 0e lds r18, 0x0E5C ; 0x800e5c 2b336: 30 91 5d 0e lds r19, 0x0E5D ; 0x800e5d 2b33a: 50 e0 ldi r21, 0x00 ; 0 2b33c: 40 e0 ldi r20, 0x00 ; 0 2b33e: 21 15 cp r18, r1 2b340: 31 05 cpc r19, r1 2b342: 41 f4 brne .+16 ; 0x2b354 2b344: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 2b348: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 2b34c: 40 91 6c 0e lds r20, 0x0E6C ; 0x800e6c 2b350: 50 91 6d 0e lds r21, 0x0E6D ; 0x800e6d 2b354: 20 93 4e 16 sts 0x164E, r18 ; 0x80164e 2b358: 30 93 4f 16 sts 0x164F, r19 ; 0x80164f 2b35c: 40 93 50 16 sts 0x1650, r20 ; 0x801650 2b360: 50 93 51 16 sts 0x1651, r21 ; 0x801651 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2b364: 46 01 movw r8, r12 2b366: 57 01 movw r10, r14 2b368: 86 0e add r8, r22 2b36a: 97 1e adc r9, r23 2b36c: a1 1c adc r10, r1 2b36e: b1 1c adc r11, r1 2b370: 80 92 5c 16 sts 0x165C, r8 ; 0x80165c 2b374: 90 92 5d 16 sts 0x165D, r9 ; 0x80165d 2b378: a0 92 5e 16 sts 0x165E, r10 ; 0x80165e 2b37c: b0 92 5f 16 sts 0x165F, r11 ; 0x80165f // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2b380: e0 91 57 0e lds r30, 0x0E57 ; 0x800e57 2b384: f0 91 58 0e lds r31, 0x0E58 ; 0x800e58 2b388: f0 93 62 16 sts 0x1662, r31 ; 0x801662 2b38c: e0 93 61 16 sts 0x1661, r30 ; 0x801661 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2b390: b0 e0 ldi r27, 0x00 ; 0 2b392: 0f 94 d3 a4 call 0x349a6 ; 0x349a6 <__muluhisi3> 2b396: dc 01 movw r26, r24 2b398: cb 01 movw r24, r22 2b39a: 88 0d add r24, r8 2b39c: 99 1d adc r25, r9 2b39e: aa 1d adc r26, r10 2b3a0: bb 1d adc r27, r11 2b3a2: 80 93 63 16 sts 0x1663, r24 ; 0x801663 2b3a6: 90 93 64 16 sts 0x1664, r25 ; 0x801664 2b3aa: a0 93 65 16 sts 0x1665, r26 ; 0x801665 2b3ae: b0 93 66 16 sts 0x1666, r27 ; 0x801666 // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2b3b2: 25 e0 ldi r18, 0x05 ; 5 2b3b4: ee 0f add r30, r30 2b3b6: ff 1f adc r31, r31 2b3b8: 2a 95 dec r18 2b3ba: e1 f7 brne .-8 ; 0x2b3b4 2b3bc: e1 50 subi r30, 0x01 ; 1 2b3be: fe 4f sbci r31, 0xFE ; 254 2b3c0: ef 2f mov r30, r31 2b3c2: ff 27 eor r31, r31 2b3c4: e6 95 lsr r30 2b3c6: 8e 0f add r24, r30 2b3c8: 9f 1f adc r25, r31 2b3ca: a1 1d adc r26, r1 2b3cc: b1 1d adc r27, r1 2b3ce: 80 93 57 16 sts 0x1657, r24 ; 0x801657 2b3d2: 90 93 58 16 sts 0x1658, r25 ; 0x801658 2b3d6: a0 93 59 16 sts 0x1659, r26 ; 0x801659 2b3da: b0 93 5a 16 sts 0x165A, r27 ; 0x80165a // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2b3de: 80 90 59 0e lds r8, 0x0E59 ; 0x800e59 2b3e2: 90 90 5a 0e lds r9, 0x0E5A ; 0x800e5a 2b3e6: b1 2c mov r11, r1 2b3e8: a1 2c mov r10, r1 2b3ea: 81 14 cp r8, r1 2b3ec: 91 04 cpc r9, r1 2b3ee: 41 f4 brne .+16 ; 0x2b400 2b3f0: 80 90 66 0e lds r8, 0x0E66 ; 0x800e66 2b3f4: 90 90 67 0e lds r9, 0x0E67 ; 0x800e67 2b3f8: a0 90 68 0e lds r10, 0x0E68 ; 0x800e68 2b3fc: b0 90 69 0e lds r11, 0x0E69 ; 0x800e69 fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2b400: c8 1a sub r12, r24 2b402: d9 0a sbc r13, r25 2b404: ea 0a sbc r14, r26 2b406: fb 0a sbc r15, r27 2b408: c8 0c add r12, r8 2b40a: d9 1c adc r13, r9 2b40c: ea 1c adc r14, r10 2b40e: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2b410: 04 c0 rjmp .+8 ; 0x2b41a 2b412: f6 94 lsr r15 2b414: e7 94 ror r14 2b416: d7 94 ror r13 2b418: c7 94 ror r12 2b41a: da 95 dec r29 2b41c: d2 f7 brpl .-12 ; 0x2b412 2b41e: c0 92 52 16 sts 0x1652, r12 ; 0x801652 2b422: d0 92 53 16 sts 0x1653, r13 ; 0x801653 2b426: e0 92 54 16 sts 0x1654, r14 ; 0x801654 2b42a: f0 92 55 16 sts 0x1655, r15 ; 0x801655 // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2b42e: 85 ef ldi r24, 0xF5 ; 245 2b430: c8 16 cp r12, r24 2b432: 8f e0 ldi r24, 0x0F ; 15 2b434: d8 06 cpc r13, r24 2b436: e1 04 cpc r14, r1 2b438: f1 04 cpc r15, r1 2b43a: 20 f4 brcc .+8 ; 0x2b444 fatType_ = 12; 2b43c: 8c e0 ldi r24, 0x0C ; 12 2b43e: 80 93 60 16 sts 0x1660, r24 ; 0x801660 2b442: 09 cf rjmp .-494 ; 0x2b256 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2b444: 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) { 2b446: 25 ef ldi r18, 0xF5 ; 245 2b448: c2 16 cp r12, r18 2b44a: 2f ef ldi r18, 0xFF ; 255 2b44c: d2 06 cpc r13, r18 2b44e: e1 04 cpc r14, r1 2b450: f1 04 cpc r15, r1 2b452: 88 f0 brcs .+34 ; 0x2b476 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2b454: 80 91 72 0e lds r24, 0x0E72 ; 0x800e72 2b458: 90 91 73 0e lds r25, 0x0E73 ; 0x800e73 2b45c: a0 91 74 0e lds r26, 0x0E74 ; 0x800e74 2b460: b0 91 75 0e lds r27, 0x0E75 ; 0x800e75 2b464: 80 93 63 16 sts 0x1663, r24 ; 0x801663 2b468: 90 93 64 16 sts 0x1664, r25 ; 0x801664 2b46c: a0 93 65 16 sts 0x1665, r26 ; 0x801665 2b470: b0 93 66 16 sts 0x1666, r27 ; 0x801666 fatType_ = 32; 2b474: 80 e2 ldi r24, 0x20 ; 32 2b476: 80 93 60 16 sts 0x1660, r24 ; 0x801660 2b47a: ee ce rjmp .-548 ; 0x2b258 0002b47c : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2b47c: 0f 93 push r16 2b47e: 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_ ){ 2b480: 60 91 84 16 lds r22, 0x1684 ; 0x801684 2b484: 70 91 85 16 lds r23, 0x1685 ; 0x801685 2b488: 80 91 86 16 lds r24, 0x1686 ; 0x801686 2b48c: 90 91 87 16 lds r25, 0x1687 ; 0x801687 2b490: 00 91 3a 0e lds r16, 0x0E3A ; 0x800e3a 2b494: 10 91 3b 0e lds r17, 0x0E3B ; 0x800e3b 2b498: 20 91 3c 0e lds r18, 0x0E3C ; 0x800e3c 2b49c: 30 91 3d 0e lds r19, 0x0E3D ; 0x800e3d 2b4a0: 60 17 cp r22, r16 2b4a2: 71 07 cpc r23, r17 2b4a4: 82 07 cpc r24, r18 2b4a6: 93 07 cpc r25, r19 2b4a8: 39 f1 breq .+78 ; 0x2b4f8 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2b4aa: 40 e0 ldi r20, 0x00 ; 0 2b4ac: 0f 94 ad 27 call 0x24f5a ; 0x24f5a 2b4b0: 88 23 and r24, r24 2b4b2: f9 f0 breq .+62 ; 0x2b4f2 return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2b4b4: 20 91 88 16 lds r18, 0x1688 ; 0x801688 2b4b8: 30 91 89 16 lds r19, 0x1689 ; 0x801689 2b4bc: 40 91 78 16 lds r20, 0x1678 ; 0x801678 2b4c0: 50 91 79 16 lds r21, 0x1679 ; 0x801679 2b4c4: 60 91 7a 16 lds r22, 0x167A ; 0x80167a 2b4c8: 70 91 7b 16 lds r23, 0x167B ; 0x80167b 2b4cc: 42 1b sub r20, r18 2b4ce: 53 0b sbc r21, r19 2b4d0: 61 09 sbc r22, r1 2b4d2: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2b4d4: 41 30 cpi r20, 0x01 ; 1 2b4d6: 92 e0 ldi r25, 0x02 ; 2 2b4d8: 59 07 cpc r21, r25 2b4da: 61 05 cpc r22, r1 2b4dc: 71 05 cpc r23, r1 2b4de: 20 f0 brcs .+8 ; 0x2b4e8 2b4e0: 40 e0 ldi r20, 0x00 ; 0 2b4e2: 52 e0 ldi r21, 0x02 ; 2 2b4e4: 60 e0 ldi r22, 0x00 ; 0 2b4e6: 70 e0 ldi r23, 0x00 ; 0 2b4e8: 4a 5b subi r20, 0xBA ; 186 2b4ea: 51 4f sbci r21, 0xF1 ; 241 2b4ec: 9a e0 ldi r25, 0x0A ; 10 2b4ee: fa 01 movw r30, r20 2b4f0: 90 83 st Z, r25 } return true; } 2b4f2: 1f 91 pop r17 2b4f4: 0f 91 pop r16 2b4f6: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2b4f8: 81 e0 ldi r24, 0x01 ; 1 2b4fa: fb cf rjmp .-10 ; 0x2b4f2 0002b4fc : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2b4fc: 20 e0 ldi r18, 0x00 ; 0 2b4fe: 30 e0 ldi r19, 0x00 ; 0 2b500: 40 ea ldi r20, 0xA0 ; 160 2b502: 52 e4 ldi r21, 0x42 ; 66 2b504: 60 e0 ldi r22, 0x00 ; 0 2b506: 70 e0 ldi r23, 0x00 ; 0 2b508: 80 ea ldi r24, 0xA0 ; 160 2b50a: 92 ec ldi r25, 0xC2 ; 194 2b50c: 0d 94 3a 4e jmp 0x29c74 ; 0x29c74 0002b510 : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2b510: 90 91 02 13 lds r25, 0x1302 ; 0x801302 2b514: 91 fd sbrc r25, 1 2b516: 17 c0 rjmp .+46 ; 0x2b546 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2b518: 88 23 and r24, r24 2b51a: a9 f0 breq .+42 ; 0x2b546 2b51c: 92 fd sbrc r25, 2 2b51e: 13 c0 rjmp .+38 ; 0x2b546 Disable_E0(); 2b520: 0f 94 38 4e call 0x29c70 ; 0x29c70 resume_hotend_temp = thermal_degTargetHotend(); 2b524: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 2b528: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 2b52c: 90 93 f7 12 sts 0x12F7, r25 ; 0x8012f7 2b530: 80 93 f6 12 sts 0x12F6, r24 ; 0x8012f6 mmu_print_saved |= SavedState::CooldownPending; 2b534: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b538: 84 60 ori r24, 0x04 ; 4 2b53a: 80 93 02 13 sts 0x1302, r24 ; 0x801302 LogEchoEvent_P(PSTR("Heater cooldown pending")); 2b53e: 8e ef ldi r24, 0xFE ; 254 2b540: 9e e9 ldi r25, 0x9E ; 158 2b542: 0d 94 5e 4e jmp 0x29cbc ; 0x29cbc } } 2b546: 08 95 ret 0002b548 : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2b548: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b54c: 80 ff sbrs r24, 0 2b54e: 45 c0 rjmp .+138 ; 0x2b5da LogEchoEvent_P(PSTR("Resuming XYZ")); 2b550: 86 e1 ldi r24, 0x16 ; 22 2b552: 9f e9 ldi r25, 0x9F ; 159 2b554: 0f 94 5e 4e call 0x29cbc ; 0x29cbc // 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)); 2b558: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee 2b55c: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef 2b560: a0 91 f0 12 lds r26, 0x12F0 ; 0x8012f0 2b564: 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; 2b568: 40 91 ea 12 lds r20, 0x12EA ; 0x8012ea 2b56c: 50 91 eb 12 lds r21, 0x12EB ; 0x8012eb 2b570: 60 91 ec 12 lds r22, 0x12EC ; 0x8012ec 2b574: 70 91 ed 12 lds r23, 0x12ED ; 0x8012ed 2b578: 40 93 61 12 sts 0x1261, r20 ; 0x801261 2b57c: 50 93 62 12 sts 0x1262, r21 ; 0x801262 2b580: 60 93 63 12 sts 0x1263, r22 ; 0x801263 2b584: 70 93 64 12 sts 0x1264, r23 ; 0x801264 current_position[Y_AXIS] = ry; 2b588: 80 93 65 12 sts 0x1265, r24 ; 0x801265 2b58c: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2b590: a0 93 67 12 sts 0x1267, r26 ; 0x801267 2b594: b0 93 68 12 sts 0x1268, r27 ; 0x801268 planner_line_to_current_position_sync(feedRate_mm_s); 2b598: 60 e0 ldi r22, 0x00 ; 0 2b59a: 70 e0 ldi r23, 0x00 ; 0 2b59c: 88 e4 ldi r24, 0x48 ; 72 2b59e: 92 e4 ldi r25, 0x42 ; 66 2b5a0: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2b5a4: 80 91 f2 12 lds r24, 0x12F2 ; 0x8012f2 2b5a8: 90 91 f3 12 lds r25, 0x12F3 ; 0x8012f3 2b5ac: a0 91 f4 12 lds r26, 0x12F4 ; 0x8012f4 2b5b0: b0 91 f5 12 lds r27, 0x12F5 ; 0x8012f5 2b5b4: 80 93 69 12 sts 0x1269, r24 ; 0x801269 2b5b8: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 2b5bc: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 2b5c0: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c planner_line_to_current_position_sync(feedRate_mm_s); 2b5c4: 60 e0 ldi r22, 0x00 ; 0 2b5c6: 70 e0 ldi r23, 0x00 ; 0 2b5c8: 80 e7 ldi r24, 0x70 ; 112 2b5ca: 91 e4 ldi r25, 0x41 ; 65 2b5cc: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 // 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); 2b5d0: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b5d4: 8e 7f andi r24, 0xFE ; 254 2b5d6: 80 93 02 13 sts 0x1302, r24 ; 0x801302 } } 2b5da: 08 95 ret 0002b5dc : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2b5dc: 0f 93 push r16 2b5de: 1f 93 push r17 2b5e0: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2b5e2: 90 91 02 13 lds r25, 0x1302 ; 0x801302 2b5e6: 91 11 cpse r25, r1 2b5e8: 72 c0 rjmp .+228 ; 0x2b6ce 2b5ea: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2b5ec: 8b ee ldi r24, 0xEB ; 235 2b5ee: 9e e9 ldi r25, 0x9E ; 158 2b5f0: 0f 94 5e 4e call 0x29cbc ; 0x29cbc Disable_E0(); 2b5f4: 0f 94 38 4e call 0x29c70 ; 0x29c70 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2b5f8: 0f 94 5b 18 call 0x230b6 ; 0x230b6 /// 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; 2b5fc: 80 91 73 12 lds r24, 0x1273 ; 0x801273 2b600: 81 11 cpse r24, r1 2b602: 02 c0 rjmp .+4 ; 0x2b608 2b604: 0e 94 01 64 call 0xc802 ; 0xc802 // 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) { 2b608: cc 23 and r28, r28 2b60a: 09 f4 brne .+2 ; 0x2b60e 2b60c: 60 c0 rjmp .+192 ; 0x2b6ce mmu_print_saved |= SavedState::ParkExtruder; 2b60e: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b612: 81 60 ori r24, 0x01 ; 1 2b614: 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]); 2b618: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2b61c: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2b620: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2b624: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2b628: 40 91 65 12 lds r20, 0x1265 ; 0x801265 2b62c: 50 91 66 12 lds r21, 0x1266 ; 0x801266 2b630: 60 91 67 12 lds r22, 0x1267 ; 0x801267 2b634: 70 91 68 12 lds r23, 0x1268 ; 0x801268 resume_position = planner_current_position(); // save current pos 2b638: 00 91 61 12 lds r16, 0x1261 ; 0x801261 2b63c: 10 91 62 12 lds r17, 0x1262 ; 0x801262 2b640: 20 91 63 12 lds r18, 0x1263 ; 0x801263 2b644: 30 91 64 12 lds r19, 0x1264 ; 0x801264 2b648: 00 93 ea 12 sts 0x12EA, r16 ; 0x8012ea 2b64c: 10 93 eb 12 sts 0x12EB, r17 ; 0x8012eb 2b650: 20 93 ec 12 sts 0x12EC, r18 ; 0x8012ec 2b654: 30 93 ed 12 sts 0x12ED, r19 ; 0x8012ed 2b658: 40 93 ee 12 sts 0x12EE, r20 ; 0x8012ee 2b65c: 50 93 ef 12 sts 0x12EF, r21 ; 0x8012ef 2b660: 60 93 f0 12 sts 0x12F0, r22 ; 0x8012f0 2b664: 70 93 f1 12 sts 0x12F1, r23 ; 0x8012f1 2b668: 80 93 f2 12 sts 0x12F2, r24 ; 0x8012f2 2b66c: 90 93 f3 12 sts 0x12F3, r25 ; 0x8012f3 2b670: a0 93 f4 12 sts 0x12F4, r26 ; 0x8012f4 2b674: 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); 2b678: 60 e0 ldi r22, 0x00 ; 0 2b67a: 70 e0 ldi r23, 0x00 ; 0 2b67c: 80 ea ldi r24, 0xA0 ; 160 2b67e: 91 e4 ldi r25, 0x41 ; 65 2b680: 0e 94 ef 6c call 0xd9de ; 0xd9de void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2b684: 80 91 39 06 lds r24, 0x0639 ; 0x800639 2b688: 88 23 and r24, r24 2b68a: 09 f1 breq .+66 ; 0x2b6ce 2b68c: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 2b690: 88 23 and r24, r24 2b692: e9 f0 breq .+58 ; 0x2b6ce 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; 2b694: 80 e0 ldi r24, 0x00 ; 0 2b696: 90 e0 ldi r25, 0x00 ; 0 2b698: aa ef ldi r26, 0xFA ; 250 2b69a: b2 e4 ldi r27, 0x42 ; 66 2b69c: 80 93 61 12 sts 0x1261, r24 ; 0x801261 2b6a0: 90 93 62 12 sts 0x1262, r25 ; 0x801262 2b6a4: a0 93 63 12 sts 0x1263, r26 ; 0x801263 2b6a8: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2b6ac: 10 92 65 12 sts 0x1265, r1 ; 0x801265 2b6b0: 10 92 66 12 sts 0x1266, r1 ; 0x801266 2b6b4: 10 92 67 12 sts 0x1267, r1 ; 0x801267 2b6b8: 10 92 68 12 sts 0x1268, r1 ; 0x801268 planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2b6bc: 60 e0 ldi r22, 0x00 ; 0 2b6be: 70 e0 ldi r23, 0x00 ; 0 2b6c0: 88 e4 ldi r24, 0x48 ; 72 2b6c2: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2b6c4: cf 91 pop r28 2b6c6: 1f 91 pop r17 2b6c8: 0f 91 pop r16 2b6ca: 0d 94 5a 4e jmp 0x29cb4 ; 0x29cb4 2b6ce: cf 91 pop r28 2b6d0: 1f 91 pop r17 2b6d2: 0f 91 pop r16 2b6d4: 08 95 ret 0002b6d6 : /// 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){ 2b6d6: 2f 92 push r2 2b6d8: 3f 92 push r3 2b6da: 4f 92 push r4 2b6dc: 5f 92 push r5 2b6de: 6f 92 push r6 2b6e0: 7f 92 push r7 2b6e2: 8f 92 push r8 2b6e4: 9f 92 push r9 2b6e6: af 92 push r10 2b6e8: bf 92 push r11 2b6ea: cf 92 push r12 2b6ec: df 92 push r13 2b6ee: ef 92 push r14 2b6f0: ff 92 push r15 2b6f2: 0f 93 push r16 2b6f4: 1f 93 push r17 2b6f6: cf 93 push r28 2b6f8: df 93 push r29 2b6fa: cd b7 in r28, 0x3d ; 61 2b6fc: de b7 in r29, 0x3e ; 62 2b6fe: cd 5b subi r28, 0xBD ; 189 2b700: d1 40 sbci r29, 0x01 ; 1 2b702: 0f b6 in r0, 0x3f ; 63 2b704: f8 94 cli 2b706: de bf out 0x3e, r29 ; 62 2b708: 0f be out 0x3f, r0 ; 63 2b70a: cd bf out 0x3d, r28 ; 61 2b70c: c3 57 subi r28, 0x73 ; 115 2b70e: de 4f sbci r29, 0xFE ; 254 2b710: 99 83 std Y+1, r25 ; 0x01 2b712: 88 83 st Y, r24 2b714: cd 58 subi r28, 0x8D ; 141 2b716: d1 40 sbci r29, 0x01 ; 1 2b718: c1 57 subi r28, 0x71 ; 113 2b71a: de 4f sbci r29, 0xFE ; 254 2b71c: 79 83 std Y+1, r23 ; 0x01 2b71e: 68 83 st Y, r22 2b720: cf 58 subi r28, 0x8F ; 143 2b722: d1 40 sbci r29, 0x01 ; 1 2b724: ce 56 subi r28, 0x6E ; 110 2b726: de 4f sbci r29, 0xFE ; 254 2b728: 59 83 std Y+1, r21 ; 0x01 2b72a: 48 83 st Y, r20 2b72c: c2 59 subi r28, 0x92 ; 146 2b72e: d1 40 sbci r29, 0x01 ; 1 2b730: 84 e1 ldi r24, 0x14 ; 20 2b732: cf 56 subi r28, 0x6F ; 111 2b734: de 4f sbci r29, 0xFE ; 254 2b736: 88 83 st Y, r24 2b738: c1 59 subi r28, 0x91 ; 145 2b73a: 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; 2b73c: ce 56 subi r28, 0x6E ; 110 2b73e: de 4f sbci r29, 0xFE ; 254 2b740: a8 81 ld r26, Y 2b742: b9 81 ldd r27, Y+1 ; 0x01 2b744: c2 59 subi r28, 0x92 ; 146 2b746: d1 40 sbci r29, 0x01 ; 1 2b748: 8d 91 ld r24, X+ 2b74a: 9d 91 ld r25, X+ 2b74c: 0d 90 ld r0, X+ 2b74e: bc 91 ld r27, X 2b750: a0 2d mov r26, r0 2b752: c6 56 subi r28, 0x66 ; 102 2b754: de 4f sbci r29, 0xFE ; 254 2b756: 88 83 st Y, r24 2b758: 99 83 std Y+1, r25 ; 0x01 2b75a: aa 83 std Y+2, r26 ; 0x02 2b75c: bb 83 std Y+3, r27 ; 0x03 2b75e: ca 59 subi r28, 0x9A ; 154 2b760: d1 40 sbci r29, 0x01 ; 1 2b762: c1 57 subi r28, 0x71 ; 113 2b764: de 4f sbci r29, 0xFE ; 254 2b766: a8 81 ld r26, Y 2b768: b9 81 ldd r27, Y+1 ; 0x01 2b76a: cf 58 subi r28, 0x8F ; 143 2b76c: d1 40 sbci r29, 0x01 ; 1 2b76e: 8d 91 ld r24, X+ 2b770: 9d 91 ld r25, X+ 2b772: 0d 90 ld r0, X+ 2b774: bc 91 ld r27, X 2b776: a0 2d mov r26, r0 2b778: ca 54 subi r28, 0x4A ; 74 2b77a: de 4f sbci r29, 0xFE ; 254 2b77c: 88 83 st Y, r24 2b77e: 99 83 std Y+1, r25 ; 0x01 2b780: aa 83 std Y+2, r26 ; 0x02 2b782: bb 83 std Y+3, r27 ; 0x03 2b784: c6 5b subi r28, 0xB6 ; 182 2b786: d1 40 sbci r29, 0x01 ; 1 2b788: c3 57 subi r28, 0x73 ; 115 2b78a: de 4f sbci r29, 0xFE ; 254 2b78c: a8 81 ld r26, Y 2b78e: b9 81 ldd r27, Y+1 ; 0x01 2b790: cd 58 subi r28, 0x8D ; 141 2b792: d1 40 sbci r29, 0x01 ; 1 2b794: 8d 91 ld r24, X+ 2b796: 9d 91 ld r25, X+ 2b798: 0d 90 ld r0, X+ 2b79a: bc 91 ld r27, X 2b79c: a0 2d mov r26, r0 2b79e: c6 54 subi r28, 0x46 ; 70 2b7a0: de 4f sbci r29, 0xFE ; 254 2b7a2: 88 83 st Y, r24 2b7a4: 99 83 std Y+1, r25 ; 0x01 2b7a6: aa 83 std Y+2, r26 ; 0x02 2b7a8: bb 83 std Y+3, r27 ; 0x03 2b7aa: ca 5b subi r28, 0xBA ; 186 2b7ac: d1 40 sbci r29, 0x01 ; 1 2b7ae: fe 01 movw r30, r28 2b7b0: e7 5f subi r30, 0xF7 ; 247 2b7b2: fe 4f sbci r31, 0xFE ; 254 2b7b4: c8 55 subi r28, 0x58 ; 88 2b7b6: de 4f sbci r29, 0xFE ; 254 2b7b8: f9 83 std Y+1, r31 ; 0x01 2b7ba: e8 83 st Y, r30 2b7bc: c8 5a subi r28, 0xA8 ; 168 2b7be: d1 40 sbci r29, 0x01 ; 1 2b7c0: ce 01 movw r24, r28 2b7c2: 8b 57 subi r24, 0x7B ; 123 2b7c4: 9f 4f sbci r25, 0xFF ; 255 2b7c6: ca 55 subi r28, 0x5A ; 90 2b7c8: de 4f sbci r29, 0xFE ; 254 2b7ca: 99 83 std Y+1, r25 ; 0x01 2b7cc: 88 83 st Y, r24 2b7ce: c6 5a subi r28, 0xA6 ; 166 2b7d0: d1 40 sbci r29, 0x01 ; 1 2b7d2: de 01 movw r26, r28 2b7d4: 11 96 adiw r26, 0x01 ; 1 2b7d6: c8 56 subi r28, 0x68 ; 104 2b7d8: de 4f sbci r29, 0xFE ; 254 2b7da: b9 83 std Y+1, r27 ; 0x01 2b7dc: a8 83 st Y, r26 2b7de: c8 59 subi r28, 0x98 ; 152 2b7e0: d1 40 sbci r29, 0x01 ; 1 2b7e2: 31 2c mov r3, r1 2b7e4: 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; 2b7e6: b1 01 movw r22, r2 2b7e8: 03 2c mov r0, r3 2b7ea: 00 0c add r0, r0 2b7ec: 88 0b sbc r24, r24 2b7ee: 99 0b sbc r25, r25 2b7f0: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2b7f4: 2a e1 ldi r18, 0x1A ; 26 2b7f6: 38 ef ldi r19, 0xF8 ; 248 2b7f8: 42 e4 ldi r20, 0x42 ; 66 2b7fa: 5e e3 ldi r21, 0x3E ; 62 2b7fc: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2b800: 6b 01 movw r12, r22 2b802: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2b804: 0f 94 26 a9 call 0x3524c ; 0x3524c 2b808: c2 56 subi r28, 0x62 ; 98 2b80a: de 4f sbci r29, 0xFE ; 254 2b80c: 68 83 st Y, r22 2b80e: 79 83 std Y+1, r23 ; 0x01 2b810: 8a 83 std Y+2, r24 ; 0x02 2b812: 9b 83 std Y+3, r25 ; 0x03 2b814: ce 59 subi r28, 0x9E ; 158 2b816: d1 40 sbci r29, 0x01 ; 1 2b818: c7 01 movw r24, r14 2b81a: b6 01 movw r22, r12 2b81c: 0f 94 60 a6 call 0x34cc0 ; 0x34cc0 2b820: ce 55 subi r28, 0x5E ; 94 2b822: de 4f sbci r29, 0xFE ; 254 2b824: 68 83 st Y, r22 2b826: 79 83 std Y+1, r23 ; 0x01 2b828: 8a 83 std Y+2, r24 ; 0x02 2b82a: 9b 83 std Y+3, r25 ; 0x03 2b82c: c2 5a subi r28, 0xA2 ; 162 2b82e: d1 40 sbci r29, 0x01 ; 1 2b830: 9b 01 movw r18, r22 2b832: ac 01 movw r20, r24 2b834: c6 56 subi r28, 0x66 ; 102 2b836: de 4f sbci r29, 0xFE ; 254 2b838: 68 81 ld r22, Y 2b83a: 79 81 ldd r23, Y+1 ; 0x01 2b83c: 8a 81 ldd r24, Y+2 ; 0x02 2b83e: 9b 81 ldd r25, Y+3 ; 0x03 2b840: ca 59 subi r28, 0x9A ; 154 2b842: d1 40 sbci r29, 0x01 ; 1 2b844: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2b848: c6 54 subi r28, 0x46 ; 70 2b84a: de 4f sbci r29, 0xFE ; 254 2b84c: 28 81 ld r18, Y 2b84e: 39 81 ldd r19, Y+1 ; 0x01 2b850: 4a 81 ldd r20, Y+2 ; 0x02 2b852: 5b 81 ldd r21, Y+3 ; 0x03 2b854: ca 5b subi r28, 0xBA ; 186 2b856: d1 40 sbci r29, 0x01 ; 1 2b858: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2b85c: 6b 01 movw r12, r22 2b85e: 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) 2b860: 20 e0 ldi r18, 0x00 ; 0 2b862: 30 e0 ldi r19, 0x00 ; 0 2b864: a9 01 movw r20, r18 2b866: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2b86a: 18 16 cp r1, r24 2b86c: 0c f0 brlt .+2 ; 0x2b870 2b86e: 7a c2 rjmp .+1268 ; 0x2bd64 // 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; 2b870: c2 56 subi r28, 0x62 ; 98 2b872: de 4f sbci r29, 0xFE ; 254 2b874: 28 81 ld r18, Y 2b876: 39 81 ldd r19, Y+1 ; 0x01 2b878: 4a 81 ldd r20, Y+2 ; 0x02 2b87a: 5b 81 ldd r21, Y+3 ; 0x03 2b87c: ce 59 subi r28, 0x9E ; 158 2b87e: d1 40 sbci r29, 0x01 ; 1 2b880: c6 56 subi r28, 0x66 ; 102 2b882: de 4f sbci r29, 0xFE ; 254 2b884: 68 81 ld r22, Y 2b886: 79 81 ldd r23, Y+1 ; 0x01 2b888: 8a 81 ldd r24, Y+2 ; 0x02 2b88a: 9b 81 ldd r25, Y+3 ; 0x03 2b88c: ca 59 subi r28, 0x9A ; 154 2b88e: d1 40 sbci r29, 0x01 ; 1 2b890: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2b894: ca 54 subi r28, 0x4A ; 74 2b896: de 4f sbci r29, 0xFE ; 254 2b898: 28 81 ld r18, Y 2b89a: 39 81 ldd r19, Y+1 ; 0x01 2b89c: 4a 81 ldd r20, Y+2 ; 0x02 2b89e: 5b 81 ldd r21, Y+3 ; 0x03 2b8a0: c6 5b subi r28, 0xB6 ; 182 2b8a2: d1 40 sbci r29, 0x01 ; 1 2b8a4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2b8a8: 4b 01 movw r8, r22 2b8aa: 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) 2b8ac: 20 e0 ldi r18, 0x00 ; 0 2b8ae: 30 e0 ldi r19, 0x00 ; 0 2b8b0: a9 01 movw r20, r18 2b8b2: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2b8b6: 18 16 cp r1, r24 2b8b8: 0c f0 brlt .+2 ; 0x2b8bc 2b8ba: 54 c2 rjmp .+1192 ; 0x2bd64 2b8bc: 20 e0 ldi r18, 0x00 ; 0 2b8be: 30 e0 ldi r19, 0x00 ; 0 2b8c0: 48 ef ldi r20, 0xF8 ; 248 2b8c2: 51 e4 ldi r21, 0x41 ; 65 2b8c4: c7 01 movw r24, r14 2b8c6: b6 01 movw r22, r12 2b8c8: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2b8cc: 87 ff sbrs r24, 7 2b8ce: 4a c2 rjmp .+1172 ; 0x2bd64 2b8d0: 20 e0 ldi r18, 0x00 ; 0 2b8d2: 30 e0 ldi r19, 0x00 ; 0 2b8d4: 48 ef ldi r20, 0xF8 ; 248 2b8d6: 51 e4 ldi r21, 0x41 ; 65 2b8d8: c5 01 movw r24, r10 2b8da: b4 01 movw r22, r8 2b8dc: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2b8e0: 87 ff sbrs r24, 7 2b8e2: 40 c2 rjmp .+1152 ; 0x2bd64 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 2b8e4: c7 01 movw r24, r14 2b8e6: b6 01 movw r22, r12 2b8e8: 0f 94 0d a7 call 0x34e1a ; 0x34e1a 2b8ec: 9b 01 movw r18, r22 2b8ee: ac 01 movw r20, r24 2b8f0: c7 01 movw r24, r14 2b8f2: b6 01 movw r22, r12 2b8f4: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2b8f8: 2b 01 movw r4, r22 2b8fa: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 2b8fc: c5 01 movw r24, r10 2b8fe: b4 01 movw r22, r8 2b900: 0f 94 0d a7 call 0x34e1a ; 0x34e1a 2b904: 9b 01 movw r18, r22 2b906: ac 01 movw r20, r24 2b908: c5 01 movw r24, r10 2b90a: b4 01 movw r22, r8 2b90c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2b910: cc 56 subi r28, 0x6C ; 108 2b912: de 4f sbci r29, 0xFE ; 254 2b914: 68 83 st Y, r22 2b916: 79 83 std Y+1, r23 ; 0x01 2b918: 8a 83 std Y+2, r24 ; 0x02 2b91a: 9b 83 std Y+3, r25 ; 0x03 2b91c: c4 59 subi r28, 0x94 ; 148 2b91e: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 2b920: a3 01 movw r20, r6 2b922: 92 01 movw r18, r4 2b924: 60 e0 ldi r22, 0x00 ; 0 2b926: 70 e0 ldi r23, 0x00 ; 0 2b928: 80 e8 ldi r24, 0x80 ; 128 2b92a: 9f e3 ldi r25, 0x3F ; 63 2b92c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2b930: c2 55 subi r28, 0x52 ; 82 2b932: de 4f sbci r29, 0xFE ; 254 2b934: 68 83 st Y, r22 2b936: 79 83 std Y+1, r23 ; 0x01 2b938: 8a 83 std Y+2, r24 ; 0x02 2b93a: 9b 83 std Y+3, r25 ; 0x03 2b93c: ce 5a subi r28, 0xAE ; 174 2b93e: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 2b940: cc 56 subi r28, 0x6C ; 108 2b942: de 4f sbci r29, 0xFE ; 254 2b944: 28 81 ld r18, Y 2b946: 39 81 ldd r19, Y+1 ; 0x01 2b948: 4a 81 ldd r20, Y+2 ; 0x02 2b94a: 5b 81 ldd r21, Y+3 ; 0x03 2b94c: c4 59 subi r28, 0x94 ; 148 2b94e: d1 40 sbci r29, 0x01 ; 1 2b950: 60 e0 ldi r22, 0x00 ; 0 2b952: 70 e0 ldi r23, 0x00 ; 0 2b954: 80 e8 ldi r24, 0x80 ; 128 2b956: 9f e3 ldi r25, 0x3F ; 63 2b958: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2b95c: ce 54 subi r28, 0x4E ; 78 2b95e: de 4f sbci r29, 0xFE ; 254 2b960: 68 83 st Y, r22 2b962: 79 83 std Y+1, r23 ; 0x01 2b964: 8a 83 std Y+2, r24 ; 0x02 2b966: 9b 83 std Y+3, r25 ; 0x03 2b968: c2 5b subi r28, 0xB2 ; 178 2b96a: 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; 2b96c: c7 01 movw r24, r14 2b96e: b6 01 movw r22, r12 2b970: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 2b974: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 2b976: fb 01 movw r30, r22 2b978: 31 96 adiw r30, 0x01 ; 1 2b97a: c6 55 subi r28, 0x56 ; 86 2b97c: de 4f sbci r29, 0xFE ; 254 2b97e: f9 83 std Y+1, r31 ; 0x01 2b980: e8 83 st Y, r30 2b982: ca 5a subi r28, 0xAA ; 170 2b984: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 2b986: c5 01 movw r24, r10 2b988: b4 01 movw r22, r8 2b98a: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 2b98e: 8b 01 movw r16, r22 2b990: 95 e0 ldi r25, 0x05 ; 5 2b992: 00 0f add r16, r16 2b994: 11 1f adc r17, r17 2b996: 9a 95 dec r25 2b998: e1 f7 brne .-8 ; 0x2b992 const uint16_t idx01 = c0 + 32 * r1; 2b99a: c8 01 movw r24, r16 2b99c: 80 96 adiw r24, 0x20 ; 32 2b99e: c4 55 subi r28, 0x54 ; 84 2b9a0: de 4f sbci r29, 0xFE ; 254 2b9a2: 99 83 std Y+1, r25 ; 0x01 2b9a4: 88 83 st Y, r24 2b9a6: cc 5a subi r28, 0xAC ; 172 2b9a8: 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]; 2b9aa: f8 01 movw r30, r16 2b9ac: ec 0d add r30, r12 2b9ae: fd 1d adc r31, r13 2b9b0: e2 5a subi r30, 0xA2 ; 162 2b9b2: f9 4f sbci r31, 0xF9 ; 249 2b9b4: 60 81 ld r22, Z 2b9b6: 70 e0 ldi r23, 0x00 ; 0 2b9b8: 90 e0 ldi r25, 0x00 ; 0 2b9ba: 80 e0 ldi r24, 0x00 ; 0 2b9bc: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2b9c0: 4b 01 movw r8, r22 2b9c2: 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; 2b9c4: ce 54 subi r28, 0x4E ; 78 2b9c6: de 4f sbci r29, 0xFE ; 254 2b9c8: 28 81 ld r18, Y 2b9ca: 39 81 ldd r19, Y+1 ; 0x01 2b9cc: 4a 81 ldd r20, Y+2 ; 0x02 2b9ce: 5b 81 ldd r21, Y+3 ; 0x03 2b9d0: c2 5b subi r28, 0xB2 ; 178 2b9d2: d1 40 sbci r29, 0x01 ; 1 2b9d4: c2 55 subi r28, 0x52 ; 82 2b9d6: de 4f sbci r29, 0xFE ; 254 2b9d8: 68 81 ld r22, Y 2b9da: 79 81 ldd r23, Y+1 ; 0x01 2b9dc: 8a 81 ldd r24, Y+2 ; 0x02 2b9de: 9b 81 ldd r25, Y+3 ; 0x03 2b9e0: ce 5a subi r28, 0xAE ; 174 2b9e2: d1 40 sbci r29, 0x01 ; 1 2b9e4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2b9e8: 9b 01 movw r18, r22 2b9ea: 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]; 2b9ec: c5 01 movw r24, r10 2b9ee: b4 01 movw r22, r8 2b9f0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2b9f4: 4b 01 movw r8, r22 2b9f6: 5c 01 movw r10, r24 2b9f8: c4 55 subi r28, 0x54 ; 84 2b9fa: de 4f sbci r29, 0xFE ; 254 2b9fc: e8 81 ld r30, Y 2b9fe: f9 81 ldd r31, Y+1 ; 0x01 2ba00: cc 5a subi r28, 0xAC ; 172 2ba02: d1 40 sbci r29, 0x01 ; 1 2ba04: ec 0d add r30, r12 2ba06: fd 1d adc r31, r13 2ba08: e2 5a subi r30, 0xA2 ; 162 2ba0a: f9 4f sbci r31, 0xF9 ; 249 2ba0c: 60 81 ld r22, Z 2ba0e: 70 e0 ldi r23, 0x00 ; 0 2ba10: 90 e0 ldi r25, 0x00 ; 0 2ba12: 80 e0 ldi r24, 0x00 ; 0 2ba14: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2ba18: 6b 01 movw r12, r22 2ba1a: 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; 2ba1c: c2 55 subi r28, 0x52 ; 82 2ba1e: de 4f sbci r29, 0xFE ; 254 2ba20: 28 81 ld r18, Y 2ba22: 39 81 ldd r19, Y+1 ; 0x01 2ba24: 4a 81 ldd r20, Y+2 ; 0x02 2ba26: 5b 81 ldd r21, Y+3 ; 0x03 2ba28: ce 5a subi r28, 0xAE ; 174 2ba2a: d1 40 sbci r29, 0x01 ; 1 2ba2c: cc 56 subi r28, 0x6C ; 108 2ba2e: de 4f sbci r29, 0xFE ; 254 2ba30: 68 81 ld r22, Y 2ba32: 79 81 ldd r23, Y+1 ; 0x01 2ba34: 8a 81 ldd r24, Y+2 ; 0x02 2ba36: 9b 81 ldd r25, Y+3 ; 0x03 2ba38: c4 59 subi r28, 0x94 ; 148 2ba3a: d1 40 sbci r29, 0x01 ; 1 2ba3c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2ba40: 9b 01 movw r18, r22 2ba42: 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]; 2ba44: c7 01 movw r24, r14 2ba46: b6 01 movw r22, r12 2ba48: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2ba4c: 9b 01 movw r18, r22 2ba4e: ac 01 movw r20, r24 2ba50: c5 01 movw r24, r10 2ba52: b4 01 movw r22, r8 2ba54: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2ba58: 6b 01 movw r12, r22 2ba5a: 7c 01 movw r14, r24 2ba5c: c6 55 subi r28, 0x56 ; 86 2ba5e: de 4f sbci r29, 0xFE ; 254 2ba60: a8 81 ld r26, Y 2ba62: b9 81 ldd r27, Y+1 ; 0x01 2ba64: ca 5a subi r28, 0xAA ; 170 2ba66: d1 40 sbci r29, 0x01 ; 1 2ba68: 0a 0f add r16, r26 2ba6a: 1b 1f adc r17, r27 2ba6c: f8 01 movw r30, r16 2ba6e: e2 5a subi r30, 0xA2 ; 162 2ba70: f9 4f sbci r31, 0xF9 ; 249 2ba72: 60 81 ld r22, Z 2ba74: 70 e0 ldi r23, 0x00 ; 0 2ba76: 90 e0 ldi r25, 0x00 ; 0 2ba78: 80 e0 ldi r24, 0x00 ; 0 2ba7a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2ba7e: 4b 01 movw r8, r22 2ba80: 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; 2ba82: ce 54 subi r28, 0x4E ; 78 2ba84: de 4f sbci r29, 0xFE ; 254 2ba86: 28 81 ld r18, Y 2ba88: 39 81 ldd r19, Y+1 ; 0x01 2ba8a: 4a 81 ldd r20, Y+2 ; 0x02 2ba8c: 5b 81 ldd r21, Y+3 ; 0x03 2ba8e: c2 5b subi r28, 0xB2 ; 178 2ba90: d1 40 sbci r29, 0x01 ; 1 2ba92: c3 01 movw r24, r6 2ba94: b2 01 movw r22, r4 2ba96: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2ba9a: 9b 01 movw r18, r22 2ba9c: 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]; 2ba9e: c5 01 movw r24, r10 2baa0: b4 01 movw r22, r8 2baa2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2baa6: 9b 01 movw r18, r22 2baa8: ac 01 movw r20, r24 2baaa: c7 01 movw r24, r14 2baac: b6 01 movw r22, r12 2baae: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2bab2: 6b 01 movw r12, r22 2bab4: 7c 01 movw r14, r24 2bab6: c6 55 subi r28, 0x56 ; 86 2bab8: de 4f sbci r29, 0xFE ; 254 2baba: e8 81 ld r30, Y 2babc: f9 81 ldd r31, Y+1 ; 0x01 2babe: ca 5a subi r28, 0xAA ; 170 2bac0: d1 40 sbci r29, 0x01 ; 1 2bac2: c4 55 subi r28, 0x54 ; 84 2bac4: de 4f sbci r29, 0xFE ; 254 2bac6: 88 81 ld r24, Y 2bac8: 99 81 ldd r25, Y+1 ; 0x01 2baca: cc 5a subi r28, 0xAC ; 172 2bacc: d1 40 sbci r29, 0x01 ; 1 2bace: e8 0f add r30, r24 2bad0: f9 1f adc r31, r25 2bad2: e2 5a subi r30, 0xA2 ; 162 2bad4: f9 4f sbci r31, 0xF9 ; 249 2bad6: 60 81 ld r22, Z 2bad8: 70 e0 ldi r23, 0x00 ; 0 2bada: 90 e0 ldi r25, 0x00 ; 0 2badc: 80 e0 ldi r24, 0x00 ; 0 2bade: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2bae2: 4b 01 movw r8, r22 2bae4: 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; 2bae6: cc 56 subi r28, 0x6C ; 108 2bae8: de 4f sbci r29, 0xFE ; 254 2baea: 28 81 ld r18, Y 2baec: 39 81 ldd r19, Y+1 ; 0x01 2baee: 4a 81 ldd r20, Y+2 ; 0x02 2baf0: 5b 81 ldd r21, Y+3 ; 0x03 2baf2: c4 59 subi r28, 0x94 ; 148 2baf4: d1 40 sbci r29, 0x01 ; 1 2baf6: c3 01 movw r24, r6 2baf8: b2 01 movw r22, r4 2bafa: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2bafe: 9b 01 movw r18, r22 2bb00: 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]; 2bb02: c5 01 movw r24, r10 2bb04: b4 01 movw r22, r8 2bb06: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2bb0a: 9b 01 movw r18, r22 2bb0c: ac 01 movw r20, r24 2bb0e: c7 01 movw r24, r14 2bb10: b6 01 movw r22, r12 2bb12: 0f 94 66 a5 call 0x34acc ; 0x34acc <__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; 2bb16: 20 e0 ldi r18, 0x00 ; 0 2bb18: 30 e0 ldi r19, 0x00 ; 0 2bb1a: 40 e0 ldi r20, 0x00 ; 0 2bb1c: 52 e4 ldi r21, 0x42 ; 66 2bb1e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2bb22: 6b 01 movw r12, r22 2bb24: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 2bb26: ac 01 movw r20, r24 2bb28: 9b 01 movw r18, r22 2bb2a: ce 55 subi r28, 0x5E ; 94 2bb2c: de 4f sbci r29, 0xFE ; 254 2bb2e: 68 81 ld r22, Y 2bb30: 79 81 ldd r23, Y+1 ; 0x01 2bb32: 8a 81 ldd r24, Y+2 ; 0x02 2bb34: 9b 81 ldd r25, Y+3 ; 0x03 2bb36: c2 5a subi r28, 0xA2 ; 162 2bb38: d1 40 sbci r29, 0x01 ; 1 2bb3a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2bb3e: c8 55 subi r28, 0x58 ; 88 2bb40: de 4f sbci r29, 0xFE ; 254 2bb42: a8 81 ld r26, Y 2bb44: b9 81 ldd r27, Y+1 ; 0x01 2bb46: c8 5a subi r28, 0xA8 ; 168 2bb48: d1 40 sbci r29, 0x01 ; 1 2bb4a: 6d 93 st X+, r22 2bb4c: 7d 93 st X+, r23 2bb4e: 8d 93 st X+, r24 2bb50: 9d 93 st X+, r25 2bb52: c8 55 subi r28, 0x58 ; 88 2bb54: de 4f sbci r29, 0xFE ; 254 2bb56: b9 83 std Y+1, r27 ; 0x01 2bb58: a8 83 st Y, r26 2bb5a: c8 5a subi r28, 0xA8 ; 168 2bb5c: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 2bb5e: a7 01 movw r20, r14 2bb60: 96 01 movw r18, r12 2bb62: c2 56 subi r28, 0x62 ; 98 2bb64: de 4f sbci r29, 0xFE ; 254 2bb66: 68 81 ld r22, Y 2bb68: 79 81 ldd r23, Y+1 ; 0x01 2bb6a: 8a 81 ldd r24, Y+2 ; 0x02 2bb6c: 9b 81 ldd r25, Y+3 ; 0x03 2bb6e: ce 59 subi r28, 0x9E ; 158 2bb70: d1 40 sbci r29, 0x01 ; 1 2bb72: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2bb76: ca 55 subi r28, 0x5A ; 90 2bb78: de 4f sbci r29, 0xFE ; 254 2bb7a: e8 81 ld r30, Y 2bb7c: f9 81 ldd r31, Y+1 ; 0x01 2bb7e: c6 5a subi r28, 0xA6 ; 166 2bb80: d1 40 sbci r29, 0x01 ; 1 2bb82: 61 93 st Z+, r22 2bb84: 71 93 st Z+, r23 2bb86: 81 93 st Z+, r24 2bb88: 91 93 st Z+, r25 2bb8a: ca 55 subi r28, 0x5A ; 90 2bb8c: de 4f sbci r29, 0xFE ; 254 2bb8e: f9 83 std Y+1, r31 ; 0x01 2bb90: e8 83 st Y, r30 2bb92: c6 5a subi r28, 0xA6 ; 166 2bb94: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 2bb96: c8 56 subi r28, 0x68 ; 104 2bb98: de 4f sbci r29, 0xFE ; 254 2bb9a: a8 81 ld r26, Y 2bb9c: b9 81 ldd r27, Y+1 ; 0x01 2bb9e: c8 59 subi r28, 0x98 ; 152 2bba0: d1 40 sbci r29, 0x01 ; 1 2bba2: cd 92 st X+, r12 2bba4: dd 92 st X+, r13 2bba6: ed 92 st X+, r14 2bba8: fd 92 st X+, r15 2bbaa: c8 56 subi r28, 0x68 ; 104 2bbac: de 4f sbci r29, 0xFE ; 254 2bbae: b9 83 std Y+1, r27 ; 0x01 2bbb0: a8 83 st Y, r26 2bbb2: c8 59 subi r28, 0x98 ; 152 2bbb4: d1 40 sbci r29, 0x01 ; 1 2bbb6: bf ef ldi r27, 0xFF ; 255 2bbb8: 2b 1a sub r2, r27 2bbba: 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){ 2bbbc: e1 e2 ldi r30, 0x21 ; 33 2bbbe: 2e 16 cp r2, r30 2bbc0: 31 04 cpc r3, r1 2bbc2: 09 f0 breq .+2 ; 0x2bbc6 2bbc4: 10 ce rjmp .-992 ; 0x2b7e6 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); 2bbc6: 40 e0 ldi r20, 0x00 ; 0 2bbc8: 50 e0 ldi r21, 0x00 ; 0 2bbca: 60 e0 ldi r22, 0x00 ; 0 2bbcc: 7d e3 ldi r23, 0x3D ; 61 2bbce: ce 01 movw r24, r28 2bbd0: 87 5f subi r24, 0xF7 ; 247 2bbd2: 9e 4f sbci r25, 0xFE ; 254 2bbd4: 0f 94 29 55 call 0x2aa52 ; 0x2aa52 2bbd8: 9b 01 movw r18, r22 2bbda: ac 01 movw r20, r24 2bbdc: c3 57 subi r28, 0x73 ; 115 2bbde: de 4f sbci r29, 0xFE ; 254 2bbe0: a8 81 ld r26, Y 2bbe2: b9 81 ldd r27, Y+1 ; 0x01 2bbe4: cd 58 subi r28, 0x8D ; 141 2bbe6: d1 40 sbci r29, 0x01 ; 1 2bbe8: 6d 91 ld r22, X+ 2bbea: 7d 91 ld r23, X+ 2bbec: 8d 91 ld r24, X+ 2bbee: 9c 91 ld r25, X 2bbf0: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2bbf4: c3 57 subi r28, 0x73 ; 115 2bbf6: de 4f sbci r29, 0xFE ; 254 2bbf8: e8 81 ld r30, Y 2bbfa: f9 81 ldd r31, Y+1 ; 0x01 2bbfc: cd 58 subi r28, 0x8D ; 141 2bbfe: d1 40 sbci r29, 0x01 ; 1 2bc00: 60 83 st Z, r22 2bc02: 71 83 std Z+1, r23 ; 0x01 2bc04: 82 83 std Z+2, r24 ; 0x02 2bc06: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 2bc08: 40 e0 ldi r20, 0x00 ; 0 2bc0a: 50 e0 ldi r21, 0x00 ; 0 2bc0c: 60 e0 ldi r22, 0x00 ; 0 2bc0e: 7d e3 ldi r23, 0x3D ; 61 2bc10: ce 01 movw r24, r28 2bc12: 8b 57 subi r24, 0x7B ; 123 2bc14: 9f 4f sbci r25, 0xFF ; 255 2bc16: 0f 94 29 55 call 0x2aa52 ; 0x2aa52 2bc1a: 9b 01 movw r18, r22 2bc1c: ac 01 movw r20, r24 2bc1e: c1 57 subi r28, 0x71 ; 113 2bc20: de 4f sbci r29, 0xFE ; 254 2bc22: a8 81 ld r26, Y 2bc24: b9 81 ldd r27, Y+1 ; 0x01 2bc26: cf 58 subi r28, 0x8F ; 143 2bc28: d1 40 sbci r29, 0x01 ; 1 2bc2a: 6d 91 ld r22, X+ 2bc2c: 7d 91 ld r23, X+ 2bc2e: 8d 91 ld r24, X+ 2bc30: 9c 91 ld r25, X 2bc32: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2bc36: c1 57 subi r28, 0x71 ; 113 2bc38: de 4f sbci r29, 0xFE ; 254 2bc3a: e8 81 ld r30, Y 2bc3c: f9 81 ldd r31, Y+1 ; 0x01 2bc3e: cf 58 subi r28, 0x8F ; 143 2bc40: d1 40 sbci r29, 0x01 ; 1 2bc42: 60 83 st Z, r22 2bc44: 71 83 std Z+1, r23 ; 0x01 2bc46: 82 83 std Z+2, r24 ; 0x02 2bc48: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 2bc4a: 40 e0 ldi r20, 0x00 ; 0 2bc4c: 50 e0 ldi r21, 0x00 ; 0 2bc4e: 60 e8 ldi r22, 0x80 ; 128 2bc50: 7c e3 ldi r23, 0x3C ; 60 2bc52: ce 01 movw r24, r28 2bc54: 01 96 adiw r24, 0x01 ; 1 2bc56: 0f 94 29 55 call 0x2aa52 ; 0x2aa52 2bc5a: ce 56 subi r28, 0x6E ; 110 2bc5c: de 4f sbci r29, 0xFE ; 254 2bc5e: a8 81 ld r26, Y 2bc60: b9 81 ldd r27, Y+1 ; 0x01 2bc62: c2 59 subi r28, 0x92 ; 146 2bc64: d1 40 sbci r29, 0x01 ; 1 2bc66: 2d 91 ld r18, X+ 2bc68: 3d 91 ld r19, X+ 2bc6a: 4d 91 ld r20, X+ 2bc6c: 5c 91 ld r21, X 2bc6e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2bc72: 16 2f mov r17, r22 2bc74: 07 2f mov r16, r23 2bc76: f8 2e mov r15, r24 2bc78: e9 2e mov r14, r25 r = MAX(2, r); 2bc7a: 20 e0 ldi r18, 0x00 ; 0 2bc7c: 30 e0 ldi r19, 0x00 ; 0 2bc7e: 40 e0 ldi r20, 0x00 ; 0 2bc80: 50 e4 ldi r21, 0x40 ; 64 2bc82: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2bc86: 18 16 cp r1, r24 2bc88: 2c f0 brlt .+10 ; 0x2bc94 2bc8a: 10 e0 ldi r17, 0x00 ; 0 2bc8c: 00 e0 ldi r16, 0x00 ; 0 2bc8e: f1 2c mov r15, r1 2bc90: 80 e4 ldi r24, 0x40 ; 64 2bc92: e8 2e mov r14, r24 2bc94: a8 01 movw r20, r16 2bc96: 97 01 movw r18, r14 2bc98: 85 2f mov r24, r21 2bc9a: 90 2f mov r25, r16 2bc9c: a3 2f mov r26, r19 2bc9e: be 2d mov r27, r14 2bca0: ce 56 subi r28, 0x6E ; 110 2bca2: de 4f sbci r29, 0xFE ; 254 2bca4: e8 81 ld r30, Y 2bca6: f9 81 ldd r31, Y+1 ; 0x01 2bca8: c2 59 subi r28, 0x92 ; 146 2bcaa: d1 40 sbci r29, 0x01 ; 1 2bcac: 80 83 st Z, r24 2bcae: 91 83 std Z+1, r25 ; 0x01 2bcb0: a2 83 std Z+2, r26 ; 0x02 2bcb2: b3 83 std Z+3, r27 ; 0x03 2bcb4: cf 56 subi r28, 0x6F ; 111 2bcb6: de 4f sbci r29, 0xFE ; 254 2bcb8: f8 81 ld r31, Y 2bcba: c1 59 subi r28, 0x91 ; 145 2bcbc: d1 40 sbci r29, 0x01 ; 1 2bcbe: f1 50 subi r31, 0x01 ; 1 2bcc0: cf 56 subi r28, 0x6F ; 111 2bcc2: de 4f sbci r29, 0xFE ; 254 2bcc4: f8 83 st Y, r31 2bcc6: c1 59 subi r28, 0x91 ; 145 2bcc8: 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){ 2bcca: f1 11 cpse r31, r1 2bccc: 37 cd rjmp .-1426 ; 0x2b73c r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 2bcce: ef 92 push r14 2bcd0: ff 92 push r15 2bcd2: 0f 93 push r16 2bcd4: 1f 93 push r17 2bcd6: c1 57 subi r28, 0x71 ; 113 2bcd8: de 4f sbci r29, 0xFE ; 254 2bcda: a8 81 ld r26, Y 2bcdc: b9 81 ldd r27, Y+1 ; 0x01 2bcde: cf 58 subi r28, 0x8F ; 143 2bce0: d1 40 sbci r29, 0x01 ; 1 2bce2: 13 96 adiw r26, 0x03 ; 3 2bce4: 8c 91 ld r24, X 2bce6: 13 97 sbiw r26, 0x03 ; 3 2bce8: 8f 93 push r24 2bcea: 12 96 adiw r26, 0x02 ; 2 2bcec: 8c 91 ld r24, X 2bcee: 12 97 sbiw r26, 0x02 ; 2 2bcf0: 8f 93 push r24 2bcf2: 11 96 adiw r26, 0x01 ; 1 2bcf4: 8c 91 ld r24, X 2bcf6: 11 97 sbiw r26, 0x01 ; 1 2bcf8: 8f 93 push r24 2bcfa: 8c 91 ld r24, X 2bcfc: 8f 93 push r24 2bcfe: c3 57 subi r28, 0x73 ; 115 2bd00: de 4f sbci r29, 0xFE ; 254 2bd02: e8 81 ld r30, Y 2bd04: f9 81 ldd r31, Y+1 ; 0x01 2bd06: cd 58 subi r28, 0x8D ; 141 2bd08: d1 40 sbci r29, 0x01 ; 1 2bd0a: 83 81 ldd r24, Z+3 ; 0x03 2bd0c: 8f 93 push r24 2bd0e: 82 81 ldd r24, Z+2 ; 0x02 2bd10: 8f 93 push r24 2bd12: 81 81 ldd r24, Z+1 ; 0x01 2bd14: 8f 93 push r24 2bd16: 80 81 ld r24, Z 2bd18: 8f 93 push r24 2bd1a: 86 ee ldi r24, 0xE6 ; 230 2bd1c: 9d e9 ldi r25, 0x9D ; 157 2bd1e: 9f 93 push r25 2bd20: 8f 93 push r24 2bd22: 0f 94 00 a3 call 0x34600 ; 0x34600 2bd26: 0f b6 in r0, 0x3f ; 63 2bd28: f8 94 cli 2bd2a: de bf out 0x3e, r29 ; 62 2bd2c: 0f be out 0x3f, r0 ; 63 2bd2e: cd bf out 0x3d, r28 ; 61 } 2bd30: c3 54 subi r28, 0x43 ; 67 2bd32: de 4f sbci r29, 0xFE ; 254 2bd34: 0f b6 in r0, 0x3f ; 63 2bd36: f8 94 cli 2bd38: de bf out 0x3e, r29 ; 62 2bd3a: 0f be out 0x3f, r0 ; 63 2bd3c: cd bf out 0x3d, r28 ; 61 2bd3e: df 91 pop r29 2bd40: cf 91 pop r28 2bd42: 1f 91 pop r17 2bd44: 0f 91 pop r16 2bd46: ff 90 pop r15 2bd48: ef 90 pop r14 2bd4a: df 90 pop r13 2bd4c: cf 90 pop r12 2bd4e: bf 90 pop r11 2bd50: af 90 pop r10 2bd52: 9f 90 pop r9 2bd54: 8f 90 pop r8 2bd56: 7f 90 pop r7 2bd58: 6f 90 pop r6 2bd5a: 5f 90 pop r5 2bd5c: 4f 90 pop r4 2bd5e: 3f 90 pop r3 2bd60: 2f 90 pop r2 2bd62: 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; 2bd64: 60 e0 ldi r22, 0x00 ; 0 2bd66: 70 e0 ldi r23, 0x00 ; 0 2bd68: cb 01 movw r24, r22 2bd6a: d5 ce rjmp .-598 ; 0x2bb16 0002bd6c : 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){ 2bd6c: ef 92 push r14 2bd6e: ff 92 push r15 2bd70: 0f 93 push r16 2bd72: 1f 93 push r17 2bd74: cf 93 push r28 2bd76: df 93 push r29 2bd78: 1f 92 push r1 2bd7a: 1f 92 push r1 2bd7c: cd b7 in r28, 0x3d ; 61 2bd7e: de b7 in r29, 0x3e ; 62 2bd80: f8 2e mov r15, r24 2bd82: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2bd84: 80 e1 ldi r24, 0x10 ; 16 2bd86: 97 e2 ldi r25, 0x27 ; 39 2bd88: 9a 83 std Y+2, r25 ; 0x02 2bd8a: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2bd8c: 8a 01 movw r16, r20 2bd8e: 16 95 lsr r17 2bd90: 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); 2bd92: 8f 2d mov r24, r15 2bd94: 0e 94 61 d3 call 0x1a6c2 ; 0x1a6c2 while (steps--){ 2bd98: 01 50 subi r16, 0x01 ; 1 2bd9a: 11 09 sbc r17, r1 2bd9c: 78 f0 brcs .+30 ; 0x2bdbc accelerate_1_step(axes, acc, delay_us, min_delay_us); 2bd9e: 28 ec ldi r18, 0xC8 ; 200 2bda0: 30 e0 ldi r19, 0x00 ; 0 2bda2: ae 01 movw r20, r28 2bda4: 4f 5f subi r20, 0xFF ; 255 2bda6: 5f 4f sbci r21, 0xFF ; 255 2bda8: 68 ee ldi r22, 0xE8 ; 232 2bdaa: 73 e0 ldi r23, 0x03 ; 3 2bdac: 8f 2d mov r24, r15 2bdae: 0e 94 30 d2 call 0x1a460 ; 0x1a460 update_position_1_step(axes, dir); 2bdb2: 6e 2d mov r22, r14 2bdb4: 8f 2d mov r24, r15 2bdb6: 0e 94 7a d3 call 0x1a6f4 ; 0x1a6f4 2bdba: ee cf rjmp .-36 ; 0x2bd98 } /// \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); 2bdbc: 6e 2d mov r22, r14 2bdbe: 8f 2d mov r24, r15 2bdc0: 0e 94 61 d3 call 0x1a6c2 ; 0x1a6c2 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); } 2bdc4: 0f 90 pop r0 2bdc6: 0f 90 pop r0 2bdc8: df 91 pop r29 2bdca: cf 91 pop r28 2bdcc: 1f 91 pop r17 2bdce: 0f 91 pop r16 2bdd0: ff 90 pop r15 2bdd2: ef 90 pop r14 2bdd4: 08 95 ret 0002bdd6 : /// 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) 2bdd6: 2f 92 push r2 2bdd8: 3f 92 push r3 2bdda: 4f 92 push r4 2bddc: 5f 92 push r5 2bdde: 6f 92 push r6 2bde0: 7f 92 push r7 2bde2: 8f 92 push r8 2bde4: 9f 92 push r9 2bde6: af 92 push r10 2bde8: bf 92 push r11 2bdea: cf 92 push r12 2bdec: df 92 push r13 2bdee: ef 92 push r14 2bdf0: ff 92 push r15 2bdf2: 0f 93 push r16 2bdf4: 1f 93 push r17 2bdf6: cf 93 push r28 2bdf8: df 93 push r29 2bdfa: cd b7 in r28, 0x3d ; 61 2bdfc: de b7 in r29, 0x3e ; 62 2bdfe: 6c 97 sbiw r28, 0x1c ; 28 2be00: 0f b6 in r0, 0x3f ; 63 2be02: f8 94 cli 2be04: de bf out 0x3e, r29 ; 62 2be06: 0f be out 0x3f, r0 ; 63 2be08: cd bf out 0x3d, r28 ; 61 2be0a: 6c 01 movw r12, r24 2be0c: 5b 01 movw r10, r22 2be0e: 4a 01 movw r8, r20 2be10: 19 01 movw r2, r18 2be12: 18 87 std Y+8, r17 ; 0x08 2be14: 0f 83 std Y+7, r16 ; 0x07 2be16: fa 82 std Y+2, r15 ; 0x02 2be18: 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; 2be1a: d7 01 movw r26, r14 2be1c: 8d 91 ld r24, X+ 2be1e: 9c 91 ld r25, X 2be20: 60 ed ldi r22, 0xD0 ; 208 2be22: 72 e0 ldi r23, 0x02 ; 2 2be24: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__udivmodhi4> 2be28: 9c 8f std Y+28, r25 ; 0x1c 2be2a: 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); 2be2c: 9f 93 push r25 2be2e: 8f 93 push r24 2be30: 3f 92 push r3 2be32: 2f 93 push r18 2be34: 1f 92 push r1 2be36: 84 e6 ldi r24, 0x64 ; 100 2be38: 8f 93 push r24 2be3a: 9f 92 push r9 2be3c: 8f 92 push r8 2be3e: bf 92 push r11 2be40: af 92 push r10 2be42: df 92 push r13 2be44: cf 92 push r12 2be46: 84 e6 ldi r24, 0x64 ; 100 2be48: 9d e9 ldi r25, 0x9D ; 157 2be4a: 9f 93 push r25 2be4c: 8f 93 push r24 2be4e: 0f 94 00 a3 call 0x34600 ; 0x34600 2be52: 0f b6 in r0, 0x3f ; 63 2be54: f8 94 cli 2be56: de bf out 0x3e, r29 ; 62 2be58: 0f be out 0x3f, r0 ; 63 2be5a: 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; 2be5c: 22 27 eor r18, r18 2be5e: 33 27 eor r19, r19 2be60: 22 19 sub r18, r2 2be62: 33 09 sbc r19, r3 2be64: 3a 8f std Y+26, r19 ; 0x1a 2be66: 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)); 2be68: c4 01 movw r24, r8 2be6a: 99 0c add r9, r9 2be6c: aa 0b sbc r26, r26 2be6e: bb 0b sbc r27, r27 2be70: 89 87 std Y+9, r24 ; 0x09 2be72: 9a 87 std Y+10, r25 ; 0x0a 2be74: ab 87 std Y+11, r26 ; 0x0b 2be76: 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)); 2be78: 95 01 movw r18, r10 2be7a: bb 0c add r11, r11 2be7c: 44 0b sbc r20, r20 2be7e: 55 0b sbc r21, r21 2be80: 29 8b std Y+17, r18 ; 0x11 2be82: 3a 8b std Y+18, r19 ; 0x12 2be84: 4b 8b std Y+19, r20 ; 0x13 2be86: 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)); 2be88: c6 01 movw r24, r12 2be8a: dd 0c add r13, r13 2be8c: aa 0b sbc r26, r26 2be8e: bb 0b sbc r27, r27 2be90: 8d 8b std Y+21, r24 ; 0x15 2be92: 9e 8b std Y+22, r25 ; 0x16 2be94: af 8b std Y+23, r26 ; 0x17 2be96: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 2be98: 12 14 cp r1, r2 2be9a: 13 04 cpc r1, r3 2be9c: 0c f0 brlt .+2 ; 0x2bea0 2be9e: ba c0 rjmp .+372 ; 0x2c014 { dad = dad_max - (ad / k); 2bea0: 8b 8d ldd r24, Y+27 ; 0x1b 2bea2: 9c 8d ldd r25, Y+28 ; 0x1c 2bea4: 6c e3 ldi r22, 0x3C ; 60 2bea6: 70 e0 ldi r23, 0x00 ; 0 2bea8: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__udivmodhi4> 2beac: 10 e1 ldi r17, 0x10 ; 16 2beae: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 2beb0: 2b 8d ldd r18, Y+27 ; 0x1b 2beb2: 3c 8d ldd r19, Y+28 ; 0x1c 2beb4: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2beb6: 0f 94 5e a5 call 0x34abc ; 0x34abc <__usmulhisi3> 2beba: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 2bebe: 20 e0 ldi r18, 0x00 ; 0 2bec0: 30 e0 ldi r19, 0x00 ; 0 2bec2: 44 e3 ldi r20, 0x34 ; 52 2bec4: 54 e4 ldi r21, 0x44 ; 68 2bec6: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 2beca: 6b 01 movw r12, r22 2becc: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 2bece: 6f 81 ldd r22, Y+7 ; 0x07 2bed0: 78 85 ldd r23, Y+8 ; 0x08 2bed2: eb 8d ldd r30, Y+27 ; 0x1b 2bed4: fc 8d ldd r31, Y+28 ; 0x1c 2bed6: 6e 0f add r22, r30 2bed8: 7f 1f adc r23, r31 2beda: 90 e0 ldi r25, 0x00 ; 0 2bedc: 80 e0 ldi r24, 0x00 ; 0 2bede: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 2bee2: 25 e3 ldi r18, 0x35 ; 53 2bee4: 3a ef ldi r19, 0xFA ; 250 2bee6: 4e e8 ldi r20, 0x8E ; 142 2bee8: 5c e3 ldi r21, 0x3C ; 60 2beea: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2beee: 4b 01 movw r8, r22 2bef0: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 2bef2: 0f 94 60 a6 call 0x34cc0 ; 0x34cc0 2bef6: 6b 83 std Y+3, r22 ; 0x03 2bef8: 7c 83 std Y+4, r23 ; 0x04 2befa: 8d 83 std Y+5, r24 ; 0x05 2befc: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 2befe: c5 01 movw r24, r10 2bf00: b4 01 movw r22, r8 2bf02: 0f 94 26 a9 call 0x3524c ; 0x3524c 2bf06: 2b 01 movw r4, r22 2bf08: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2bf0a: 69 85 ldd r22, Y+9 ; 0x09 2bf0c: 7a 85 ldd r23, Y+10 ; 0x0a 2bf0e: 8b 85 ldd r24, Y+11 ; 0x0b 2bf10: 9c 85 ldd r25, Y+12 ; 0x0c 2bf12: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2bf16: 4b 01 movw r8, r22 2bf18: 5c 01 movw r10, r24 2bf1a: 2b 8d ldd r18, Y+27 ; 0x1b 2bf1c: 3c 8d ldd r19, Y+28 ; 0x1c 2bf1e: a4 e6 ldi r26, 0x64 ; 100 2bf20: b0 e0 ldi r27, 0x00 ; 0 2bf22: 0f 94 de a4 call 0x349bc ; 0x349bc <__umulhisi3> 2bf26: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2bf2a: 20 e0 ldi r18, 0x00 ; 0 2bf2c: 30 e0 ldi r19, 0x00 ; 0 2bf2e: 44 e3 ldi r20, 0x34 ; 52 2bf30: 54 e4 ldi r21, 0x44 ; 68 2bf32: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 2bf36: 9b 01 movw r18, r22 2bf38: ac 01 movw r20, r24 2bf3a: c5 01 movw r24, r10 2bf3c: b4 01 movw r22, r8 2bf3e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2bf42: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 2bf46: 6d 87 std Y+13, r22 ; 0x0d 2bf48: 7e 87 std Y+14, r23 ; 0x0e 2bf4a: 8f 87 std Y+15, r24 ; 0x0f 2bf4c: 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)); 2bf4e: 69 89 ldd r22, Y+17 ; 0x11 2bf50: 7a 89 ldd r23, Y+18 ; 0x12 2bf52: 8b 89 ldd r24, Y+19 ; 0x13 2bf54: 9c 89 ldd r25, Y+20 ; 0x14 2bf56: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2bf5a: 4b 01 movw r8, r22 2bf5c: 5c 01 movw r10, r24 2bf5e: a3 01 movw r20, r6 2bf60: 92 01 movw r18, r4 2bf62: c7 01 movw r24, r14 2bf64: b6 01 movw r22, r12 2bf66: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2bf6a: 9b 01 movw r18, r22 2bf6c: ac 01 movw r20, r24 2bf6e: c5 01 movw r24, r10 2bf70: b4 01 movw r22, r8 2bf72: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2bf76: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 2bf7a: 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)); 2bf7c: 6d 89 ldd r22, Y+21 ; 0x15 2bf7e: 7e 89 ldd r23, Y+22 ; 0x16 2bf80: 8f 89 ldd r24, Y+23 ; 0x17 2bf82: 98 8d ldd r25, Y+24 ; 0x18 2bf84: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2bf88: 2b 01 movw r4, r22 2bf8a: 3c 01 movw r6, r24 2bf8c: a7 01 movw r20, r14 2bf8e: 96 01 movw r18, r12 2bf90: 6b 81 ldd r22, Y+3 ; 0x03 2bf92: 7c 81 ldd r23, Y+4 ; 0x04 2bf94: 8d 81 ldd r24, Y+5 ; 0x05 2bf96: 9e 81 ldd r25, Y+6 ; 0x06 2bf98: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2bf9c: 9b 01 movw r18, r22 2bf9e: ac 01 movw r20, r24 2bfa0: c3 01 movw r24, r6 2bfa2: b2 01 movw r22, r4 2bfa4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2bfa8: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 2bfac: 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)) 2bfae: 01 e0 ldi r16, 0x01 ; 1 2bfb0: 20 e4 ldi r18, 0x40 ; 64 2bfb2: 31 e0 ldi r19, 0x01 ; 1 2bfb4: 4d 85 ldd r20, Y+13 ; 0x0d 2bfb6: 5e 85 ldd r21, Y+14 ; 0x0e 2bfb8: b4 01 movw r22, r8 2bfba: 0e 94 ba d3 call 0x1a774 ; 0x1a774 2bfbe: 21 2f mov r18, r17 2bfc0: 30 e0 ldi r19, 0x00 ; 0 2bfc2: 88 23 and r24, r24 2bfc4: b9 f1 breq .+110 ; 0x2c034 2bfc6: 4b 8d ldd r20, Y+27 ; 0x1b 2bfc8: 5c 8d ldd r21, Y+28 ; 0x1c 2bfca: 42 0f add r20, r18 2bfcc: 53 1f adc r21, r19 { ad += dad + 1; 2bfce: 4f 5f subi r20, 0xFF ; 255 2bfd0: 5f 4f sbci r21, 0xFF ; 255 2bfd2: 5c 8f std Y+28, r21 ; 0x1c 2bfd4: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 2bfd6: eb 8d ldd r30, Y+27 ; 0x1b 2bfd8: fc 8d ldd r31, Y+28 ; 0x1c 2bfda: a9 81 ldd r26, Y+1 ; 0x01 2bfdc: ba 81 ldd r27, Y+2 ; 0x02 2bfde: ed 93 st X+, r30 2bfe0: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 2bfe2: 6c 96 adiw r28, 0x1c ; 28 2bfe4: 0f b6 in r0, 0x3f ; 63 2bfe6: f8 94 cli 2bfe8: de bf out 0x3e, r29 ; 62 2bfea: 0f be out 0x3f, r0 ; 63 2bfec: cd bf out 0x3d, r28 ; 61 2bfee: df 91 pop r29 2bff0: cf 91 pop r28 2bff2: 1f 91 pop r17 2bff4: 0f 91 pop r16 2bff6: ff 90 pop r15 2bff8: ef 90 pop r14 2bffa: df 90 pop r13 2bffc: cf 90 pop r12 2bffe: bf 90 pop r11 2c000: af 90 pop r10 2c002: 9f 90 pop r9 2c004: 8f 90 pop r8 2c006: 7f 90 pop r7 2c008: 6f 90 pop r6 2c00a: 5f 90 pop r5 2c00c: 4f 90 pop r4 2c00e: 3f 90 pop r3 2c010: 2f 90 pop r2 2c012: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 2c014: 2f ec ldi r18, 0xCF ; 207 2c016: 32 e0 ldi r19, 0x02 ; 2 2c018: ab 8d ldd r26, Y+27 ; 0x1b 2c01a: bc 8d ldd r27, Y+28 ; 0x1c 2c01c: 2a 1b sub r18, r26 2c01e: 3b 0b sbc r19, r27 2c020: c9 01 movw r24, r18 2c022: 6c e3 ldi r22, 0x3C ; 60 2c024: 70 e0 ldi r23, 0x00 ; 0 2c026: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__udivmodhi4> 2c02a: 10 e1 ldi r17, 0x10 ; 16 2c02c: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2c02e: a9 8d ldd r26, Y+25 ; 0x19 2c030: ba 8d ldd r27, Y+26 ; 0x1a 2c032: 41 cf rjmp .-382 ; 0x2beb6 // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 2c034: 2f 5f subi r18, 0xFF ; 255 2c036: 3f 4f sbci r19, 0xFF ; 255 2c038: ab 8d ldd r26, Y+27 ; 0x1b 2c03a: bc 8d ldd r27, Y+28 ; 0x1c 2c03c: a2 0f add r26, r18 2c03e: b3 1f adc r27, r19 2c040: bc 8f std Y+28, r27 ; 0x1c 2c042: ab 8f std Y+27, r26 ; 0x1b 2c044: a0 3d cpi r26, 0xD0 ; 208 2c046: b2 40 sbci r27, 0x02 ; 2 2c048: 08 f4 brcc .+2 ; 0x2c04c 2c04a: 26 cf rjmp .-436 ; 0x2be98 2c04c: c4 cf rjmp .-120 ; 0x2bfd6 0002c04e : 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){ 2c04e: 2f 92 push r2 2c050: 3f 92 push r3 2c052: 4f 92 push r4 2c054: 5f 92 push r5 2c056: 6f 92 push r6 2c058: 7f 92 push r7 2c05a: 8f 92 push r8 2c05c: 9f 92 push r9 2c05e: af 92 push r10 2c060: bf 92 push r11 2c062: cf 92 push r12 2c064: df 92 push r13 2c066: ef 92 push r14 2c068: ff 92 push r15 2c06a: 0f 93 push r16 2c06c: 1f 93 push r17 2c06e: cf 93 push r28 2c070: df 93 push r29 2c072: cd b7 in r28, 0x3d ; 61 2c074: de b7 in r29, 0x3e ; 62 2c076: ca 55 subi r28, 0x5A ; 90 2c078: d1 09 sbc r29, r1 2c07a: 0f b6 in r0, 0x3f ; 63 2c07c: f8 94 cli 2c07e: de bf out 0x3e, r29 ; 62 2c080: 0f be out 0x3f, r0 ; 63 2c082: cd bf out 0x3d, r28 ; 61 2c084: 63 96 adiw r28, 0x13 ; 19 2c086: 9f af std Y+63, r25 ; 0x3f 2c088: 8e af std Y+62, r24 ; 0x3e 2c08a: 63 97 sbiw r28, 0x13 ; 19 2c08c: 8b 01 movw r16, r22 2c08e: 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 2c090: 7e 01 movw r14, r28 2c092: 25 e4 ldi r18, 0x45 ; 69 2c094: e2 0e add r14, r18 2c096: f1 1c adc r15, r1 2c098: 80 e1 ldi r24, 0x10 ; 16 2c09a: 97 e2 ldi r25, 0x27 ; 39 2c09c: f7 01 movw r30, r14 2c09e: 91 83 std Z+1, r25 ; 0x01 2c0a0: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 2c0a2: 81 eb ldi r24, 0xB1 ; 177 2c0a4: 9d e9 ldi r25, 0x9D ; 157 2c0a6: 9f 93 push r25 2c0a8: 8f 93 push r24 2c0aa: 0f 94 00 a3 call 0x34600 ; 0x34600 2c0ae: 2e e5 ldi r18, 0x5E ; 94 2c0b0: 36 e0 ldi r19, 0x06 ; 6 2c0b2: 61 96 adiw r28, 0x11 ; 17 2c0b4: 3f af std Y+63, r19 ; 0x3f 2c0b6: 2e af std Y+62, r18 ; 0x3e 2c0b8: 61 97 sbiw r28, 0x11 ; 17 2c0ba: c8 01 movw r24, r16 2c0bc: 80 5e subi r24, 0xE0 ; 224 2c0be: 93 40 sbci r25, 0x03 ; 3 2c0c0: 2b 96 adiw r28, 0x0b ; 11 2c0c2: 9f af std Y+63, r25 ; 0x3f 2c0c4: 8e af std Y+62, r24 ; 0x3e 2c0c6: 2b 97 sbiw r28, 0x0b ; 11 2c0c8: 0f 90 pop r0 2c0ca: 0f 90 pop r0 2c0cc: e0 e4 ldi r30, 0x40 ; 64 2c0ce: f0 e0 ldi r31, 0x00 ; 0 2c0d0: 29 96 adiw r28, 0x09 ; 9 2c0d2: ff af std Y+63, r31 ; 0x3f 2c0d4: ee af std Y+62, r30 ; 0x3e 2c0d6: 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); 2c0d8: 63 96 adiw r28, 0x13 ; 19 2c0da: 2e ad ldd r18, Y+62 ; 0x3e 2c0dc: 3f ad ldd r19, Y+63 ; 0x3f 2c0de: 63 97 sbiw r28, 0x13 ; 19 2c0e0: 20 5e subi r18, 0xE0 ; 224 2c0e2: 33 40 sbci r19, 0x03 ; 3 2c0e4: 69 96 adiw r28, 0x19 ; 25 2c0e6: 3f af std Y+63, r19 ; 0x3f 2c0e8: 2e af std Y+62, r18 ; 0x3e 2c0ea: 69 97 sbiw r28, 0x19 ; 25 2c0ec: 29 96 adiw r28, 0x09 ; 9 2c0ee: 4e ac ldd r4, Y+62 ; 0x3e 2c0f0: 5f ac ldd r5, Y+63 ; 0x3f 2c0f2: 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){ 2c0f4: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2c0f6: 63 96 adiw r28, 0x13 ; 19 2c0f8: 8e ad ldd r24, Y+62 ; 0x3e 2c0fa: 9f ad ldd r25, Y+63 ; 0x3f 2c0fc: 63 97 sbiw r28, 0x13 ; 19 2c0fe: 80 52 subi r24, 0x20 ; 32 2c100: 9c 4f sbci r25, 0xFC ; 252 2c102: 6b 96 adiw r28, 0x1b ; 27 2c104: 9f af std Y+63, r25 ; 0x3f 2c106: 8e af std Y+62, r24 ; 0x3e 2c108: 6b 97 sbiw r28, 0x1b ; 27 2c10a: 60 90 54 06 lds r6, 0x0654 ; 0x800654 2c10e: 70 90 55 06 lds r7, 0x0655 ; 0x800655 2c112: 80 90 56 06 lds r8, 0x0656 ; 0x800656 2c116: 90 90 57 06 lds r9, 0x0657 ; 0x800657 2c11a: 6b 96 adiw r28, 0x1b ; 27 2c11c: ae ac ldd r10, Y+62 ; 0x3e 2c11e: bf ac ldd r11, Y+63 ; 0x3f 2c120: 6b 97 sbiw r28, 0x1b ; 27 2c122: 31 10 cpse r3, r1 2c124: 04 c0 rjmp .+8 ; 0x2c12e 2c126: 69 96 adiw r28, 0x19 ; 25 2c128: ae ac ldd r10, Y+62 ; 0x3e 2c12a: bf ac ldd r11, Y+63 ; 0x3f 2c12c: 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; 2c12e: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2c132: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 2c136: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 2c13a: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 2c13e: f5 01 movw r30, r10 2c140: e8 1b sub r30, r24 2c142: f9 0b sbc r31, r25 2c144: 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) 2c146: 71 f0 breq .+28 ; 0x2c164 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)); 2c148: af 01 movw r20, r30 2c14a: f7 ff sbrs r31, 7 2c14c: 04 c0 rjmp .+8 ; 0x2c156 2c14e: 44 27 eor r20, r20 2c150: 55 27 eor r21, r21 2c152: 4e 1b sub r20, r30 2c154: 5f 0b sbc r21, r31 2c156: 69 2f mov r22, r25 2c158: 66 1f adc r22, r22 2c15a: 66 27 eor r22, r22 2c15c: 66 1f adc r22, r22 2c15e: 81 e0 ldi r24, 0x01 ; 1 2c160: 0f 94 b6 5e call 0x2bd6c ; 0x2bd6c // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 2c164: 80 91 50 06 lds r24, 0x0650 ; 0x800650 2c168: 90 91 51 06 lds r25, 0x0651 ; 0x800651 2c16c: a0 91 52 06 lds r26, 0x0652 ; 0x800652 2c170: b0 91 53 06 lds r27, 0x0653 ; 0x800653 2c174: 2b 96 adiw r28, 0x0b ; 11 2c176: 4e ad ldd r20, Y+62 ; 0x3e 2c178: 5f ad ldd r21, Y+63 ; 0x3f 2c17a: 2b 97 sbiw r28, 0x0b ; 11 2c17c: 48 1b sub r20, r24 2c17e: 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)); 2c180: 57 fd sbrc r21, 7 2c182: b2 c0 rjmp .+356 ; 0x2c2e8 2c184: 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) 2c186: 41 15 cp r20, r1 2c188: 51 05 cpc r21, r1 2c18a: 09 f0 breq .+2 ; 0x2c18e 2c18c: ae c0 rjmp .+348 ; 0x2c2ea // 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; 2c18e: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c192: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c196: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c19a: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c19e: 68 1a sub r6, r24 2c1a0: 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)); 2c1a2: 77 fc sbrc r7, 7 2c1a4: ab c0 rjmp .+342 ; 0x2c2fc 2c1a6: 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) 2c1a8: 61 14 cp r6, r1 2c1aa: 71 04 cpc r7, r1 2c1ac: 09 f0 breq .+2 ; 0x2c1b0 2c1ae: a7 c0 rjmp .+334 ; 0x2c2fe 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); 2c1b0: 40 91 54 06 lds r20, 0x0654 ; 0x800654 2c1b4: 50 91 55 06 lds r21, 0x0655 ; 0x800655 2c1b8: 60 91 56 06 lds r22, 0x0656 ; 0x800656 2c1bc: 70 91 57 06 lds r23, 0x0657 ; 0x800657 2c1c0: 00 e0 ldi r16, 0x00 ; 0 2c1c2: 28 ec ldi r18, 0xC8 ; 200 2c1c4: 30 e0 ldi r19, 0x00 ; 0 2c1c6: 2b 96 adiw r28, 0x0b ; 11 2c1c8: 6e ad ldd r22, Y+62 ; 0x3e 2c1ca: 7f ad ldd r23, Y+63 ; 0x3f 2c1cc: 2b 97 sbiw r28, 0x0b ; 11 2c1ce: c5 01 movw r24, r10 2c1d0: 0e 94 ba d3 call 0x1a774 ; 0x1a774 sm4_set_dir(X_AXIS, d); 2c1d4: 63 2d mov r22, r3 2c1d6: 80 e0 ldi r24, 0x00 ; 0 2c1d8: 0f 94 c3 25 call 0x24b86 ; 0x24b86 //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 2c1dc: 5f 92 push r5 2c1de: 4f 92 push r4 2c1e0: 8d ea ldi r24, 0xAD ; 173 2c1e2: 9d e9 ldi r25, 0x9D ; 157 2c1e4: 9f 93 push r25 2c1e6: 8f 93 push r24 2c1e8: 0f 94 00 a3 call 0x34600 ; 0x34600 lcd_set_cursor(4,3); 2c1ec: 63 e0 ldi r22, 0x03 ; 3 2c1ee: 84 e0 ldi r24, 0x04 ; 4 2c1f0: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 2c1f4: 5f 92 push r5 2c1f6: 4f 92 push r4 2c1f8: 8e e9 ldi r24, 0x9E ; 158 2c1fa: 9d e9 ldi r25, 0x9D ; 157 2c1fc: 9f 93 push r25 2c1fe: 8f 93 push r24 2c200: 0e 94 66 6f call 0xdecc ; 0xdecc 2c204: 0f b6 in r0, 0x3f ; 63 2c206: f8 94 cli 2c208: de bf out 0x3e, r29 ; 62 2c20a: 0f be out 0x3f, r0 ; 63 2c20c: cd bf out 0x3d, r28 ; 61 2c20e: 21 e0 ldi r18, 0x01 ; 1 2c210: 30 e0 ldi r19, 0x00 ; 0 2c212: 31 10 cpse r3, r1 2c214: 02 c0 rjmp .+4 ; 0x2c21a 2c216: 2f ef ldi r18, 0xFF ; 255 2c218: 3f ef ldi r19, 0xFF ; 255 2c21a: 40 ec ldi r20, 0xC0 ; 192 2c21c: 42 03 mulsu r20, r18 2c21e: c0 01 movw r24, r0 2c220: 43 9f mul r20, r19 2c222: 90 0d add r25, r0 2c224: 11 24 eor r1, r1 2c226: 67 96 adiw r28, 0x17 ; 23 2c228: 9f af std Y+63, r25 ; 0x3f 2c22a: 8e af std Y+62, r24 ; 0x3e 2c22c: 67 97 sbiw r28, 0x17 ; 23 2c22e: 40 ee ldi r20, 0xE0 ; 224 2c230: 53 e0 ldi r21, 0x03 ; 3 2c232: 24 9f mul r18, r20 2c234: 40 01 movw r8, r0 2c236: 25 9f mul r18, r21 2c238: 90 0c add r9, r0 2c23a: 34 9f mul r19, r20 2c23c: 90 0c add r9, r0 2c23e: 11 24 eor r1, r1 2c240: 63 96 adiw r28, 0x13 ; 19 2c242: ee ad ldd r30, Y+62 ; 0x3e 2c244: ff ad ldd r31, Y+63 ; 0x3f 2c246: 63 97 sbiw r28, 0x13 ; 19 2c248: 8e 0e add r8, r30 2c24a: 9f 1e adc r9, r31 2c24c: 9e 01 movw r18, r28 2c24e: 2f 5f subi r18, 0xFF ; 255 2c250: 3f 4f sbci r19, 0xFF ; 255 2c252: 2d 96 adiw r28, 0x0d ; 13 2c254: 3f af std Y+63, r19 ; 0x3f 2c256: 2e af std Y+62, r18 ; 0x3e 2c258: 2d 97 sbiw r28, 0x0d ; 13 2c25a: 61 96 adiw r28, 0x11 ; 17 2c25c: 8e ad ldd r24, Y+62 ; 0x3e 2c25e: 9f ad ldd r25, Y+63 ; 0x3f 2c260: 61 97 sbiw r28, 0x11 ; 17 2c262: 2f 96 adiw r28, 0x0f ; 15 2c264: 9f af std Y+63, r25 ; 0x3f 2c266: 8e af std Y+62, r24 ; 0x3e 2c268: 2f 97 sbiw r28, 0x0f ; 15 2c26a: 71 2c mov r7, r1 2c26c: 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; 2c26e: e0 e1 ldi r30, 0x10 ; 16 2c270: f7 e2 ldi r31, 0x27 ; 39 2c272: 27 96 adiw r28, 0x07 ; 7 2c274: ff af std Y+63, r31 ; 0x3f 2c276: ee af std Y+62, r30 ; 0x3e 2c278: 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); 2c27a: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2c27e: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 2c282: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 2c286: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 2c28a: 84 01 movw r16, r8 2c28c: 08 1b sub r16, r24 2c28e: 19 0b sbc r17, r25 2c290: 17 ff sbrs r17, 7 2c292: 03 c0 rjmp .+6 ; 0x2c29a 2c294: 11 95 neg r17 2c296: 01 95 neg r16 2c298: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 2c29a: 98 01 movw r18, r16 2c29c: 35 95 asr r19 2c29e: 27 95 ror r18 2c2a0: 65 96 adiw r28, 0x15 ; 21 2c2a2: 3f af std Y+63, r19 ; 0x3f 2c2a4: 2e af std Y+62, r18 ; 0x3e 2c2a6: 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; 2c2a8: 1c 9b sbis 0x03, 4 ; 3 2c2aa: 33 c0 rjmp .+102 ; 0x2c312 2c2ac: 45 e0 ldi r20, 0x05 ; 5 2c2ae: 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); 2c2b0: 65 96 adiw r28, 0x15 ; 21 2c2b2: ae ac ldd r10, Y+62 ; 0x3e 2c2b4: bf ac ldd r11, Y+63 ; 0x3f 2c2b6: 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); 2c2b8: 63 2d mov r22, r3 2c2ba: 82 2d mov r24, r2 2c2bc: 0e 94 61 d3 call 0x1a6c2 ; 0x1a6c2 while (steps--){ 2c2c0: 31 e0 ldi r19, 0x01 ; 1 2c2c2: a3 1a sub r10, r19 2c2c4: b1 08 sbc r11, r1 2c2c6: 40 f1 brcs .+80 ; 0x2c318 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2c2c8: 28 ec ldi r18, 0xC8 ; 200 2c2ca: 30 e0 ldi r19, 0x00 ; 0 2c2cc: a7 01 movw r20, r14 2c2ce: 68 ee ldi r22, 0xE8 ; 232 2c2d0: 73 e0 ldi r23, 0x03 ; 3 2c2d2: 82 2d mov r24, r2 2c2d4: 0e 94 30 d2 call 0x1a460 ; 0x1a460 update_position_1_step(axes, dir); 2c2d8: 63 2d mov r22, r3 2c2da: 82 2d mov r24, r2 2c2dc: 0e 94 7a d3 call 0x1a6f4 ; 0x1a6f4 2c2e0: ef cf rjmp .-34 ; 0x2c2c0 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){ 2c2e2: 33 24 eor r3, r3 2c2e4: 33 94 inc r3 2c2e6: 11 cf rjmp .-478 ; 0x2c10a 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)); 2c2e8: 62 e0 ldi r22, 0x02 ; 2 2c2ea: 57 ff sbrs r21, 7 2c2ec: 03 c0 rjmp .+6 ; 0x2c2f4 2c2ee: 51 95 neg r21 2c2f0: 41 95 neg r20 2c2f2: 51 09 sbc r21, r1 2c2f4: 82 e0 ldi r24, 0x02 ; 2 2c2f6: 0f 94 b6 5e call 0x2bd6c ; 0x2bd6c 2c2fa: 49 cf rjmp .-366 ; 0x2c18e // 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)); 2c2fc: 64 e0 ldi r22, 0x04 ; 4 2c2fe: a3 01 movw r20, r6 2c300: 77 fe sbrs r7, 7 2c302: 03 c0 rjmp .+6 ; 0x2c30a 2c304: 51 95 neg r21 2c306: 41 95 neg r20 2c308: 51 09 sbc r21, r1 2c30a: 84 e0 ldi r24, 0x04 ; 4 2c30c: 0f 94 b6 5e call 0x2bd6c ; 0x2bd6c 2c310: 4f cf rjmp .-354 ; 0x2c1b0 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; 2c312: 22 24 eor r2, r2 2c314: 23 94 inc r2 2c316: cc cf rjmp .-104 ; 0x2c2b0 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); 2c318: 65 96 adiw r28, 0x15 ; 21 2c31a: ee ad ldd r30, Y+62 ; 0x3e 2c31c: ff ad ldd r31, Y+63 ; 0x3f 2c31e: 65 97 sbiw r28, 0x15 ; 21 2c320: 0e 1b sub r16, r30 2c322: 1f 0b sbc r17, r31 2c324: 23 96 adiw r28, 0x03 ; 3 2c326: 1f af std Y+63, r17 ; 0x3f 2c328: 0e af std Y+62, r16 ; 0x3e 2c32a: 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); 2c32c: 63 2d mov r22, r3 2c32e: 82 2d mov r24, r2 2c330: 0e 94 61 d3 call 0x1a6c2 ; 0x1a6c2 while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 2c334: 9e 01 movw r18, r28 2c336: 2f 5b subi r18, 0xBF ; 191 2c338: 3f 4f sbci r19, 0xFF ; 255 2c33a: a7 01 movw r20, r14 2c33c: 68 ee ldi r22, 0xE8 ; 232 2c33e: 73 e0 ldi r23, 0x03 ; 3 2c340: 82 2d mov r24, r2 2c342: 0e 94 d7 d2 call 0x1a5ae ; 0x1a5ae 2c346: 88 23 and r24, r24 2c348: 29 f0 breq .+10 ; 0x2c354 update_position_1_step(axes, dir); 2c34a: 63 2d mov r22, r3 2c34c: 82 2d mov r24, r2 2c34e: 0e 94 7a d3 call 0x1a6f4 ; 0x1a6f4 2c352: f0 cf rjmp .-32 ; 0x2c334 z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 2c354: 60 e0 ldi r22, 0x00 ; 0 2c356: 82 e0 ldi r24, 0x02 ; 2 2c358: 0f 94 c3 25 call 0x24b86 ; 0x24b86 /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 2c35c: 20 e1 ldi r18, 0x10 ; 16 2c35e: 37 e2 ldi r19, 0x27 ; 39 2c360: 27 96 adiw r28, 0x07 ; 7 2c362: 3f af std Y+63, r19 ; 0x3f 2c364: 2e af std Y+62, r18 ; 0x3e 2c366: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2c368: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c36c: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c370: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c374: 30 91 57 06 lds r19, 0x0657 ; 0x800657 2c378: 00 5a subi r16, 0xA0 ; 160 2c37a: 16 4f sbci r17, 0xF6 ; 246 2c37c: 17 ff sbrs r17, 7 2c37e: 02 c0 rjmp .+4 ; 0x2c384 2c380: 0f 5f subi r16, 0xFF ; 255 2c382: 1f 4f sbci r17, 0xFF ; 255 2c384: 15 95 asr r17 2c386: 07 95 ror r16 2c388: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c38c: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c390: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c394: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c398: 80 17 cp r24, r16 2c39a: 91 07 cpc r25, r17 2c39c: f4 f4 brge .+60 ; 0x2c3da if (!_PINDA){ 2c39e: 1c 9b sbis 0x03, 4 ; 3 2c3a0: 1c c0 rjmp .+56 ; 0x2c3da break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2c3a2: 28 ec ldi r18, 0xC8 ; 200 2c3a4: 30 e0 ldi r19, 0x00 ; 0 2c3a6: a7 01 movw r20, r14 2c3a8: 68 ee ldi r22, 0xE8 ; 232 2c3aa: 73 e0 ldi r23, 0x03 ; 3 2c3ac: 84 e0 ldi r24, 0x04 ; 4 2c3ae: 0e 94 30 d2 call 0x1a460 ; 0x1a460 /// 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_){ 2c3b2: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c3b6: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c3ba: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c3be: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c3c2: 01 96 adiw r24, 0x01 ; 1 2c3c4: a1 1d adc r26, r1 2c3c6: b1 1d adc r27, r1 2c3c8: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c3cc: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c3d0: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c3d4: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c3d8: d7 cf rjmp .-82 ; 0x2c388 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 2c3da: 1c 9b sbis 0x03, 4 ; 3 2c3dc: 3f c0 rjmp .+126 ; 0x2c45c steps_to_go = MAX(0, max_z - _Z); 2c3de: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c3e2: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c3e6: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c3ea: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c3ee: e0 e6 ldi r30, 0x60 ; 96 2c3f0: f9 e0 ldi r31, 0x09 ; 9 2c3f2: e8 1b sub r30, r24 2c3f4: f9 0b sbc r31, r25 2c3f6: cf 01 movw r24, r30 2c3f8: f7 ff sbrs r31, 7 2c3fa: 02 c0 rjmp .+4 ; 0x2c400 2c3fc: 90 e0 ldi r25, 0x00 ; 0 2c3fe: 80 e0 ldi r24, 0x00 ; 0 2c400: 25 96 adiw r28, 0x05 ; 5 2c402: 9f af std Y+63, r25 ; 0x3f 2c404: 8e af std Y+62, r24 ; 0x3e 2c406: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 2c408: 1c 9b sbis 0x03, 4 ; 3 2c40a: 28 c0 rjmp .+80 ; 0x2c45c 2c40c: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c410: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c414: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c418: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c41c: 80 36 cpi r24, 0x60 ; 96 2c41e: 99 40 sbci r25, 0x09 ; 9 2c420: ec f4 brge .+58 ; 0x2c45c go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2c422: 9e 01 movw r18, r28 2c424: 2d 5b subi r18, 0xBD ; 189 2c426: 3f 4f sbci r19, 0xFF ; 255 2c428: a7 01 movw r20, r14 2c42a: 68 ee ldi r22, 0xE8 ; 232 2c42c: 73 e0 ldi r23, 0x03 ; 3 2c42e: 84 e0 ldi r24, 0x04 ; 4 2c430: 0e 94 d7 d2 call 0x1a5ae ; 0x1a5ae ++_Z_; 2c434: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c438: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c43c: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c440: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c444: 01 96 adiw r24, 0x01 ; 1 2c446: a1 1d adc r26, r1 2c448: b1 1d adc r27, r1 2c44a: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c44e: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c452: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c456: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c45a: d6 cf rjmp .-84 ; 0x2c408 /// \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); 2c45c: 60 e0 ldi r22, 0x00 ; 0 2c45e: 84 e0 ldi r24, 0x04 ; 4 2c460: 0e 94 61 d3 call 0x1a6c2 ; 0x1a6c2 while (delay_us < MAX_DELAY){ 2c464: f7 01 movw r30, r14 2c466: 20 81 ld r18, Z 2c468: 31 81 ldd r19, Z+1 ; 0x01 2c46a: 20 31 cpi r18, 0x10 ; 16 2c46c: f7 e2 ldi r31, 0x27 ; 39 2c46e: 3f 07 cpc r19, r31 2c470: 58 f4 brcc .+22 ; 0x2c488 accelerate_1_step(axes, -dec, delay_us, delay_us); 2c472: a7 01 movw r20, r14 2c474: 68 e1 ldi r22, 0x18 ; 24 2c476: 7c ef ldi r23, 0xFC ; 252 2c478: 84 e0 ldi r24, 0x04 ; 4 2c47a: 0e 94 30 d2 call 0x1a460 ; 0x1a460 update_position_1_step(axes, dir); 2c47e: 60 e0 ldi r22, 0x00 ; 0 2c480: 84 e0 ldi r24, 0x04 ; 4 2c482: 0e 94 7a d3 call 0x1a6f4 ; 0x1a6f4 2c486: ee cf rjmp .-36 ; 0x2c464 } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 2c488: 61 e0 ldi r22, 0x01 ; 1 2c48a: 82 e0 ldi r24, 0x02 ; 2 2c48c: 0f 94 c3 25 call 0x24b86 ; 0x24b86 /// speed up current_delay_us = MAX_DELAY; 2c490: 20 e1 ldi r18, 0x10 ; 16 2c492: 37 e2 ldi r19, 0x27 ; 39 2c494: f7 01 movw r30, r14 2c496: 31 83 std Z+1, r19 ; 0x01 2c498: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2c49a: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c49e: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c4a2: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c4a6: 30 91 57 06 lds r19, 0x0657 ; 0x800657 2c4aa: 0c 0d add r16, r12 2c4ac: 1d 1d adc r17, r13 2c4ae: 17 ff sbrs r17, 7 2c4b0: 02 c0 rjmp .+4 ; 0x2c4b6 2c4b2: 0f 5f subi r16, 0xFF ; 255 2c4b4: 1f 4f sbci r17, 0xFF ; 255 2c4b6: 15 95 asr r17 2c4b8: 07 95 ror r16 2c4ba: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c4be: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c4c2: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c4c6: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c4ca: 08 17 cp r16, r24 2c4cc: 19 07 cpc r17, r25 2c4ce: 0c f0 brlt .+2 ; 0x2c4d2 2c4d0: d9 c0 rjmp .+434 ; 0x2c684 if (_PINDA){ 2c4d2: 1c 9b sbis 0x03, 4 ; 3 2c4d4: bb c0 rjmp .+374 ; 0x2c64c z_trig = _Z; 2c4d6: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c4da: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c4de: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c4e2: 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){ 2c4e6: 1c 99 sbic 0x03, 4 ; 3 2c4e8: 28 c0 rjmp .+80 ; 0x2c53a steps_to_go = MAX(0, _Z - min_z); 2c4ea: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c4ee: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c4f2: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c4f6: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c4fa: 8c 19 sub r24, r12 2c4fc: 9d 09 sbc r25, r13 2c4fe: 97 ff sbrs r25, 7 2c500: 02 c0 rjmp .+4 ; 0x2c506 2c502: 90 e0 ldi r25, 0x00 ; 0 2c504: 80 e0 ldi r24, 0x00 ; 0 2c506: 25 96 adiw r28, 0x05 ; 5 2c508: 9f af std Y+63, r25 ; 0x3f 2c50a: 8e af std Y+62, r24 ; 0x3e 2c50c: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 2c50e: 1c 99 sbic 0x03, 4 ; 3 2c510: 0c c0 rjmp .+24 ; 0x2c52a 2c512: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c516: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c51a: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c51e: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c522: c8 16 cp r12, r24 2c524: d9 06 cpc r13, r25 2c526: 0c f4 brge .+2 ; 0x2c52a 2c528: af c0 rjmp .+350 ; 0x2c688 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 2c52a: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c52e: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c532: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c536: 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){ 2c53a: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c53e: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c542: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c546: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c54a: c8 16 cp r12, r24 2c54c: d9 06 cpc r13, r25 2c54e: 3c f4 brge .+14 ; 0x2c55e 2c550: f7 01 movw r30, r14 2c552: 80 81 ld r24, Z 2c554: 91 81 ldd r25, Z+1 ; 0x01 2c556: 80 31 cpi r24, 0x10 ; 16 2c558: 97 42 sbci r25, 0x27 ; 39 2c55a: 08 f4 brcc .+2 ; 0x2c55e 2c55c: b2 c0 rjmp .+356 ; 0x2c6c2 2c55e: 0c 19 sub r16, r12 2c560: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 2c562: 31 10 cpse r3, r1 2c564: ca c0 rjmp .+404 ; 0x2c6fa line_buffer[c] = (uint16_t)(z_trig - min_z); 2c566: f3 01 movw r30, r6 2c568: ee 0f add r30, r30 2c56a: ff 1f adc r31, r31 2c56c: 21 e0 ldi r18, 0x01 ; 1 2c56e: 30 e0 ldi r19, 0x00 ; 0 2c570: 2c 0f add r18, r28 2c572: 3d 1f adc r19, r29 2c574: e2 0f add r30, r18 2c576: f3 1f adc r31, r19 2c578: 11 83 std Z+1, r17 ; 0x01 2c57a: 00 83 st Z, r16 2c57c: ff ef ldi r31, 0xFF ; 255 2c57e: 6f 1a sub r6, r31 2c580: 7f 0a sbc r7, r31 2c582: 67 96 adiw r28, 0x17 ; 23 2c584: 2e ad ldd r18, Y+62 ; 0x3e 2c586: 3f ad ldd r19, Y+63 ; 0x3f 2c588: 67 97 sbiw r28, 0x17 ; 23 2c58a: 82 0e add r8, r18 2c58c: 93 1e adc r9, r19 2c58e: 2d 96 adiw r28, 0x0d ; 13 2c590: 8e ad ldd r24, Y+62 ; 0x3e 2c592: 9f ad ldd r25, Y+63 ; 0x3f 2c594: 2d 97 sbiw r28, 0x0d ; 13 2c596: 02 97 sbiw r24, 0x02 ; 2 2c598: 2d 96 adiw r28, 0x0d ; 13 2c59a: 9f af std Y+63, r25 ; 0x3f 2c59c: 8e af std Y+62, r24 ; 0x3e 2c59e: 2d 97 sbiw r28, 0x0d ; 13 2c5a0: 2f 96 adiw r28, 0x0f ; 15 2c5a2: ee ad ldd r30, Y+62 ; 0x3e 2c5a4: ff ad ldd r31, Y+63 ; 0x3f 2c5a6: 2f 97 sbiw r28, 0x0f ; 15 2c5a8: 31 97 sbiw r30, 0x01 ; 1 2c5aa: 2f 96 adiw r28, 0x0f ; 15 2c5ac: ff af std Y+63, r31 ; 0x3f 2c5ae: ee af std Y+62, r30 ; 0x3e 2c5b0: 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 2c5b2: f0 e2 ldi r31, 0x20 ; 32 2c5b4: 6f 16 cp r6, r31 2c5b6: 71 04 cpc r7, r1 2c5b8: 09 f0 breq .+2 ; 0x2c5bc 2c5ba: 59 ce rjmp .-846 ; 0x2c26e 2c5bc: 21 e0 ldi r18, 0x01 ; 1 2c5be: 42 1a sub r4, r18 2c5c0: 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){ 2c5c2: 31 e0 ldi r19, 0x01 ; 1 2c5c4: 33 12 cpse r3, r19 2c5c6: 8d ce rjmp .-742 ; 0x2c2e2 2c5c8: 61 96 adiw r28, 0x11 ; 17 2c5ca: 8e ad ldd r24, Y+62 ; 0x3e 2c5cc: 9f ad ldd r25, Y+63 ; 0x3f 2c5ce: 61 97 sbiw r28, 0x11 ; 17 2c5d0: 80 96 adiw r24, 0x20 ; 32 2c5d2: 61 96 adiw r28, 0x11 ; 17 2c5d4: 9f af std Y+63, r25 ; 0x3f 2c5d6: 8e af std Y+62, r24 ; 0x3e 2c5d8: 61 97 sbiw r28, 0x11 ; 17 2c5da: 2b 96 adiw r28, 0x0b ; 11 2c5dc: ee ad ldd r30, Y+62 ; 0x3e 2c5de: ff ad ldd r31, Y+63 ; 0x3f 2c5e0: 2b 97 sbiw r28, 0x0b ; 11 2c5e2: e0 5c subi r30, 0xC0 ; 192 2c5e4: ff 4f sbci r31, 0xFF ; 255 2c5e6: 2b 96 adiw r28, 0x0b ; 11 2c5e8: ff af std Y+63, r31 ; 0x3f 2c5ea: ee af std Y+62, r30 ; 0x3e 2c5ec: 2b 97 sbiw r28, 0x0b ; 11 2c5ee: 29 96 adiw r28, 0x09 ; 9 2c5f0: 2e ad ldd r18, Y+62 ; 0x3e 2c5f2: 3f ad ldd r19, Y+63 ; 0x3f 2c5f4: 29 97 sbiw r28, 0x09 ; 9 2c5f6: 22 50 subi r18, 0x02 ; 2 2c5f8: 31 09 sbc r19, r1 2c5fa: 29 96 adiw r28, 0x09 ; 9 2c5fc: 3f af std Y+63, r19 ; 0x3f 2c5fe: 2e af std Y+62, r18 ; 0x3e 2c600: 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 2c602: 23 2b or r18, r19 2c604: 09 f0 breq .+2 ; 0x2c608 2c606: 72 cd rjmp .-1308 ; 0x2c0ec 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); 2c608: 8c e9 ldi r24, 0x9C ; 156 2c60a: 9d e9 ldi r25, 0x9D ; 157 2c60c: 9f 93 push r25 2c60e: 8f 93 push r24 2c610: 0f 94 00 a3 call 0x34600 ; 0x34600 2c614: 0f 90 pop r0 2c616: 0f 90 pop r0 } 2c618: c6 5a subi r28, 0xA6 ; 166 2c61a: df 4f sbci r29, 0xFF ; 255 2c61c: 0f b6 in r0, 0x3f ; 63 2c61e: f8 94 cli 2c620: de bf out 0x3e, r29 ; 62 2c622: 0f be out 0x3f, r0 ; 63 2c624: cd bf out 0x3d, r28 ; 61 2c626: df 91 pop r29 2c628: cf 91 pop r28 2c62a: 1f 91 pop r17 2c62c: 0f 91 pop r16 2c62e: ff 90 pop r15 2c630: ef 90 pop r14 2c632: df 90 pop r13 2c634: cf 90 pop r12 2c636: bf 90 pop r11 2c638: af 90 pop r10 2c63a: 9f 90 pop r9 2c63c: 8f 90 pop r8 2c63e: 7f 90 pop r7 2c640: 6f 90 pop r6 2c642: 5f 90 pop r5 2c644: 4f 90 pop r4 2c646: 3f 90 pop r3 2c648: 2f 90 pop r2 2c64a: 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); 2c64c: 28 ec ldi r18, 0xC8 ; 200 2c64e: 30 e0 ldi r19, 0x00 ; 0 2c650: a7 01 movw r20, r14 2c652: 68 ee ldi r22, 0xE8 ; 232 2c654: 73 e0 ldi r23, 0x03 ; 3 2c656: 84 e0 ldi r24, 0x04 ; 4 2c658: 0e 94 30 d2 call 0x1a460 ; 0x1a460 /// 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_){ 2c65c: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c660: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c664: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c668: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c66c: 01 97 sbiw r24, 0x01 ; 1 2c66e: a1 09 sbc r26, r1 2c670: b1 09 sbc r27, r1 2c672: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c676: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c67a: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c67e: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c682: 1b cf rjmp .-458 ; 0x2c4ba 2c684: 86 01 movw r16, r12 2c686: 2f cf rjmp .-418 ; 0x2c4e6 } /// 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); 2c688: 9e 01 movw r18, r28 2c68a: 2d 5b subi r18, 0xBD ; 189 2c68c: 3f 4f sbci r19, 0xFF ; 255 2c68e: a7 01 movw r20, r14 2c690: 68 ee ldi r22, 0xE8 ; 232 2c692: 73 e0 ldi r23, 0x03 ; 3 2c694: 84 e0 ldi r24, 0x04 ; 4 2c696: 0e 94 d7 d2 call 0x1a5ae ; 0x1a5ae --_Z_; 2c69a: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c69e: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c6a2: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c6a6: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c6aa: 01 97 sbiw r24, 0x01 ; 1 2c6ac: a1 09 sbc r26, r1 2c6ae: b1 09 sbc r27, r1 2c6b0: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c6b4: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c6b8: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c6bc: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c6c0: 26 cf rjmp .-436 ; 0x2c50e } 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); 2c6c2: 28 ec ldi r18, 0xC8 ; 200 2c6c4: 30 e0 ldi r19, 0x00 ; 0 2c6c6: a7 01 movw r20, r14 2c6c8: 68 e1 ldi r22, 0x18 ; 24 2c6ca: 7c ef ldi r23, 0xFC ; 252 2c6cc: 84 e0 ldi r24, 0x04 ; 4 2c6ce: 0e 94 30 d2 call 0x1a460 ; 0x1a460 --_Z_; 2c6d2: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c6d6: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c6da: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c6de: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c6e2: 01 97 sbiw r24, 0x01 ; 1 2c6e4: a1 09 sbc r26, r1 2c6e6: b1 09 sbc r27, r1 2c6e8: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c6ec: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c6f0: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c6f4: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c6f8: 20 cf rjmp .-448 ; 0x2c53a 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); 2c6fa: 2d 96 adiw r28, 0x0d ; 13 2c6fc: ee ad ldd r30, Y+62 ; 0x3e 2c6fe: ff ad ldd r31, Y+63 ; 0x3f 2c700: 2d 97 sbiw r28, 0x0d ; 13 2c702: 86 ad ldd r24, Z+62 ; 0x3e 2c704: 97 ad ldd r25, Z+63 ; 0x3f 2c706: 01 2e mov r0, r17 2c708: 00 0c add r0, r0 2c70a: 22 0b sbc r18, r18 2c70c: 33 0b sbc r19, r19 2c70e: 08 0f add r16, r24 2c710: 19 1f adc r17, r25 2c712: 21 1d adc r18, r1 2c714: 31 1d adc r19, r1 2c716: 36 95 lsr r19 2c718: 27 95 ror r18 2c71a: 17 95 ror r17 2c71c: 07 95 ror r16 2c71e: 0f 3f cpi r16, 0xFF ; 255 2c720: 11 05 cpc r17, r1 2c722: 21 05 cpc r18, r1 2c724: 31 05 cpc r19, r1 2c726: 29 f0 breq .+10 ; 0x2c732 2c728: 20 f0 brcs .+8 ; 0x2c732 2c72a: 0f ef ldi r16, 0xFF ; 255 2c72c: 10 e0 ldi r17, 0x00 ; 0 2c72e: 20 e0 ldi r18, 0x00 ; 0 2c730: 30 e0 ldi r19, 0x00 ; 0 2c732: 2f 96 adiw r28, 0x0f ; 15 2c734: ee ad ldd r30, Y+62 ; 0x3e 2c736: ff ad ldd r31, Y+63 ; 0x3f 2c738: 2f 97 sbiw r28, 0x0f ; 15 2c73a: 07 8f std Z+31, r16 ; 0x1f 2c73c: 1f cf rjmp .-450 ; 0x2c57c 0002c73e : 2c73e: ef 92 push r14 2c740: ff 92 push r15 2c742: 0f 93 push r16 2c744: 1f 93 push r17 2c746: cf 93 push r28 2c748: df 93 push r29 2c74a: cd b7 in r28, 0x3d ; 61 2c74c: de b7 in r29, 0x3e ; 62 2c74e: 2f 97 sbiw r28, 0x0f ; 15 2c750: 0f b6 in r0, 0x3f ; 63 2c752: f8 94 cli 2c754: de bf out 0x3e, r29 ; 62 2c756: 0f be out 0x3f, r0 ; 63 2c758: cd bf out 0x3d, r28 ; 61 2c75a: 10 92 90 12 sts 0x1290, r1 ; 0x801290 2c75e: 02 e9 ldi r16, 0x92 ; 146 2c760: 12 e1 ldi r17, 0x12 ; 18 2c762: ee 24 eor r14, r14 2c764: e3 94 inc r14 2c766: f1 2c mov r15, r1 2c768: d8 01 movw r26, r16 2c76a: 11 96 adiw r26, 0x01 ; 1 2c76c: fc 92 st X, r15 2c76e: ee 92 st -X, r14 2c770: 12 96 adiw r26, 0x02 ; 2 2c772: 1c 92 st X, r1 2c774: 12 97 sbiw r26, 0x02 ; 2 2c776: 82 e8 ldi r24, 0x82 ; 130 2c778: 13 96 adiw r26, 0x03 ; 3 2c77a: 8c 93 st X, r24 2c77c: 40 e0 ldi r20, 0x00 ; 0 2c77e: 60 e0 ldi r22, 0x00 ; 0 2c780: 87 e9 ldi r24, 0x97 ; 151 2c782: 92 e1 ldi r25, 0x12 ; 18 2c784: 0f 94 2b 4e call 0x29c56 ; 0x29c56 2c788: 40 e0 ldi r20, 0x00 ; 0 2c78a: 60 e0 ldi r22, 0x00 ; 0 2c78c: 8c e9 ldi r24, 0x9C ; 156 2c78e: 92 e1 ldi r25, 0x12 ; 18 2c790: 0f 94 2b 4e call 0x29c56 ; 0x29c56 2c794: f8 01 movw r30, r16 2c796: 17 86 std Z+15, r1 ; 0x0f 2c798: 10 8a std Z+16, r1 ; 0x10 2c79a: 11 8a std Z+17, r1 ; 0x11 2c79c: 12 8a std Z+18, r1 ; 0x12 2c79e: 13 8a std Z+19, r1 ; 0x13 2c7a0: 8a e0 ldi r24, 0x0A ; 10 2c7a2: 84 8b std Z+20, r24 ; 0x14 2c7a4: 40 e0 ldi r20, 0x00 ; 0 2c7a6: 60 e0 ldi r22, 0x00 ; 0 2c7a8: ce 01 movw r24, r28 2c7aa: 01 96 adiw r24, 0x01 ; 1 2c7ac: 0f 94 2b 4e call 0x29c56 ; 0x29c56 2c7b0: 85 e0 ldi r24, 0x05 ; 5 2c7b2: fe 01 movw r30, r28 2c7b4: 31 96 adiw r30, 0x01 ; 1 2c7b6: de 01 movw r26, r28 2c7b8: 16 96 adiw r26, 0x06 ; 6 2c7ba: 01 90 ld r0, Z+ 2c7bc: 0d 92 st X+, r0 2c7be: 8a 95 dec r24 2c7c0: e1 f7 brne .-8 ; 0x2c7ba 2c7c2: 85 e0 ldi r24, 0x05 ; 5 2c7c4: fe 01 movw r30, r28 2c7c6: 36 96 adiw r30, 0x06 ; 6 2c7c8: a7 ea ldi r26, 0xA7 ; 167 2c7ca: b2 e1 ldi r27, 0x12 ; 18 2c7cc: 01 90 ld r0, Z+ 2c7ce: 0d 92 st X+, r0 2c7d0: 8a 95 dec r24 2c7d2: e1 f7 brne .-8 ; 0x2c7cc 2c7d4: d8 01 movw r26, r16 2c7d6: 5a 96 adiw r26, 0x1a ; 26 2c7d8: 1c 92 st X, r1 2c7da: 5a 97 sbiw r26, 0x1a ; 26 2c7dc: 5c 96 adiw r26, 0x1c ; 28 2c7de: 1c 92 st X, r1 2c7e0: 1e 92 st -X, r1 2c7e2: 5b 97 sbiw r26, 0x1b ; 27 2c7e4: 87 ea ldi r24, 0xA7 ; 167 2c7e6: 92 e1 ldi r25, 0x12 ; 18 2c7e8: 0f 94 1a 4e call 0x29c34 ; 0x29c34 2c7ec: f8 01 movw r30, r16 2c7ee: 81 8f std Z+25, r24 ; 0x19 2c7f0: 15 8e std Z+29, r1 ; 0x1d 2c7f2: 16 8e std Z+30, r1 ; 0x1e 2c7f4: 40 e0 ldi r20, 0x00 ; 0 2c7f6: 60 e0 ldi r22, 0x00 ; 0 2c7f8: 81 eb ldi r24, 0xB1 ; 177 2c7fa: 92 e1 ldi r25, 0x12 ; 18 2c7fc: 0f 94 2b 4e call 0x29c56 ; 0x29c56 2c800: d8 01 movw r26, r16 2c802: 94 96 adiw r26, 0x24 ; 36 2c804: 1c 92 st X, r1 2c806: 40 e0 ldi r20, 0x00 ; 0 2c808: 60 e0 ldi r22, 0x00 ; 0 2c80a: ce 01 movw r24, r28 2c80c: 0b 96 adiw r24, 0x0b ; 11 2c80e: 0f 94 2b 4e call 0x29c56 ; 0x29c56 2c812: 85 e0 ldi r24, 0x05 ; 5 2c814: fe 01 movw r30, r28 2c816: 3b 96 adiw r30, 0x0b ; 11 2c818: de 01 movw r26, r28 2c81a: 11 96 adiw r26, 0x01 ; 1 2c81c: 01 90 ld r0, Z+ 2c81e: 0d 92 st X+, r0 2c820: 8a 95 dec r24 2c822: e1 f7 brne .-8 ; 0x2c81c 2c824: 85 e0 ldi r24, 0x05 ; 5 2c826: fe 01 movw r30, r28 2c828: 31 96 adiw r30, 0x01 ; 1 2c82a: a7 eb ldi r26, 0xB7 ; 183 2c82c: b2 e1 ldi r27, 0x12 ; 18 2c82e: 01 90 ld r0, Z+ 2c830: 0d 92 st X+, r0 2c832: 8a 95 dec r24 2c834: e1 f7 brne .-8 ; 0x2c82e 2c836: f8 01 movw r30, r16 2c838: 12 a6 std Z+42, r1 ; 0x2a 2c83a: 14 a6 std Z+44, r1 ; 0x2c 2c83c: 13 a6 std Z+43, r1 ; 0x2b 2c83e: 87 eb ldi r24, 0xB7 ; 183 2c840: 92 e1 ldi r25, 0x12 ; 18 2c842: 0f 94 1a 4e call 0x29c34 ; 0x29c34 2c846: d8 01 movw r26, r16 2c848: 99 96 adiw r26, 0x29 ; 41 2c84a: 8c 93 st X, r24 2c84c: 99 97 sbiw r26, 0x29 ; 41 2c84e: dd 96 adiw r26, 0x3d ; 61 2c850: 1c 92 st X, r1 2c852: dd 97 sbiw r26, 0x3d ; 61 2c854: 81 e9 ldi r24, 0x91 ; 145 2c856: 92 e1 ldi r25, 0x12 ; 18 2c858: df 96 adiw r26, 0x3f ; 63 2c85a: 9c 93 st X, r25 2c85c: 8e 93 st -X, r24 2c85e: de 97 sbiw r26, 0x3e ; 62 2c860: f0 92 d3 12 sts 0x12D3, r15 ; 0x8012d3 2c864: e0 92 d2 12 sts 0x12D2, r14 ; 0x8012d2 2c868: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 2c86c: 1f ef ldi r17, 0xFF ; 255 2c86e: 10 93 d5 12 sts 0x12D5, r17 ; 0x8012d5 2c872: 0f 94 6e 4e call 0x29cdc ; 0x29cdc 2c876: 80 93 d6 12 sts 0x12D6, r24 ; 0x8012d6 2c87a: 10 92 d7 12 sts 0x12D7, r1 ; 0x8012d7 2c87e: 10 92 d8 12 sts 0x12D8, r1 ; 0x8012d8 2c882: 10 92 d9 12 sts 0x12D9, r1 ; 0x8012d9 2c886: 10 92 db 12 sts 0x12DB, r1 ; 0x8012db 2c88a: 10 92 da 12 sts 0x12DA, r1 ; 0x8012da 2c88e: 10 92 dd 12 sts 0x12DD, r1 ; 0x8012dd 2c892: 10 92 dc 12 sts 0x12DC, r1 ; 0x8012dc 2c896: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 2c89a: 10 92 e1 12 sts 0x12E1, r1 ; 0x8012e1 2c89e: 10 92 e2 12 sts 0x12E2, r1 ; 0x8012e2 2c8a2: 10 92 e3 12 sts 0x12E3, r1 ; 0x8012e3 2c8a6: 83 e0 ldi r24, 0x03 ; 3 2c8a8: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 2c8ac: 10 92 e7 12 sts 0x12E7, r1 ; 0x8012e7 2c8b0: 85 e1 ldi r24, 0x15 ; 21 2c8b2: 80 93 de 12 sts 0x12DE, r24 ; 0x8012de 2c8b6: 84 e1 ldi r24, 0x14 ; 20 2c8b8: 80 93 df 12 sts 0x12DF, r24 ; 0x8012df 2c8bc: 83 e6 ldi r24, 0x63 ; 99 2c8be: 80 93 e8 12 sts 0x12E8, r24 ; 0x8012e8 2c8c2: 80 93 e9 12 sts 0x12E9, r24 ; 0x8012e9 2c8c6: 10 92 ea 12 sts 0x12EA, r1 ; 0x8012ea 2c8ca: 10 92 eb 12 sts 0x12EB, r1 ; 0x8012eb 2c8ce: 10 92 ec 12 sts 0x12EC, r1 ; 0x8012ec 2c8d2: 10 92 ed 12 sts 0x12ED, r1 ; 0x8012ed 2c8d6: 10 92 ee 12 sts 0x12EE, r1 ; 0x8012ee 2c8da: 10 92 ef 12 sts 0x12EF, r1 ; 0x8012ef 2c8de: 10 92 f0 12 sts 0x12F0, r1 ; 0x8012f0 2c8e2: 10 92 f1 12 sts 0x12F1, r1 ; 0x8012f1 2c8e6: 10 92 f2 12 sts 0x12F2, r1 ; 0x8012f2 2c8ea: 10 92 f3 12 sts 0x12F3, r1 ; 0x8012f3 2c8ee: 10 92 f4 12 sts 0x12F4, r1 ; 0x8012f4 2c8f2: 10 92 f5 12 sts 0x12F5, r1 ; 0x8012f5 2c8f6: 10 92 f7 12 sts 0x12F7, r1 ; 0x8012f7 2c8fa: 10 92 f6 12 sts 0x12F6, r1 ; 0x8012f6 2c8fe: 10 92 f8 12 sts 0x12F8, r1 ; 0x8012f8 2c902: 8e e2 ldi r24, 0x2E ; 46 2c904: 90 e8 ldi r25, 0x80 ; 128 2c906: 90 93 fa 12 sts 0x12FA, r25 ; 0x8012fa 2c90a: 80 93 f9 12 sts 0x12F9, r24 ; 0x8012f9 2c90e: 10 93 fb 12 sts 0x12FB, r17 ; 0x8012fb 2c912: 10 93 fc 12 sts 0x12FC, r17 ; 0x8012fc 2c916: 10 92 fe 12 sts 0x12FE, r1 ; 0x8012fe 2c91a: 10 92 fd 12 sts 0x12FD, r1 ; 0x8012fd 2c91e: 10 93 ff 12 sts 0x12FF, r17 ; 0x8012ff 2c922: 82 e0 ldi r24, 0x02 ; 2 2c924: 80 93 00 13 sts 0x1300, r24 ; 0x801300 2c928: 10 92 01 13 sts 0x1301, r1 ; 0x801301 2c92c: 10 92 02 13 sts 0x1302, r1 ; 0x801302 2c930: 10 92 03 13 sts 0x1303, r1 ; 0x801303 2c934: 10 92 04 13 sts 0x1304, r1 ; 0x801304 2c938: 10 92 06 13 sts 0x1306, r1 ; 0x801306 2c93c: 10 92 05 13 sts 0x1305, r1 ; 0x801305 2c940: 10 92 08 13 sts 0x1308, r1 ; 0x801308 2c944: 10 92 07 13 sts 0x1307, r1 ; 0x801307 2c948: 0f 94 41 7c call 0x2f882 ; 0x2f882 2c94c: e5 ed ldi r30, 0xD5 ; 213 2c94e: f3 e1 ldi r31, 0x13 ; 19 2c950: 10 92 5d 14 sts 0x145D, r1 ; 0x80145d 2c954: 10 92 60 14 sts 0x1460, r1 ; 0x801460 2c958: 10 92 82 14 sts 0x1482, r1 ; 0x801482 2c95c: 10 92 85 14 sts 0x1485, r1 ; 0x801485 2c960: 89 e1 ldi r24, 0x19 ; 25 2c962: 80 93 44 16 sts 0x1644, r24 ; 0x801644 2c966: 10 92 47 16 sts 0x1647, r1 ; 0x801647 2c96a: 10 92 48 16 sts 0x1648, r1 ; 0x801648 2c96e: 10 92 60 16 sts 0x1660, r1 ; 0x801660 2c972: 10 92 67 16 sts 0x1667, r1 ; 0x801667 2c976: 10 92 6a 16 sts 0x166A, r1 ; 0x80166a 2c97a: 10 92 e8 16 sts 0x16E8, r1 ; 0x8016e8 2c97e: 10 92 ea 16 sts 0x16EA, r1 ; 0x8016ea 2c982: 10 92 e9 16 sts 0x16E9, r1 ; 0x8016e9 2c986: 10 92 79 15 sts 0x1579, r1 ; 0x801579 2c98a: 10 92 78 15 sts 0x1578, r1 ; 0x801578 2c98e: 10 92 e4 16 sts 0x16E4, r1 ; 0x8016e4 2c992: 10 92 e5 16 sts 0x16E5, r1 ; 0x8016e5 2c996: 10 92 e6 16 sts 0x16E6, r1 ; 0x8016e6 2c99a: 10 92 e7 16 sts 0x16E7, r1 ; 0x8016e7 2c99e: 10 92 eb 16 sts 0x16EB, r1 ; 0x8016eb 2c9a2: 10 92 ec 16 sts 0x16EC, r1 ; 0x8016ec 2c9a6: 10 92 ed 16 sts 0x16ED, r1 ; 0x8016ed 2c9aa: 10 92 ee 16 sts 0x16EE, r1 ; 0x8016ee 2c9ae: 12 82 std Z+2, r1 ; 0x02 2c9b0: 13 82 std Z+3, r1 ; 0x03 2c9b2: 10 82 st Z, r1 2c9b4: 11 82 std Z+1, r1 ; 0x01 2c9b6: 10 92 77 15 sts 0x1577, r1 ; 0x801577 2c9ba: 10 92 8a 16 sts 0x168A, r1 ; 0x80168a 2c9be: e5 ea ldi r30, 0xA5 ; 165 2c9c0: f4 e1 ldi r31, 0x14 ; 20 2c9c2: 82 ed ldi r24, 0xD2 ; 210 2c9c4: df 01 movw r26, r30 2c9c6: 1d 92 st X+, r1 2c9c8: 8a 95 dec r24 2c9ca: e9 f7 brne .-6 ; 0x2c9c6 2c9cc: 10 92 26 14 sts 0x1426, r1 ; 0x801426 2c9d0: 10 92 25 14 sts 0x1425, r1 ; 0x801425 2c9d4: 10 92 24 14 sts 0x1424, r1 ; 0x801424 2c9d8: 88 ee ldi r24, 0xE8 ; 232 2c9da: 96 e1 ldi r25, 0x16 ; 22 2c9dc: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> 2c9e0: ee ec ldi r30, 0xCE ; 206 2c9e2: f3 e1 ldi r31, 0x13 ; 19 2c9e4: 11 82 std Z+1, r1 ; 0x01 2c9e6: 12 82 std Z+2, r1 ; 0x02 2c9e8: 13 82 std Z+3, r1 ; 0x03 2c9ea: 14 82 std Z+4, r1 ; 0x04 2c9ec: 15 82 std Z+5, r1 ; 0x05 2c9ee: 16 82 std Z+6, r1 ; 0x06 2c9f0: 10 83 st Z, r17 2c9f2: e1 ef ldi r30, 0xF1 ; 241 2c9f4: f6 e1 ldi r31, 0x16 ; 22 2c9f6: 15 82 std Z+5, r1 ; 0x05 2c9f8: 17 82 std Z+7, r1 ; 0x07 2c9fa: 16 82 std Z+6, r1 ; 0x06 2c9fc: 11 86 std Z+9, r1 ; 0x09 2c9fe: 13 86 std Z+11, r1 ; 0x0b 2ca00: 12 86 std Z+10, r1 ; 0x0a 2ca02: 0f 94 01 0b call 0x21602 ; 0x21602 2ca06: 60 93 07 17 sts 0x1707, r22 ; 0x801707 2ca0a: 70 93 08 17 sts 0x1708, r23 ; 0x801708 2ca0e: 80 93 09 17 sts 0x1709, r24 ; 0x801709 2ca12: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a 2ca16: 2f 96 adiw r28, 0x0f ; 15 2ca18: 0f b6 in r0, 0x3f ; 63 2ca1a: f8 94 cli 2ca1c: de bf out 0x3e, r29 ; 62 2ca1e: 0f be out 0x3f, r0 ; 63 2ca20: cd bf out 0x3d, r28 ; 61 2ca22: df 91 pop r29 2ca24: cf 91 pop r28 2ca26: 1f 91 pop r17 2ca28: 0f 91 pop r16 2ca2a: ff 90 pop r15 2ca2c: ef 90 pop r14 2ca2e: 08 95 ret 0002ca30 : 2ca30: 42 e0 ldi r20, 0x02 ; 2 2ca32: 0e 94 a1 7a call 0xf542 ; 0xf542 } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2ca36: 0c 94 17 7b jmp 0xf62e ; 0xf62e 0002ca3a : 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; 2ca3a: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 2ca3e: 83 36 cpi r24, 0x63 ; 99 2ca40: 09 f4 brne .+2 ; 0x2ca44 2ca42: 8f ef ldi r24, 0xFF ; 255 } 2ca44: 08 95 ret 0002ca46 : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2ca46: 82 ef ldi r24, 0xF2 ; 242 2ca48: 92 ea ldi r25, 0xA2 ; 162 2ca4a: 0e 94 1f 7b call 0xf63e ; 0xf63e uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2ca4e: 60 e0 ldi r22, 0x00 ; 0 2ca50: 8c ea ldi r24, 0xAC ; 172 2ca52: 9c e0 ldi r25, 0x0C ; 12 2ca54: 0e 94 b8 78 call 0xf170 ; 0xf170 if (status == 1) { 2ca58: 81 30 cpi r24, 0x01 ; 1 2ca5a: 21 f4 brne .+8 ; 0x2ca64 SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2ca5c: 8e e5 ldi r24, 0x5E ; 94 2ca5e: 93 e6 ldi r25, 0x63 ; 99 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2ca60: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 2ca64: 88 e5 ldi r24, 0x58 ; 88 2ca66: 93 e6 ldi r25, 0x63 ; 99 2ca68: fb cf rjmp .-10 ; 0x2ca60 0002ca6a : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2ca6a: bc 01 movw r22, r24 2ca6c: 99 0f add r25, r25 2ca6e: 88 0b sbc r24, r24 2ca70: 99 0b sbc r25, r25 2ca72: 0e 94 85 7a call 0xf50a ; 0xf50a } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2ca76: 0c 94 17 7b jmp 0xf62e ; 0xf62e 0002ca7a : 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){ 2ca7a: cf 93 push r28 2ca7c: c8 2f mov r28, r24 extruder = ex; 2ca7e: 80 93 e8 12 sts 0x12E8, r24 ; 0x8012e8 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 2ca82: 84 ee ldi r24, 0xE4 ; 228 2ca84: 92 ea ldi r25, 0xA2 ; 162 2ca86: 0e 94 1f 7b call 0xf63e ; 0xf63e 2ca8a: 88 ed ldi r24, 0xD8 ; 216 2ca8c: 92 ea ldi r25, 0xA2 ; 162 2ca8e: 0e 94 1f 7b call 0xf63e ; 0xf63e 2ca92: 8e ec ldi r24, 0xCE ; 206 2ca94: 92 ea ldi r25, 0xA2 ; 162 2ca96: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN((int)ex); 2ca9a: 8c 2f mov r24, r28 2ca9c: 90 e0 ldi r25, 0x00 ; 0 } 2ca9e: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 2caa0: 0d 94 35 65 jmp 0x2ca6a ; 0x2ca6a 0002caa4 : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2caa4: 28 9a sbi 0x05, 0 ; 5 } 2caa6: 08 95 ret 0002caa8 : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2caa8: 0f 93 push r16 2caaa: 1f 93 push r17 2caac: cf 93 push r28 2caae: df 93 push r29 2cab0: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2cab2: 0f 94 01 0b call 0x21602 ; 0x21602 2cab6: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2cab8: 0f 94 f1 25 call 0x24be2 ; 0x24be2 2cabc: 8f 3f cpi r24, 0xFF ; 255 2cabe: 69 f0 breq .+26 ; 0x2cada if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2cac0: 0f 94 01 0b call 0x21602 ; 0x21602 2cac4: 60 1b sub r22, r16 2cac6: 71 0b sbc r23, r17 2cac8: 6c 17 cp r22, r28 2caca: 7d 07 cpc r23, r29 2cacc: a8 f3 brcs .-22 ; 0x2cab8 } return true; fail: return false; 2cace: 80 e0 ldi r24, 0x00 ; 0 } 2cad0: df 91 pop r29 2cad2: cf 91 pop r28 2cad4: 1f 91 pop r17 2cad6: 0f 91 pop r16 2cad8: 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; 2cada: 81 e0 ldi r24, 0x01 ; 1 2cadc: f9 cf rjmp .-14 ; 0x2cad0 0002cade : lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 2cade: 87 e6 ldi r24, 0x67 ; 103 2cae0: 96 e1 ldi r25, 0x16 ; 22 2cae2: 0f 94 db 2b call 0x257b6 ; 0x257b6 file.close(); 2cae6: 87 e6 ldi r24, 0x67 ; 103 2cae8: 96 e1 ldi r25, 0x16 ; 22 2caea: 0f 94 10 2c call 0x25820 ; 0x25820 saving = false; 2caee: e5 ed ldi r30, 0xD5 ; 213 2caf0: f3 e1 ldi r31, 0x13 ; 19 2caf2: 10 82 st Z, r1 logging = false; 2caf4: 11 82 std Z+1, r1 ; 0x01 // so one can unplug the printer and continue printing the next day. } } 2caf6: 08 95 ret 0002caf8 : //! 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) 2caf8: cf 92 push r12 2cafa: df 92 push r13 2cafc: ef 92 push r14 2cafe: ff 92 push r15 2cb00: 0f 93 push r16 2cb02: 1f 93 push r17 2cb04: cf 93 push r28 2cb06: df 93 push r29 { if (saved_printing) return; 2cb08: 20 91 73 12 lds r18, 0x1273 ; 0x801273 2cb0c: 21 11 cpse r18, r1 2cb0e: d9 c0 rjmp .+434 ; 0x2ccc2 2cb10: 09 2f mov r16, r25 2cb12: 18 2f mov r17, r24 2cb14: eb 01 movw r28, r22 cli(); 2cb16: f8 94 cli void save_print_file_state() { uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { 2cb18: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 2cb1c: 88 23 and r24, r24 2cb1e: 09 f4 brne .+2 ; 0x2cb22 2cb20: d9 c0 rjmp .+434 ; 0x2ccd4 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue 2cb22: 80 91 49 12 lds r24, 0x1249 ; 0x801249 2cb26: 90 91 4a 12 lds r25, 0x124A ; 0x80124a 2cb2a: a0 91 4b 12 lds r26, 0x124B ; 0x80124b 2cb2e: b0 91 4c 12 lds r27, 0x124C ; 0x80124c 2cb32: 80 93 45 12 sts 0x1245, r24 ; 0x801245 2cb36: 90 93 46 12 sts 0x1246, r25 ; 0x801246 2cb3a: a0 93 47 12 sts 0x1247, r26 ; 0x801247 2cb3e: b0 93 48 12 sts 0x1248, r27 ; 0x801248 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner 2cb42: 0f 94 9d 39 call 0x2733a ; 0x2733a saved_sdpos -= sdlen_planner; 2cb46: c0 90 45 12 lds r12, 0x1245 ; 0x801245 2cb4a: d0 90 46 12 lds r13, 0x1246 ; 0x801246 2cb4e: e0 90 47 12 lds r14, 0x1247 ; 0x801247 2cb52: f0 90 48 12 lds r15, 0x1248 ; 0x801248 2cb56: c8 1a sub r12, r24 2cb58: d9 0a sbc r13, r25 2cb5a: e1 08 sbc r14, r1 2cb5c: f1 08 sbc r15, r1 2cb5e: c0 92 45 12 sts 0x1245, r12 ; 0x801245 2cb62: d0 92 46 12 sts 0x1246, r13 ; 0x801246 2cb66: e0 92 47 12 sts 0x1247, r14 ; 0x801247 2cb6a: f0 92 48 12 sts 0x1248, r15 ; 0x801248 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue 2cb6e: 0e 94 5e 79 call 0xf2bc ; 0xf2bc saved_sdpos -= sdlen_cmdqueue; 2cb72: c8 1a sub r12, r24 2cb74: d9 0a sbc r13, r25 2cb76: e1 08 sbc r14, r1 2cb78: f1 08 sbc r15, r1 2cb7a: c0 92 45 12 sts 0x1245, r12 ; 0x801245 2cb7e: d0 92 46 12 sts 0x1246, r13 ; 0x801246 2cb82: e0 92 47 12 sts 0x1247, r14 ; 0x801247 2cb86: f0 92 48 12 sts 0x1248, r15 ; 0x801248 saved_printing_type = PowerPanic::PRINT_TYPE_SD; 2cb8a: 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; 2cb8e: 80 91 72 12 lds r24, 0x1272 ; 0x801272 2cb92: f0 90 71 12 lds r15, 0x1271 ; 0x801271 2cb96: 81 11 cpse r24, r1 2cb98: 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)) 2cb9a: 20 91 51 12 lds r18, 0x1251 ; 0x801251 2cb9e: 30 91 52 12 lds r19, 0x1252 ; 0x801252 2cba2: 21 15 cp r18, r1 2cba4: 31 05 cpc r19, r1 2cba6: 09 f4 brne .+2 ; 0x2cbaa 2cba8: d1 c0 rjmp .+418 ; 0x2cd4c 2cbaa: 81 11 cpse r24, r1 2cbac: cf c0 rjmp .+414 ; 0x2cd4c 2cbae: 80 91 71 12 lds r24, 0x1271 ; 0x801271 2cbb2: 81 11 cpse r24, r1 2cbb4: cb c0 rjmp .+406 ; 0x2cd4c { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); 2cbb6: f9 01 movw r30, r18 2cbb8: e8 5a subi r30, 0xA8 ; 168 2cbba: ff 4f sbci r31, 0xFF ; 255 2cbbc: 80 e1 ldi r24, 0x10 ; 16 2cbbe: ae e7 ldi r26, 0x7E ; 126 2cbc0: b2 e0 ldi r27, 0x02 ; 2 2cbc2: 01 90 ld r0, Z+ 2cbc4: 0d 92 st X+, r0 2cbc6: 8a 95 dec r24 2cbc8: e1 f7 brne .-8 ; 0x2cbc2 saved_feedrate2 = current_block->gcode_feedrate; 2cbca: f9 01 movw r30, r18 2cbcc: e6 59 subi r30, 0x96 ; 150 2cbce: ff 4f sbci r31, 0xFF ; 255 2cbd0: 80 81 ld r24, Z 2cbd2: 91 81 ldd r25, Z+1 ; 0x01 2cbd4: 90 93 50 12 sts 0x1250, r25 ; 0x801250 2cbd8: 80 93 4f 12 sts 0x124F, r24 ; 0x80124f saved_segment_idx = current_block->segment_idx; 2cbdc: 28 59 subi r18, 0x98 ; 152 2cbde: 3f 4f sbci r19, 0xFF ; 255 2cbe0: f9 01 movw r30, r18 2cbe2: 80 81 ld r24, Z 2cbe4: 91 81 ldd r25, Z+1 ; 0x01 2cbe6: 90 93 4e 12 sts 0x124E, r25 ; 0x80124e 2cbea: 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 2cbee: 0f 94 22 4c call 0x29844 ; 0x29844 memcpy(saved_pos, current_position, sizeof(saved_pos)); 2cbf2: 80 e1 ldi r24, 0x10 ; 16 2cbf4: e1 e6 ldi r30, 0x61 ; 97 2cbf6: f2 e1 ldi r31, 0x12 ; 18 2cbf8: a0 e9 ldi r26, 0x90 ; 144 2cbfa: b2 e0 ldi r27, 0x02 ; 2 2cbfc: 01 90 ld r0, Z+ 2cbfe: 0d 92 st X+, r0 2cc00: 8a 95 dec r24 2cc02: e1 f7 brne .-8 ; 0x2cbfc if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 2cc04: ff 20 and r15, r15 2cc06: 61 f0 breq .+24 ; 0x2cc20 2cc08: 80 e0 ldi r24, 0x00 ; 0 2cc0a: 90 e0 ldi r25, 0x00 ; 0 2cc0c: a0 e8 ldi r26, 0x80 ; 128 2cc0e: bf eb ldi r27, 0xBF ; 191 2cc10: 80 93 90 02 sts 0x0290, r24 ; 0x800290 2cc14: 90 93 91 02 sts 0x0291, r25 ; 0x800291 2cc18: a0 93 92 02 sts 0x0292, r26 ; 0x800292 2cc1c: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_feedmultiply2 = feedmultiply; //save feedmultiply 2cc20: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 2cc24: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 2cc28: 90 93 60 12 sts 0x1260, r25 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.496+0x1> 2cc2c: 80 93 5f 12 sts 0x125F, r24 ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.496> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 2cc30: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 2cc34: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 2cc38: 90 93 5c 12 sts 0x125C, r25 ; 0x80125c 2cc3c: 80 93 5b 12 sts 0x125B, r24 ; 0x80125b saved_bed_temperature = (uint8_t)degTargetBed(); 2cc40: 80 91 59 12 lds r24, 0x1259 ; 0x801259 2cc44: 80 93 58 12 sts 0x1258, r24 ; 0x801258 saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 2cc48: 80 91 57 12 lds r24, 0x1257 ; 0x801257 2cc4c: 83 fb bst r24, 3 2cc4e: 88 27 eor r24, r24 2cc50: 80 f9 bld r24, 0 2cc52: 80 93 56 12 sts 0x1256, r24 ; 0x801256 saved_fan_speed = fanSpeed; 2cc56: 80 91 55 12 lds r24, 0x1255 ; 0x801255 2cc5a: 80 93 54 12 sts 0x1254, r24 ; 0x801254 cmdqueue_reset(); //empty cmdqueue 2cc5e: 0e 94 bf 83 call 0x1077e ; 0x1077e card.sdprinting = false; 2cc62: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 // card.closefile(); saved_printing = true; 2cc66: 81 e0 ldi r24, 0x01 ; 1 2cc68: 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(); 2cc6c: 0f 94 a5 18 call 0x2314a ; 0x2314a sei(); 2cc70: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 2cc72: 20 e0 ldi r18, 0x00 ; 0 2cc74: 30 e0 ldi r19, 0x00 ; 0 2cc76: a9 01 movw r20, r18 2cc78: f8 01 movw r30, r16 2cc7a: 6c 2f mov r22, r28 2cc7c: 7d 2f mov r23, r29 2cc7e: 8f 2f mov r24, r31 2cc80: 90 2f mov r25, r16 2cc82: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2cc86: 88 23 and r24, r24 2cc88: e1 f0 breq .+56 ; 0x2ccc2 // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 2cc8a: 80 91 56 12 lds r24, 0x1256 ; 0x801256 2cc8e: 81 11 cpse r24, r1 2cc90: 05 c0 rjmp .+10 ; 0x2cc9c enquecommand_P(MSG_M83); 2cc92: 61 e0 ldi r22, 0x01 ; 1 2cc94: 87 e5 ldi r24, 0x57 ; 87 2cc96: 9d e6 ldi r25, 0x6D ; 109 2cc98: 0e 94 65 8d call 0x11aca ; 0x11aca // 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); 2cc9c: 0f 93 push r16 2cc9e: 1f 93 push r17 2cca0: df 93 push r29 2cca2: cf 93 push r28 2cca4: 87 e4 ldi r24, 0x47 ; 71 2cca6: 9d e6 ldi r25, 0x6D ; 109 2cca8: 9f 93 push r25 2ccaa: 8f 93 push r24 2ccac: 0e 94 2b 8e call 0x11c56 ; 0x11c56 2ccb0: 81 e0 ldi r24, 0x01 ; 1 2ccb2: 80 93 53 12 sts 0x1253, r24 ; 0x801253 2ccb6: 0f 90 pop r0 2ccb8: 0f 90 pop r0 2ccba: 0f 90 pop r0 2ccbc: 0f 90 pop r0 2ccbe: 0f 90 pop r0 2ccc0: 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(); } } 2ccc2: df 91 pop r29 2ccc4: cf 91 pop r28 2ccc6: 1f 91 pop r17 2ccc8: 0f 91 pop r16 2ccca: ff 90 pop r15 2cccc: ef 90 pop r14 2ccce: df 90 pop r13 2ccd0: cf 90 pop r12 2ccd2: 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 2ccd4: 80 91 42 12 lds r24, 0x1242 ; 0x801242 2ccd8: 88 23 and r24, r24 2ccda: b1 f1 breq .+108 ; 0x2cd48 saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue 2ccdc: 80 91 3e 12 lds r24, 0x123E ; 0x80123e 2cce0: 90 91 3f 12 lds r25, 0x123F ; 0x80123f 2cce4: a0 91 40 12 lds r26, 0x1240 ; 0x801240 2cce8: b0 91 41 12 lds r27, 0x1241 ; 0x801241 2ccec: 80 93 45 12 sts 0x1245, r24 ; 0x801245 2ccf0: 90 93 46 12 sts 0x1246, r25 ; 0x801246 2ccf4: a0 93 47 12 sts 0x1247, r26 ; 0x801247 2ccf8: 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 2ccfc: 0f 94 9d 39 call 0x2733a ; 0x2733a saved_sdpos -= nlines; 2cd00: 40 91 45 12 lds r20, 0x1245 ; 0x801245 2cd04: 50 91 46 12 lds r21, 0x1246 ; 0x801246 2cd08: 60 91 47 12 lds r22, 0x1247 ; 0x801247 2cd0c: 70 91 48 12 lds r23, 0x1248 ; 0x801248 2cd10: 48 1b sub r20, r24 2cd12: 51 09 sbc r21, r1 2cd14: 61 09 sbc r22, r1 2cd16: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer 2cd18: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 2cd1c: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 2cd20: 09 2e mov r0, r25 2cd22: 00 0c add r0, r0 2cd24: aa 0b sbc r26, r26 2cd26: bb 0b sbc r27, r27 2cd28: 48 1b sub r20, r24 2cd2a: 59 0b sbc r21, r25 2cd2c: 6a 0b sbc r22, r26 2cd2e: 7b 0b sbc r23, r27 2cd30: 40 93 45 12 sts 0x1245, r20 ; 0x801245 2cd34: 50 93 46 12 sts 0x1246, r21 ; 0x801246 2cd38: 60 93 47 12 sts 0x1247, r22 ; 0x801247 2cd3c: 70 93 48 12 sts 0x1248, r23 ; 0x801248 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; 2cd40: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; 2cd42: 80 93 79 02 sts 0x0279, r24 ; 0x800279 2cd46: 23 cf rjmp .-442 ; 0x2cb8e 2cd48: 82 e0 ldi r24, 0x02 ; 2 2cd4a: fb cf rjmp .-10 ; 0x2cd42 saved_feedrate2 = current_block->gcode_feedrate; saved_segment_idx = current_block->segment_idx; } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; 2cd4c: 80 e0 ldi r24, 0x00 ; 0 2cd4e: 90 e0 ldi r25, 0x00 ; 0 2cd50: a0 e8 ldi r26, 0x80 ; 128 2cd52: bf eb ldi r27, 0xBF ; 191 2cd54: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e 2cd58: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f 2cd5c: a0 93 80 02 sts 0x0280, r26 ; 0x800280 2cd60: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_feedrate2 = feedrate; 2cd64: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 2cd68: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 2cd6c: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2cd70: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 2cd74: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 2cd78: 70 93 50 12 sts 0x1250, r23 ; 0x801250 2cd7c: 60 93 4f 12 sts 0x124F, r22 ; 0x80124f saved_segment_idx = 0; 2cd80: 10 92 4e 12 sts 0x124E, r1 ; 0x80124e 2cd84: 10 92 4d 12 sts 0x124D, r1 ; 0x80124d 2cd88: 32 cf rjmp .-412 ; 0x2cbee 0002cd8a : // "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) { 2cd8a: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2cd8e: 81 11 cpse r24, r1 2cd90: 1d c0 rjmp .+58 ; 0x2cdcc Stopped = true; 2cd92: 81 e0 ldi r24, 0x01 ; 1 2cd94: 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); 2cd98: 61 e0 ldi r22, 0x01 ; 1 2cd9a: 80 e0 ldi r24, 0x00 ; 0 2cd9c: 0e 94 e4 dc call 0x1b9c8 ; 0x1b9c8 } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); 2cda0: 87 ec ldi r24, 0xC7 ; 199 2cda2: 92 ea ldi r25, 0xA2 ; 162 2cda4: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); 2cda8: 82 e1 ldi r24, 0x12 ; 18 2cdaa: 9d e6 ldi r25, 0x6D ; 109 2cdac: 0e 94 18 7d call 0xfa30 ; 0xfa30 // 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)); 2cdb0: 8b e4 ldi r24, 0x4B ; 75 2cdb2: 93 e6 ldi r25, 0x63 ; 99 2cdb4: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2cdb8: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe // 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); 2cdbc: 72 9a sbi 0x0e, 2 ; 14 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); 2cdbe: 0f 94 18 05 call 0x20a30 ; 0x20a30 if(!allow_recovery) { // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); 2cdc2: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2cdc6: 81 60 ori r24, 0x01 ; 1 2cdc8: 80 93 3a 12 sts 0x123A, r24 ; 0x80123a } } } 2cdcc: 08 95 ret 0002cdce : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2cdce: 0f 93 push r16 2cdd0: 1f 93 push r17 2cdd2: cf 93 push r28 2cdd4: df 93 push r29 2cdd6: ec 01 movw r28, r24 2cdd8: 0f 94 fc a1 call 0x343f8 ; 0x343f8 <__strlen_P> 2cddc: 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) 2cdde: 80 36 cpi r24, 0x60 ; 96 2cde0: 91 05 cpc r25, r1 2cde2: 08 f0 brcs .+2 ; 0x2cde6 2cde4: 85 c0 rjmp .+266 ; 0x2cef0 return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2cde6: 80 91 53 12 lds r24, 0x1253 ; 0x801253 2cdea: 81 11 cpse r24, r1 2cdec: 05 c0 rjmp .+10 ; 0x2cdf8 cmdqueue_pop_front(); 2cdee: 0e 94 9e 79 call 0xf33c ; 0xf33c cmdbuffer_front_already_processed = true; 2cdf2: 81 e0 ldi r24, 0x01 ; 1 2cdf4: 80 93 53 12 sts 0x1253, r24 ; 0x801253 } if (bufindr == bufindw && buflen > 0) 2cdf8: 40 91 38 12 lds r20, 0x1238 ; 0x801238 2cdfc: 50 91 39 12 lds r21, 0x1239 ; 0x801239 2ce00: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.512> 2ce04: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.512+0x1> 2ce08: 48 17 cp r20, r24 2ce0a: 59 07 cpc r21, r25 2ce0c: 41 f4 brne .+16 ; 0x2ce1e 2ce0e: 20 91 3c 12 lds r18, 0x123C ; 0x80123c 2ce12: 30 91 3d 12 lds r19, 0x123D ; 0x80123d 2ce16: 12 16 cp r1, r18 2ce18: 13 06 cpc r1, r19 2ce1a: 0c f4 brge .+2 ; 0x2ce1e 2ce1c: 69 c0 rjmp .+210 ; 0x2cef0 // 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; 2ce1e: 20 91 47 10 lds r18, 0x1047 ; 0x801047 2ce22: 30 91 48 10 lds r19, 0x1048 ; 0x801048 2ce26: 12 16 cp r1, r18 2ce28: 13 06 cpc r1, r19 2ce2a: 0c f0 brlt .+2 ; 0x2ce2e 2ce2c: 41 c0 rjmp .+130 ; 0x2ceb0 2ce2e: 9c 01 movw r18, r24 2ce30: 2f 59 subi r18, 0x9F ; 159 2ce32: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2ce34: 84 17 cp r24, r20 2ce36: 95 07 cpc r25, r21 2ce38: e8 f5 brcc .+122 ; 0x2ceb4 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2ce3a: 44 50 subi r20, 0x04 ; 4 2ce3c: 51 09 sbc r21, r1 2ce3e: 40 1b sub r20, r16 2ce40: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2ce42: 42 17 cp r20, r18 2ce44: 53 07 cpc r21, r19 2ce46: 0c f4 brge .+2 ; 0x2ce4a 2ce48: 53 c0 rjmp .+166 ; 0x2cef0 } } 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); 2ce4a: 50 93 39 12 sts 0x1239, r21 ; 0x801239 2ce4e: 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; 2ce52: 80 91 38 12 lds r24, 0x1238 ; 0x801238 2ce56: 90 91 39 12 lds r25, 0x1239 ; 0x801239 2ce5a: fc 01 movw r30, r24 2ce5c: e5 5b subi r30, 0xB5 ; 181 2ce5e: ff 4e sbci r31, 0xEF ; 239 2ce60: 23 e0 ldi r18, 0x03 ; 3 2ce62: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2ce64: be 01 movw r22, r28 2ce66: 82 5b subi r24, 0xB2 ; 178 2ce68: 9f 4e sbci r25, 0xEF ; 239 2ce6a: 0f 94 f5 a1 call 0x343ea ; 0x343ea else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2ce6e: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 2ce72: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 2ce76: 01 96 adiw r24, 0x01 ; 1 2ce78: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 2ce7c: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c SERIAL_ECHO_START; 2ce80: 84 ee ldi r24, 0xE4 ; 228 2ce82: 92 ea ldi r25, 0xA2 ; 162 2ce84: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(enqueingFront); 2ce88: 8e ea ldi r24, 0xAE ; 174 2ce8a: 92 ea ldi r25, 0xA2 ; 162 2ce8c: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2ce90: 80 91 38 12 lds r24, 0x1238 ; 0x801238 2ce94: 90 91 39 12 lds r25, 0x1239 ; 0x801239 2ce98: 82 5b subi r24, 0xB2 ; 178 2ce9a: 9f 4e sbci r25, 0xEF ; 239 2ce9c: 0e 94 11 86 call 0x10c22 ; 0x10c22 SERIAL_ECHOLNPGM("\""); 2cea0: 8c ea ldi r24, 0xAC ; 172 2cea2: 92 ea ldi r25, 0xA2 ; 162 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2cea4: df 91 pop r29 2cea6: cf 91 pop r28 2cea8: 1f 91 pop r17 2ceaa: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ceac: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 // 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) 2ceb0: 9c 01 movw r18, r24 2ceb2: c0 cf rjmp .-128 ; 0x2ce34 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2ceb4: c8 01 movw r24, r16 2ceb6: 04 96 adiw r24, 0x04 ; 4 2ceb8: 48 17 cp r20, r24 2ceba: 59 07 cpc r21, r25 2cebc: 28 f0 brcs .+10 ; 0x2cec8 // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2cebe: 44 50 subi r20, 0x04 ; 4 2cec0: 51 09 sbc r21, r1 2cec2: 40 1b sub r20, r16 2cec4: 51 0b sbc r21, r17 2cec6: c1 cf rjmp .-126 ; 0x2ce4a return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2cec8: 89 ee ldi r24, 0xE9 ; 233 2ceca: 91 e0 ldi r25, 0x01 ; 1 2cecc: bc 01 movw r22, r24 2cece: 60 1b sub r22, r16 2ced0: 71 0b sbc r23, r17 2ced2: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2ced4: 62 17 cp r22, r18 2ced6: 73 07 cpc r23, r19 2ced8: 5c f0 brlt .+22 ; 0x2cef0 memset(cmdbuffer, 0, bufindr); 2ceda: 70 e0 ldi r23, 0x00 ; 0 2cedc: 60 e0 ldi r22, 0x00 ; 0 2cede: 8b e4 ldi r24, 0x4B ; 75 2cee0: 90 e1 ldi r25, 0x10 ; 16 2cee2: 0f 94 70 aa call 0x354e0 ; 0x354e0 bufindr = bufindr_new; 2cee6: 10 93 39 12 sts 0x1239, r17 ; 0x801239 2ceea: 00 93 38 12 sts 0x1238, r16 ; 0x801238 2ceee: b1 cf rjmp .-158 ; 0x2ce52 SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2cef0: 87 ec ldi r24, 0xC7 ; 199 2cef2: 92 ea ldi r25, 0xA2 ; 162 2cef4: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(enqueingFront); 2cef8: 8e ea ldi r24, 0xAE ; 174 2cefa: 92 ea ldi r25, 0xA2 ; 162 2cefc: 0e 94 1f 7b call 0xf63e ; 0xf63e if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2cf00: ce 01 movw r24, r28 2cf02: 0e 94 1f 7b call 0xf63e ; 0xf63e else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2cf06: 85 e9 ldi r24, 0x95 ; 149 2cf08: 92 ea ldi r25, 0xA2 ; 162 2cf0a: cc cf rjmp .-104 ; 0x2cea4 0002cf0c : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2cf0c: ab 01 movw r20, r22 2cf0e: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2cf10: 87 e6 ldi r24, 0x67 ; 103 2cf12: 96 e1 ldi r25, 0x16 ; 22 2cf14: 0f 94 32 2a call 0x25464 ; 0x25464 2cf18: 81 11 cpse r24, r1 2cf1a: 02 c0 rjmp .+4 ; 0x2cf20 2cf1c: 80 e0 ldi r24, 0x00 ; 0 2cf1e: 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() ) 2cf20: 87 e6 ldi r24, 0x67 ; 103 2cf22: 96 e1 ldi r25, 0x16 ; 22 2cf24: 0f 94 b9 29 call 0x25372 ; 0x25372 2cf28: 88 23 and r24, r24 2cf2a: c1 f3 breq .-16 ; 0x2cf1c 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; 2cf2c: 20 91 88 16 lds r18, 0x1688 ; 0x801688 2cf30: 30 91 89 16 lds r19, 0x1689 ; 0x801689 2cf34: 2a 5b subi r18, 0xBA ; 186 2cf36: 31 4f sbci r19, 0xF1 ; 241 2cf38: 30 93 83 16 sts 0x1683, r19 ; 0x801683 2cf3c: 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; } 2cf40: 08 95 ret 0002cf42 : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2cf42: 8f 92 push r8 2cf44: 9f 92 push r9 2cf46: af 92 push r10 2cf48: bf 92 push r11 2cf4a: cf 92 push r12 2cf4c: df 92 push r13 2cf4e: ef 92 push r14 2cf50: ff 92 push r15 2cf52: 0f 93 push r16 2cf54: 1f 93 push r17 2cf56: cf 93 push r28 2cf58: df 93 push r29 2cf5a: cd b7 in r28, 0x3d ; 61 2cf5c: de b7 in r29, 0x3e ; 62 2cf5e: ee 97 sbiw r28, 0x3e ; 62 2cf60: 0f b6 in r0, 0x3f ; 63 2cf62: f8 94 cli 2cf64: de bf out 0x3e, r29 ; 62 2cf66: 0f be out 0x3f, r0 ; 63 2cf68: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2cf6a: 80 91 25 14 lds r24, 0x1425 ; 0x801425 2cf6e: 8f 93 push r24 2cf70: 80 91 24 14 lds r24, 0x1424 ; 0x801424 2cf74: 8f 93 push r24 2cf76: 80 e5 ldi r24, 0x50 ; 80 2cf78: 92 ea ldi r25, 0xA2 ; 162 2cf7a: 9f 93 push r25 2cf7c: 8f 93 push r24 2cf7e: 8e 01 movw r16, r28 2cf80: 0f 5d subi r16, 0xDF ; 223 2cf82: 1f 4f sbci r17, 0xFF ; 255 2cf84: 1f 93 push r17 2cf86: 0f 93 push r16 2cf88: 0f 94 55 a3 call 0x346aa ; 0x346aa 2cf8c: 0f 90 pop r0 2cf8e: 0f 90 pop r0 2cf90: 0f 90 pop r0 2cf92: 0f 90 pop r0 2cf94: 0f 90 pop r0 2cf96: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2cf98: f1 2c mov r15, r1 2cf9a: f8 01 movw r30, r16 2cf9c: 01 90 ld r0, Z+ 2cf9e: 00 20 and r0, r0 2cfa0: e9 f7 brne .-6 ; 0x2cf9c 2cfa2: 31 97 sbiw r30, 0x01 ; 1 2cfa4: e0 1b sub r30, r16 2cfa6: f1 0b sbc r31, r17 2cfa8: fe 16 cp r15, r30 2cfaa: 84 f4 brge .+32 ; 0x2cfcc autoname[i]=tolower(autoname[i]); 2cfac: 68 01 movw r12, r16 2cfae: cf 0c add r12, r15 2cfb0: d1 1c adc r13, r1 2cfb2: f7 fc sbrc r15, 7 2cfb4: da 94 dec r13 2cfb6: f6 01 movw r30, r12 2cfb8: 80 81 ld r24, Z 2cfba: 08 2e mov r0, r24 2cfbc: 00 0c add r0, r0 2cfbe: 99 0b sbc r25, r25 2cfc0: 0f 94 52 aa call 0x354a4 ; 0x354a4 2cfc4: f6 01 movw r30, r12 2cfc6: 80 83 st Z, r24 2cfc8: f3 94 inc r15 2cfca: e7 cf rjmp .-50 ; 0x2cf9a dir_t p; root.rewind(); 2cfcc: 8d e5 ldi r24, 0x5D ; 93 2cfce: 94 e1 ldi r25, 0x14 ; 20 2cfd0: 0e 94 01 7a call 0xf402 ; 0xf402 bool found=false; 2cfd4: a1 2c mov r10, r1 2cfd6: ce 01 movw r24, r28 2cfd8: 01 96 adiw r24, 0x01 ; 1 2cfda: 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); 2cfdc: 8b e0 ldi r24, 0x0B ; 11 2cfde: c8 2e mov r12, r24 2cfe0: 8d e6 ldi r24, 0x6D ; 109 2cfe2: 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; 2cfe4: 80 91 60 14 lds r24, 0x1460 ; 0x801460 2cfe8: 82 30 cpi r24, 0x02 ; 2 2cfea: 08 f4 brcc .+2 ; 0x2cfee 2cfec: 50 c0 rjmp .+160 ; 0x2d08e 2cfee: 80 91 65 14 lds r24, 0x1465 ; 0x801465 2cff2: 90 91 66 14 lds r25, 0x1466 ; 0x801466 2cff6: a0 91 67 14 lds r26, 0x1467 ; 0x801467 2cffa: b0 91 68 14 lds r27, 0x1468 ; 0x801468 2cffe: 8f 71 andi r24, 0x1F ; 31 2d000: 99 27 eor r25, r25 2d002: aa 27 eor r26, r26 2d004: bb 27 eor r27, r27 2d006: 89 2b or r24, r25 2d008: 8a 2b or r24, r26 2d00a: 8b 2b or r24, r27 2d00c: 09 f0 breq .+2 ; 0x2d010 2d00e: 3f c0 rjmp .+126 ; 0x2d08e 2d010: 50 e0 ldi r21, 0x00 ; 0 2d012: 40 e0 ldi r20, 0x00 ; 0 2d014: b7 01 movw r22, r14 2d016: 8d e5 ldi r24, 0x5D ; 93 2d018: 94 e1 ldi r25, 0x14 ; 20 2d01a: 0f 94 6f 2d call 0x25ade ; 0x25ade dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2d01e: 18 16 cp r1, r24 2d020: b4 f5 brge .+108 ; 0x2d08e { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2d022: b1 2c mov r11, r1 2d024: f7 01 movw r30, r14 2d026: 01 90 ld r0, Z+ 2d028: 00 20 and r0, r0 2d02a: e9 f7 brne .-6 ; 0x2d026 2d02c: 31 97 sbiw r30, 0x01 ; 1 2d02e: ee 19 sub r30, r14 2d030: ff 09 sbc r31, r15 2d032: be 16 cp r11, r30 2d034: 74 f4 brge .+28 ; 0x2d052 p.name[i]=tolower(p.name[i]); 2d036: 47 01 movw r8, r14 2d038: 8b 0c add r8, r11 2d03a: 91 1c adc r9, r1 2d03c: b7 fc sbrc r11, 7 2d03e: 9a 94 dec r9 2d040: f4 01 movw r30, r8 2d042: 80 81 ld r24, Z 2d044: 90 e0 ldi r25, 0x00 ; 0 2d046: 0f 94 52 aa call 0x354a4 ; 0x354a4 2d04a: f4 01 movw r30, r8 2d04c: 80 83 st Z, r24 2d04e: b3 94 inc r11 2d050: e9 cf rjmp .-46 ; 0x2d024 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2d052: 8a 85 ldd r24, Y+10 ; 0x0a 2d054: 8e 37 cpi r24, 0x7E ; 126 2d056: 31 f2 breq .-116 ; 0x2cfe4 if(strncmp((char*)p.name,autoname,5)==0) 2d058: 45 e0 ldi r20, 0x05 ; 5 2d05a: 50 e0 ldi r21, 0x00 ; 0 2d05c: b8 01 movw r22, r16 2d05e: c7 01 movw r24, r14 2d060: 0f 94 b0 aa call 0x35560 ; 0x35560 2d064: 89 2b or r24, r25 2d066: 09 f0 breq .+2 ; 0x2d06a 2d068: bd cf rjmp .-134 ; 0x2cfe4 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2d06a: 1f 93 push r17 2d06c: 0f 93 push r16 2d06e: df 92 push r13 2d070: cf 92 push r12 2d072: 0e 94 2b 8e call 0x11c56 ; 0x11c56 // M24: Start/resume SD print enquecommand_P(MSG_M24); 2d076: 61 e0 ldi r22, 0x01 ; 1 2d078: 87 e0 ldi r24, 0x07 ; 7 2d07a: 9d e6 ldi r25, 0x6D ; 109 2d07c: 0e 94 65 8d call 0x11aca ; 0x11aca 2d080: 0f 90 pop r0 2d082: 0f 90 pop r0 2d084: 0f 90 pop r0 2d086: 0f 90 pop r0 found=true; 2d088: aa 24 eor r10, r10 2d08a: a3 94 inc r10 2d08c: ab cf rjmp .-170 ; 0x2cfe4 } } if(!found) lastnr=-1; 2d08e: 8f ef ldi r24, 0xFF ; 255 2d090: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2d092: aa 20 and r10, r10 2d094: 29 f0 breq .+10 ; 0x2d0a0 lastnr=-1; else lastnr++; 2d096: 80 91 24 14 lds r24, 0x1424 ; 0x801424 2d09a: 90 91 25 14 lds r25, 0x1425 ; 0x801425 2d09e: 01 96 adiw r24, 0x01 ; 1 2d0a0: 90 93 25 14 sts 0x1425, r25 ; 0x801425 2d0a4: 80 93 24 14 sts 0x1424, r24 ; 0x801424 } 2d0a8: ee 96 adiw r28, 0x3e ; 62 2d0aa: 0f b6 in r0, 0x3f ; 63 2d0ac: f8 94 cli 2d0ae: de bf out 0x3e, r29 ; 62 2d0b0: 0f be out 0x3f, r0 ; 63 2d0b2: cd bf out 0x3d, r28 ; 61 2d0b4: df 91 pop r29 2d0b6: cf 91 pop r28 2d0b8: 1f 91 pop r17 2d0ba: 0f 91 pop r16 2d0bc: ff 90 pop r15 2d0be: ef 90 pop r14 2d0c0: df 90 pop r13 2d0c2: cf 90 pop r12 2d0c4: bf 90 pop r11 2d0c6: af 90 pop r10 2d0c8: 9f 90 pop r9 2d0ca: 8f 90 pop r8 2d0cc: 08 95 ret 0002d0ce : * \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) { 2d0ce: 8f 92 push r8 2d0d0: 9f 92 push r9 2d0d2: af 92 push r10 2d0d4: bf 92 push r11 2d0d6: cf 92 push r12 2d0d8: df 92 push r13 2d0da: ef 92 push r14 2d0dc: ff 92 push r15 2d0de: 0f 93 push r16 2d0e0: 1f 93 push r17 2d0e2: cf 93 push r28 2d0e4: df 93 push r29 2d0e6: 00 d0 rcall .+0 ; 0x2d0e8 2d0e8: 1f 92 push r1 2d0ea: cd b7 in r28, 0x3d ; 61 2d0ec: de b7 in r29, 0x3e ; 62 2d0ee: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2d0f0: 83 81 ldd r24, Z+3 ; 0x03 2d0f2: 81 30 cpi r24, 0x01 ; 1 2d0f4: 11 f0 breq .+4 ; 0x2d0fa // set file to correct position return seekSet(newPos); fail: return false; 2d0f6: 80 e0 ldi r24, 0x00 ; 0 2d0f8: 60 c0 rjmp .+192 ; 0x2d1ba * \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; 2d0fa: 81 81 ldd r24, Z+1 ; 0x01 2d0fc: 81 ff sbrs r24, 1 2d0fe: fb cf rjmp .-10 ; 0x2d0f6 // 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; 2d100: 81 89 ldd r24, Z+17 ; 0x11 2d102: 92 89 ldd r25, Z+18 ; 0x12 2d104: a3 89 ldd r26, Z+19 ; 0x13 2d106: b4 89 ldd r27, Z+20 ; 0x14 2d108: 89 2b or r24, r25 2d10a: 8a 2b or r24, r26 2d10c: 8b 2b or r24, r27 2d10e: 09 f4 brne .+2 ; 0x2d112 2d110: 6e c0 rjmp .+220 ; 0x2d1ee 2d112: 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; 2d114: 40 e0 ldi r20, 0x00 ; 0 2d116: 50 e0 ldi r21, 0x00 ; 0 2d118: ba 01 movw r22, r20 2d11a: cf 01 movw r24, r30 2d11c: 0f 94 32 2a call 0x25464 ; 0x25464 2d120: 88 23 and r24, r24 2d122: 49 f3 breq .-46 ; 0x2d0f6 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2d124: f7 01 movw r30, r14 2d126: c1 8c ldd r12, Z+25 ; 0x19 2d128: d2 8c ldd r13, Z+26 ; 0x1a 2d12a: 85 88 ldd r8, Z+21 ; 0x15 2d12c: 96 88 ldd r9, Z+22 ; 0x16 2d12e: a7 88 ldd r10, Z+23 ; 0x17 2d130: 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; 2d132: 82 e0 ldi r24, 0x02 ; 2 2d134: 90 e0 ldi r25, 0x00 ; 0 2d136: a0 e0 ldi r26, 0x00 ; 0 2d138: b0 e0 ldi r27, 0x00 ; 0 2d13a: f6 01 movw r30, r12 2d13c: 80 83 st Z, r24 2d13e: 91 83 std Z+1, r25 ; 0x01 2d140: a2 83 std Z+2, r26 ; 0x02 2d142: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2d144: 9e 01 movw r18, r28 2d146: 2f 5f subi r18, 0xFF ; 255 2d148: 3f 4f sbci r19, 0xFF ; 255 2d14a: b5 01 movw r22, r10 2d14c: a4 01 movw r20, r8 2d14e: c6 01 movw r24, r12 2d150: 0f 94 7c 28 call 0x250f8 ; 0x250f8 2d154: 88 23 and r24, r24 2d156: 79 f2 breq .-98 ; 0x2d0f6 // free cluster if (!fatPut(cluster, 0)) goto fail; 2d158: 00 e0 ldi r16, 0x00 ; 0 2d15a: 10 e0 ldi r17, 0x00 ; 0 2d15c: 98 01 movw r18, r16 2d15e: b5 01 movw r22, r10 2d160: a4 01 movw r20, r8 2d162: c6 01 movw r24, r12 2d164: 0f 94 ea 27 call 0x24fd4 ; 0x24fd4 2d168: 88 23 and r24, r24 2d16a: 29 f2 breq .-118 ; 0x2d0f6 cluster = next; 2d16c: 89 80 ldd r8, Y+1 ; 0x01 2d16e: 9a 80 ldd r9, Y+2 ; 0x02 2d170: ab 80 ldd r10, Y+3 ; 0x03 2d172: 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; 2d174: f6 01 movw r30, r12 2d176: 87 89 ldd r24, Z+23 ; 0x17 2d178: 80 31 cpi r24, 0x10 ; 16 2d17a: 81 f5 brne .+96 ; 0x2d1dc 2d17c: f8 ef ldi r31, 0xF8 ; 248 2d17e: 8f 16 cp r8, r31 2d180: ff ef ldi r31, 0xFF ; 255 2d182: 9f 06 cpc r9, r31 2d184: a1 04 cpc r10, r1 2d186: b1 04 cpc r11, r1 2d188: e8 f2 brcs .-70 ; 0x2d144 firstCluster_ = 0; 2d18a: f7 01 movw r30, r14 2d18c: 15 8a std Z+21, r1 ; 0x15 2d18e: 16 8a std Z+22, r1 ; 0x16 2d190: 17 8a std Z+23, r1 ; 0x17 2d192: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2d194: 11 8a std Z+17, r1 ; 0x11 2d196: 12 8a std Z+18, r1 ; 0x12 2d198: 13 8a std Z+19, r1 ; 0x13 2d19a: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2d19c: 81 81 ldd r24, Z+1 ; 0x01 2d19e: 80 68 ori r24, 0x80 ; 128 2d1a0: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2d1a2: c7 01 movw r24, r14 2d1a4: 0f 94 db 2b call 0x257b6 ; 0x257b6 2d1a8: 88 23 and r24, r24 2d1aa: 09 f4 brne .+2 ; 0x2d1ae 2d1ac: a4 cf rjmp .-184 ; 0x2d0f6 // set file to correct position return seekSet(newPos); 2d1ae: 40 e0 ldi r20, 0x00 ; 0 2d1b0: 50 e0 ldi r21, 0x00 ; 0 2d1b2: ba 01 movw r22, r20 2d1b4: c7 01 movw r24, r14 2d1b6: 0f 94 32 2a call 0x25464 ; 0x25464 fail: return false; } 2d1ba: 0f 90 pop r0 2d1bc: 0f 90 pop r0 2d1be: 0f 90 pop r0 2d1c0: 0f 90 pop r0 2d1c2: df 91 pop r29 2d1c4: cf 91 pop r28 2d1c6: 1f 91 pop r17 2d1c8: 0f 91 pop r16 2d1ca: ff 90 pop r15 2d1cc: ef 90 pop r14 2d1ce: df 90 pop r13 2d1d0: cf 90 pop r12 2d1d2: bf 90 pop r11 2d1d4: af 90 pop r10 2d1d6: 9f 90 pop r9 2d1d8: 8f 90 pop r8 2d1da: 08 95 ret return cluster >= FAT32EOC_MIN; 2d1dc: 88 ef ldi r24, 0xF8 ; 248 2d1de: 88 16 cp r8, r24 2d1e0: 8f ef ldi r24, 0xFF ; 255 2d1e2: 98 06 cpc r9, r24 2d1e4: a8 06 cpc r10, r24 2d1e6: 8f e0 ldi r24, 0x0F ; 15 2d1e8: b8 06 cpc r11, r24 2d1ea: 78 f6 brcc .-98 ; 0x2d18a 2d1ec: ab cf rjmp .-170 ; 0x2d144 // 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; 2d1ee: 81 e0 ldi r24, 0x01 ; 1 2d1f0: e4 cf rjmp .-56 ; 0x2d1ba 0002d1f2 : +* 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) { 2d1f2: 2f 92 push r2 2d1f4: 3f 92 push r3 2d1f6: 4f 92 push r4 2d1f8: 5f 92 push r5 2d1fa: 6f 92 push r6 2d1fc: 7f 92 push r7 2d1fe: 8f 92 push r8 2d200: 9f 92 push r9 2d202: af 92 push r10 2d204: bf 92 push r11 2d206: cf 92 push r12 2d208: df 92 push r13 2d20a: ef 92 push r14 2d20c: ff 92 push r15 2d20e: 0f 93 push r16 2d210: 1f 93 push r17 2d212: cf 93 push r28 2d214: df 93 push r29 2d216: cd b7 in r28, 0x3d ; 61 2d218: de b7 in r29, 0x3e ; 62 2d21a: c6 57 subi r28, 0x76 ; 118 2d21c: d1 09 sbc r29, r1 2d21e: 0f b6 in r0, 0x3f ; 63 2d220: f8 94 cli 2d222: de bf out 0x3e, r29 ; 62 2d224: 0f be out 0x3f, r0 ; 63 2d226: cd bf out 0x3d, r28 ; 61 2d228: 4c 01 movw r8, r24 2d22a: 6b 01 movw r12, r22 2d22c: 3a 01 movw r6, r20 2d22e: e5 96 adiw r28, 0x35 ; 53 2d230: 2f af std Y+63, r18 ; 0x3f 2d232: e5 97 sbiw r28, 0x35 ; 53 2d234: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2d236: 2d b6 in r2, 0x3d ; 61 2d238: 3e b6 in r3, 0x3e ; 62 2d23a: 10 2f mov r17, r16 2d23c: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2d23e: 80 91 45 0e lds r24, 0x0E45 ; 0x800e45 2d242: 8f 5f subi r24, 0xFF ; 255 2d244: 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()) { 2d248: fb 01 movw r30, r22 2d24a: 80 85 ldd r24, Z+8 ; 0x08 2d24c: 91 85 ldd r25, Z+9 ; 0x09 2d24e: a2 85 ldd r26, Z+10 ; 0x0a 2d250: b3 85 ldd r27, Z+11 ; 0x0b 2d252: 80 93 ea 13 sts 0x13EA, r24 ; 0x8013ea 2d256: 90 93 eb 13 sts 0x13EB, r25 ; 0x8013eb 2d25a: a0 93 ec 13 sts 0x13EC, r26 ; 0x8013ec 2d25e: b0 93 ed 13 sts 0x13ED, r27 ; 0x8013ed _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2d262: 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); 2d264: 5e 01 movw r10, r28 2d266: f7 e6 ldi r31, 0x67 ; 103 2d268: af 0e add r10, r31 2d26a: 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; 2d26c: f6 01 movw r30, r12 2d26e: 83 81 ldd r24, Z+3 ; 0x03 2d270: 82 30 cpi r24, 0x02 ; 2 2d272: 08 f4 brcc .+2 ; 0x2d276 2d274: c0 c1 rjmp .+896 ; 0x2d5f6 2d276: 80 85 ldd r24, Z+8 ; 0x08 2d278: 91 85 ldd r25, Z+9 ; 0x09 2d27a: a2 85 ldd r26, Z+10 ; 0x0a 2d27c: b3 85 ldd r27, Z+11 ; 0x0b 2d27e: 8f 71 andi r24, 0x1F ; 31 2d280: 99 27 eor r25, r25 2d282: aa 27 eor r26, r26 2d284: bb 27 eor r27, r27 2d286: 89 2b or r24, r25 2d288: 8a 2b or r24, r26 2d28a: 8b 2b or r24, r27 2d28c: 09 f0 breq .+2 ; 0x2d290 2d28e: b3 c1 rjmp .+870 ; 0x2d5f6 //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'; 2d290: 10 92 ee 13 sts 0x13EE, r1 ; 0x8013ee 2d294: 4e ee ldi r20, 0xEE ; 238 2d296: 53 e1 ldi r21, 0x13 ; 19 2d298: be 01 movw r22, r28 2d29a: 69 5b subi r22, 0xB9 ; 185 2d29c: 7f 4f sbci r23, 0xFF ; 255 2d29e: c6 01 movw r24, r12 2d2a0: 0f 94 6f 2d call 0x25ade ; 0x25ade } 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()) { 2d2a4: 18 16 cp r1, r24 2d2a6: 0c f0 brlt .+2 ; 0x2d2aa 2d2a8: a6 c1 rjmp .+844 ; 0x2d5f6 if (recursionCnt > MAX_DIR_DEPTH) 2d2aa: 80 91 45 0e lds r24, 0x0E45 ; 0x800e45 2d2ae: 87 30 cpi r24, 0x07 ; 7 2d2b0: 08 f0 brcs .+2 ; 0x2d2b4 2d2b2: a1 c1 rjmp .+834 ; 0x2d5f6 return; uint8_t pn0 = p.name[0]; 2d2b4: 28 96 adiw r28, 0x08 ; 8 2d2b6: 8f ad ldd r24, Y+63 ; 0x3f 2d2b8: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2d2ba: 88 23 and r24, r24 2d2bc: 09 f4 brne .+2 ; 0x2d2c0 2d2be: 9b c1 rjmp .+822 ; 0x2d5f6 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2d2c0: 85 3e cpi r24, 0xE5 ; 229 2d2c2: 09 f4 brne .+2 ; 0x2d2c6 2d2c4: 39 c1 rjmp .+626 ; 0x2d538 2d2c6: 8e 32 cpi r24, 0x2E ; 46 2d2c8: 09 f4 brne .+2 ; 0x2d2cc 2d2ca: 36 c1 rjmp .+620 ; 0x2d538 if (longFilename[0] == '.') continue; 2d2cc: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d2d0: 8e 32 cpi r24, 0x2E ; 46 2d2d2: 09 f4 brne .+2 ; 0x2d2d6 2d2d4: 31 c1 rjmp .+610 ; 0x2d538 2d2d6: 63 96 adiw r28, 0x13 ; 19 2d2d8: 8f ad ldd r24, Y+63 ; 0x3f 2d2da: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2d2dc: 98 2f mov r25, r24 2d2de: 9a 70 andi r25, 0x0A ; 10 2d2e0: 09 f0 breq .+2 ; 0x2d2e4 2d2e2: 2a c1 rjmp .+596 ; 0x2d538 2d2e4: 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; 2d2e6: 91 e0 ldi r25, 0x01 ; 1 2d2e8: 80 31 cpi r24, 0x10 ; 16 2d2ea: 19 f0 breq .+6 ; 0x2d2f2 2d2ec: 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 2d2ee: 80 31 cpi r24, 0x10 ; 16 2d2f0: 31 f4 brne .+12 ; 0x2d2fe 2d2f2: e5 96 adiw r28, 0x35 ; 53 2d2f4: ff ad ldd r31, Y+63 ; 0x3f 2d2f6: e5 97 sbiw r28, 0x35 ; 53 2d2f8: ff 23 and r31, r31 2d2fa: 09 f4 brne .+2 ; 0x2d2fe 2d2fc: 94 c0 rjmp .+296 ; 0x2d426 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2d2fe: 90 93 23 14 sts 0x1423, r25 ; 0x801423 if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2d302: 80 31 cpi r24, 0x10 ; 16 2d304: 61 f0 breq .+24 ; 0x2d31e 2d306: 60 96 adiw r28, 0x10 ; 16 2d308: 8f ad ldd r24, Y+63 ; 0x3f 2d30a: 60 97 sbiw r28, 0x10 ; 16 2d30c: 87 34 cpi r24, 0x47 ; 71 2d30e: 09 f0 breq .+2 ; 0x2d312 2d310: 13 c1 rjmp .+550 ; 0x2d538 2d312: 61 96 adiw r28, 0x11 ; 17 2d314: 8f ad ldd r24, Y+63 ; 0x3f 2d316: 61 97 sbiw r28, 0x11 ; 17 2d318: 8e 37 cpi r24, 0x7E ; 126 2d31a: 09 f4 brne .+2 ; 0x2d31e 2d31c: 0d c1 rjmp .+538 ; 0x2d538 switch (lsAction) { 2d31e: e5 96 adiw r28, 0x35 ; 53 2d320: ff ad ldd r31, Y+63 ; 0x3f 2d322: e5 97 sbiw r28, 0x35 ; 53 2d324: f1 30 cpi r31, 0x01 ; 1 2d326: 09 f4 brne .+2 ; 0x2d32a 2d328: 1b c1 rjmp .+566 ; 0x2d560 2d32a: f2 30 cpi r31, 0x02 ; 2 2d32c: 09 f4 brne .+2 ; 0x2d330 2d32e: 25 c1 rjmp .+586 ; 0x2d57a case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2d330: be 01 movw r22, r28 2d332: 69 5b subi r22, 0xB9 ; 185 2d334: 7f 4f sbci r23, 0xFF ; 255 2d336: 89 ed ldi r24, 0xD9 ; 217 2d338: 93 e1 ldi r25, 0x13 ; 19 2d33a: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 2d33e: c4 01 movw r24, r8 2d340: 0e 94 11 86 call 0x10c22 ; 0x10c22 2d344: 89 ed ldi r24, 0xD9 ; 217 2d346: 93 e1 ldi r25, 0x13 ; 19 2d348: 0e 94 11 86 call 0x10c22 ; 0x10c22 SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2d34c: 80 e2 ldi r24, 0x20 ; 32 2d34e: 0e 94 0c 7a call 0xf418 ; 0xf418 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2d352: a7 96 adiw r28, 0x27 ; 39 2d354: 6c ad ldd r22, Y+60 ; 0x3c 2d356: 7d ad ldd r23, Y+61 ; 0x3d 2d358: 8e ad ldd r24, Y+62 ; 0x3e 2d35a: 9f ad ldd r25, Y+63 ; 0x3f 2d35c: a7 97 sbiw r28, 0x27 ; 39 2d35e: 4a e0 ldi r20, 0x0A ; 10 2d360: 0e 94 20 7a call 0xf440 ; 0xf440 SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2d364: 51 fe sbrs r5, 1 2d366: 45 c0 rjmp .+138 ; 0x2d3f2 { crmodDate = p.lastWriteDate; 2d368: a1 96 adiw r28, 0x21 ; 33 2d36a: 2e ad ldd r18, Y+62 ; 0x3e 2d36c: 3f ad ldd r19, Y+63 ; 0x3f 2d36e: a1 97 sbiw r28, 0x21 ; 33 2d370: 30 93 e9 13 sts 0x13E9, r19 ; 0x8013e9 2d374: 20 93 e8 13 sts 0x13E8, r18 ; 0x8013e8 crmodTime = p.lastWriteTime; 2d378: 6f 96 adiw r28, 0x1f ; 31 2d37a: 4e ad ldd r20, Y+62 ; 0x3e 2d37c: 5f ad ldd r21, Y+63 ; 0x3f 2d37e: 6f 97 sbiw r28, 0x1f ; 31 2d380: 50 93 e7 13 sts 0x13E7, r21 ; 0x8013e7 2d384: 40 93 e6 13 sts 0x13E6, r20 ; 0x8013e6 if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2d388: 69 96 adiw r28, 0x19 ; 25 2d38a: 8e ad ldd r24, Y+62 ; 0x3e 2d38c: 9f ad ldd r25, Y+63 ; 0x3f 2d38e: 69 97 sbiw r28, 0x19 ; 25 2d390: 28 17 cp r18, r24 2d392: 39 07 cpc r19, r25 2d394: 50 f0 brcs .+20 ; 0x2d3aa 2d396: 28 17 cp r18, r24 2d398: 39 07 cpc r19, r25 2d39a: 99 f4 brne .+38 ; 0x2d3c2 2d39c: 67 96 adiw r28, 0x17 ; 23 2d39e: 2e ad ldd r18, Y+62 ; 0x3e 2d3a0: 3f ad ldd r19, Y+63 ; 0x3f 2d3a2: 67 97 sbiw r28, 0x17 ; 23 2d3a4: 42 17 cp r20, r18 2d3a6: 53 07 cpc r21, r19 2d3a8: 60 f4 brcc .+24 ; 0x2d3c2 crmodDate = p.creationDate; 2d3aa: 90 93 e9 13 sts 0x13E9, r25 ; 0x8013e9 2d3ae: 80 93 e8 13 sts 0x13E8, r24 ; 0x8013e8 crmodTime = p.creationTime; 2d3b2: 67 96 adiw r28, 0x17 ; 23 2d3b4: 8e ad ldd r24, Y+62 ; 0x3e 2d3b6: 9f ad ldd r25, Y+63 ; 0x3f 2d3b8: 67 97 sbiw r28, 0x17 ; 23 2d3ba: 90 93 e7 13 sts 0x13E7, r25 ; 0x8013e7 2d3be: 80 93 e6 13 sts 0x13E6, r24 ; 0x8013e6 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2d3c2: 80 91 e9 13 lds r24, 0x13E9 ; 0x8013e9 2d3c6: 8f 93 push r24 2d3c8: 80 91 e8 13 lds r24, 0x13E8 ; 0x8013e8 2d3cc: 8f 93 push r24 2d3ce: 80 91 e7 13 lds r24, 0x13E7 ; 0x8013e7 2d3d2: 8f 93 push r24 2d3d4: 80 91 e6 13 lds r24, 0x13E6 ; 0x8013e6 2d3d8: 8f 93 push r24 2d3da: 2d e2 ldi r18, 0x2D ; 45 2d3dc: 32 ea ldi r19, 0xA2 ; 162 2d3de: 3f 93 push r19 2d3e0: 2f 93 push r18 2d3e2: 0f 94 00 a3 call 0x34600 ; 0x34600 2d3e6: 0f 90 pop r0 2d3e8: 0f 90 pop r0 2d3ea: 0f 90 pop r0 2d3ec: 0f 90 pop r0 2d3ee: 0f 90 pop r0 2d3f0: 0f 90 pop r0 } if (lsParams.LFN) 2d3f2: 11 23 and r17, r17 2d3f4: 99 f0 breq .+38 ; 0x2d41c printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2d3f6: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d3fa: 88 23 and r24, r24 2d3fc: 09 f4 brne .+2 ; 0x2d400 2d3fe: ba c0 rjmp .+372 ; 0x2d574 2d400: 8e ee ldi r24, 0xEE ; 238 2d402: 93 e1 ldi r25, 0x13 ; 19 2d404: 9f 93 push r25 2d406: 8f 93 push r24 2d408: e7 e2 ldi r30, 0x27 ; 39 2d40a: f2 ea ldi r31, 0xA2 ; 162 2d40c: ff 93 push r31 2d40e: ef 93 push r30 2d410: 0f 94 00 a3 call 0x34600 ; 0x34600 2d414: 0f 90 pop r0 2d416: 0f 90 pop r0 2d418: 0f 90 pop r0 2d41a: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2d41c: 0e 94 17 7b call 0xf62e ; 0xf62e manage_heater(); 2d420: 0f 94 43 37 call 0x26e86 ; 0x26e86 2d424: 89 c0 rjmp .+274 ; 0x2d538 } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2d426: 2d b7 in r18, 0x3d ; 61 2d428: 3e b7 in r19, 0x3e ; 62 2d42a: e7 96 adiw r28, 0x37 ; 55 2d42c: 3f af std Y+63, r19 ; 0x3f 2d42e: 2e af std Y+62, r18 ; 0x3e 2d430: 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); 2d432: be 01 movw r22, r28 2d434: 69 5b subi r22, 0xB9 ; 185 2d436: 7f 4f sbci r23, 0xFF ; 255 2d438: c5 01 movw r24, r10 2d43a: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2d43e: f4 01 movw r30, r8 2d440: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2d442: 88 23 and r24, r24 2d444: 09 f4 brne .+2 ; 0x2d448 2d446: 86 c0 rjmp .+268 ; 0x2d554 2d448: 01 90 ld r0, Z+ 2d44a: 00 20 and r0, r0 2d44c: e9 f7 brne .-6 ; 0x2d448 2d44e: 31 97 sbiw r30, 0x01 ; 1 2d450: e8 19 sub r30, r8 2d452: f9 09 sbc r31, r9 2d454: d5 01 movw r26, r10 2d456: 0d 90 ld r0, X+ 2d458: 00 20 and r0, r0 2d45a: e9 f7 brne .-6 ; 0x2d456 2d45c: ea 19 sub r30, r10 2d45e: fb 09 sbc r31, r11 char path[len]; 2d460: ea 0f add r30, r26 2d462: fb 1f adc r31, r27 2d464: 31 96 adiw r30, 0x01 ; 1 2d466: 2d b7 in r18, 0x3d ; 61 2d468: 3e b7 in r19, 0x3e ; 62 2d46a: 2e 1b sub r18, r30 2d46c: 3f 0b sbc r19, r31 2d46e: 0f b6 in r0, 0x3f ; 63 2d470: f8 94 cli 2d472: 3e bf out 0x3e, r19 ; 62 2d474: 0f be out 0x3f, r0 ; 63 2d476: 2d bf out 0x3d, r18 ; 61 2d478: ed b7 in r30, 0x3d ; 61 2d47a: fe b7 in r31, 0x3e ; 62 2d47c: 31 96 adiw r30, 0x01 ; 1 2d47e: 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 2d480: 60 ef ldi r22, 0xF0 ; 240 2d482: 72 e0 ldi r23, 0x02 ; 2 2d484: 81 11 cpse r24, r1 2d486: b4 01 movw r22, r8 2d488: c7 01 movw r24, r14 2d48a: 0f 94 a9 aa call 0x35552 ; 0x35552 strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2d48e: b5 01 movw r22, r10 2d490: c7 01 movw r24, r14 2d492: 0f 94 8a aa call 0x35514 ; 0x35514 strcat(path, "/"); // 1 character 2d496: 60 ef ldi r22, 0xF0 ; 240 2d498: 72 e0 ldi r23, 0x02 ; 2 2d49a: c7 01 movw r24, r14 2d49c: 0f 94 8a aa call 0x35514 ; 0x35514 // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2d4a0: 11 23 and r17, r17 2d4a2: a9 f0 breq .+42 ; 0x2d4ce printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2d4a4: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d4a8: 81 11 cpse r24, r1 2d4aa: 57 c0 rjmp .+174 ; 0x2d55a 2d4ac: c5 01 movw r24, r10 2d4ae: 9f 93 push r25 2d4b0: 8f 93 push r24 2d4b2: ff 92 push r15 2d4b4: ef 92 push r14 2d4b6: 2c e3 ldi r18, 0x3C ; 60 2d4b8: 32 ea ldi r19, 0xA2 ; 162 2d4ba: 3f 93 push r19 2d4bc: 2f 93 push r18 2d4be: 0f 94 00 a3 call 0x34600 ; 0x34600 2d4c2: 0f 90 pop r0 2d4c4: 0f 90 pop r0 2d4c6: 0f 90 pop r0 2d4c8: 0f 90 pop r0 2d4ca: 0f 90 pop r0 2d4cc: 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) {} 2d4ce: 1c a2 std Y+36, r1 ; 0x24 2d4d0: 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); 2d4d2: 21 e0 ldi r18, 0x01 ; 1 2d4d4: a5 01 movw r20, r10 2d4d6: b6 01 movw r22, r12 2d4d8: ce 01 movw r24, r28 2d4da: 84 96 adiw r24, 0x24 ; 36 2d4dc: 0f 94 3b 54 call 0x2a876 ; 0x2a876 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); 2d4e0: 83 e2 ldi r24, 0x23 ; 35 2d4e2: fe 01 movw r30, r28 2d4e4: b4 96 adiw r30, 0x24 ; 36 2d4e6: de 01 movw r26, r28 2d4e8: 11 96 adiw r26, 0x01 ; 1 2d4ea: 01 90 ld r0, Z+ 2d4ec: 0d 92 st X+, r0 2d4ee: 8a 95 dec r24 2d4f0: e1 f7 brne .-8 ; 0x2d4ea 2d4f2: 10 fb bst r17, 0 2d4f4: 50 f8 bld r5, 0 2d4f6: 05 2d mov r16, r5 2d4f8: 20 e0 ldi r18, 0x00 ; 0 2d4fa: 50 e0 ldi r21, 0x00 ; 0 2d4fc: 40 e0 ldi r20, 0x00 ; 0 2d4fe: be 01 movw r22, r28 2d500: 6f 5f subi r22, 0xFF ; 255 2d502: 7f 4f sbci r23, 0xFF ; 255 2d504: c7 01 movw r24, r14 2d506: 0f 94 f9 68 call 0x2d1f2 ; 0x2d1f2 2d50a: ce 01 movw r24, r28 2d50c: 01 96 adiw r24, 0x01 ; 1 2d50e: 0e 94 06 7a call 0xf40c ; 0xf40c // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2d512: 11 23 and r17, r17 2d514: 21 f0 breq .+8 ; 0x2d51e puts_P(PSTR("DIR_EXIT")); 2d516: 83 e3 ldi r24, 0x33 ; 51 2d518: 92 ea ldi r25, 0xA2 ; 162 2d51a: 0f 94 27 a3 call 0x3464e ; 0x3464e 2d51e: ce 01 movw r24, r28 2d520: 84 96 adiw r24, 0x24 ; 36 2d522: 0e 94 06 7a call 0xf40c ; 0xf40c 2d526: e7 96 adiw r28, 0x37 ; 55 2d528: ee ad ldd r30, Y+62 ; 0x3e 2d52a: ff ad ldd r31, Y+63 ; 0x3f 2d52c: e7 97 sbiw r28, 0x37 ; 55 2d52e: 0f b6 in r0, 0x3f ; 63 2d530: f8 94 cli 2d532: fe bf out 0x3e, r31 ; 62 2d534: 0f be out 0x3f, r0 ; 63 2d536: 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()) { 2d538: f6 01 movw r30, r12 2d53a: 80 85 ldd r24, Z+8 ; 0x08 2d53c: 91 85 ldd r25, Z+9 ; 0x09 2d53e: a2 85 ldd r26, Z+10 ; 0x0a 2d540: b3 85 ldd r27, Z+11 ; 0x0b 2d542: 80 93 ea 13 sts 0x13EA, r24 ; 0x8013ea 2d546: 90 93 eb 13 sts 0x13EB, r25 ; 0x8013eb 2d54a: a0 93 ec 13 sts 0x13EC, r26 ; 0x8013ec 2d54e: b0 93 ed 13 sts 0x13ED, r27 ; 0x8013ed 2d552: 8c ce rjmp .-744 ; 0x2d26c // 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; 2d554: e1 e0 ldi r30, 0x01 ; 1 2d556: f0 e0 ldi r31, 0x00 ; 0 2d558: 7d cf rjmp .-262 ; 0x2d454 // 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); 2d55a: 8e ee ldi r24, 0xEE ; 238 2d55c: 93 e1 ldi r25, 0x13 ; 19 2d55e: a7 cf rjmp .-178 ; 0x2d4ae else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2d560: 80 91 ef 16 lds r24, 0x16EF ; 0x8016ef 2d564: 90 91 f0 16 lds r25, 0x16F0 ; 0x8016f0 2d568: 01 96 adiw r24, 0x01 ; 1 2d56a: 90 93 f0 16 sts 0x16F0, r25 ; 0x8016f0 2d56e: 80 93 ef 16 sts 0x16EF, r24 ; 0x8016ef 2d572: e2 cf rjmp .-60 ; 0x2d538 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2d574: 89 ed ldi r24, 0xD9 ; 217 2d576: 93 e1 ldi r25, 0x13 ; 19 2d578: 45 cf rjmp .-374 ; 0x2d404 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2d57a: be 01 movw r22, r28 2d57c: 69 5b subi r22, 0xB9 ; 185 2d57e: 7f 4f sbci r23, 0xFF ; 255 2d580: 89 ed ldi r24, 0xD9 ; 217 2d582: 93 e1 ldi r25, 0x13 ; 19 2d584: 0e 94 eb 79 call 0xf3d6 ; 0xf3d6 SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2d588: a1 96 adiw r28, 0x21 ; 33 2d58a: 2e ad ldd r18, Y+62 ; 0x3e 2d58c: 3f ad ldd r19, Y+63 ; 0x3f 2d58e: a1 97 sbiw r28, 0x21 ; 33 2d590: 30 93 e9 13 sts 0x13E9, r19 ; 0x8013e9 2d594: 20 93 e8 13 sts 0x13E8, r18 ; 0x8013e8 crmodTime = p.lastWriteTime; 2d598: 6f 96 adiw r28, 0x1f ; 31 2d59a: 4e ad ldd r20, Y+62 ; 0x3e 2d59c: 5f ad ldd r21, Y+63 ; 0x3f 2d59e: 6f 97 sbiw r28, 0x1f ; 31 2d5a0: 50 93 e7 13 sts 0x13E7, r21 ; 0x8013e7 2d5a4: 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 ) ){ 2d5a8: 69 96 adiw r28, 0x19 ; 25 2d5aa: 8e ad ldd r24, Y+62 ; 0x3e 2d5ac: 9f ad ldd r25, Y+63 ; 0x3f 2d5ae: 69 97 sbiw r28, 0x19 ; 25 2d5b0: 28 17 cp r18, r24 2d5b2: 39 07 cpc r19, r25 2d5b4: 50 f0 brcs .+20 ; 0x2d5ca 2d5b6: 28 17 cp r18, r24 2d5b8: 39 07 cpc r19, r25 2d5ba: 99 f4 brne .+38 ; 0x2d5e2 2d5bc: 67 96 adiw r28, 0x17 ; 23 2d5be: 2e ad ldd r18, Y+62 ; 0x3e 2d5c0: 3f ad ldd r19, Y+63 ; 0x3f 2d5c2: 67 97 sbiw r28, 0x17 ; 23 2d5c4: 42 17 cp r20, r18 2d5c6: 53 07 cpc r21, r19 2d5c8: 60 f4 brcc .+24 ; 0x2d5e2 crmodDate = p.creationDate; 2d5ca: 90 93 e9 13 sts 0x13E9, r25 ; 0x8013e9 2d5ce: 80 93 e8 13 sts 0x13E8, r24 ; 0x8013e8 crmodTime = p.creationTime; 2d5d2: 67 96 adiw r28, 0x17 ; 23 2d5d4: 8e ad ldd r24, Y+62 ; 0x3e 2d5d6: 9f ad ldd r25, Y+63 ; 0x3f 2d5d8: 67 97 sbiw r28, 0x17 ; 23 2d5da: 90 93 e7 13 sts 0x13E7, r25 ; 0x8013e7 2d5de: 80 93 e6 13 sts 0x13E6, r24 ; 0x8013e6 } //writeDate = p.lastAccessDate; if (match != NULL) { 2d5e2: 61 14 cp r6, r1 2d5e4: 71 04 cpc r7, r1 2d5e6: 59 f1 breq .+86 ; 0x2d63e if (strcasecmp(match, filename) == 0) return; 2d5e8: 69 ed ldi r22, 0xD9 ; 217 2d5ea: 73 e1 ldi r23, 0x13 ; 19 2d5ec: c3 01 movw r24, r6 2d5ee: 0f 94 77 aa call 0x354ee ; 0x354ee 2d5f2: 89 2b or r24, r25 2d5f4: 59 f5 brne .+86 ; 0x2d64c // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2d5f6: 80 91 45 0e lds r24, 0x0E45 ; 0x800e45 2d5fa: 81 50 subi r24, 0x01 ; 1 2d5fc: 80 93 45 0e sts 0x0E45, r24 ; 0x800e45 cnt++; break; } } } // while readDir } 2d600: 0f b6 in r0, 0x3f ; 63 2d602: f8 94 cli 2d604: 3e be out 0x3e, r3 ; 62 2d606: 0f be out 0x3f, r0 ; 63 2d608: 2d be out 0x3d, r2 ; 61 2d60a: ca 58 subi r28, 0x8A ; 138 2d60c: df 4f sbci r29, 0xFF ; 255 2d60e: 0f b6 in r0, 0x3f ; 63 2d610: f8 94 cli 2d612: de bf out 0x3e, r29 ; 62 2d614: 0f be out 0x3f, r0 ; 63 2d616: cd bf out 0x3d, r28 ; 61 2d618: df 91 pop r29 2d61a: cf 91 pop r28 2d61c: 1f 91 pop r17 2d61e: 0f 91 pop r16 2d620: ff 90 pop r15 2d622: ef 90 pop r14 2d624: df 90 pop r13 2d626: cf 90 pop r12 2d628: bf 90 pop r11 2d62a: af 90 pop r10 2d62c: 9f 90 pop r9 2d62e: 8f 90 pop r8 2d630: 7f 90 pop r7 2d632: 6f 90 pop r6 2d634: 5f 90 pop r5 2d636: 4f 90 pop r4 2d638: 3f 90 pop r3 2d63a: 2f 90 pop r2 2d63c: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2d63e: 80 91 ef 16 lds r24, 0x16EF ; 0x8016ef 2d642: 90 91 f0 16 lds r25, 0x16F0 ; 0x8016f0 2d646: 48 16 cp r4, r24 2d648: 19 06 cpc r1, r25 2d64a: a9 f2 breq .-86 ; 0x2d5f6 cnt++; 2d64c: 43 94 inc r4 2d64e: 74 cf rjmp .-280 ; 0x2d538 0002d650 : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2d650: cf 92 push r12 2d652: df 92 push r13 2d654: ef 92 push r14 2d656: ff 92 push r15 2d658: 0f 93 push r16 2d65a: cf 93 push r28 2d65c: df 93 push r29 2d65e: cd b7 in r28, 0x3d ; 61 2d660: de b7 in r29, 0x3e ; 62 2d662: a3 97 sbiw r28, 0x23 ; 35 2d664: 0f b6 in r0, 0x3f ; 63 2d666: f8 94 cli 2d668: de bf out 0x3e, r29 ; 62 2d66a: 0f be out 0x3f, r0 ; 63 2d66c: cd bf out 0x3d, r28 ; 61 2d66e: 6c 01 movw r12, r24 { curDir=&workDir; 2d670: 80 e8 ldi r24, 0x80 ; 128 2d672: e8 2e mov r14, r24 2d674: 84 e1 ldi r24, 0x14 ; 20 2d676: f8 2e mov r15, r24 2d678: 82 e8 ldi r24, 0x82 ; 130 2d67a: 94 e1 ldi r25, 0x14 ; 20 2d67c: d7 01 movw r26, r14 2d67e: 8d 93 st X+, r24 2d680: 9c 93 st X, r25 nrFiles=nr; 2d682: 10 92 f0 16 sts 0x16F0, r1 ; 0x8016f0 2d686: 10 92 ef 16 sts 0x16EF, r1 ; 0x8016ef curDir->rewind(); 2d68a: 0e 94 01 7a call 0xf402 ; 0xf402 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2d68e: 00 e0 ldi r16, 0x00 ; 0 2d690: 0e 7f andi r16, 0xFE ; 254 2d692: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2d694: d7 01 movw r26, r14 2d696: ed 91 ld r30, X+ 2d698: fc 91 ld r31, X 2d69a: 83 e2 ldi r24, 0x23 ; 35 2d69c: de 01 movw r26, r28 2d69e: 11 96 adiw r26, 0x01 ; 1 2d6a0: 01 90 ld r0, Z+ 2d6a2: 0d 92 st X+, r0 2d6a4: 8a 95 dec r24 2d6a6: e1 f7 brne .-8 ; 0x2d6a0 2d6a8: 22 e0 ldi r18, 0x02 ; 2 2d6aa: a6 01 movw r20, r12 2d6ac: be 01 movw r22, r28 2d6ae: 6f 5f subi r22, 0xFF ; 255 2d6b0: 7f 4f sbci r23, 0xFF ; 255 2d6b2: 8f ed ldi r24, 0xDF ; 223 2d6b4: 92 e0 ldi r25, 0x02 ; 2 2d6b6: 0f 94 f9 68 call 0x2d1f2 ; 0x2d1f2 2d6ba: ce 01 movw r24, r28 2d6bc: 01 96 adiw r24, 0x01 ; 1 2d6be: 0e 94 06 7a call 0xf40c ; 0xf40c } 2d6c2: a3 96 adiw r28, 0x23 ; 35 2d6c4: 0f b6 in r0, 0x3f ; 63 2d6c6: f8 94 cli 2d6c8: de bf out 0x3e, r29 ; 62 2d6ca: 0f be out 0x3f, r0 ; 63 2d6cc: cd bf out 0x3d, r28 ; 61 2d6ce: df 91 pop r29 2d6d0: cf 91 pop r28 2d6d2: 0f 91 pop r16 2d6d4: ff 90 pop r15 2d6d6: ef 90 pop r14 2d6d8: df 90 pop r13 2d6da: cf 90 pop r12 2d6dc: 08 95 ret 0002d6de : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2d6de: ef 92 push r14 2d6e0: ff 92 push r15 2d6e2: 0f 93 push r16 2d6e4: cf 93 push r28 2d6e6: df 93 push r29 2d6e8: cd b7 in r28, 0x3d ; 61 2d6ea: de b7 in r29, 0x3e ; 62 2d6ec: a3 97 sbiw r28, 0x23 ; 35 2d6ee: 0f b6 in r0, 0x3f ; 63 2d6f0: f8 94 cli 2d6f2: de bf out 0x3e, r29 ; 62 2d6f4: 0f be out 0x3f, r0 ; 63 2d6f6: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2d6f8: 20 e8 ldi r18, 0x80 ; 128 2d6fa: e2 2e mov r14, r18 2d6fc: 24 e1 ldi r18, 0x14 ; 20 2d6fe: f2 2e mov r15, r18 2d700: 22 e8 ldi r18, 0x82 ; 130 2d702: 34 e1 ldi r19, 0x14 ; 20 2d704: d7 01 movw r26, r14 2d706: 2d 93 st X+, r18 2d708: 3c 93 st X, r19 nrFiles = 0; 2d70a: 10 92 f0 16 sts 0x16F0, r1 ; 0x8016f0 2d70e: 10 92 ef 16 sts 0x16EF, r1 ; 0x8016ef curDir->seekSet((uint32_t)entry << 5); 2d712: b0 e0 ldi r27, 0x00 ; 0 2d714: a0 e0 ldi r26, 0x00 ; 0 2d716: ac 01 movw r20, r24 2d718: bd 01 movw r22, r26 2d71a: e5 e0 ldi r30, 0x05 ; 5 2d71c: 44 0f add r20, r20 2d71e: 55 1f adc r21, r21 2d720: 66 1f adc r22, r22 2d722: 77 1f adc r23, r23 2d724: ea 95 dec r30 2d726: d1 f7 brne .-12 ; 0x2d71c 2d728: c9 01 movw r24, r18 2d72a: 0f 94 32 2a call 0x25464 ; 0x25464 2d72e: 00 e0 ldi r16, 0x00 ; 0 2d730: 0e 7f andi r16, 0xFE ; 254 2d732: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2d734: d7 01 movw r26, r14 2d736: ed 91 ld r30, X+ 2d738: fc 91 ld r31, X 2d73a: 83 e2 ldi r24, 0x23 ; 35 2d73c: de 01 movw r26, r28 2d73e: 11 96 adiw r26, 0x01 ; 1 2d740: 01 90 ld r0, Z+ 2d742: 0d 92 st X+, r0 2d744: 8a 95 dec r24 2d746: e1 f7 brne .-8 ; 0x2d740 2d748: 22 e0 ldi r18, 0x02 ; 2 2d74a: 50 e0 ldi r21, 0x00 ; 0 2d74c: 40 e0 ldi r20, 0x00 ; 0 2d74e: be 01 movw r22, r28 2d750: 6f 5f subi r22, 0xFF ; 255 2d752: 7f 4f sbci r23, 0xFF ; 255 2d754: 8f ed ldi r24, 0xDF ; 223 2d756: 92 e0 ldi r25, 0x02 ; 2 2d758: 0f 94 f9 68 call 0x2d1f2 ; 0x2d1f2 2d75c: ce 01 movw r24, r28 2d75e: 01 96 adiw r24, 0x01 ; 1 2d760: 0e 94 06 7a call 0xf40c ; 0xf40c } 2d764: a3 96 adiw r28, 0x23 ; 35 2d766: 0f b6 in r0, 0x3f ; 63 2d768: f8 94 cli 2d76a: de bf out 0x3e, r29 ; 62 2d76c: 0f be out 0x3f, r0 ; 63 2d76e: cd bf out 0x3d, r28 ; 61 2d770: df 91 pop r29 2d772: cf 91 pop r28 2d774: 0f 91 pop r16 2d776: ff 90 pop r15 2d778: ef 90 pop r14 2d77a: 08 95 ret 0002d77c : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2d77c: cf 92 push r12 2d77e: df 92 push r13 2d780: ef 92 push r14 2d782: ff 92 push r15 2d784: 0f 93 push r16 2d786: cf 93 push r28 2d788: df 93 push r29 2d78a: cd b7 in r28, 0x3d ; 61 2d78c: de b7 in r29, 0x3e ; 62 2d78e: a3 97 sbiw r28, 0x23 ; 35 2d790: 0f b6 in r0, 0x3f ; 63 2d792: f8 94 cli 2d794: de bf out 0x3e, r29 ; 62 2d796: 0f be out 0x3f, r0 ; 63 2d798: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2d79a: 80 e8 ldi r24, 0x80 ; 128 2d79c: c8 2e mov r12, r24 2d79e: 84 e1 ldi r24, 0x14 ; 20 2d7a0: d8 2e mov r13, r24 2d7a2: 82 e8 ldi r24, 0x82 ; 130 2d7a4: 94 e1 ldi r25, 0x14 ; 20 2d7a6: d6 01 movw r26, r12 2d7a8: 8d 93 st X+, r24 2d7aa: 9c 93 st X, r25 nrFiles=0; 2d7ac: 2f ee ldi r18, 0xEF ; 239 2d7ae: e2 2e mov r14, r18 2d7b0: 26 e1 ldi r18, 0x16 ; 22 2d7b2: f2 2e mov r15, r18 2d7b4: f7 01 movw r30, r14 2d7b6: 11 82 std Z+1, r1 ; 0x01 2d7b8: 10 82 st Z, r1 curDir->rewind(); 2d7ba: 0e 94 01 7a call 0xf402 ; 0xf402 2d7be: 00 e0 ldi r16, 0x00 ; 0 2d7c0: 0e 7f andi r16, 0xFE ; 254 2d7c2: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2d7c4: d6 01 movw r26, r12 2d7c6: ed 91 ld r30, X+ 2d7c8: fc 91 ld r31, X 2d7ca: 83 e2 ldi r24, 0x23 ; 35 2d7cc: de 01 movw r26, r28 2d7ce: 11 96 adiw r26, 0x01 ; 1 2d7d0: 01 90 ld r0, Z+ 2d7d2: 0d 92 st X+, r0 2d7d4: 8a 95 dec r24 2d7d6: e1 f7 brne .-8 ; 0x2d7d0 2d7d8: 21 e0 ldi r18, 0x01 ; 1 2d7da: 50 e0 ldi r21, 0x00 ; 0 2d7dc: 40 e0 ldi r20, 0x00 ; 0 2d7de: be 01 movw r22, r28 2d7e0: 6f 5f subi r22, 0xFF ; 255 2d7e2: 7f 4f sbci r23, 0xFF ; 255 2d7e4: 8f ed ldi r24, 0xDF ; 223 2d7e6: 92 e0 ldi r25, 0x02 ; 2 2d7e8: 0f 94 f9 68 call 0x2d1f2 ; 0x2d1f2 2d7ec: ce 01 movw r24, r28 2d7ee: 01 96 adiw r24, 0x01 ; 1 2d7f0: 0e 94 06 7a call 0xf40c ; 0xf40c //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2d7f4: f7 01 movw r30, r14 2d7f6: 80 81 ld r24, Z 2d7f8: 91 81 ldd r25, Z+1 ; 0x01 2d7fa: a3 96 adiw r28, 0x23 ; 35 2d7fc: 0f b6 in r0, 0x3f ; 63 2d7fe: f8 94 cli 2d800: de bf out 0x3e, r29 ; 62 2d802: 0f be out 0x3f, r0 ; 63 2d804: cd bf out 0x3d, r28 ; 61 2d806: df 91 pop r29 2d808: cf 91 pop r28 2d80a: 0f 91 pop r16 2d80c: ff 90 pop r15 2d80e: ef 90 pop r14 2d810: df 90 pop r13 2d812: cf 90 pop r12 2d814: 08 95 ret 0002d816 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2d816: cf 93 push r28 2d818: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2d81a: 8f e2 ldi r24, 0x2F ; 47 2d81c: 0e 94 0c 7a call 0xf418 ; 0xf418 { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2d820: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2d822: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2d824: 80 91 77 15 lds r24, 0x1577 ; 0x801577 2d828: c8 17 cp r28, r24 2d82a: 60 f4 brcc .+24 ; 0x2d844 { SERIAL_PROTOCOL(dir_names[i]); 2d82c: cd 9f mul r28, r29 2d82e: c0 01 movw r24, r0 2d830: 11 24 eor r1, r1 2d832: 89 5d subi r24, 0xD9 ; 217 2d834: 9b 4e sbci r25, 0xEB ; 235 2d836: 0e 94 11 86 call 0x10c22 ; 0x10c22 2d83a: 8f e2 ldi r24, 0x2F ; 47 2d83c: 0e 94 0c 7a call 0xf418 ; 0xf418 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2d840: cf 5f subi r28, 0xFF ; 255 2d842: f0 cf rjmp .-32 ; 0x2d824 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2d844: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d848: 81 11 cpse r24, r1 2d84a: 06 c0 rjmp .+12 ; 0x2d858 2d84c: 89 ed ldi r24, 0xD9 ; 217 2d84e: 93 e1 ldi r25, 0x13 ; 19 } 2d850: df 91 pop r29 2d852: cf 91 pop r28 2d854: 0c 94 11 86 jmp 0x10c22 ; 0x10c22 for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2d858: 8e ee ldi r24, 0xEE ; 238 2d85a: 93 e1 ldi r25, 0x13 ; 19 2d85c: f9 cf rjmp .-14 ; 0x2d850 0002d85e : 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) { 2d85e: cf 92 push r12 2d860: df 92 push r13 2d862: ef 92 push r14 2d864: ff 92 push r15 2d866: 6b 01 movw r12, r22 2d868: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2d86a: 88 ea ldi r24, 0xA8 ; 168 2d86c: 9c e0 ldi r25, 0x0C ; 12 2d86e: 0f 94 46 a4 call 0x3488c ; 0x3488c 2d872: ab 01 movw r20, r22 2d874: bc 01 movw r22, r24 2d876: 4c 0d add r20, r12 2d878: 5d 1d adc r21, r13 2d87a: 6e 1d adc r22, r14 2d87c: 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); 2d87e: 88 ea ldi r24, 0xA8 ; 168 2d880: 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); } 2d882: ff 90 pop r15 2d884: ef 90 pop r14 2d886: df 90 pop r13 2d888: 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); 2d88a: 0d 94 94 a4 jmp 0x34928 ; 0x34928 0002d88e : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2d88e: cf 93 push r28 2d890: df 93 push r29 2d892: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2d894: 0f 94 46 a4 call 0x3488c ; 0x3488c if (val == EEPROM_EMPTY_VALUE32) { 2d898: 6f 3f cpi r22, 0xFF ; 255 2d89a: 2f ef ldi r18, 0xFF ; 255 2d89c: 72 07 cpc r23, r18 2d89e: 82 07 cpc r24, r18 2d8a0: 92 07 cpc r25, r18 2d8a2: 49 f4 brne .+18 ; 0x2d8b6 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); 2d8a4: 40 e0 ldi r20, 0x00 ; 0 2d8a6: 50 e0 ldi r21, 0x00 ; 0 2d8a8: ba 01 movw r22, r20 2d8aa: ce 01 movw r24, r28 2d8ac: 0f 94 94 a4 call 0x34928 ; 0x34928 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; 2d8b0: 60 e0 ldi r22, 0x00 ; 0 2d8b2: 70 e0 ldi r23, 0x00 ; 0 2d8b4: cb 01 movw r24, r22 } return val; } 2d8b6: df 91 pop r29 2d8b8: cf 91 pop r28 2d8ba: 08 95 ret 0002d8bc : : "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(){ 2d8bc: 0f 93 push r16 2d8be: 1f 93 push r17 2d8c0: cf 93 push r28 2d8c2: df 93 push r29 if( ! gfEnsureBlock() ){ 2d8c4: 0f 94 3e 5a call 0x2b47c ; 0x2b47c 2d8c8: 88 23 and r24, r24 2d8ca: 39 f1 breq .+78 ; 0x2d91a 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; 2d8cc: 20 91 82 16 lds r18, 0x1682 ; 0x801682 2d8d0: 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; 2d8d4: 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; 2d8d6: 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 == ';' ){ 2d8d8: 88 81 ld r24, Y 2d8da: 8b 33 cpi r24, 0x3B ; 59 2d8dc: 51 f5 brne .+84 ; 0x2d932 // 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); 2d8de: fe 01 movw r30, r28 0002d8e0 : 2d8e0: 61 91 ld r22, Z+ 2d8e2: 6a 30 cpi r22, 0x0A ; 10 2d8e4: e9 f7 brne .-6 ; 0x2d8e0 2d8e6: ef 01 movw r28, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 2d8e8: cf 01 movw r24, r30 2d8ea: 86 54 subi r24, 0x46 ; 70 2d8ec: 9e 40 sbci r25, 0x0E ; 14 2d8ee: 81 30 cpi r24, 0x01 ; 1 2d8f0: 92 40 sbci r25, 0x02 ; 2 2d8f2: e4 f0 brlt .+56 ; 0x2d92c // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 2d8f4: ce 01 movw r24, r28 2d8f6: 82 1b sub r24, r18 2d8f8: 93 0b sbc r25, r19 2d8fa: 01 97 sbiw r24, 0x01 ; 1 2d8fc: 0f 94 1a 55 call 0x2aa34 ; 0x2aa34 if( ! gfComputeNextFileBlock() )goto eof_or_fail; 2d900: 87 e6 ldi r24, 0x67 ; 103 2d902: 96 e1 ldi r25, 0x16 ; 22 2d904: 0f 94 b9 29 call 0x25372 ; 0x25372 2d908: 88 23 and r24, r24 2d90a: 39 f0 breq .+14 ; 0x2d91a if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 2d90c: 0f 94 3e 5a call 0x2b47c ; 0x2b47c rdPtr = start = blockBuffBegin; 2d910: 26 e4 ldi r18, 0x46 ; 70 2d912: 3e e0 ldi r19, 0x0E ; 14 2d914: 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 2d916: 81 11 cpse r24, r1 2d918: e2 cf rjmp .-60 ; 0x2d8de } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 2d91a: 86 e4 ldi r24, 0x46 ; 70 2d91c: 90 e1 ldi r25, 0x10 ; 16 2d91e: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2d922: 80 93 82 16 sts 0x1682, r24 ; 0x801682 return -1; 2d926: cf ef ldi r28, 0xFF ; 255 2d928: df ef ldi r29, 0xFF ; 255 2d92a: 34 c0 rjmp .+104 ; 0x2d994 2d92c: 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){ 2d92e: c1 f5 brne .+112 ; 0x2d9a0 // 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 2d930: 21 97 sbiw r28, 0x01 ; 1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 2d932: ce 01 movw r24, r28 2d934: 82 1b sub r24, r18 2d936: 93 0b sbc r25, r19 2d938: 01 96 adiw r24, 0x01 ; 1 2d93a: 0f 94 1a 55 call 0x2aa34 ; 0x2aa34 int16_t rv = *rdPtr++; 2d93e: ce 01 movw r24, r28 2d940: 01 96 adiw r24, 0x01 ; 1 2d942: c8 81 ld r28, Y 2d944: d0 e0 ldi r29, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 2d946: 00 91 6f 16 lds r16, 0x166F ; 0x80166f 2d94a: 10 91 70 16 lds r17, 0x1670 ; 0x801670 2d94e: 20 91 71 16 lds r18, 0x1671 ; 0x801671 2d952: 30 91 72 16 lds r19, 0x1672 ; 0x801672 2d956: 40 91 78 16 lds r20, 0x1678 ; 0x801678 2d95a: 50 91 79 16 lds r21, 0x1679 ; 0x801679 2d95e: 60 91 7a 16 lds r22, 0x167A ; 0x80167a 2d962: 70 91 7b 16 lds r23, 0x167B ; 0x80167b 2d966: 04 17 cp r16, r20 2d968: 15 07 cpc r17, r21 2d96a: 26 07 cpc r18, r22 2d96c: 37 07 cpc r19, r23 2d96e: a8 f6 brcc .-86 ; 0x2d91a // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 2d970: 9c 01 movw r18, r24 2d972: 26 54 subi r18, 0x46 ; 70 2d974: 3e 40 sbci r19, 0x0E ; 14 2d976: 21 15 cp r18, r1 2d978: 32 40 sbci r19, 0x02 ; 2 2d97a: 44 f0 brlt .+16 ; 0x2d98c // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 2d97c: 87 e6 ldi r24, 0x67 ; 103 2d97e: 96 e1 ldi r25, 0x16 ; 22 2d980: 0f 94 b9 29 call 0x25372 ; 0x25372 2d984: 88 23 and r24, r24 2d986: 49 f2 breq .-110 ; 0x2d91a // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 2d988: 86 e4 ldi r24, 0x46 ; 70 2d98a: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 2d98c: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2d990: 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; } 2d994: ce 01 movw r24, r28 2d996: df 91 pop r29 2d998: cf 91 pop r28 2d99a: 1f 91 pop r17 2d99c: 0f 91 pop r16 2d99e: 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 == ';' ){ 2d9a0: 88 81 ld r24, Y 2d9a2: 8b 33 cpi r24, 0x3B ; 59 2d9a4: 09 f4 brne .+2 ; 0x2d9a8 2d9a6: 98 cf rjmp .-208 ; 0x2d8d8 2d9a8: c3 cf rjmp .-122 ; 0x2d930 0002d9aa : ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } return ret; } void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } 2d9aa: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2d9ac: f8 94 cli 2d9ae: 10 92 03 17 sts 0x1703, r1 ; 0x801703 2d9b2: 10 92 02 17 sts 0x1702, r1 ; 0x801702 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2d9b6: 8f bf out 0x3f, r24 ; 63 } 2d9b8: 08 95 ret 0002d9ba : 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); 2d9ba: 87 e6 ldi r24, 0x67 ; 103 2d9bc: 9f e0 ldi r25, 0x0F ; 15 2d9be: 0f 94 3e a4 call 0x3487c ; 0x3487c 2d9c2: 91 e0 ldi r25, 0x01 ; 1 2d9c4: 81 11 cpse r24, r1 2d9c6: 01 c0 rjmp .+2 ; 0x2d9ca 2d9c8: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { 2d9ca: 81 e0 ldi r24, 0x01 ; 1 2d9cc: 20 91 f1 16 lds r18, 0x16F1 ; 0x8016f1 2d9d0: 21 11 cpse r18, r1 2d9d2: 01 c0 rjmp .+2 ; 0x2d9d6 2d9d4: 80 e0 ldi r24, 0x00 ; 0 2d9d6: 98 13 cpse r25, r24 state = enabled ? State::initializing : State::disabled; 2d9d8: 90 93 f1 16 sts 0x16F1, r25 ; 0x8016f1 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); 2d9dc: 87 e0 ldi r24, 0x07 ; 7 2d9de: 9f e0 ldi r25, 0x0F ; 15 2d9e0: 0f 94 3e a4 call 0x3487c ; 0x3487c 2d9e4: 91 e0 ldi r25, 0x01 ; 1 2d9e6: 81 11 cpse r24, r1 2d9e8: 01 c0 rjmp .+2 ; 0x2d9ec 2d9ea: 90 e0 ldi r25, 0x00 ; 0 2d9ec: 90 93 f2 16 sts 0x16F2, r25 ; 0x8016f2 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); 2d9f0: 85 ed ldi r24, 0xD5 ; 213 2d9f2: 9e e0 ldi r25, 0x0E ; 14 2d9f4: 0f 94 3e a4 call 0x3487c ; 0x3487c 2d9f8: 91 e0 ldi r25, 0x01 ; 1 2d9fa: 81 11 cpse r24, r1 2d9fc: 01 c0 rjmp .+2 ; 0x2da00 2d9fe: 90 e0 ldi r25, 0x00 ; 0 2da00: 90 93 f3 16 sts 0x16F3, r25 ; 0x8016f3 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); 2da04: 87 e4 ldi r24, 0x47 ; 71 2da06: 9d e0 ldi r25, 0x0D ; 13 2da08: 0f 94 3e a4 call 0x3487c ; 0x3487c if (sensorActionOnError == SensorActionOnError::_Undef) { 2da0c: 8f 3f cpi r24, 0xFF ; 255 2da0e: c9 f0 breq .+50 ; 0x2da42 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); 2da10: 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)); 2da14: 8d ea ldi r24, 0xAD ; 173 2da16: 9c e0 ldi r25, 0x0C ; 12 2da18: 0f 94 3e a4 call 0x3487c ; 0x3487c 2da1c: 91 e0 ldi r25, 0x01 ; 1 2da1e: 81 11 cpse r24, r1 2da20: 01 c0 rjmp .+2 ; 0x2da24 2da22: 90 e0 ldi r25, 0x00 ; 0 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 2da24: 90 93 ff 16 sts 0x16FF, r25 ; 0x8016ff oldPos = pat9125_y; 2da28: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 2da2c: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 2da30: 90 93 01 17 sts 0x1701, r25 ; 0x801701 2da34: 80 93 00 17 sts 0x1700, r24 ; 0x801700 resetStepCount(); 2da38: 0f 94 d5 6c call 0x2d9aa ; 0x2d9aa jamErrCnt = 0; 2da3c: 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)); } 2da40: 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; 2da42: 10 92 f9 16 sts 0x16F9, r1 ; 0x8016f9 2da46: e6 cf rjmp .-52 ; 0x2da14 0002da48 : #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) { 2da48: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 2da4c: 83 30 cpi r24, 0x03 ; 3 2da4e: 21 f4 brne .+8 ; 0x2da58 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; 2da50: 10 92 f1 16 sts 0x16F1, r1 ; 0x8016f1 filter = 0; 2da54: 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 2da58: 0f 94 dd 6c call 0x2d9ba ; 0x2d9ba int16_t stepCount; int16_t chunkSteps; uint8_t jamErrCnt; constexpr void calcChunkSteps(float u) { chunkSteps = (int16_t)(1.25 * u); //[mm] 2da5c: 20 e0 ldi r18, 0x00 ; 0 2da5e: 30 e0 ldi r19, 0x00 ; 0 2da60: 40 ea ldi r20, 0xA0 ; 160 2da62: 5f e3 ldi r21, 0x3F ; 63 2da64: 60 91 77 0d lds r22, 0x0D77 ; 0x800d77 2da68: 70 91 78 0d lds r23, 0x0D78 ; 0x800d78 2da6c: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 2da70: 90 91 7a 0d lds r25, 0x0D7A ; 0x800d7a 2da74: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2da78: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 2da7c: 70 93 05 17 sts 0x1705, r23 ; 0x801705 2da80: 60 93 04 17 sts 0x1704, r22 ; 0x801704 static void swi2c_write(uint8_t data); void swi2c_init(void) { SET_INPUT(SWI2C_SDA); 2da84: 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 2da86: 59 9a sbi 0x0b, 1 ; 11 WRITE(SWI2C_SCL, 0); 2da88: 9f b7 in r25, 0x3f ; 63 2da8a: f8 94 cli 2da8c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2da90: 8b 7f andi r24, 0xFB ; 251 2da92: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2da96: 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. 2da98: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 2da9c: 84 60 ori r24, 0x04 ; 4 2da9e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 2daa2: 84 e6 ldi r24, 0x64 ; 100 2daa4: 98 e0 ldi r25, 0x08 ; 8 2daa6: 9a 95 dec r25 2daa8: f1 f7 brne .-4 ; 0x2daa6 2daaa: 81 50 subi r24, 0x01 ; 1 for (uint8_t i = 0; i < 100; i++) //wait. Not sure what for, but wait anyway. 2daac: d9 f7 brne .-10 ; 0x2daa4 2daae: 8a e0 ldi r24, 0x0A ; 10 } */ static void swi2c_nack(void) { WRITE(SWI2C_SDA, 1); 2dab0: 59 9a sbi 0x0b, 1 ; 11 2dab2: 98 e0 ldi r25, 0x08 ; 8 2dab4: 9a 95 dec r25 2dab6: f1 f7 brne .-4 ; 0x2dab4 __delay(); WRITE(SWI2C_SCL, 1); 2dab8: 2f b7 in r18, 0x3f ; 63 2daba: f8 94 cli 2dabc: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2dac0: 94 60 ori r25, 0x04 ; 4 2dac2: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2dac6: 2f bf out 0x3f, r18 ; 63 2dac8: 98 e0 ldi r25, 0x08 ; 8 2daca: 9a 95 dec r25 2dacc: f1 f7 brne .-4 ; 0x2daca __delay(); WRITE(SWI2C_SCL, 0); 2dace: 2f b7 in r18, 0x3f ; 63 2dad0: f8 94 cli 2dad2: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2dad6: 9b 7f andi r25, 0xFB ; 251 2dad8: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2dadc: 2f bf out 0x3f, r18 ; 63 2dade: 98 e0 ldi r25, 0x08 ; 8 2dae0: 9a 95 dec r25 2dae2: f1 f7 brne .-4 ; 0x2dae0 2dae4: 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. 2dae6: 21 f7 brne .-56 ; 0x2dab0 swi2c_nack(); } swi2c_stop(); //"release" the bus by sending a stop condition. 2dae8: 0f 94 ad 14 call 0x2295a ; 0x2295a SET_OUTPUT(SWI2C_SDA); //finally make the SDA line an output since the bus is idle for sure. 2daec: 51 9a sbi 0x0a, 1 ; 10 } } uint8_t swi2c_check(uint8_t dev_addr) { swi2c_start(); 2daee: 0f 94 bd 14 call 0x2297a ; 0x2297a swi2c_write((dev_addr & SWI2C_DMSK) << SWI2C_ASHF); 2daf2: 8a ee ldi r24, 0xEA ; 234 2daf4: 0f 94 4c 14 call 0x22898 ; 0x22898 if (!swi2c_wait_ack()) { swi2c_stop(); return 1; } 2daf8: 0f 94 78 14 call 0x228f0 ; 0x228f0 2dafc: 81 11 cpse r24, r1 2dafe: 08 c0 rjmp .+16 ; 0x2db10 2db00: 0f 94 ad 14 call 0x2295a ; 0x2295a void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; filter = 0; 2db04: 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; 2db08: 83 e0 ldi r24, 0x03 ; 3 2db0a: 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 } 2db0e: 08 95 ret swi2c_stop(); 2db10: 0f 94 ad 14 call 0x2295a ; 0x2295a { 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); 2db14: 60 e0 ldi r22, 0x00 ; 0 2db16: 8f e7 ldi r24, 0x7F ; 127 2db18: 0f 94 6d 4c call 0x298da ; 0x298da // Verify that the sensor responds with its correct product ID. pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2db1c: 80 e0 ldi r24, 0x00 ; 0 2db1e: 0f 94 96 4c call 0x2992c ; 0x2992c 2db22: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2db26: 81 e0 ldi r24, 0x01 ; 1 2db28: 0f 94 96 4c call 0x2992c ; 0x2992c 2db2c: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2db30: 90 91 66 0d lds r25, 0x0D66 ; 0x800d66 2db34: 91 33 cpi r25, 0x31 ; 49 2db36: b1 f5 brne .+108 ; 0x2dba4 2db38: 81 39 cpi r24, 0x91 ; 145 2db3a: a1 f5 brne .+104 ; 0x2dba4 } #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); 2db3c: 67 e9 ldi r22, 0x97 ; 151 2db3e: 86 e0 ldi r24, 0x06 ; 6 2db40: 0f 94 6d 4c call 0x298da ; 0x298da #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 2db44: 8f e9 ldi r24, 0x9F ; 159 2db46: 9f e0 ldi r25, 0x0F ; 15 2db48: 01 97 sbiw r24, 0x01 ; 1 2db4a: f1 f7 brne .-4 ; 0x2db48 2db4c: 00 c0 rjmp .+0 ; 0x2db4e 2db4e: 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)) 2db50: 86 e1 ldi r24, 0x16 ; 22 2db52: 92 ea ldi r25, 0xA2 ; 162 2db54: 0f 94 f2 4c call 0x299e4 ; 0x299e4 2db58: 88 23 and r24, r24 2db5a: a1 f2 breq .-88 ; 0x2db04 2db5c: 8f e3 ldi r24, 0x3F ; 63 2db5e: 9c e9 ldi r25, 0x9C ; 156 2db60: 01 97 sbiw r24, 0x01 ; 1 2db62: f1 f7 brne .-4 ; 0x2db60 2db64: 00 c0 rjmp .+0 ; 0x2db66 2db66: 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); 2db68: 61 e0 ldi r22, 0x01 ; 1 2db6a: 8f e7 ldi r24, 0x7F ; 127 2db6c: 0f 94 6d 4c call 0x298da ; 0x298da //Write init sequence in bank1. MUST ALREADY BE IN bank1. if (!pat9125_wr_seq(pat9125_init_bank1)) 2db70: 83 ee ldi r24, 0xE3 ; 227 2db72: 91 ea ldi r25, 0xA1 ; 161 2db74: 0f 94 f2 4c call 0x299e4 ; 0x299e4 2db78: 88 23 and r24, r24 2db7a: 21 f2 breq .-120 ; 0x2db04 return 0; // Switch to bank0, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0x00); 2db7c: 60 e0 ldi r22, 0x00 ; 0 2db7e: 8f e7 ldi r24, 0x7F ; 127 2db80: 0f 94 6d 4c call 0x298da ; 0x298da // Enable write protect. pat9125_wr_reg(PAT9125_WP, 0x00); //prevents writing to registers over 0x09 2db84: 60 e0 ldi r22, 0x00 ; 0 2db86: 89 e0 ldi r24, 0x09 ; 9 2db88: 0f 94 6d 4c call 0x298da ; 0x298da pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2db8c: 80 e0 ldi r24, 0x00 ; 0 2db8e: 0f 94 96 4c call 0x2992c ; 0x2992c 2db92: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2db96: 81 e0 ldi r24, 0x01 ; 1 2db98: 0f 94 96 4c call 0x2992c ; 0x2992c 2db9c: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 deinit(); triggerError(); ; // } #ifdef IR_SENSOR_PIN else if (!READ(IR_SENSOR_PIN)) { 2dba0: 89 b1 in r24, 0x09 ; 9 2dba2: 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); 2dba4: 80 e0 ldi r24, 0x00 ; 0 2dba6: 0f 94 96 4c call 0x2992c ; 0x2992c 2dbaa: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2dbae: 81 e0 ldi r24, 0x01 ; 1 2dbb0: 0f 94 96 4c call 0x2992c ; 0x2992c 2dbb4: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2dbb8: 90 91 66 0d lds r25, 0x0D66 ; 0x800d66 2dbbc: 91 33 cpi r25, 0x31 ; 49 2dbbe: 09 f0 breq .+2 ; 0x2dbc2 2dbc0: a1 cf rjmp .-190 ; 0x2db04 2dbc2: 81 39 cpi r24, 0x91 ; 145 2dbc4: 09 f0 breq .+2 ; 0x2dbc8 2dbc6: 9e cf rjmp .-196 ; 0x2db04 2dbc8: b9 cf rjmp .-142 ; 0x2db3c 0002dbca : 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() { 2dbca: cf 93 push r28 2dbcc: df 93 push r29 if (jamDetection) { 2dbce: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 2dbd2: 88 23 and r24, r24 2dbd4: 09 f4 brne .+2 ; 0x2dbd8 2dbd6: 60 c0 rjmp .+192 ; 0x2dc98 setJamDetectionEnabled(eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION)); } int16_t PAT9125_sensor::getStepCount() { int16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } 2dbd8: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2dbda: f8 94 cli 2dbdc: c0 91 02 17 lds r28, 0x1702 ; 0x801702 2dbe0: d0 91 03 17 lds r29, 0x1703 ; 0x801703 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2dbe4: 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 2dbe6: ce 01 movw r24, r28 2dbe8: d7 ff sbrs r29, 7 2dbea: 04 c0 rjmp .+8 ; 0x2dbf4 2dbec: 88 27 eor r24, r24 2dbee: 99 27 eor r25, r25 2dbf0: 8c 1b sub r24, r28 2dbf2: 9d 0b sbc r25, r29 2dbf4: 20 91 04 17 lds r18, 0x1704 ; 0x801704 2dbf8: 30 91 05 17 lds r19, 0x1705 ; 0x801705 2dbfc: 82 17 cp r24, r18 2dbfe: 93 07 cpc r25, r19 2dc00: 4c f1 brlt .+82 ; 0x2dc54 resetStepCount(); 2dc02: 0f 94 d5 6c call 0x2d9aa ; 0x2d9aa if (!pat9125_update()) { // get up to date data. reinit on error. 2dc06: 0f 94 10 4d call 0x29a20 ; 0x29a20 2dc0a: 81 11 cpse r24, r1 2dc0c: 02 c0 rjmp .+4 ; 0x2dc12 init(); // try to reinit. 2dc0e: 0f 94 24 6d call 0x2da48 ; 0x2da48 } bool fsDir = (pat9125_y - oldPos) > 0; 2dc12: 20 91 38 0e lds r18, 0x0E38 ; 0x800e38 2dc16: 30 91 39 0e lds r19, 0x0E39 ; 0x800e39 2dc1a: 80 91 06 17 lds r24, 0x1706 ; 0x801706 2dc1e: 40 91 00 17 lds r20, 0x1700 ; 0x801700 2dc22: 50 91 01 17 lds r21, 0x1701 ; 0x801701 2dc26: b9 01 movw r22, r18 2dc28: 64 1b sub r22, r20 2dc2a: 75 0b sbc r23, r21 2dc2c: 41 e0 ldi r20, 0x01 ; 1 2dc2e: 16 16 cp r1, r22 2dc30: 17 06 cpc r1, r23 2dc32: 0c f0 brlt .+2 ; 0x2dc36 2dc34: 40 e0 ldi r20, 0x00 ; 0 bool stDir = _stepCount > 0; 2dc36: 91 e0 ldi r25, 0x01 ; 1 2dc38: 1c 16 cp r1, r28 2dc3a: 1d 06 cpc r1, r29 2dc3c: 0c f0 brlt .+2 ; 0x2dc40 2dc3e: 90 e0 ldi r25, 0x00 ; 0 if (fsDir != stDir) { 2dc40: 49 17 cp r20, r25 2dc42: 09 f4 brne .+2 ; 0x2dc46 2dc44: 61 c0 rjmp .+194 ; 0x2dd08 jamErrCnt++; 2dc46: 8f 5f subi r24, 0xFF ; 255 } else if (jamErrCnt) { jamErrCnt--; 2dc48: 80 93 06 17 sts 0x1706, r24 ; 0x801706 } oldPos = pat9125_y; 2dc4c: 30 93 01 17 sts 0x1701, r19 ; 0x801701 2dc50: 20 93 00 17 sts 0x1700, r18 ; 0x801700 } if (jamErrCnt > 10) { 2dc54: 80 91 06 17 lds r24, 0x1706 ; 0x801706 2dc58: 8b 30 cpi r24, 0x0B ; 11 2dc5a: f0 f0 brcs .+60 ; 0x2dc98 jamErrCnt = 0; 2dc5c: 10 92 06 17 sts 0x1706, r1 ; 0x801706 void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } } void PAT9125_sensor::filJam() { runoutEnabled = false; 2dc60: 10 92 f3 16 sts 0x16F3, r1 ; 0x8016f3 autoLoadEnabled = false; 2dc64: 10 92 f2 16 sts 0x16F2, r1 ; 0x8016f2 jamDetection = false; 2dc68: 10 92 ff 16 sts 0x16FF, r1 ; 0x8016ff stop_and_save_print_to_ram(0, 0); 2dc6c: 60 e0 ldi r22, 0x00 ; 0 2dc6e: 70 e0 ldi r23, 0x00 ; 0 2dc70: cb 01 movw r24, r22 2dc72: 0f 94 7c 65 call 0x2caf8 ; 0x2caf8 restore_print_from_ram_and_continue(0); 2dc76: 60 e0 ldi r22, 0x00 ; 0 2dc78: 70 e0 ldi r23, 0x00 ; 0 2dc7a: cb 01 movw r24, r22 2dc7c: 0e 94 13 67 call 0xce26 ; 0xce26 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 2dc80: 85 e6 ldi r24, 0x65 ; 101 2dc82: 9f e0 ldi r25, 0x0F ; 15 2dc84: 0e 94 d7 78 call 0xf1ae ; 0xf1ae eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 2dc88: 81 e0 ldi r24, 0x01 ; 1 2dc8a: 9f e0 ldi r25, 0x0F ; 15 2dc8c: 0e 94 ca 78 call 0xf194 ; 0xf194 enquecommand_front_P(MSG_M600); 2dc90: 82 e0 ldi r24, 0x02 ; 2 2dc92: 9d e6 ldi r25, 0x6D ; 109 2dc94: 0f 94 e7 66 call 0x2cdce ; 0x2cdce jamErrCnt = 0; filJam(); } } if (pollingTimer.expired_cont(pollingPeriod)) { 2dc98: 6a e0 ldi r22, 0x0A ; 10 2dc9a: 70 e0 ldi r23, 0x00 ; 0 2dc9c: 8a ef ldi r24, 0xFA ; 250 2dc9e: 96 e1 ldi r25, 0x16 ; 22 2dca0: 0f 94 58 0b call 0x216b0 ; 0x216b0 ::expired_cont(unsigned short)> 2dca4: c8 2f mov r28, r24 2dca6: 88 23 and r24, r24 2dca8: 39 f1 breq .+78 ; 0x2dcf8 pollingTimer.start(); 2dcaa: 8a ef ldi r24, 0xFA ; 250 2dcac: 96 e1 ldi r25, 0x16 ; 22 2dcae: 0f 94 5f 0b call 0x216be ; 0x216be ::start()> if (!pat9125_update()) { 2dcb2: 0f 94 10 4d call 0x29a20 ; 0x29a20 2dcb6: 81 11 cpse r24, r1 2dcb8: 02 c0 rjmp .+4 ; 0x2dcbe init(); // try to reinit. 2dcba: 0f 94 24 6d call 0x2da48 ; 0x2da48 } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); 2dcbe: 80 91 64 0d lds r24, 0x0D64 ; 0x800d64 2dcc2: 81 31 cpi r24, 0x11 ; 17 2dcc4: 30 f0 brcs .+12 ; 0x2dcd2 2dcc6: c1 e0 ldi r28, 0x01 ; 1 2dcc8: 80 91 63 0d lds r24, 0x0D63 ; 0x800d63 2dccc: 82 33 cpi r24, 0x32 ; 50 2dcce: 08 f4 brcc .+2 ; 0x2dcd2 2dcd0: c0 e0 ldi r28, 0x00 ; 0 2dcd2: 80 91 fd 16 lds r24, 0x16FD ; 0x8016fd if (present != filterFilPresent) { 2dcd6: 20 91 fe 16 lds r18, 0x16FE ; 0x8016fe 2dcda: 30 e0 ldi r19, 0x00 ; 0 2dcdc: c2 17 cp r28, r18 2dcde: 13 06 cpc r1, r19 2dce0: c1 f0 breq .+48 ; 0x2dd12 filter++; 2dce2: 8f 5f subi r24, 0xFF ; 255 } else if (filter) { filter--; 2dce4: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd } if (filter >= filterCnt) { 2dce8: 80 91 fd 16 lds r24, 0x16FD ; 0x8016fd 2dcec: 85 30 cpi r24, 0x05 ; 5 2dcee: 20 f0 brcs .+8 ; 0x2dcf8 filter = 0; 2dcf0: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd filterFilPresent = present; 2dcf4: c0 93 fe 16 sts 0x16FE, r28 ; 0x8016fe } } return (filter == 0); // return stability 2dcf8: 81 e0 ldi r24, 0x01 ; 1 2dcfa: 90 91 fd 16 lds r25, 0x16FD ; 0x8016fd 2dcfe: 91 11 cpse r25, r1 2dd00: 80 e0 ldi r24, 0x00 ; 0 } 2dd02: df 91 pop r29 2dd04: cf 91 pop r28 2dd06: 08 95 ret } bool fsDir = (pat9125_y - oldPos) > 0; bool stDir = _stepCount > 0; if (fsDir != stDir) { jamErrCnt++; } else if (jamErrCnt) { 2dd08: 88 23 and r24, r24 2dd0a: 09 f4 brne .+2 ; 0x2dd0e 2dd0c: 9f cf rjmp .-194 ; 0x2dc4c jamErrCnt--; 2dd0e: 81 50 subi r24, 0x01 ; 1 2dd10: 9b cf rjmp .-202 ; 0x2dc48 } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); if (present != filterFilPresent) { filter++; } else if (filter) { 2dd12: 88 23 and r24, r24 2dd14: 49 f3 breq .-46 ; 0x2dce8 filter--; 2dd16: 81 50 subi r24, 0x01 ; 1 2dd18: e5 cf rjmp .-54 ; 0x2dce4 0002dd1a : * 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() { 2dd1a: 2f 92 push r2 2dd1c: 3f 92 push r3 2dd1e: 4f 92 push r4 2dd20: 5f 92 push r5 2dd22: 6f 92 push r6 2dd24: 7f 92 push r7 2dd26: 8f 92 push r8 2dd28: 9f 92 push r9 2dd2a: af 92 push r10 2dd2c: bf 92 push r11 2dd2e: cf 92 push r12 2dd30: df 92 push r13 2dd32: ef 92 push r14 2dd34: ff 92 push r15 2dd36: 0f 93 push r16 2dd38: 1f 93 push r17 2dd3a: cf 93 push r28 2dd3c: df 93 push r29 2dd3e: cd b7 in r28, 0x3d ; 61 2dd40: de b7 in r29, 0x3e ; 62 2dd42: ed 97 sbiw r28, 0x3d ; 61 2dd44: 0f b6 in r0, 0x3f ; 63 2dd46: f8 94 cli 2dd48: de bf out 0x3e, r29 ; 62 2dd4a: 0f be out 0x3f, r0 ; 63 2dd4c: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2dd4e: 10 92 79 15 sts 0x1579, r1 ; 0x801579 2dd52: 10 92 78 15 sts 0x1578, r1 ; 0x801578 lastSortedFilePosition = 0; 2dd56: 10 92 43 16 sts 0x1643, r1 ; 0x801643 2dd5a: 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 2dd5e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2dd62: 82 fd sbrc r24, 2 2dd64: f7 c0 rjmp .+494 ; 0x2df54 uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2dd66: 89 e0 ldi r24, 0x09 ; 9 2dd68: 9f e0 ldi r25, 0x0F ; 15 2dd6a: 0f 94 3e a4 call 0x3487c ; 0x3487c 2dd6e: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2dd70: 82 e0 ldi r24, 0x02 ; 2 2dd72: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2dd76: 0f 94 be 6b call 0x2d77c ; 0x2d77c 2dd7a: 6c 01 movw r12, r24 if (fileCnt > 0) { 2dd7c: 00 97 sbiw r24, 0x00 ; 0 2dd7e: 09 f4 brne .+2 ; 0x2dd82 2dd80: e6 c0 rjmp .+460 ; 0x2df4e // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2dd82: 85 36 cpi r24, 0x65 ; 101 2dd84: 91 05 cpc r25, r1 2dd86: 80 f0 brcs .+32 ; 0x2dda8 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2dd88: 32 e0 ldi r19, 0x02 ; 2 2dd8a: 33 16 cp r3, r19 2dd8c: 51 f0 breq .+20 ; 0x2dda2 2dd8e: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 2dd92: 81 11 cpse r24, r1 2dd94: 06 c0 rjmp .+12 ; 0x2dda2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2dd96: 88 ef ldi r24, 0xF8 ; 248 2dd98: 92 e6 ldi r25, 0x62 ; 98 2dd9a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2dd9e: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 } fileCnt = SDSORT_LIMIT; 2dda2: f4 e6 ldi r31, 0x64 ; 100 2dda4: cf 2e mov r12, r31 2dda6: d1 2c mov r13, r1 } sort_count = fileCnt; 2dda8: d0 92 79 15 sts 0x1579, r13 ; 0x801579 2ddac: c0 92 78 15 sts 0x1578, r12 ; 0x801578 2ddb0: 6a e7 ldi r22, 0x7A ; 122 2ddb2: 66 2e mov r6, r22 2ddb4: 65 e1 ldi r22, 0x15 ; 21 2ddb6: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2ddb8: f1 2c mov r15, r1 2ddba: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2ddbc: 72 e8 ldi r23, 0x82 ; 130 2ddbe: a7 2e mov r10, r23 2ddc0: 74 e1 ldi r23, 0x14 ; 20 2ddc2: b7 2e mov r11, r23 nrFiles = 1; 2ddc4: 88 24 eor r8, r8 2ddc6: 83 94 inc r8 2ddc8: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2ddca: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2ddce: 82 fd sbrc r24, 2 2ddd0: c1 c0 rjmp .+386 ; 0x2df54 manage_heater(); 2ddd2: 0f 94 43 37 call 0x26e86 ; 0x26e86 if (i == 0) 2ddd6: e1 14 cp r14, r1 2ddd8: f1 04 cpc r15, r1 2ddda: 09 f0 breq .+2 ; 0x2ddde 2dddc: d4 c0 rjmp .+424 ; 0x2df86 getfilename(0); 2ddde: 90 e0 ldi r25, 0x00 ; 0 2dde0: 80 e0 ldi r24, 0x00 ; 0 2dde2: 0f 94 28 6b call 0x2d650 ; 0x2d650 else getfilename_next(position); sort_entries[i] = position >> 5; 2dde6: 80 91 ea 13 lds r24, 0x13EA ; 0x8013ea 2ddea: 90 91 eb 13 lds r25, 0x13EB ; 0x8013eb 2ddee: a0 91 ec 13 lds r26, 0x13EC ; 0x8013ec 2ddf2: b0 91 ed 13 lds r27, 0x13ED ; 0x8013ed 2ddf6: 55 e0 ldi r21, 0x05 ; 5 2ddf8: b6 95 lsr r27 2ddfa: a7 95 ror r26 2ddfc: 97 95 ror r25 2ddfe: 87 95 ror r24 2de00: 5a 95 dec r21 2de02: d1 f7 brne .-12 ; 0x2ddf8 2de04: f3 01 movw r30, r6 2de06: 81 93 st Z+, r24 2de08: 91 93 st Z+, r25 2de0a: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2de0c: ff ef ldi r31, 0xFF ; 255 2de0e: ef 1a sub r14, r31 2de10: ff 0a sbc r15, r31 2de12: ce 14 cp r12, r14 2de14: df 04 cpc r13, r15 2de16: c9 f6 brne .-78 ; 0x2ddca else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2de18: 21 e0 ldi r18, 0x01 ; 1 2de1a: e2 16 cp r14, r18 2de1c: f1 04 cpc r15, r1 2de1e: 09 f4 brne .+2 ; 0x2de22 2de20: 96 c0 rjmp .+300 ; 0x2df4e 2de22: 32 e0 ldi r19, 0x02 ; 2 2de24: 33 16 cp r3, r19 2de26: 09 f4 brne .+2 ; 0x2de2a 2de28: 92 c0 rjmp .+292 ; 0x2df4e 2de2a: 20 91 60 0d lds r18, 0x0D60 ; 0x800d60 2de2e: 21 11 cpse r18, r1 2de30: 8e c0 rjmp .+284 ; 0x2df4e #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2de32: 90 93 43 16 sts 0x1643, r25 ; 0x801643 2de36: 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)); 2de3a: 88 ee ldi r24, 0xE8 ; 232 2de3c: 92 e6 ldi r25, 0x62 ; 98 2de3e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2de42: ee 9c mul r14, r14 2de44: 90 01 movw r18, r0 2de46: ef 9c mul r14, r15 2de48: 30 0d add r19, r0 2de4a: 30 0d add r19, r0 2de4c: 11 24 eor r1, r1 2de4e: bc 01 movw r22, r24 2de50: c9 01 movw r24, r18 2de52: 96 95 lsr r25 2de54: 87 95 ror r24 2de56: 0e 94 6c 72 call 0xe4d8 ; 0xe4d8 2de5a: 3c e7 ldi r19, 0x7C ; 124 2de5c: a3 2e mov r10, r19 2de5e: 35 e1 ldi r19, 0x15 ; 21 2de60: 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; 2de62: 91 2c mov r9, r1 2de64: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2de66: cc 24 eor r12, r12 2de68: c3 94 inc r12 2de6a: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2de6c: c4 01 movw r24, r8 2de6e: 0e 94 a2 71 call 0xe344 ; 0xe344 counter += i; 2de72: 8c 0c add r8, r12 2de74: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2de76: f5 01 movw r30, r10 2de78: 01 90 ld r0, Z+ 2de7a: f0 81 ld r31, Z 2de7c: e0 2d mov r30, r0 2de7e: f9 af std Y+57, r31 ; 0x39 2de80: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2de82: cf 01 movw r24, r30 2de84: 0f 94 6f 6b call 0x2d6de ; 0x2d6de strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2de88: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2de8c: 69 ed ldi r22, 0xD9 ; 217 2de8e: 73 e1 ldi r23, 0x13 ; 19 2de90: 88 23 and r24, r24 2de92: 11 f0 breq .+4 ; 0x2de98 2de94: 6e ee ldi r22, 0xEE ; 238 2de96: 73 e1 ldi r23, 0x13 ; 19 2de98: ce 01 movw r24, r28 2de9a: 01 96 adiw r24, 0x01 ; 1 2de9c: 0f 94 a9 aa call 0x35552 ; 0x35552 crmod_date_bckp = crmodDate; 2dea0: 60 90 e8 13 lds r6, 0x13E8 ; 0x8013e8 2dea4: 70 90 e9 13 lds r7, 0x13E9 ; 0x8013e9 crmod_time_bckp = crmodTime; 2dea8: 20 91 e6 13 lds r18, 0x13E6 ; 0x8013e6 2deac: 30 91 e7 13 lds r19, 0x13E7 ; 0x8013e7 2deb0: 3b af std Y+59, r19 ; 0x3b 2deb2: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2deb4: 20 90 23 14 lds r2, 0x1423 ; 0x801423 2deb8: bf aa std Y+55, r11 ; 0x37 2deba: ae aa std Y+54, r10 ; 0x36 2debc: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2debe: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2dec2: 82 fd sbrc r24, 2 2dec4: 47 c0 rjmp .+142 ; 0x2df54 printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2dec6: 0f 94 43 37 call 0x26e86 ; 0x26e86 const uint16_t o2 = sort_entries[j - 1]; 2deca: c8 01 movw r24, r16 2decc: 01 97 sbiw r24, 0x01 ; 1 2dece: 9d af std Y+61, r25 ; 0x3d 2ded0: 8c af std Y+60, r24 ; 0x3c 2ded2: ee a9 ldd r30, Y+54 ; 0x36 2ded4: ff a9 ldd r31, Y+55 ; 0x37 2ded6: 52 90 ld r5, -Z 2ded8: 42 90 ld r4, -Z 2deda: ff ab std Y+55, r31 ; 0x37 2dedc: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2dede: c2 01 movw r24, r4 2dee0: 0f 94 6f 6b call 0x2d6de ; 0x2d6de char *name2 = LONGEST_FILENAME; // use the string in-place 2dee4: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2dee8: 69 ed ldi r22, 0xD9 ; 217 2deea: 73 e1 ldi r23, 0x13 ; 19 2deec: 88 23 and r24, r24 2deee: 11 f0 breq .+4 ; 0x2def4 2def0: 6e ee ldi r22, 0xEE ; 238 2def2: 73 e1 ldi r23, 0x13 ; 19 // Sort the current pair according to settings. if ( 2def4: 31 10 cpse r3, r1 2def6: 8a c0 rjmp .+276 ; 0x2e00c 2def8: 80 91 23 14 lds r24, 0x1423 ; 0x801423 2defc: 28 12 cpse r2, r24 2defe: 83 c0 rjmp .+262 ; 0x2e006 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2df00: 80 91 e8 13 lds r24, 0x13E8 ; 0x8013e8 2df04: 90 91 e9 13 lds r25, 0x13E9 ; 0x8013e9 2df08: 68 16 cp r6, r24 2df0a: 79 06 cpc r7, r25 2df0c: 09 f0 breq .+2 ; 0x2df10 2df0e: 6c c0 rjmp .+216 ; 0x2dfe8 2df10: 80 91 e6 13 lds r24, 0x13E6 ; 0x8013e6 2df14: 90 91 e7 13 lds r25, 0x13E7 ; 0x8013e7 2df18: 2a ad ldd r18, Y+58 ; 0x3a 2df1a: 3b ad ldd r19, Y+59 ; 0x3b 2df1c: 82 17 cp r24, r18 2df1e: 93 07 cpc r25, r19 2df20: 08 f0 brcs .+2 ; 0x2df24 2df22: 66 c0 rjmp .+204 ; 0x2dff0 #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2df24: 00 0f add r16, r16 2df26: 11 1f adc r17, r17 2df28: f8 01 movw r30, r16 2df2a: e6 58 subi r30, 0x86 ; 134 2df2c: fa 4e sbci r31, 0xEA ; 234 2df2e: 28 ad ldd r18, Y+56 ; 0x38 2df30: 39 ad ldd r19, Y+57 ; 0x39 2df32: 31 83 std Z+1, r19 ; 0x01 2df34: 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){ 2df36: 3f ef ldi r19, 0xFF ; 255 2df38: c3 1a sub r12, r19 2df3a: d3 0a sbc r13, r19 2df3c: 82 e0 ldi r24, 0x02 ; 2 2df3e: a8 0e add r10, r24 2df40: b1 1c adc r11, r1 2df42: ec 14 cp r14, r12 2df44: fd 04 cpc r15, r13 2df46: 09 f0 breq .+2 ; 0x2df4a 2df48: 91 cf rjmp .-222 ; 0x2de6c for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2df4a: 0e 94 c3 71 call 0xe386 ; 0xe386 } } KEEPALIVE_STATE(NOT_BUSY); 2df4e: 81 e0 ldi r24, 0x01 ; 1 2df50: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } 2df54: ed 96 adiw r28, 0x3d ; 61 2df56: 0f b6 in r0, 0x3f ; 63 2df58: f8 94 cli 2df5a: de bf out 0x3e, r29 ; 62 2df5c: 0f be out 0x3f, r0 ; 63 2df5e: cd bf out 0x3d, r28 ; 61 2df60: df 91 pop r29 2df62: cf 91 pop r28 2df64: 1f 91 pop r17 2df66: 0f 91 pop r16 2df68: ff 90 pop r15 2df6a: ef 90 pop r14 2df6c: df 90 pop r13 2df6e: cf 90 pop r12 2df70: bf 90 pop r11 2df72: af 90 pop r10 2df74: 9f 90 pop r9 2df76: 8f 90 pop r8 2df78: 7f 90 pop r7 2df7a: 6f 90 pop r6 2df7c: 5f 90 pop r5 2df7e: 4f 90 pop r4 2df80: 3f 90 pop r3 2df82: 2f 90 pop r2 2df84: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2df86: 40 91 ea 13 lds r20, 0x13EA ; 0x8013ea 2df8a: 50 91 eb 13 lds r21, 0x13EB ; 0x8013eb 2df8e: 60 91 ec 13 lds r22, 0x13EC ; 0x8013ec 2df92: 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; 2df96: b0 92 81 14 sts 0x1481, r11 ; 0x801481 2df9a: a0 92 80 14 sts 0x1480, r10 ; 0x801480 nrFiles = 1; 2df9e: 90 92 f0 16 sts 0x16F0, r9 ; 0x8016f0 2dfa2: 80 92 ef 16 sts 0x16EF, r8 ; 0x8016ef curDir->seekSet(position); 2dfa6: 82 e8 ldi r24, 0x82 ; 130 2dfa8: 94 e1 ldi r25, 0x14 ; 20 2dfaa: 0f 94 32 2a call 0x25464 ; 0x25464 2dfae: 1e 7f andi r17, 0xFE ; 254 2dfb0: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2dfb2: e0 91 80 14 lds r30, 0x1480 ; 0x801480 2dfb6: f0 91 81 14 lds r31, 0x1481 ; 0x801481 2dfba: 83 e2 ldi r24, 0x23 ; 35 2dfbc: de 01 movw r26, r28 2dfbe: 11 96 adiw r26, 0x01 ; 1 2dfc0: 01 90 ld r0, Z+ 2dfc2: 0d 92 st X+, r0 2dfc4: 8a 95 dec r24 2dfc6: e1 f7 brne .-8 ; 0x2dfc0 2dfc8: 01 2f mov r16, r17 2dfca: 22 e0 ldi r18, 0x02 ; 2 2dfcc: 50 e0 ldi r21, 0x00 ; 0 2dfce: 40 e0 ldi r20, 0x00 ; 0 2dfd0: be 01 movw r22, r28 2dfd2: 6f 5f subi r22, 0xFF ; 255 2dfd4: 7f 4f sbci r23, 0xFF ; 255 2dfd6: 8f ed ldi r24, 0xDF ; 223 2dfd8: 92 e0 ldi r25, 0x02 ; 2 2dfda: 0f 94 f9 68 call 0x2d1f2 ; 0x2d1f2 2dfde: ce 01 movw r24, r28 2dfe0: 01 96 adiw r24, 0x01 ; 1 2dfe2: 0e 94 06 7a call 0xf40c ; 0xf40c 2dfe6: ff ce rjmp .-514 ; 0x2dde6 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)) 2dfe8: 86 15 cp r24, r6 2dfea: 97 05 cpc r25, r7 2dfec: 08 f4 brcc .+2 ; 0x2dff0 2dfee: 9a cf rjmp .-204 ; 0x2df24 break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2dff0: ee a9 ldd r30, Y+54 ; 0x36 2dff2: ff a9 ldd r31, Y+55 ; 0x37 2dff4: 53 82 std Z+3, r5 ; 0x03 2dff6: 42 82 std Z+2, r4 ; 0x02 2dff8: 0c ad ldd r16, Y+60 ; 0x3c 2dffa: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2dffc: 01 15 cp r16, r1 2dffe: 11 05 cpc r17, r1 2e000: 09 f0 breq .+2 ; 0x2e004 2e002: 5d cf rjmp .-326 ; 0x2debe 2e004: 8f cf rjmp .-226 ; 0x2df24 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)) 2e006: 22 20 and r2, r2 2e008: 99 f3 breq .-26 ; 0x2dff0 2e00a: 8c cf rjmp .-232 ; 0x2df24 2e00c: 31 e0 ldi r19, 0x01 ; 1 2e00e: 33 12 cpse r3, r19 2e010: ef cf rjmp .-34 ; 0x2dff0 getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2e012: 80 91 23 14 lds r24, 0x1423 ; 0x801423 2e016: 28 12 cpse r2, r24 2e018: 07 c0 rjmp .+14 ; 0x2e028 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2e01a: ce 01 movw r24, r28 2e01c: 01 96 adiw r24, 0x01 ; 1 2e01e: 0f 94 77 aa call 0x354ee ; 0x354ee 2e022: 97 fd sbrc r25, 7 2e024: e5 cf rjmp .-54 ; 0x2dff0 2e026: 7e cf rjmp .-260 ; 0x2df24 2e028: 21 10 cpse r2, r1 2e02a: e2 cf rjmp .-60 ; 0x2dff0 2e02c: 7b cf rjmp .-266 ; 0x2df24 0002e02e : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2e02e: cf 92 push r12 2e030: df 92 push r13 2e032: ef 92 push r14 2e034: ff 92 push r15 2e036: 0f 93 push r16 2e038: 1f 93 push r17 2e03a: cf 93 push r28 2e03c: df 93 push r29 2e03e: cd b7 in r28, 0x3d ; 61 2e040: de b7 in r29, 0x3e ; 62 2e042: a3 97 sbiw r28, 0x23 ; 35 2e044: 0f b6 in r0, 0x3f ; 63 2e046: f8 94 cli 2e048: de bf out 0x3e, r29 ; 62 2e04a: 0f be out 0x3f, r0 ; 63 2e04c: cd bf out 0x3d, r28 ; 61 2e04e: 7c 01 movw r14, r24 2e050: 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) {} 2e052: 19 82 std Y+1, r1 ; 0x01 2e054: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2e056: 80 91 85 14 lds r24, 0x1485 ; 0x801485 parent=&workDir; 2e05a: 92 e8 ldi r25, 0x82 ; 130 2e05c: c9 2e mov r12, r25 2e05e: 94 e1 ldi r25, 0x14 ; 20 2e060: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2e062: 81 11 cpse r24, r1 2e064: 04 c0 rjmp .+8 ; 0x2e06e } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2e066: 8d e5 ldi r24, 0x5D ; 93 2e068: c8 2e mov r12, r24 2e06a: 84 e1 ldi r24, 0x14 ; 20 2e06c: 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); 2e06e: 21 e0 ldi r18, 0x01 ; 1 2e070: a7 01 movw r20, r14 2e072: b6 01 movw r22, r12 2e074: ce 01 movw r24, r28 2e076: 01 96 adiw r24, 0x01 ; 1 2e078: 0f 94 3b 54 call 0x2a876 ; 0x2a876 2e07c: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2e07e: 88 23 and r24, r24 2e080: 21 f1 breq .+72 ; 0x2e0ca 2e082: 80 91 77 15 lds r24, 0x1577 ; 0x801577 2e086: 85 30 cpi r24, 0x05 ; 5 2e088: 00 f5 brcc .+64 ; 0x2e0ca SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2e08a: 29 e0 ldi r18, 0x09 ; 9 2e08c: 82 9f mul r24, r18 2e08e: c0 01 movw r24, r0 2e090: 11 24 eor r1, r1 2e092: b7 01 movw r22, r14 2e094: 89 5d subi r24, 0xD9 ; 217 2e096: 9b 4e sbci r25, 0xEB ; 235 2e098: 0f 94 a9 aa call 0x35552 ; 0x35552 puts(relpath); 2e09c: c7 01 movw r24, r14 2e09e: 0f 94 cd aa call 0x3559a ; 0x3559a if (workDirDepth < MAX_DIR_DEPTH) { 2e0a2: 80 91 77 15 lds r24, 0x1577 ; 0x801577 2e0a6: 86 30 cpi r24, 0x06 ; 6 2e0a8: 80 f1 brcs .+96 ; 0x2e10a for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2e0aa: 83 e2 ldi r24, 0x23 ; 35 2e0ac: fe 01 movw r30, r28 2e0ae: 31 96 adiw r30, 0x01 ; 1 2e0b0: a2 e8 ldi r26, 0x82 ; 130 2e0b2: b4 e1 ldi r27, 0x14 ; 20 2e0b4: 01 90 ld r0, Z+ 2e0b6: 0d 92 st X+, r0 2e0b8: 8a 95 dec r24 2e0ba: e1 f7 brne .-8 ; 0x2e0b4 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2e0bc: 00 23 and r16, r16 2e0be: 09 f4 brne .+2 ; 0x2e0c2 2e0c0: 4c c0 rjmp .+152 ; 0x2e15a presort(); 2e0c2: 0f 94 8d 6e call 0x2dd1a ; 0x2dd1a else presort_flag = true; #endif return 1; 2e0c6: 10 2f mov r17, r16 2e0c8: 0c c0 rjmp .+24 ; 0x2e0e2 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2e0ca: 84 ee ldi r24, 0xE4 ; 228 2e0cc: 92 ea ldi r25, 0xA2 ; 162 2e0ce: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2e0d2: 8c ee ldi r24, 0xEC ; 236 2e0d4: 9c e6 ldi r25, 0x6C ; 108 2e0d6: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN(relpath); 2e0da: c7 01 movw r24, r14 2e0dc: 0e 94 1d 86 call 0x10c3a ; 0x10c3a return 0; 2e0e0: 10 e0 ldi r17, 0x00 ; 0 2e0e2: ce 01 movw r24, r28 2e0e4: 01 96 adiw r24, 0x01 ; 1 2e0e6: 0e 94 06 7a call 0xf40c ; 0xf40c else presort_flag = true; #endif return 1; } } 2e0ea: 81 2f mov r24, r17 2e0ec: a3 96 adiw r28, 0x23 ; 35 2e0ee: 0f b6 in r0, 0x3f ; 63 2e0f0: f8 94 cli 2e0f2: de bf out 0x3e, r29 ; 62 2e0f4: 0f be out 0x3f, r0 ; 63 2e0f6: cd bf out 0x3d, r28 ; 61 2e0f8: df 91 pop r29 2e0fa: cf 91 pop r28 2e0fc: 1f 91 pop r17 2e0fe: 0f 91 pop r16 2e100: ff 90 pop r15 2e102: ef 90 pop r14 2e104: df 90 pop r13 2e106: cf 90 pop r12 2e108: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2e10a: 8f 5f subi r24, 0xFF ; 255 2e10c: 80 93 77 15 sts 0x1577, r24 ; 0x801577 workDirParents[d+1] = workDirParents[d]; 2e110: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2e112: 81 50 subi r24, 0x01 ; 1 2e114: c8 f0 brcs .+50 ; 0x2e148 workDirParents[d+1] = workDirParents[d]; 2e116: 28 2f mov r18, r24 2e118: 30 e0 ldi r19, 0x00 ; 0 2e11a: a9 01 movw r20, r18 2e11c: 4f 5f subi r20, 0xFF ; 255 2e11e: 5f 4f sbci r21, 0xFF ; 255 2e120: 94 9f mul r25, r20 2e122: d0 01 movw r26, r0 2e124: 95 9f mul r25, r21 2e126: b0 0d add r27, r0 2e128: 11 24 eor r1, r1 2e12a: ab 55 subi r26, 0x5B ; 91 2e12c: bb 4e sbci r27, 0xEB ; 235 2e12e: 92 9f mul r25, r18 2e130: f0 01 movw r30, r0 2e132: 93 9f mul r25, r19 2e134: f0 0d add r31, r0 2e136: 11 24 eor r1, r1 2e138: eb 55 subi r30, 0x5B ; 91 2e13a: fb 4e sbci r31, 0xEB ; 235 2e13c: 29 2f mov r18, r25 2e13e: 01 90 ld r0, Z+ 2e140: 0d 92 st X+, r0 2e142: 2a 95 dec r18 2e144: e1 f7 brne .-8 ; 0x2e13e 2e146: e5 cf rjmp .-54 ; 0x2e112 workDirParents[0]=*parent; 2e148: 83 e2 ldi r24, 0x23 ; 35 2e14a: f6 01 movw r30, r12 2e14c: a5 ea ldi r26, 0xA5 ; 165 2e14e: b4 e1 ldi r27, 0x14 ; 20 2e150: 01 90 ld r0, Z+ 2e152: 0d 92 st X+, r0 2e154: 8a 95 dec r24 2e156: e1 f7 brne .-8 ; 0x2e150 2e158: a8 cf rjmp .-176 ; 0x2e0aa #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2e15a: 81 e0 ldi r24, 0x01 ; 1 2e15c: 80 93 26 14 sts 0x1426, r24 ; 0x801426 2e160: c0 cf rjmp .-128 ; 0x2e0e2 0002e162 : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2e162: 93 e2 ldi r25, 0x23 ; 35 2e164: ed e5 ldi r30, 0x5D ; 93 2e166: f4 e1 ldi r31, 0x14 ; 20 2e168: a2 e8 ldi r26, 0x82 ; 130 2e16a: b4 e1 ldi r27, 0x14 ; 20 2e16c: 01 90 ld r0, Z+ 2e16e: 0d 92 st X+, r0 2e170: 9a 95 dec r25 2e172: e1 f7 brne .-8 ; 0x2e16c workDirDepth = 0; 2e174: 10 92 77 15 sts 0x1577, r1 ; 0x801577 curDir=&workDir; 2e178: 22 e8 ldi r18, 0x82 ; 130 2e17a: 34 e1 ldi r19, 0x14 ; 20 2e17c: 30 93 81 14 sts 0x1481, r19 ; 0x801481 2e180: 20 93 80 14 sts 0x1480, r18 ; 0x801480 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2e184: 81 11 cpse r24, r1 presort(); 2e186: 0d 94 8d 6e jmp 0x2dd1a ; 0x2dd1a else presort_flag = true; 2e18a: 81 e0 ldi r24, 0x01 ; 1 2e18c: 80 93 26 14 sts 0x1426, r24 ; 0x801426 #endif } 2e190: 08 95 ret 0002e192 : * * @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) 2e192: 8f 92 push r8 2e194: 9f 92 push r9 2e196: af 92 push r10 2e198: bf 92 push r11 2e19a: cf 92 push r12 2e19c: df 92 push r13 2e19e: ef 92 push r14 2e1a0: ff 92 push r15 2e1a2: 0f 93 push r16 2e1a4: 1f 93 push r17 2e1a6: cf 93 push r28 2e1a8: df 93 push r29 2e1aa: cd b7 in r28, 0x3d ; 61 2e1ac: de b7 in r29, 0x3e ; 62 2e1ae: 2d 97 sbiw r28, 0x0d ; 13 2e1b0: 0f b6 in r0, 0x3f ; 63 2e1b2: f8 94 cli 2e1b4: de bf out 0x3e, r29 ; 62 2e1b6: 0f be out 0x3f, r0 ; 63 2e1b8: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2e1ba: 2d e5 ldi r18, 0x5D ; 93 2e1bc: 34 e1 ldi r19, 0x14 ; 20 2e1be: 30 93 81 14 sts 0x1481, r19 ; 0x801481 2e1c2: 20 93 80 14 sts 0x1480, r18 ; 0x801480 if (!fileName) 2e1c6: dc 01 movw r26, r24 2e1c8: ed 91 ld r30, X+ 2e1ca: fc 91 ld r31, X 2e1cc: 30 97 sbiw r30, 0x00 ; 0 2e1ce: a1 f4 brne .+40 ; 0x2e1f8 } else //relative path { curDir = &workDir; } return 1; 2e1d0: 81 e0 ldi r24, 0x01 ; 1 } 2e1d2: 2d 96 adiw r28, 0x0d ; 13 2e1d4: 0f b6 in r0, 0x3f ; 63 2e1d6: f8 94 cli 2e1d8: de bf out 0x3e, r29 ; 62 2e1da: 0f be out 0x3f, r0 ; 63 2e1dc: cd bf out 0x3d, r28 ; 61 2e1de: df 91 pop r29 2e1e0: cf 91 pop r28 2e1e2: 1f 91 pop r17 2e1e4: 0f 91 pop r16 2e1e6: ff 90 pop r15 2e1e8: ef 90 pop r14 2e1ea: df 90 pop r13 2e1ec: cf 90 pop r12 2e1ee: bf 90 pop r11 2e1f0: af 90 pop r10 2e1f2: 9f 90 pop r9 2e1f4: 8f 90 pop r8 2e1f6: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 2e1f8: 20 81 ld r18, Z 2e1fa: 2f 32 cpi r18, 0x2F ; 47 2e1fc: 09 f0 breq .+2 ; 0x2e200 2e1fe: 47 c0 rjmp .+142 ; 0x2e28e 2e200: 6c 01 movw r12, r24 { cdroot(false); 2e202: 80 e0 ldi r24, 0x00 ; 0 2e204: 0f 94 b1 70 call 0x2e162 ; 0x2e162 dirname_start = fileName + 1; 2e208: f6 01 movw r30, r12 2e20a: 00 81 ld r16, Z 2e20c: 11 81 ldd r17, Z+1 ; 0x01 2e20e: 0f 5f subi r16, 0xFF ; 255 2e210: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2e212: 92 e8 ldi r25, 0x82 ; 130 2e214: 89 2e mov r8, r25 2e216: 94 e1 ldi r25, 0x14 ; 20 2e218: 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) 2e21a: d8 01 movw r26, r16 2e21c: 8c 91 ld r24, X 2e21e: 88 23 and r24, r24 2e220: b9 f2 breq .-82 ; 0x2e1d0 { dirname_end = strchr(dirname_start, '/'); 2e222: 6f e2 ldi r22, 0x2F ; 47 2e224: 70 e0 ldi r23, 0x00 ; 0 2e226: c8 01 movw r24, r16 2e228: 0f 94 95 aa call 0x3552a ; 0x3552a 2e22c: 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) 2e22e: 00 97 sbiw r24, 0x00 ; 0 2e230: 51 f1 breq .+84 ; 0x2e286 2e232: 08 17 cp r16, r24 2e234: 19 07 cpc r17, r25 2e236: 38 f5 brcc .+78 ; 0x2e286 { 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); 2e238: 7c 01 movw r14, r24 2e23a: e0 1a sub r14, r16 2e23c: f1 0a sbc r15, r17 2e23e: bd e0 ldi r27, 0x0D ; 13 2e240: eb 16 cp r14, r27 2e242: f1 04 cpc r15, r1 2e244: 18 f0 brcs .+6 ; 0x2e24c 2e246: 8c e0 ldi r24, 0x0C ; 12 2e248: e8 2e mov r14, r24 2e24a: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2e24c: a7 01 movw r20, r14 2e24e: b8 01 movw r22, r16 2e250: ce 01 movw r24, r28 2e252: 01 96 adiw r24, 0x01 ; 1 2e254: 0f 94 be aa call 0x3557c ; 0x3557c subdirname[len] = 0; 2e258: e1 e0 ldi r30, 0x01 ; 1 2e25a: f0 e0 ldi r31, 0x00 ; 0 2e25c: ec 0f add r30, r28 2e25e: fd 1f adc r31, r29 2e260: ee 0d add r30, r14 2e262: ff 1d adc r31, r15 2e264: 10 82 st Z, r1 if (!chdir(subdirname, false)) 2e266: 60 e0 ldi r22, 0x00 ; 0 2e268: ce 01 movw r24, r28 2e26a: 01 96 adiw r24, 0x01 ; 1 2e26c: 0f 94 17 70 call 0x2e02e ; 0x2e02e 2e270: 88 23 and r24, r24 2e272: 09 f4 brne .+2 ; 0x2e276 2e274: ae cf rjmp .-164 ; 0x2e1d2 return 0; curDir = &workDir; 2e276: 90 92 81 14 sts 0x1481, r9 ; 0x801481 2e27a: 80 92 80 14 sts 0x1480, r8 ; 0x801480 dirname_start = dirname_end + 1; 2e27e: 85 01 movw r16, r10 2e280: 0f 5f subi r16, 0xFF ; 255 2e282: 1f 4f sbci r17, 0xFF ; 255 2e284: ca cf rjmp .-108 ; 0x2e21a } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 2e286: f6 01 movw r30, r12 2e288: 11 83 std Z+1, r17 ; 0x01 2e28a: 00 83 st Z, r16 2e28c: a1 cf rjmp .-190 ; 0x2e1d0 } } else //relative path { curDir = &workDir; 2e28e: 82 e8 ldi r24, 0x82 ; 130 2e290: 94 e1 ldi r25, 0x14 ; 20 2e292: 90 93 81 14 sts 0x1481, r25 ; 0x801481 2e296: 80 93 80 14 sts 0x1480, r24 ; 0x801480 2e29a: 9a cf rjmp .-204 ; 0x2e1d0 0002e29c : 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*/){ 2e29c: bf 92 push r11 2e29e: cf 92 push r12 2e2a0: df 92 push r13 2e2a2: ef 92 push r14 2e2a4: ff 92 push r15 2e2a6: 0f 93 push r16 2e2a8: 1f 93 push r17 2e2aa: cf 93 push r28 2e2ac: df 93 push r29 2e2ae: 1f 92 push r1 2e2b0: 1f 92 push r1 2e2b2: cd b7 in r28, 0x3d ; 61 2e2b4: de b7 in r29, 0x3e ; 62 if(!mounted) 2e2b6: 20 91 d8 13 lds r18, 0x13D8 ; 0x8013d8 2e2ba: 22 23 and r18, r18 2e2bc: 09 f4 brne .+2 ; 0x2e2c0 2e2be: ef c0 rjmp .+478 ; 0x2e49e 2e2c0: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2e2c2: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 2e2c6: 88 23 and r24, r24 2e2c8: 09 f4 brne .+2 ; 0x2e2cc 2e2ca: 04 c1 rjmp .+520 ; 0x2e4d4 if(!replace_current){ 2e2cc: 61 11 cpse r22, r1 2e2ce: f6 c0 rjmp .+492 ; 0x2e4bc if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 2e2d0: d0 90 8a 16 lds r13, 0x168A ; 0x80168a 2e2d4: dd 20 and r13, r13 2e2d6: 21 f0 breq .+8 ; 0x2e2e0 // 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); 2e2d8: 8e ea ldi r24, 0xAE ; 174 2e2da: 91 ea ldi r25, 0xA1 ; 161 2e2dc: 0e 94 7e 83 call 0x106fc ; 0x106fc return; } SERIAL_ECHO_START; 2e2e0: 84 ee ldi r24, 0xE4 ; 228 2e2e2: 92 ea ldi r25, 0xA2 ; 162 2e2e4: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(ofSubroutineCallTgt); 2e2e8: 85 e9 ldi r24, 0x95 ; 149 2e2ea: 91 ea ldi r25, 0xA1 ; 161 2e2ec: 0e 94 1f 7b call 0xf63e ; 0xf63e 2e2f0: c7 01 movw r24, r14 2e2f2: 0e 94 11 86 call 0x10c22 ; 0x10c22 SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 2e2f6: 8a e8 ldi r24, 0x8A ; 138 2e2f8: 91 ea ldi r25, 0xA1 ; 161 2e2fa: 0e 94 1f 7b call 0xf63e ; 0xf63e //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 2e2fe: 00 91 8a 16 lds r16, 0x168A ; 0x80168a 2e302: 25 e5 ldi r18, 0x55 ; 85 2e304: 02 9f mul r16, r18 2e306: 80 01 movw r16, r0 2e308: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 2e30a: 01 57 subi r16, 0x71 ; 113 2e30c: 19 4e sbci r17, 0xE9 ; 233 2e30e: 8f e2 ldi r24, 0x2F ; 47 2e310: f8 01 movw r30, r16 2e312: 81 93 st Z+, r24 2e314: 8f 01 movw r16, r30 2e316: cc 24 eor r12, r12 2e318: c3 94 inc r12 for(uint8_t i=0;i 2e322: d8 16 cp r13, r24 2e324: b0 f4 brcc .+44 ; 0x2e352 { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 2e326: db 9c mul r13, r11 2e328: c0 01 movw r24, r0 2e32a: 11 24 eor r1, r1 2e32c: b8 01 movw r22, r16 2e32e: 8b 55 subi r24, 0x5B ; 91 2e330: 9b 4e sbci r25, 0xEB ; 235 2e332: 0f 94 19 2c call 0x25832 ; 0x25832 2e336: c8 01 movw r24, r16 2e338: 8c 01 movw r16, r24 2e33a: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 2e33c: f8 01 movw r30, r16 2e33e: 20 81 ld r18, Z 2e340: 22 23 and r18, r18 2e342: 29 f0 breq .+10 ; 0x2e34e 2e344: f4 e5 ldi r31, 0x54 ; 84 2e346: fc 15 cp r31, r12 2e348: 10 f0 brcs .+4 ; 0x2e34e {t++;cnt++;} //crawl counter forward. 2e34a: c3 94 inc r12 2e34c: f5 cf rjmp .-22 ; 0x2e338 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) 2e352: 27 e4 ldi r18, 0x47 ; 71 2e354: 2c 15 cp r18, r12 2e356: 08 f4 brcc .+2 ; 0x2e35a 2e358: ae c0 rjmp .+348 ; 0x2e4b6 file.getFilename(t); 2e35a: b8 01 movw r22, r16 2e35c: 87 e6 ldi r24, 0x67 ; 103 2e35e: 96 e1 ldi r25, 0x16 ; 22 2e360: 0f 94 19 2c call 0x25832 ; 0x25832 SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 2e364: 80 91 8a 16 lds r24, 0x168A ; 0x80168a 2e368: f5 e5 ldi r31, 0x55 ; 85 2e36a: 8f 9f mul r24, r31 2e36c: c0 01 movw r24, r0 2e36e: 11 24 eor r1, r1 2e370: 81 57 subi r24, 0x71 ; 113 2e372: 99 4e sbci r25, 0xE9 ; 233 2e374: 0e 94 11 86 call 0x10c22 ; 0x10c22 SERIAL_ECHORPGM(ofPos); 2e378: 84 e8 ldi r24, 0x84 ; 132 2e37a: 91 ea ldi r25, 0xA1 ; 161 2e37c: 0e 94 1f 7b call 0xf63e ; 0xf63e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2e380: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 2e384: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 2e388: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 2e38c: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 2e390: 4a e0 ldi r20, 0x0A ; 10 2e392: 0e 94 20 7a call 0xf440 ; 0xf440 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2e396: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 2e39a: 80 91 8a 16 lds r24, 0x168A ; 0x80168a 2e39e: 24 e0 ldi r18, 0x04 ; 4 2e3a0: 82 9f mul r24, r18 2e3a2: f0 01 movw r30, r0 2e3a4: 11 24 eor r1, r1 2e3a6: e5 57 subi r30, 0x75 ; 117 2e3a8: f9 4e sbci r31, 0xE9 ; 233 2e3aa: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 2e3ae: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 2e3b2: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 2e3b6: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 2e3ba: 40 83 st Z, r20 2e3bc: 51 83 std Z+1, r21 ; 0x01 2e3be: 62 83 std Z+2, r22 ; 0x02 2e3c0: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 2e3c2: 8f 5f subi r24, 0xFF ; 255 2e3c4: 80 93 8a 16 sts 0x168A, r24 ; 0x80168a } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 2e3c8: 87 e6 ldi r24, 0x67 ; 103 2e3ca: 96 e1 ldi r25, 0x16 ; 22 2e3cc: 0f 94 10 2c call 0x25820 ; 0x25820 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; 2e3d0: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 const char *fname=name; 2e3d4: fa 82 std Y+2, r15 ; 0x02 2e3d6: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 2e3d8: ce 01 movw r24, r28 2e3da: 01 96 adiw r24, 0x01 ; 1 2e3dc: 0f 94 c9 70 call 0x2e192 ; 0x2e192 2e3e0: 88 23 and r24, r24 2e3e2: 09 f4 brne .+2 ; 0x2e3e6 2e3e4: 5c c0 rjmp .+184 ; 0x2e49e */ 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) ){ 2e3e6: 49 81 ldd r20, Y+1 ; 0x01 2e3e8: 5a 81 ldd r21, Y+2 ; 0x02 2e3ea: 60 91 80 14 lds r22, 0x1480 ; 0x801480 2e3ee: 70 91 81 14 lds r23, 0x1481 ; 0x801481 2e3f2: 21 e0 ldi r18, 0x01 ; 1 2e3f4: 87 e6 ldi r24, 0x67 ; 103 2e3f6: 96 e1 ldi r25, 0x16 ; 22 2e3f8: 0f 94 3b 54 call 0x2a876 ; 0x2a876 2e3fc: 88 23 and r24, r24 2e3fe: 09 f4 brne .+2 ; 0x2e402 2e400: 77 c0 rjmp .+238 ; 0x2e4f0 // compute the block to start with if( ! gfComputeNextFileBlock() ) 2e402: 87 e6 ldi r24, 0x67 ; 103 2e404: 96 e1 ldi r25, 0x16 ; 22 2e406: 0f 94 b9 29 call 0x25372 ; 0x25372 2e40a: 88 23 and r24, r24 2e40c: 09 f4 brne .+2 ; 0x2e410 2e40e: 70 c0 rjmp .+224 ; 0x2e4f0 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; 2e410: 80 91 88 16 lds r24, 0x1688 ; 0x801688 2e414: 90 91 89 16 lds r25, 0x1689 ; 0x801689 2e418: 8a 5b subi r24, 0xBA ; 186 2e41a: 91 4f sbci r25, 0xF1 ; 241 2e41c: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2e420: 80 93 82 16 sts 0x1682, r24 ; 0x801682 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 2e424: 89 81 ldd r24, Y+1 ; 0x01 2e426: 9a 81 ldd r25, Y+2 ; 0x02 2e428: 0f 94 28 6b call 0x2d650 ; 0x2d650 filesize = file.fileSize(); 2e42c: 80 91 78 16 lds r24, 0x1678 ; 0x801678 2e430: 90 91 79 16 lds r25, 0x1679 ; 0x801679 2e434: a0 91 7a 16 lds r26, 0x167A ; 0x80167a 2e438: b0 91 7b 16 lds r27, 0x167B ; 0x80167b 2e43c: 80 93 e4 16 sts 0x16E4, r24 ; 0x8016e4 2e440: 90 93 e5 16 sts 0x16E5, r25 ; 0x8016e5 2e444: a0 93 e6 16 sts 0x16E6, r26 ; 0x8016e6 2e448: b0 93 e7 16 sts 0x16E7, r27 ; 0x8016e7 SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 2e44c: 84 e5 ldi r24, 0x54 ; 84 2e44e: 91 ea ldi r25, 0xA1 ; 161 2e450: 0e 94 1f 7b call 0xf63e ; 0xf63e printAbsFilenameFast(); 2e454: 0f 94 0b 6c call 0x2d816 ; 0x2d816 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 2e458: 8c e4 ldi r24, 0x4C ; 76 2e45a: 91 ea ldi r25, 0xA1 ; 161 2e45c: 0e 94 1f 7b call 0xf63e ; 0xf63e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2e460: 60 91 e4 16 lds r22, 0x16E4 ; 0x8016e4 2e464: 70 91 e5 16 lds r23, 0x16E5 ; 0x8016e5 2e468: 80 91 e6 16 lds r24, 0x16E6 ; 0x8016e6 2e46c: 90 91 e7 16 lds r25, 0x16E7 ; 0x8016e7 2e470: 4a e0 ldi r20, 0x0A ; 10 2e472: 0e 94 20 7a call 0xf440 ; 0xf440 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2e476: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_PROTOCOLLN(filesize); sdpos = 0; 2e47a: 10 92 eb 16 sts 0x16EB, r1 ; 0x8016eb 2e47e: 10 92 ec 16 sts 0x16EC, r1 ; 0x8016ec 2e482: 10 92 ed 16 sts 0x16ED, r1 ; 0x8016ed 2e486: 10 92 ee 16 sts 0x16EE, r1 ; 0x8016ee SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2e48a: 8e e3 ldi r24, 0x3E ; 62 2e48c: 91 ea ldi r25, 0xA1 ; 161 2e48e: 0e 94 18 7d call 0xfa30 ; 0xfa30 lcd_setstatuspgm(ofFileSelected); 2e492: 8e e3 ldi r24, 0x3E ; 62 2e494: 91 ea ldi r25, 0xA1 ; 161 2e496: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe scrollstuff = 0; 2e49a: 10 92 62 0d sts 0x0D62, r1 ; 0x800d62 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 2e49e: 0f 90 pop r0 2e4a0: 0f 90 pop r0 2e4a2: df 91 pop r29 2e4a4: cf 91 pop r28 2e4a6: 1f 91 pop r17 2e4a8: 0f 91 pop r16 2e4aa: ff 90 pop r15 2e4ac: ef 90 pop r14 2e4ae: df 90 pop r13 2e4b0: cf 90 pop r12 2e4b2: bf 90 pop r11 2e4b4: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 2e4b6: f8 01 movw r30, r16 2e4b8: 10 82 st Z, r1 2e4ba: 54 cf rjmp .-344 ; 0x2e364 SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 2e4bc: 84 ee ldi r24, 0xE4 ; 228 2e4be: 92 ea ldi r25, 0xA2 ; 162 2e4c0: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(ofNowDoingFile); 2e4c4: 83 e7 ldi r24, 0x73 ; 115 2e4c6: 91 ea ldi r25, 0xA1 ; 161 2e4c8: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN(name); 2e4cc: c7 01 movw r24, r14 2e4ce: 0e 94 1d 86 call 0x10c3a ; 0x10c3a 2e4d2: 7a cf rjmp .-268 ; 0x2e3c8 } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 2e4d4: 10 92 8a 16 sts 0x168A, r1 ; 0x80168a SERIAL_ECHO_START; 2e4d8: 84 ee ldi r24, 0xE4 ; 228 2e4da: 92 ea ldi r25, 0xA2 ; 162 2e4dc: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(ofNowFreshFile); 2e4e0: 82 e6 ldi r24, 0x62 ; 98 2e4e2: 91 ea ldi r25, 0xA1 ; 161 2e4e4: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN(name); 2e4e8: c7 01 movw r24, r14 2e4ea: 0e 94 1d 86 call 0x10c3a ; 0x10c3a 2e4ee: 70 cf rjmp .-288 ; 0x2e3d0 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2e4f0: 88 ed ldi r24, 0xD8 ; 216 2e4f2: 9c e6 ldi r25, 0x6C ; 108 2e4f4: 0e 94 1f 7b call 0xf63e ; 0xf63e 2e4f8: 89 81 ldd r24, Y+1 ; 0x01 2e4fa: 9a 81 ldd r25, Y+2 ; 0x02 2e4fc: 0e 94 11 86 call 0x10c22 ; 0x10c22 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2e500: 8e e2 ldi r24, 0x2E ; 46 2e502: 0e 94 0c 7a call 0xf418 ; 0xf418 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2e506: 0e 94 17 7b call 0xf62e ; 0xf62e 2e50a: c9 cf rjmp .-110 ; 0x2e49e 0002e50c : void CardReader::printingHasFinished() { st_synchronize(); 2e50c: 0f 94 5b 18 call 0x230b6 ; 0x230b6 file.close(); 2e510: 87 e6 ldi r24, 0x67 ; 103 2e512: 96 e1 ldi r25, 0x16 ; 22 2e514: 0f 94 10 2c call 0x25820 ; 0x25820 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 2e518: 80 91 8a 16 lds r24, 0x168A ; 0x80168a 2e51c: 88 23 and r24, r24 2e51e: 69 f1 breq .+90 ; 0x2e57a { file_subcall_ctr--; 2e520: 81 50 subi r24, 0x01 ; 1 2e522: 80 93 8a 16 sts 0x168A, r24 ; 0x80168a openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 2e526: 25 e5 ldi r18, 0x55 ; 85 2e528: 82 9f mul r24, r18 2e52a: c0 01 movw r24, r0 2e52c: 11 24 eor r1, r1 2e52e: 61 e0 ldi r22, 0x01 ; 1 2e530: 81 57 subi r24, 0x71 ; 113 2e532: 99 4e sbci r25, 0xE9 ; 233 2e534: 0f 94 4e 71 call 0x2e29c ; 0x2e29c setIndex(filespos[file_subcall_ctr]); 2e538: e0 91 8a 16 lds r30, 0x168A ; 0x80168a 2e53c: 84 e0 ldi r24, 0x04 ; 4 2e53e: e8 9f mul r30, r24 2e540: f0 01 movw r30, r0 2e542: 11 24 eor r1, r1 2e544: e5 57 subi r30, 0x75 ; 117 2e546: f9 4e sbci r31, 0xE9 ; 233 2e548: 60 81 ld r22, Z 2e54a: 71 81 ldd r23, Z+1 ; 0x01 2e54c: 82 81 ldd r24, Z+2 ; 0x02 2e54e: 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);}; 2e550: 60 93 eb 16 sts 0x16EB, r22 ; 0x8016eb 2e554: 70 93 ec 16 sts 0x16EC, r23 ; 0x8016ec 2e558: 80 93 ed 16 sts 0x16ED, r24 ; 0x8016ed 2e55c: 90 93 ee 16 sts 0x16EE, r25 ; 0x8016ee 2e560: 0f 94 86 67 call 0x2cf0c ; 0x2cf0c SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 2e564: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 2e568: 88 23 and r24, r24 2e56a: 71 f0 breq .+28 ; 0x2e588 { sdprinting = true; 2e56c: 81 e0 ldi r24, 0x01 ; 1 2e56e: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 2e572: 85 e0 ldi r24, 0x05 ; 5 2e574: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.385> 2e578: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 2e57a: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 2e57e: 83 e0 ldi r24, 0x03 ; 3 2e580: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.385> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 2e584: 0c 94 d8 84 jmp 0x109b0 ; 0x109b0 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 2e588: 08 95 ret 0002e58a : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 2e58a: cf 92 push r12 2e58c: df 92 push r13 2e58e: ef 92 push r14 2e590: ff 92 push r15 2e592: 0f 93 push r16 2e594: 1f 93 push r17 2e596: cf 93 push r28 2e598: df 93 push r29 2e59a: 08 2f mov r16, r24 { mounted = false; 2e59c: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 if(root.isOpen()) 2e5a0: 80 91 60 14 lds r24, 0x1460 ; 0x801460 2e5a4: 88 23 and r24, r24 2e5a6: 21 f0 breq .+8 ; 0x2e5b0 root.close(); 2e5a8: 8d e5 ldi r24, 0x5D ; 93 2e5aa: 94 e1 ldi r25, 0x14 ; 20 2e5ac: 0f 94 10 2c call 0x25820 ; 0x25820 * \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; 2e5b0: 10 92 47 16 sts 0x1647, r1 ; 0x801647 2e5b4: 10 92 44 16 sts 0x1644, r1 ; 0x801644 // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 2e5b8: 0f 94 01 0b call 0x21602 ; 0x21602 2e5bc: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 2e5be: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 SET_OUTPUT(SDSS); 2e5c2: 20 9a sbi 0x04, 0 ; 4 SET_INPUT(MISO); 2e5c4: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 2e5c6: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 2e5c8: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 2e5ca: 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); 2e5cc: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 2e5ce: 85 e0 ldi r24, 0x05 ; 5 2e5d0: 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); 2e5d4: 82 e5 ldi r24, 0x52 ; 82 2e5d6: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 2e5d8: 1d bc out 0x2d, r1 ; 45 2e5da: 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); 2e5dc: 8f ef ldi r24, 0xFF ; 255 2e5de: 0f 94 ec 25 call 0x24bd8 ; 0x24bd8 2e5e2: 11 50 subi r17, 0x01 ; 1 2e5e4: d9 f7 brne .-10 ; 0x2e5dc WRITE(MISO, 1); // temporarily enable the MISO line pullup 2e5e6: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 2e5e8: 20 e0 ldi r18, 0x00 ; 0 2e5ea: 30 e0 ldi r19, 0x00 ; 0 2e5ec: a9 01 movw r20, r18 2e5ee: 60 e0 ldi r22, 0x00 ; 0 2e5f0: 84 e4 ldi r24, 0x44 ; 68 2e5f2: 96 e1 ldi r25, 0x16 ; 22 2e5f4: 0f 94 f8 25 call 0x24bf0 ; 0x24bf0 2e5f8: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e5fc: 81 30 cpi r24, 0x01 ; 1 2e5fe: 61 f0 breq .+24 ; 0x2e618 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 2e600: 0f 94 01 0b call 0x21602 ; 0x21602 2e604: 6c 1b sub r22, r28 2e606: 7d 0b sbc r23, r29 2e608: 61 3d cpi r22, 0xD1 ; 209 2e60a: 77 40 sbci r23, 0x07 ; 7 2e60c: 68 f3 brcs .-38 ; 0x2e5e8 WRITE(MISO, 0); // disable the MISO line pullup 2e60e: 2b 98 cbi 0x05, 3 ; 5 2e610: 81 e0 ldi r24, 0x01 ; 1 2e612: 80 93 44 16 sts 0x1644, r24 ; 0x801644 2e616: 22 c0 rjmp .+68 ; 0x2e65c error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 2e618: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 2e61a: 0f 94 01 0b call 0x21602 ; 0x21602 2e61e: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 2e620: 81 e3 ldi r24, 0x31 ; 49 2e622: 91 ea ldi r25, 0xA1 ; 161 2e624: 0e 94 18 7d call 0xfa30 ; 0xfa30 spiSend(0XFF); 2e628: 8f ef ldi r24, 0xFF ; 255 2e62a: 0f 94 ec 25 call 0x24bd8 ; 0x24bd8 while ((status_ = spiRec()) != 0xFF) 2e62e: 0f 94 f1 25 call 0x24be2 ; 0x24be2 2e632: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e636: 8f 3f cpi r24, 0xFF ; 255 2e638: 59 f1 breq .+86 ; 0x2e690 { spiSend(0XFF); 2e63a: 8f ef ldi r24, 0xFF ; 255 2e63c: 0f 94 ec 25 call 0x24bd8 ; 0x24bd8 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 2e640: 0f 94 01 0b call 0x21602 ; 0x21602 2e644: 6c 1b sub r22, r28 2e646: 7d 0b sbc r23, r29 2e648: 62 32 cpi r22, 0x22 ; 34 2e64a: 71 05 cpc r23, r1 2e64c: 80 f3 brcs .-32 ; 0x2e62e 2e64e: 82 e0 ldi r24, 0x02 ; 2 2e650: 80 93 44 16 sts 0x1644, r24 ; 0x801644 { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 2e654: 80 e2 ldi r24, 0x20 ; 32 2e656: 91 ea ldi r25, 0xA1 ; 161 2e658: 0e 94 18 7d call 0xfa30 ; 0xfa30 #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 2e65c: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 2e660: 84 ee ldi r24, 0xE4 ; 228 2e662: 92 ea ldi r25, 0xA2 ; 162 2e664: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 2e668: 8b ec ldi r24, 0xCB ; 203 2e66a: 9c e6 ldi r25, 0x6C ; 108 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 2e66c: 0e 94 18 7d call 0xfa30 ; 0xfa30 } if (mounted) 2e670: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 2e674: 88 23 and r24, r24 2e676: 09 f4 brne .+2 ; 0x2e67a 2e678: 9a c0 rjmp .+308 ; 0x2e7ae { cdroot(doPresort); 2e67a: 80 2f mov r24, r16 } } 2e67c: df 91 pop r29 2e67e: cf 91 pop r28 2e680: 1f 91 pop r17 2e682: 0f 91 pop r16 2e684: ff 90 pop r15 2e686: ef 90 pop r14 2e688: df 90 pop r13 2e68a: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 2e68c: 0d 94 b1 70 jmp 0x2e162 ; 0x2e162 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 2e690: 2a ea ldi r18, 0xAA ; 170 2e692: 31 e0 ldi r19, 0x01 ; 1 2e694: 40 e0 ldi r20, 0x00 ; 0 2e696: 50 e0 ldi r21, 0x00 ; 0 2e698: 68 e0 ldi r22, 0x08 ; 8 2e69a: 84 e4 ldi r24, 0x44 ; 68 2e69c: 96 e1 ldi r25, 0x16 ; 22 2e69e: 0f 94 f8 25 call 0x24bf0 ; 0x24bf0 2e6a2: 82 ff sbrs r24, 2 2e6a4: 2b c0 rjmp .+86 ; 0x2e6fc 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;} 2e6a6: 81 e0 ldi r24, 0x01 ; 1 2e6a8: 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; 2e6ac: 80 91 47 16 lds r24, 0x1647 ; 0x801647 2e6b0: c1 2c mov r12, r1 2e6b2: d1 2c mov r13, r1 2e6b4: 76 01 movw r14, r12 2e6b6: 82 30 cpi r24, 0x02 ; 2 2e6b8: 29 f4 brne .+10 ; 0x2e6c4 2e6ba: c1 2c mov r12, r1 2e6bc: d1 2c mov r13, r1 2e6be: e1 2c mov r14, r1 2e6c0: 80 e4 ldi r24, 0x40 ; 64 2e6c2: 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); 2e6c4: 20 e0 ldi r18, 0x00 ; 0 2e6c6: 30 e0 ldi r19, 0x00 ; 0 2e6c8: a9 01 movw r20, r18 2e6ca: 67 e3 ldi r22, 0x37 ; 55 2e6cc: 84 e4 ldi r24, 0x44 ; 68 2e6ce: 96 e1 ldi r25, 0x16 ; 22 2e6d0: 0f 94 f8 25 call 0x24bf0 ; 0x24bf0 return cardCommand(cmd, arg); 2e6d4: a7 01 movw r20, r14 2e6d6: 96 01 movw r18, r12 2e6d8: 69 e2 ldi r22, 0x29 ; 41 2e6da: 84 e4 ldi r24, 0x44 ; 68 2e6dc: 96 e1 ldi r25, 0x16 ; 22 2e6de: 0f 94 f8 25 call 0x24bf0 ; 0x24bf0 while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 2e6e2: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e6e6: 88 23 and r24, r24 2e6e8: b1 f0 breq .+44 ; 0x2e716 // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 2e6ea: 0f 94 01 0b call 0x21602 ; 0x21602 2e6ee: 6c 1b sub r22, r28 2e6f0: 7d 0b sbc r23, r29 2e6f2: 61 3d cpi r22, 0xD1 ; 209 2e6f4: 77 40 sbci r23, 0x07 ; 7 2e6f6: 30 f3 brcs .-52 ; 0x2e6c4 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2e6f8: 8a e0 ldi r24, 0x0A ; 10 2e6fa: 8b cf rjmp .-234 ; 0x2e612 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 2e6fc: 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(); 2e6fe: 0f 94 f1 25 call 0x24be2 ; 0x24be2 2e702: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e706: 11 50 subi r17, 0x01 ; 1 2e708: d1 f7 brne .-12 ; 0x2e6fe if (status_ != 0XAA) { 2e70a: 8a 3a cpi r24, 0xAA ; 170 2e70c: 11 f0 breq .+4 ; 0x2e712 2e70e: 82 e0 ldi r24, 0x02 ; 2 2e710: 80 cf rjmp .-256 ; 0x2e612 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;} 2e712: 82 e0 ldi r24, 0x02 ; 2 2e714: c9 cf rjmp .-110 ; 0x2e6a8 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 2e716: 80 91 47 16 lds r24, 0x1647 ; 0x801647 2e71a: 82 30 cpi r24, 0x02 ; 2 2e71c: d1 f4 brne .+52 ; 0x2e752 if (cardCommand(CMD58, 0)) { 2e71e: 20 e0 ldi r18, 0x00 ; 0 2e720: 30 e0 ldi r19, 0x00 ; 0 2e722: a9 01 movw r20, r18 2e724: 6a e3 ldi r22, 0x3A ; 58 2e726: 84 e4 ldi r24, 0x44 ; 68 2e728: 96 e1 ldi r25, 0x16 ; 22 2e72a: 0f 94 f8 25 call 0x24bf0 ; 0x24bf0 2e72e: 88 23 and r24, r24 2e730: 11 f0 breq .+4 ; 0x2e736 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2e732: 88 e0 ldi r24, 0x08 ; 8 2e734: 6e cf rjmp .-292 ; 0x2e612 error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 2e736: 0f 94 f1 25 call 0x24be2 ; 0x24be2 2e73a: 80 7c andi r24, 0xC0 ; 192 2e73c: 80 3c cpi r24, 0xC0 ; 192 2e73e: 19 f4 brne .+6 ; 0x2e746 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;} 2e740: 83 e0 ldi r24, 0x03 ; 3 2e742: 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(); 2e746: 0f 94 f1 25 call 0x24be2 ; 0x24be2 2e74a: 0f 94 f1 25 call 0x24be2 ; 0x24be2 2e74e: 0f 94 f1 25 call 0x24be2 ; 0x24be2 } chipSelectHigh(); 2e752: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 2e756: 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);} 2e75a: 81 e0 ldi r24, 0x01 ; 1 2e75c: 0f 94 ed 58 call 0x2b1da ; 0x2b1da 2e760: 81 11 cpse r24, r1 2e762: 0c c0 rjmp .+24 ; 0x2e77c 2e764: 80 e0 ldi r24, 0x00 ; 0 2e766: 0f 94 ed 58 call 0x2b1da ; 0x2b1da #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 2e76a: 81 11 cpse r24, r1 2e76c: 07 c0 rjmp .+14 ; 0x2e77c { SERIAL_ERROR_START; 2e76e: 87 ec ldi r24, 0xC7 ; 199 2e770: 92 ea ldi r25, 0xA2 ; 162 2e772: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 2e776: 88 eb ldi r24, 0xB8 ; 184 2e778: 9c e6 ldi r25, 0x6C ; 108 2e77a: 78 cf rjmp .-272 ; 0x2e66c } else if (!root.openRoot(&volume)) 2e77c: 69 e4 ldi r22, 0x49 ; 73 2e77e: 76 e1 ldi r23, 0x16 ; 22 2e780: 8d e5 ldi r24, 0x5D ; 93 2e782: 94 e1 ldi r25, 0x14 ; 20 2e784: 0f 94 69 29 call 0x252d2 ; 0x252d2 2e788: 81 11 cpse r24, r1 2e78a: 07 c0 rjmp .+14 ; 0x2e79a { SERIAL_ERROR_START; 2e78c: 87 ec ldi r24, 0xC7 ; 199 2e78e: 92 ea ldi r25, 0xA2 ; 162 2e790: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 2e794: 88 ea ldi r24, 0xA8 ; 168 2e796: 9c e6 ldi r25, 0x6C ; 108 2e798: 69 cf rjmp .-302 ; 0x2e66c } else { mounted = true; 2e79a: 81 e0 ldi r24, 0x01 ; 1 2e79c: 80 93 d8 13 sts 0x13D8, r24 ; 0x8013d8 SERIAL_ECHO_START; 2e7a0: 84 ee ldi r24, 0xE4 ; 228 2e7a2: 92 ea ldi r25, 0xA2 ; 162 2e7a4: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 2e7a8: 8d e9 ldi r24, 0x9D ; 157 2e7aa: 9c e6 ldi r25, 0x6C ; 108 2e7ac: 5f cf rjmp .-322 ; 0x2e66c if (mounted) { cdroot(doPresort); } } 2e7ae: df 91 pop r29 2e7b0: cf 91 pop r28 2e7b2: 1f 91 pop r17 2e7b4: 0f 91 pop r16 2e7b6: ff 90 pop r15 2e7b8: ef 90 pop r14 2e7ba: df 90 pop r13 2e7bc: cf 90 pop r12 2e7be: 08 95 ret 0002e7c0 : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 2e7c0: 4f 92 push r4 2e7c2: 5f 92 push r5 2e7c4: 6f 92 push r6 2e7c6: 7f 92 push r7 2e7c8: 8f 92 push r8 2e7ca: 9f 92 push r9 2e7cc: af 92 push r10 2e7ce: bf 92 push r11 2e7d0: cf 92 push r12 2e7d2: df 92 push r13 2e7d4: ef 92 push r14 2e7d6: ff 92 push r15 2e7d8: 4b 01 movw r8, r22 2e7da: 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]; 2e7dc: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 2e7e0: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 2e7e4: 07 2e mov r0, r23 2e7e6: 00 0c add r0, r0 2e7e8: 88 0b sbc r24, r24 2e7ea: 99 0b sbc r25, r25 2e7ec: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> if (!degTargetHotend(extruder)) 2e7f0: 20 e0 ldi r18, 0x00 ; 0 2e7f2: 30 e0 ldi r19, 0x00 ; 0 2e7f4: a9 01 movw r20, r18 2e7f6: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2e7fa: 88 23 and r24, r24 2e7fc: d1 f0 breq .+52 ; 0x2e832 #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; 2e7fe: 10 92 5f 0d sts 0x0D5F, r1 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.390> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 2e802: cc 24 eor r12, r12 2e804: ca 94 dec r12 2e806: dc 2c mov r13, r12 2e808: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 2e80a: 98 ee ldi r25, 0xE8 ; 232 2e80c: 49 2e mov r4, r25 2e80e: 93 e0 ldi r25, 0x03 ; 3 2e810: 59 2e mov r5, r25 2e812: 61 2c mov r6, r1 2e814: 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) || 2e816: 80 91 5f 0d lds r24, 0x0D5F ; 0x800d5f <_ZL13cancel_heatup.lto_priv.390> 2e81a: 81 11 cpse r24, r1 2e81c: 0a c0 rjmp .+20 ; 0x2e832 2e81e: 2f ef ldi r18, 0xFF ; 255 2e820: c2 16 cp r12, r18 2e822: d2 06 cpc r13, r18 2e824: e2 06 cpc r14, r18 2e826: f2 06 cpc r15, r18 2e828: 89 f4 brne .+34 ; 0x2e84c (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) { 2e82a: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 2e82e: 82 30 cpi r24, 0x02 ; 2 2e830: b9 f4 brne .+46 ; 0x2e860 { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 2e832: ff 90 pop r15 2e834: ef 90 pop r14 2e836: df 90 pop r13 2e838: cf 90 pop r12 2e83a: bf 90 pop r11 2e83c: af 90 pop r10 2e83e: 9f 90 pop r9 2e840: 8f 90 pop r8 2e842: 7f 90 pop r7 2e844: 6f 90 pop r6 2e846: 5f 90 pop r5 2e848: 4f 90 pop r4 2e84a: 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) || 2e84c: f7 fc sbrc r15, 7 2e84e: f1 cf rjmp .-30 ; 0x2e832 (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 2e850: 0f 94 01 0b call 0x21602 ; 0x21602 2e854: 6c 19 sub r22, r12 2e856: 7d 09 sbc r23, r13 2e858: 68 3b cpi r22, 0xB8 ; 184 2e85a: 7b 40 sbci r23, 0x0B ; 11 2e85c: 30 f3 brcs .-52 ; 0x2e82a 2e85e: e9 cf rjmp .-46 ; 0x2e832 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) 2e860: 0f 94 01 0b call 0x21602 ; 0x21602 2e864: 68 19 sub r22, r8 2e866: 79 09 sbc r23, r9 2e868: 8a 09 sbc r24, r10 2e86a: 9b 09 sbc r25, r11 2e86c: 69 3e cpi r22, 0xE9 ; 233 2e86e: 73 40 sbci r23, 0x03 ; 3 2e870: 81 05 cpc r24, r1 2e872: 91 05 cpc r25, r1 2e874: 08 f4 brcc .+2 ; 0x2e878 2e876: 42 c0 rjmp .+132 ; 0x2e8fc { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { 2e878: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 2e87c: 81 11 cpse r24, r1 2e87e: 3a c0 rjmp .+116 ; 0x2e8f4 SERIAL_PROTOCOLPGM("T:"); 2e880: 8d e1 ldi r24, 0x1D ; 29 2e882: 91 ea ldi r25, 0xA1 ; 161 2e884: 0e 94 1f 7b call 0xf63e ; 0xf63e else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2e888: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2e88c: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2e890: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2e894: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2e898: 41 e0 ldi r20, 0x01 ; 1 2e89a: 0e 94 a1 7a call 0xf542 ; 0xf542 SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 2e89e: 89 e1 ldi r24, 0x19 ; 25 2e8a0: 91 ea ldi r25, 0xA1 ; 161 2e8a2: 0e 94 1f 7b call 0xf63e ; 0xf63e 2e8a6: 60 e0 ldi r22, 0x00 ; 0 2e8a8: 70 e0 ldi r23, 0x00 ; 0 2e8aa: cb 01 movw r24, r22 2e8ac: 0e 94 85 7a call 0xf50a ; 0xf50a SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 2e8b0: 85 e1 ldi r24, 0x15 ; 21 2e8b2: 91 ea ldi r25, 0xA1 ; 161 2e8b4: 0e 94 1f 7b call 0xf63e ; 0xf63e if (residencyStart > -1) 2e8b8: f7 fc sbrc r15, 7 2e8ba: 52 c0 rjmp .+164 ; 0x2e960 { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 2e8bc: 0f 94 01 0b call 0x21602 ; 0x21602 2e8c0: 46 01 movw r8, r12 2e8c2: 57 01 movw r10, r14 2e8c4: 58 eb ldi r21, 0xB8 ; 184 2e8c6: 85 0e add r8, r21 2e8c8: 5b e0 ldi r21, 0x0B ; 11 2e8ca: 95 1e adc r9, r21 2e8cc: a1 1c adc r10, r1 2e8ce: b1 1c adc r11, r1 2e8d0: a5 01 movw r20, r10 2e8d2: 94 01 movw r18, r8 2e8d4: 26 1b sub r18, r22 2e8d6: 37 0b sbc r19, r23 2e8d8: 48 0b sbc r20, r24 2e8da: 59 0b sbc r21, r25 2e8dc: ca 01 movw r24, r20 2e8de: b9 01 movw r22, r18 2e8e0: a3 01 movw r20, r6 2e8e2: 92 01 movw r18, r4 2e8e4: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 2e8e8: ca 01 movw r24, r20 2e8ea: b9 01 movw r22, r18 2e8ec: 0e 94 85 7a call 0xf50a ; 0xf50a } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2e8f0: 0e 94 17 7b call 0xf62e ; 0xf62e } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 2e8f4: 0f 94 01 0b call 0x21602 ; 0x21602 2e8f8: 4b 01 movw r8, r22 2e8fa: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 2e8fc: 90 e0 ldi r25, 0x00 ; 0 2e8fe: 80 e0 ldi r24, 0x00 ; 0 2e900: 0e 94 0a 8d call 0x11a14 ; 0x11a14 #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))) || 2e904: 3f ef ldi r19, 0xFF ; 255 2e906: c3 16 cp r12, r19 2e908: d3 06 cpc r13, r19 2e90a: e3 06 cpc r14, r19 2e90c: f3 06 cpc r15, r19 2e90e: 09 f0 breq .+2 ; 0x2e912 2e910: 46 c0 rjmp .+140 ; 0x2e99e } 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))) || 2e912: 80 91 59 0d lds r24, 0x0D59 ; 0x800d59 <_ZL16target_direction.lto_priv.488> 2e916: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 2e91a: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 2e91e: 88 23 and r24, r24 2e920: 19 f1 breq .+70 ; 0x2e968 2e922: 07 2e mov r0, r23 2e924: 00 0c add r0, r0 2e926: 88 0b sbc r24, r24 2e928: 99 0b sbc r25, r25 2e92a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2e92e: 20 e0 ldi r18, 0x00 ; 0 2e930: 30 e0 ldi r19, 0x00 ; 0 2e932: 40 e8 ldi r20, 0x80 ; 128 2e934: 5f e3 ldi r21, 0x3F ; 63 2e936: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2e93a: 9b 01 movw r18, r22 2e93c: ac 01 movw r20, r24 2e93e: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2e942: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2e946: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2e94a: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2e94e: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2e952: 87 fd sbrc r24, 7 2e954: 60 cf rjmp .-320 ; 0x2e816 (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 2e956: 0f 94 01 0b call 0x21602 ; 0x21602 2e95a: 6b 01 movw r12, r22 2e95c: 7c 01 movw r14, r24 2e95e: 5b cf rjmp .-330 ; 0x2e816 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2e960: 8f e3 ldi r24, 0x3F ; 63 2e962: 0e 94 0c 7a call 0xf418 ; 0xf418 2e966: c4 cf rjmp .-120 ; 0x2e8f0 2e968: 07 2e mov r0, r23 2e96a: 00 0c add r0, r0 2e96c: 88 0b sbc r24, r24 2e96e: 99 0b sbc r25, r25 2e970: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__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))) || 2e974: 20 e0 ldi r18, 0x00 ; 0 2e976: 30 e0 ldi r19, 0x00 ; 0 2e978: 40 e8 ldi r20, 0x80 ; 128 2e97a: 5f e3 ldi r21, 0x3F ; 63 2e97c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2e980: 9b 01 movw r18, r22 2e982: ac 01 movw r20, r24 2e984: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2e988: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2e98c: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2e990: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2e994: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2e998: 18 16 cp r1, r24 2e99a: ec f6 brge .-70 ; 0x2e956 2e99c: 3c cf rjmp .-392 ; 0x2e816 2e99e: f7 fc sbrc r15, 7 2e9a0: 3a cf rjmp .-396 ; 0x2e816 2e9a2: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 2e9a6: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 2e9aa: 07 2e mov r0, r23 2e9ac: 00 0c add r0, r0 2e9ae: 88 0b sbc r24, r24 2e9b0: 99 0b sbc r25, r25 2e9b2: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2e9b6: 9b 01 movw r18, r22 2e9b8: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 2e9ba: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2e9be: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2e9c2: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2e9c6: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2e9ca: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2e9ce: 9f 77 andi r25, 0x7F ; 127 2e9d0: 20 e0 ldi r18, 0x00 ; 0 2e9d2: 30 e0 ldi r19, 0x00 ; 0 2e9d4: 40 ea ldi r20, 0xA0 ; 160 2e9d6: 50 e4 ldi r21, 0x40 ; 64 2e9d8: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2e9dc: 18 16 cp r1, r24 2e9de: 0c f0 brlt .+2 ; 0x2e9e2 2e9e0: 1a cf rjmp .-460 ; 0x2e816 2e9e2: b9 cf rjmp .-142 ; 0x2e956 0002e9e4 : // 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) { 2e9e4: 1f 93 push r17 2e9e6: cf 93 push r28 2e9e8: df 93 push r29 2e9ea: ec 01 movw r28, r24 2e9ec: 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()) { 2e9ee: 80 91 d4 12 lds r24, 0x12D4 ; 0x8012d4 2e9f2: 83 30 cpi r24, 0x03 ; 3 2e9f4: 09 f4 brne .+2 ; 0x2e9f8 2e9f6: 4e c0 rjmp .+156 ; 0x2ea94 2e9f8: 8c 31 cpi r24, 0x1C ; 28 2e9fa: 09 f4 brne .+2 ; 0x2e9fe 2e9fc: 52 c0 rjmp .+164 ; 0x2eaa2 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 2e9fe: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 2ea02: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 2ea06: 8c 17 cp r24, r28 2ea08: 9d 07 cpc r25, r29 2ea0a: 79 f1 breq .+94 ; 0x2ea6a lastErrorCode = ec; 2ea0c: d0 93 fa 12 sts 0x12FA, r29 ; 0x8012fa 2ea10: c0 93 f9 12 sts 0x12F9, r28 ; 0x8012f9 lastErrorSource = res; 2ea14: 10 93 fb 12 sts 0x12FB, r17 ; 0x8012fb LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 2ea18: ce 01 movw r24, r28 2ea1a: 0f 94 75 4e call 0x29cea ; 0x29cea 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); 2ea1e: e8 2f mov r30, r24 2ea20: f0 e0 ldi r31, 0x00 ; 0 2ea22: ee 0f add r30, r30 2ea24: ff 1f adc r31, r31 2ea26: ea 5c subi r30, 0xCA ; 202 2ea28: ff 45 sbci r31, 0x5F ; 95 2ea2a: 85 91 lpm r24, Z+ 2ea2c: 94 91 lpm r25, Z 2ea2e: 02 96 adiw r24, 0x02 ; 2 2ea30: 0f 94 5e 4e call 0x29cbc ; 0x29cbc if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 2ea34: c1 30 cpi r28, 0x01 ; 1 2ea36: d1 05 cpc r29, r1 2ea38: c1 f0 breq .+48 ; 0x2ea6a 2ea3a: cc 30 cpi r28, 0x0C ; 12 2ea3c: 80 e8 ldi r24, 0x80 ; 128 2ea3e: d8 07 cpc r29, r24 2ea40: a1 f0 breq .+40 ; 0x2ea6a 2ea42: c9 32 cpi r28, 0x29 ; 41 2ea44: 80 e8 ldi r24, 0x80 ; 128 2ea46: d8 07 cpc r29, r24 2ea48: 81 f0 breq .+32 ; 0x2ea6a IncrementMMUFails(); 2ea4a: 0f 94 8c 4d call 0x29b18 ; 0x29b18 | (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 2ea4e: ce 01 movw r24, r28 2ea50: 88 27 eor r24, r24 2ea52: 9e 77 andi r25, 0x7E ; 126 2ea54: 89 2b or r24, r25 2ea56: 49 f0 breq .+18 ; 0x2ea6a /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 2ea58: 80 91 07 13 lds r24, 0x1307 ; 0x801307 2ea5c: 90 91 08 13 lds r25, 0x1308 ; 0x801308 2ea60: 01 96 adiw r24, 0x01 ; 1 2ea62: 90 93 08 13 sts 0x1308, r25 ; 0x801308 2ea66: 80 93 07 13 sts 0x1307, r24 ; 0x801307 return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 2ea6a: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 2ea6e: 88 23 and r24, r24 2ea70: d9 f0 breq .+54 ; 0x2eaa8 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 2ea72: 11 e0 ldi r17, 0x01 ; 1 2ea74: 10 93 44 0d sts 0x0D44, r17 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 2ea78: ce 01 movw r24, r28 2ea7a: 0f 94 00 51 call 0x2a200 ; 0x2a200 2ea7e: 8f 3f cpi r24, 0xFF ; 255 2ea80: 99 f0 breq .+38 ; 0x2eaa8 void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 2ea82: 10 93 e7 12 sts 0x12E7, r17 ; 0x8012e7 logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 2ea86: 83 e2 ldi r24, 0x23 ; 35 2ea88: 90 ea ldi r25, 0xA0 ; 160 && mmu2Magic[2] == 'U' && mmu2Magic[3] == '2' && mmu2Magic[4] == ':' && strlen_constexpr(mmu2Magic) == 5, "MMU2 logging prefix mismatch, must be updated at various spots"); } 2ea8a: df 91 pop r29 2ea8c: cf 91 pop r28 2ea8e: 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"); 2ea90: 0c 94 18 7d jmp 0xfa30 ; 0xfa30 // 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; 2ea94: 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(); 2ea98: 0f 94 22 4c call 0x29844 ; 0x29844 // 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; 2ea9c: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 2eaa0: ae cf rjmp .-164 ; 0x2e9fe 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; 2eaa2: 10 92 03 13 sts 0x1303, r1 ; 0x801303 2eaa6: f8 cf rjmp .-16 ; 0x2ea98 2eaa8: 10 92 e7 12 sts 0x12E7, r1 ; 0x8012e7 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 2eaac: 80 91 43 0d lds r24, 0x0D43 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.450> 2eab0: 81 11 cpse r24, r1 2eab2: 06 c0 rjmp .+12 ; 0x2eac0 2eab4: 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"); } 2eab6: df 91 pop r29 2eab8: cf 91 pop r28 2eaba: 1f 91 pop r17 2eabc: 0d 94 c6 4f jmp 0x29f8c ; 0x29f8c 2eac0: df 91 pop r29 2eac2: cf 91 pop r28 2eac4: 1f 91 pop r17 2eac6: 08 95 ret 0002eac8 : * \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) { 2eac8: 2f 92 push r2 2eaca: 3f 92 push r3 2eacc: 4f 92 push r4 2eace: 5f 92 push r5 2ead0: 6f 92 push r6 2ead2: 7f 92 push r7 2ead4: 8f 92 push r8 2ead6: 9f 92 push r9 2ead8: af 92 push r10 2eada: bf 92 push r11 2eadc: cf 92 push r12 2eade: df 92 push r13 2eae0: ef 92 push r14 2eae2: ff 92 push r15 2eae4: 0f 93 push r16 2eae6: 1f 93 push r17 2eae8: cf 93 push r28 2eaea: df 93 push r29 2eaec: 00 d0 rcall .+0 ; 0x2eaee 2eaee: 1f 92 push r1 2eaf0: cd b7 in r28, 0x3d ; 61 2eaf2: de b7 in r29, 0x3e ; 62 2eaf4: 5c 01 movw r10, r24 2eaf6: 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; 2eaf8: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 2eafc: 81 30 cpi r24, 0x01 ; 1 2eafe: 09 f0 breq .+2 ; 0x2eb02 2eb00: de c0 rjmp .+444 ; 0x2ecbe 2eb02: 80 91 68 16 lds r24, 0x1668 ; 0x801668 2eb06: 81 ff sbrs r24, 1 2eb08: da c0 rjmp .+436 ; 0x2ecbe // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 2eb0a: 82 fd sbrc r24, 2 2eb0c: bc c0 rjmp .+376 ; 0x2ec86 * \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) { 2eb0e: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2eb10: 21 2c mov r2, r1 2eb12: 32 e0 ldi r19, 0x02 ; 2 2eb14: 33 2e mov r3, r19 2eb16: 00 91 6f 16 lds r16, 0x166F ; 0x80166f 2eb1a: 10 91 70 16 lds r17, 0x1670 ; 0x801670 2eb1e: 20 91 71 16 lds r18, 0x1671 ; 0x801671 2eb22: 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) { 2eb26: e1 14 cp r14, r1 2eb28: f1 04 cpc r15, r1 2eb2a: 09 f4 brne .+2 ; 0x2eb2e 2eb2c: 30 c1 rjmp .+608 ; 0x2ed8e uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 2eb2e: 80 91 80 16 lds r24, 0x1680 ; 0x801680 2eb32: 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);} 2eb36: dc 01 movw r26, r24 2eb38: 14 96 adiw r26, 0x04 ; 4 2eb3a: 7c 90 ld r7, X 2eb3c: 7a 94 dec r7 2eb3e: b9 01 movw r22, r18 2eb40: a8 01 movw r20, r16 2eb42: 29 e0 ldi r18, 0x09 ; 9 2eb44: 76 95 lsr r23 2eb46: 67 95 ror r22 2eb48: 57 95 ror r21 2eb4a: 47 95 ror r20 2eb4c: 2a 95 dec r18 2eb4e: d1 f7 brne .-12 ; 0x2eb44 2eb50: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 2eb52: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 2eb54: 71 10 cpse r7, r1 2eb56: 25 c0 rjmp .+74 ; 0x2eba2 2eb58: 01 15 cp r16, r1 2eb5a: 11 05 cpc r17, r1 2eb5c: 11 f5 brne .+68 ; 0x2eba2 2eb5e: 40 91 6b 16 lds r20, 0x166B ; 0x80166b 2eb62: 50 91 6c 16 lds r21, 0x166C ; 0x80166c 2eb66: 60 91 6d 16 lds r22, 0x166D ; 0x80166d 2eb6a: 70 91 6e 16 lds r23, 0x166E ; 0x80166e // start of new cluster if (curCluster_ == 0) { 2eb6e: 41 15 cp r20, r1 2eb70: 51 05 cpc r21, r1 2eb72: 61 05 cpc r22, r1 2eb74: 71 05 cpc r23, r1 2eb76: 09 f0 breq .+2 ; 0x2eb7a 2eb78: a8 c0 rjmp .+336 ; 0x2ecca if (firstCluster_ == 0) { 2eb7a: 80 91 7c 16 lds r24, 0x167C ; 0x80167c 2eb7e: 90 91 7d 16 lds r25, 0x167D ; 0x80167d 2eb82: a0 91 7e 16 lds r26, 0x167E ; 0x80167e 2eb86: b0 91 7f 16 lds r27, 0x167F ; 0x80167f 2eb8a: 00 97 sbiw r24, 0x00 ; 0 2eb8c: a1 05 cpc r26, r1 2eb8e: b1 05 cpc r27, r1 2eb90: 09 f0 breq .+2 ; 0x2eb94 2eb92: b4 c0 rjmp .+360 ; 0x2ecfc } 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; 2eb94: 87 e6 ldi r24, 0x67 ; 103 2eb96: 96 e1 ldi r25, 0x16 ; 22 2eb98: 0f 94 c6 2a call 0x2558c ; 0x2558c 2eb9c: 88 23 and r24, r24 2eb9e: 09 f4 brne .+2 ; 0x2eba2 2eba0: 8e c0 rjmp .+284 ; 0x2ecbe curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2eba2: c1 01 movw r24, r2 2eba4: 80 1b sub r24, r16 2eba6: 91 0b sbc r25, r17 2eba8: 67 01 movw r12, r14 2ebaa: 8e 15 cp r24, r14 2ebac: 9f 05 cpc r25, r15 2ebae: 08 f4 brcc .+2 ; 0x2ebb2 2ebb0: 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; 2ebb2: e0 91 80 16 lds r30, 0x1680 ; 0x801680 2ebb6: f0 91 81 16 lds r31, 0x1681 ; 0x801681 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2ebba: 80 91 6b 16 lds r24, 0x166B ; 0x80166b 2ebbe: 90 91 6c 16 lds r25, 0x166C ; 0x80166c 2ebc2: a0 91 6d 16 lds r26, 0x166D ; 0x80166d 2ebc6: b0 91 6e 16 lds r27, 0x166E ; 0x80166e 2ebca: 02 97 sbiw r24, 0x02 ; 2 2ebcc: a1 09 sbc r26, r1 2ebce: b1 09 sbc r27, r1 2ebd0: 25 85 ldd r18, Z+13 ; 0x0d 2ebd2: 04 c0 rjmp .+8 ; 0x2ebdc 2ebd4: 88 0f add r24, r24 2ebd6: 99 1f adc r25, r25 2ebd8: aa 1f adc r26, r26 2ebda: bb 1f adc r27, r27 2ebdc: 2a 95 dec r18 2ebde: d2 f7 brpl .-12 ; 0x2ebd4 2ebe0: 46 85 ldd r20, Z+14 ; 0x0e 2ebe2: 57 85 ldd r21, Z+15 ; 0x0f 2ebe4: 60 89 ldd r22, Z+16 ; 0x10 2ebe6: 71 89 ldd r23, Z+17 ; 0x11 2ebe8: 84 0f add r24, r20 2ebea: 95 1f adc r25, r21 2ebec: a6 1f adc r26, r22 2ebee: b7 1f adc r27, r23 2ebf0: 9c 01 movw r18, r24 2ebf2: ad 01 movw r20, r26 2ebf4: 27 0d add r18, r7 2ebf6: 31 1d adc r19, r1 2ebf8: 41 1d adc r20, r1 2ebfa: 51 1d adc r21, r1 2ebfc: 29 01 movw r4, r18 2ebfe: 3a 01 movw r6, r20 if (n == 512) { 2ec00: c1 14 cp r12, r1 2ec02: 32 e0 ldi r19, 0x02 ; 2 2ec04: d3 06 cpc r13, r19 2ec06: 09 f0 breq .+2 ; 0x2ec0a 2ec08: 8a c0 rjmp .+276 ; 0x2ed1e // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 2ec0a: 80 91 3a 0e lds r24, 0x0E3A ; 0x800e3a 2ec0e: 90 91 3b 0e lds r25, 0x0E3B ; 0x800e3b 2ec12: a0 91 3c 0e lds r26, 0x0E3C ; 0x800e3c 2ec16: b0 91 3d 0e lds r27, 0x0E3D ; 0x800e3d 2ec1a: 48 16 cp r4, r24 2ec1c: 59 06 cpc r5, r25 2ec1e: 6a 06 cpc r6, r26 2ec20: 7b 06 cpc r7, r27 2ec22: 69 f4 brne .+26 ; 0x2ec3e 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; 2ec24: 10 92 42 0e sts 0x0E42, r1 ; 0x800e42 cacheBlockNumber_ = blockNumber; 2ec28: 8f ef ldi r24, 0xFF ; 255 2ec2a: 9f ef ldi r25, 0xFF ; 255 2ec2c: dc 01 movw r26, r24 2ec2e: 80 93 3a 0e sts 0x0E3A, r24 ; 0x800e3a 2ec32: 90 93 3b 0e sts 0x0E3B, r25 ; 0x800e3b 2ec36: a0 93 3c 0e sts 0x0E3C, r26 ; 0x800e3c 2ec3a: 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); 2ec3e: 95 01 movw r18, r10 2ec40: b3 01 movw r22, r6 2ec42: a2 01 movw r20, r4 2ec44: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 2ec48: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 2ec4c: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 2ec50: 88 23 and r24, r24 2ec52: a9 f1 breq .+106 ; 0x2ecbe if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 2ec54: 80 91 6f 16 lds r24, 0x166F ; 0x80166f 2ec58: 90 91 70 16 lds r25, 0x1670 ; 0x801670 2ec5c: a0 91 71 16 lds r26, 0x1671 ; 0x801671 2ec60: b0 91 72 16 lds r27, 0x1672 ; 0x801672 2ec64: 8c 0d add r24, r12 2ec66: 9d 1d adc r25, r13 2ec68: a1 1d adc r26, r1 2ec6a: b1 1d adc r27, r1 2ec6c: 80 93 6f 16 sts 0x166F, r24 ; 0x80166f 2ec70: 90 93 70 16 sts 0x1670, r25 ; 0x801670 2ec74: a0 93 71 16 sts 0x1671, r26 ; 0x801671 2ec78: b0 93 72 16 sts 0x1672, r27 ; 0x801672 src += n; 2ec7c: ac 0c add r10, r12 2ec7e: bd 1c adc r11, r13 nToWrite -= n; 2ec80: ec 18 sub r14, r12 2ec82: fd 08 sbc r15, r13 2ec84: 48 cf rjmp .-368 ; 0x2eb16 // 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_) { 2ec86: 40 91 78 16 lds r20, 0x1678 ; 0x801678 2ec8a: 50 91 79 16 lds r21, 0x1679 ; 0x801679 2ec8e: 60 91 7a 16 lds r22, 0x167A ; 0x80167a 2ec92: 70 91 7b 16 lds r23, 0x167B ; 0x80167b 2ec96: 80 91 6f 16 lds r24, 0x166F ; 0x80166f 2ec9a: 90 91 70 16 lds r25, 0x1670 ; 0x801670 2ec9e: a0 91 71 16 lds r26, 0x1671 ; 0x801671 2eca2: b0 91 72 16 lds r27, 0x1672 ; 0x801672 2eca6: 48 17 cp r20, r24 2eca8: 59 07 cpc r21, r25 2ecaa: 6a 07 cpc r22, r26 2ecac: 7b 07 cpc r23, r27 2ecae: 09 f4 brne .+2 ; 0x2ecb2 2ecb0: 2e cf rjmp .-420 ; 0x2eb0e } /** 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);} 2ecb2: 87 e6 ldi r24, 0x67 ; 103 2ecb4: 96 e1 ldi r25, 0x16 ; 22 2ecb6: 0f 94 32 2a call 0x25464 ; 0x25464 if (!seekEnd()) goto fail; 2ecba: 81 11 cpse r24, r1 2ecbc: 28 cf rjmp .-432 ; 0x2eb0e } return nbyte; fail: // return for write error writeError = true; 2ecbe: 81 e0 ldi r24, 0x01 ; 1 2ecc0: 80 93 67 16 sts 0x1667, r24 ; 0x801667 return -1; 2ecc4: 8f ef ldi r24, 0xFF ; 255 2ecc6: 9f ef ldi r25, 0xFF ; 255 2ecc8: 81 c0 rjmp .+258 ; 0x2edcc } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 2ecca: 9e 01 movw r18, r28 2eccc: 2f 5f subi r18, 0xFF ; 255 2ecce: 3f 4f sbci r19, 0xFF ; 255 2ecd0: 0f 94 7c 28 call 0x250f8 ; 0x250f8 2ecd4: 88 23 and r24, r24 2ecd6: 99 f3 breq .-26 ; 0x2ecbe if (vol_->isEOC(next)) { 2ecd8: 89 81 ldd r24, Y+1 ; 0x01 2ecda: 9a 81 ldd r25, Y+2 ; 0x02 2ecdc: ab 81 ldd r26, Y+3 ; 0x03 2ecde: 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; 2ece0: e0 91 80 16 lds r30, 0x1680 ; 0x801680 2ece4: f0 91 81 16 lds r31, 0x1681 ; 0x801681 2ece8: 27 89 ldd r18, Z+23 ; 0x17 2ecea: 20 31 cpi r18, 0x10 ; 16 2ecec: 81 f4 brne .+32 ; 0x2ed0e 2ecee: 88 3f cpi r24, 0xF8 ; 248 2ecf0: ef ef ldi r30, 0xFF ; 255 2ecf2: 9e 07 cpc r25, r30 2ecf4: a1 05 cpc r26, r1 2ecf6: b1 05 cpc r27, r1 2ecf8: 08 f0 brcs .+2 ; 0x2ecfc 2ecfa: 4c cf rjmp .-360 ; 0x2eb94 // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 2ecfc: 80 93 6b 16 sts 0x166B, r24 ; 0x80166b 2ed00: 90 93 6c 16 sts 0x166C, r25 ; 0x80166c 2ed04: a0 93 6d 16 sts 0x166D, r26 ; 0x80166d 2ed08: b0 93 6e 16 sts 0x166E, r27 ; 0x80166e 2ed0c: 4a cf rjmp .-364 ; 0x2eba2 return cluster >= FAT32EOC_MIN; 2ed0e: 88 3f cpi r24, 0xF8 ; 248 2ed10: ff ef ldi r31, 0xFF ; 255 2ed12: 9f 07 cpc r25, r31 2ed14: af 07 cpc r26, r31 2ed16: ff e0 ldi r31, 0x0F ; 15 2ed18: bf 07 cpc r27, r31 2ed1a: 80 f3 brcs .-32 ; 0x2ecfc 2ed1c: 3b cf rjmp .-394 ; 0x2eb94 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 2ed1e: 01 15 cp r16, r1 2ed20: 11 05 cpc r17, r1 2ed22: 69 f5 brne .+90 ; 0x2ed7e 2ed24: 40 91 6f 16 lds r20, 0x166F ; 0x80166f 2ed28: 50 91 70 16 lds r21, 0x1670 ; 0x801670 2ed2c: 60 91 71 16 lds r22, 0x1671 ; 0x801671 2ed30: 70 91 72 16 lds r23, 0x1672 ; 0x801672 2ed34: 80 91 78 16 lds r24, 0x1678 ; 0x801678 2ed38: 90 91 79 16 lds r25, 0x1679 ; 0x801679 2ed3c: a0 91 7a 16 lds r26, 0x167A ; 0x80167a 2ed40: b0 91 7b 16 lds r27, 0x167B ; 0x80167b 2ed44: 48 17 cp r20, r24 2ed46: 59 07 cpc r21, r25 2ed48: 6a 07 cpc r22, r26 2ed4a: 7b 07 cpc r23, r27 2ed4c: c0 f0 brcs .+48 ; 0x2ed7e // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 2ed4e: 0f 94 b5 26 call 0x24d6a ; 0x24d6a 2ed52: 88 23 and r24, r24 2ed54: 09 f4 brne .+2 ; 0x2ed58 2ed56: b3 cf rjmp .-154 ; 0x2ecbe 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; 2ed58: 81 e0 ldi r24, 0x01 ; 1 2ed5a: 80 93 42 0e sts 0x0E42, r24 ; 0x800e42 cacheBlockNumber_ = blockNumber; 2ed5e: 40 92 3a 0e sts 0x0E3A, r4 ; 0x800e3a 2ed62: 50 92 3b 0e sts 0x0E3B, r5 ; 0x800e3b 2ed66: 60 92 3c 0e sts 0x0E3C, r6 ; 0x800e3c 2ed6a: 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); 2ed6e: a6 01 movw r20, r12 2ed70: b5 01 movw r22, r10 2ed72: c8 01 movw r24, r16 2ed74: 8a 5b subi r24, 0xBA ; 186 2ed76: 91 4f sbci r25, 0xF1 ; 241 2ed78: 0f 94 67 aa call 0x354ce ; 0x354ce 2ed7c: 6b cf rjmp .-298 ; 0x2ec54 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; 2ed7e: 41 e0 ldi r20, 0x01 ; 1 2ed80: c3 01 movw r24, r6 2ed82: b2 01 movw r22, r4 2ed84: 0f 94 ad 27 call 0x24f5a ; 0x24f5a 2ed88: 81 11 cpse r24, r1 2ed8a: f1 cf rjmp .-30 ; 0x2ed6e 2ed8c: 98 cf rjmp .-208 ; 0x2ecbe } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 2ed8e: 80 91 78 16 lds r24, 0x1678 ; 0x801678 2ed92: 90 91 79 16 lds r25, 0x1679 ; 0x801679 2ed96: a0 91 7a 16 lds r26, 0x167A ; 0x80167a 2ed9a: b0 91 7b 16 lds r27, 0x167B ; 0x80167b 2ed9e: 80 17 cp r24, r16 2eda0: 91 07 cpc r25, r17 2eda2: a2 07 cpc r26, r18 2eda4: b3 07 cpc r27, r19 2eda6: 68 f4 brcc .+26 ; 0x2edc2 2eda8: 80 91 68 16 lds r24, 0x1668 ; 0x801668 // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 2edac: 00 93 78 16 sts 0x1678, r16 ; 0x801678 2edb0: 10 93 79 16 sts 0x1679, r17 ; 0x801679 2edb4: 20 93 7a 16 sts 0x167A, r18 ; 0x80167a 2edb8: 30 93 7b 16 sts 0x167B, r19 ; 0x80167b flags_ |= F_FILE_DIR_DIRTY; 2edbc: 80 68 ori r24, 0x80 ; 128 2edbe: 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) { 2edc2: 80 91 68 16 lds r24, 0x1668 ; 0x801668 2edc6: 83 fd sbrc r24, 3 2edc8: 18 c0 rjmp .+48 ; 0x2edfa if (!sync()) goto fail; } return nbyte; 2edca: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 2edcc: 0f 90 pop r0 2edce: 0f 90 pop r0 2edd0: 0f 90 pop r0 2edd2: 0f 90 pop r0 2edd4: df 91 pop r29 2edd6: cf 91 pop r28 2edd8: 1f 91 pop r17 2edda: 0f 91 pop r16 2eddc: ff 90 pop r15 2edde: ef 90 pop r14 2ede0: df 90 pop r13 2ede2: cf 90 pop r12 2ede4: bf 90 pop r11 2ede6: af 90 pop r10 2ede8: 9f 90 pop r9 2edea: 8f 90 pop r8 2edec: 7f 90 pop r7 2edee: 6f 90 pop r6 2edf0: 5f 90 pop r5 2edf2: 4f 90 pop r4 2edf4: 3f 90 pop r3 2edf6: 2f 90 pop r2 2edf8: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 2edfa: 87 e6 ldi r24, 0x67 ; 103 2edfc: 96 e1 ldi r25, 0x16 ; 22 2edfe: 0f 94 db 2b call 0x257b6 ; 0x257b6 2ee02: 81 11 cpse r24, r1 2ee04: e2 cf rjmp .-60 ; 0x2edca 2ee06: 5b cf rjmp .-330 ; 0x2ecbe 0002ee08 : #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) { 2ee08: 0f 93 push r16 2ee0a: cf 93 push r28 2ee0c: df 93 push r29 2ee0e: cd b7 in r28, 0x3d ; 61 2ee10: de b7 in r29, 0x3e ; 62 2ee12: a3 97 sbiw r28, 0x23 ; 35 2ee14: 0f b6 in r0, 0x3f ; 63 2ee16: f8 94 cli 2ee18: de bf out 0x3e, r29 ; 62 2ee1a: 0f be out 0x3f, r0 ; 63 2ee1c: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 2ee1e: 20 91 78 15 lds r18, 0x1578 ; 0x801578 2ee22: 30 91 79 15 lds r19, 0x1579 ; 0x801579 2ee26: 82 17 cp r24, r18 2ee28: 93 07 cpc r25, r19 2ee2a: d8 f4 brcc .+54 ; 0x2ee62 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 2ee2c: 61 30 cpi r22, 0x01 ; 1 2ee2e: 31 f4 brne .+12 ; 0x2ee3c 2ee30: 21 50 subi r18, 0x01 ; 1 2ee32: 31 09 sbc r19, r1 2ee34: a9 01 movw r20, r18 2ee36: 48 1b sub r20, r24 2ee38: 59 0b sbc r21, r25 2ee3a: ca 01 movw r24, r20 2ee3c: 88 0f add r24, r24 2ee3e: 99 1f adc r25, r25 2ee40: fc 01 movw r30, r24 2ee42: e6 58 subi r30, 0x86 ; 134 2ee44: fa 4e sbci r31, 0xEA ; 234 2ee46: 80 81 ld r24, Z 2ee48: 91 81 ldd r25, Z+1 ; 0x01 2ee4a: 0f 94 6f 6b call 0x2d6de ; 0x2d6de else getfilename_afterMaxSorting(nr); } 2ee4e: a3 96 adiw r28, 0x23 ; 35 2ee50: 0f b6 in r0, 0x3f ; 63 2ee52: f8 94 cli 2ee54: de bf out 0x3e, r29 ; 62 2ee56: 0f be out 0x3f, r0 ; 63 2ee58: cd bf out 0x3d, r28 ; 61 2ee5a: df 91 pop r29 2ee5c: cf 91 pop r28 2ee5e: 0f 91 pop r16 2ee60: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 2ee62: 42 e8 ldi r20, 0x82 ; 130 2ee64: 54 e1 ldi r21, 0x14 ; 20 2ee66: 50 93 81 14 sts 0x1481, r21 ; 0x801481 2ee6a: 40 93 80 14 sts 0x1480, r20 ; 0x801480 nrFiles = entry - sort_count + 1; 2ee6e: 82 1b sub r24, r18 2ee70: 93 0b sbc r25, r19 2ee72: 01 96 adiw r24, 0x01 ; 1 2ee74: 90 93 f0 16 sts 0x16F0, r25 ; 0x8016f0 2ee78: 80 93 ef 16 sts 0x16EF, r24 ; 0x8016ef curDir->seekSet(lastSortedFilePosition << 5); 2ee7c: 40 91 42 16 lds r20, 0x1642 ; 0x801642 2ee80: 50 91 43 16 lds r21, 0x1643 ; 0x801643 2ee84: 85 e0 ldi r24, 0x05 ; 5 2ee86: 44 0f add r20, r20 2ee88: 55 1f adc r21, r21 2ee8a: 8a 95 dec r24 2ee8c: e1 f7 brne .-8 ; 0x2ee86 2ee8e: 70 e0 ldi r23, 0x00 ; 0 2ee90: 60 e0 ldi r22, 0x00 ; 0 2ee92: 82 e8 ldi r24, 0x82 ; 130 2ee94: 94 e1 ldi r25, 0x14 ; 20 2ee96: 0f 94 32 2a call 0x25464 ; 0x25464 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2ee9a: 00 e0 ldi r16, 0x00 ; 0 2ee9c: 0e 7f andi r16, 0xFE ; 254 2ee9e: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2eea0: e0 91 80 14 lds r30, 0x1480 ; 0x801480 2eea4: f0 91 81 14 lds r31, 0x1481 ; 0x801481 2eea8: 83 e2 ldi r24, 0x23 ; 35 2eeaa: de 01 movw r26, r28 2eeac: 11 96 adiw r26, 0x01 ; 1 2eeae: 01 90 ld r0, Z+ 2eeb0: 0d 92 st X+, r0 2eeb2: 8a 95 dec r24 2eeb4: e1 f7 brne .-8 ; 0x2eeae 2eeb6: 22 e0 ldi r18, 0x02 ; 2 2eeb8: 50 e0 ldi r21, 0x00 ; 0 2eeba: 40 e0 ldi r20, 0x00 ; 0 2eebc: be 01 movw r22, r28 2eebe: 6f 5f subi r22, 0xFF ; 255 2eec0: 7f 4f sbci r23, 0xFF ; 255 2eec2: 8f ed ldi r24, 0xDF ; 223 2eec4: 92 e0 ldi r25, 0x02 ; 2 2eec6: 0f 94 f9 68 call 0x2d1f2 ; 0x2d1f2 2eeca: ce 01 movw r24, r28 2eecc: 01 96 adiw r24, 0x01 ; 1 2eece: 0e 94 06 7a call 0xf40c ; 0xf40c 2eed2: bd cf rjmp .-134 ; 0x2ee4e 0002eed4 : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 2eed4: 0f 93 push r16 2eed6: 1f 93 push r17 2eed8: cf 93 push r28 2eeda: df 93 push r29 2eedc: 1f 92 push r1 2eede: 1f 92 push r1 2eee0: cd b7 in r28, 0x3d ; 61 2eee2: de b7 in r29, 0x3e ; 62 { if(!mounted) 2eee4: 20 91 d8 13 lds r18, 0x13D8 ; 0x8013d8 2eee8: 22 23 and r18, r18 2eeea: 69 f1 breq .+90 ; 0x2ef46 2eeec: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2eeee: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 2eef2: 88 23 and r24, r24 2eef4: 79 f1 breq .+94 ; 0x2ef54 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 2eef6: 8a e4 ldi r24, 0x4A ; 74 2eef8: 9f e9 ldi r25, 0x9F ; 159 2eefa: 0e 94 18 7d call 0xfa30 ; 0xfa30 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; 2eefe: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 const char *fname=name; 2ef02: 1a 83 std Y+2, r17 ; 0x02 2ef04: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 2ef06: ce 01 movw r24, r28 2ef08: 01 96 adiw r24, 0x01 ; 1 2ef0a: 0f 94 c9 70 call 0x2e192 ; 0x2e192 2ef0e: 88 23 and r24, r24 2ef10: d1 f0 breq .+52 ; 0x2ef46 return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 2ef12: 49 81 ldd r20, Y+1 ; 0x01 2ef14: 5a 81 ldd r21, Y+2 ; 0x02 2ef16: 60 91 80 14 lds r22, 0x1480 ; 0x801480 2ef1a: 70 91 81 14 lds r23, 0x1481 ; 0x801481 2ef1e: 26 e5 ldi r18, 0x56 ; 86 2ef20: 87 e6 ldi r24, 0x67 ; 103 2ef22: 96 e1 ldi r25, 0x16 ; 22 2ef24: 0f 94 3b 54 call 0x2a876 ; 0x2a876 2ef28: 81 11 cpse r24, r1 2ef2a: 22 c0 rjmp .+68 ; 0x2ef70 SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2ef2c: 88 ed ldi r24, 0xD8 ; 216 2ef2e: 9c e6 ldi r25, 0x6C ; 108 2ef30: 0e 94 1f 7b call 0xf63e ; 0xf63e 2ef34: 89 81 ldd r24, Y+1 ; 0x01 2ef36: 9a 81 ldd r25, Y+2 ; 0x02 2ef38: 0e 94 11 86 call 0x10c22 ; 0x10c22 2ef3c: 8e e2 ldi r24, 0x2E ; 46 2ef3e: 0e 94 0c 7a call 0xf418 ; 0xf418 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2ef42: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 2ef46: 0f 90 pop r0 2ef48: 0f 90 pop r0 2ef4a: df 91 pop r29 2ef4c: cf 91 pop r28 2ef4e: 1f 91 pop r17 2ef50: 0f 91 pop r16 2ef52: 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 2ef54: 10 92 8a 16 sts 0x168A, r1 ; 0x80168a SERIAL_ECHO_START; 2ef58: 84 ee ldi r24, 0xE4 ; 228 2ef5a: 92 ea ldi r25, 0xA2 ; 162 2ef5c: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHORPGM(ofNowFreshFile); 2ef60: 82 e6 ldi r24, 0x62 ; 98 2ef62: 91 ea ldi r25, 0xA1 ; 161 2ef64: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN(name); 2ef68: c8 01 movw r24, r16 2ef6a: 0e 94 1d 86 call 0x10c3a ; 0x10c3a 2ef6e: c7 cf rjmp .-114 ; 0x2eefe 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; 2ef70: 81 e0 ldi r24, 0x01 ; 1 2ef72: 80 93 d5 13 sts 0x13D5, r24 ; 0x8013d5 getfilename(0, fname); 2ef76: 89 81 ldd r24, Y+1 ; 0x01 2ef78: 9a 81 ldd r25, Y+2 ; 0x02 2ef7a: 0f 94 28 6b call 0x2d650 ; 0x2d650 SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 2ef7e: 88 e3 ldi r24, 0x38 ; 56 2ef80: 9f e9 ldi r25, 0x9F ; 159 2ef82: 0e 94 1f 7b call 0xf63e ; 0xf63e printAbsFilenameFast(); 2ef86: 0f 94 0b 6c call 0x2d816 ; 0x2d816 SERIAL_PROTOCOLLN(); 2ef8a: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2ef8e: 8e e3 ldi r24, 0x3E ; 62 2ef90: 91 ea ldi r25, 0xA1 ; 161 2ef92: 0e 94 18 7d call 0xfa30 ; 0xfa30 lcd_setstatuspgm(ofFileSelected); 2ef96: 8e e3 ldi r24, 0x3E ; 62 2ef98: 91 ea ldi r25, 0xA1 ; 161 2ef9a: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe scrollstuff = 0; 2ef9e: 10 92 62 0d sts 0x0D62, r1 ; 0x800d62 2efa2: d1 cf rjmp .-94 ; 0x2ef46 0002efa4 : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 2efa4: 0f 93 push r16 2efa6: 1f 93 push r17 2efa8: cf 93 push r28 2efaa: df 93 push r29 2efac: ec 01 movw r28, r24 { memset(ip, 0, 4); 2efae: 84 e0 ldi r24, 0x04 ; 4 2efb0: fe 01 movw r30, r28 2efb2: 11 92 st Z+, r1 2efb4: 8a 95 dec r24 2efb6: e9 f7 brne .-6 ; 0x2efb2 /** 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 2efb8: 23 e0 ldi r18, 0x03 ; 3 2efba: 30 ea ldi r19, 0xA0 ; 160 2efbc: 4a e0 ldi r20, 0x0A ; 10 2efbe: 50 e9 ldi r21, 0x90 ; 144 2efc0: 60 e3 ldi r22, 0x30 ; 48 2efc2: 84 e4 ldi r24, 0x44 ; 68 2efc4: 96 e1 ldi r25, 0x16 ; 22 2efc6: 0f 94 f8 25 call 0x24bf0 ; 0x24bf0 2efca: 88 23 and r24, r24 2efcc: 91 f0 breq .+36 ; 0x2eff2 2efce: 23 e0 ldi r18, 0x03 ; 3 2efd0: 30 ea ldi r19, 0xA0 ; 160 2efd2: 4a e0 ldi r20, 0x0A ; 10 2efd4: 50 e9 ldi r21, 0x90 ; 144 2efd6: 61 e1 ldi r22, 0x11 ; 17 2efd8: 84 e4 ldi r24, 0x44 ; 68 2efda: 96 e1 ldi r25, 0x16 ; 22 2efdc: 0f 94 f8 25 call 0x24bf0 ; 0x24bf0 2efe0: 88 23 and r24, r24 2efe2: 39 f0 breq .+14 ; 0x2eff2 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2efe4: 80 e8 ldi r24, 0x80 ; 128 2efe6: 80 93 44 16 sts 0x1644, r24 ; 0x801644 chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 2efea: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 return false; 2efee: 80 e0 ldi r24, 0x00 ; 0 2eff0: 2f c0 rjmp .+94 ; 0x2f050 //------------------------------------------------------------------------------ /** 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(); 2eff2: 0f 94 01 0b call 0x21602 ; 0x21602 2eff6: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2eff8: 0f 94 f1 25 call 0x24be2 ; 0x24be2 2effc: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2f000: 8f 3f cpi r24, 0xFF ; 255 2f002: 69 f4 brne .+26 ; 0x2f01e if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2f004: 0f 94 01 0b call 0x21602 ; 0x21602 2f008: 60 1b sub r22, r16 2f00a: 71 0b sbc r23, r17 2f00c: 6d 32 cpi r22, 0x2D ; 45 2f00e: 71 40 sbci r23, 0x01 ; 1 2f010: 98 f3 brcs .-26 ; 0x2eff8 2f012: 81 e1 ldi r24, 0x11 ; 17 2f014: 80 93 44 16 sts 0x1644, r24 ; 0x801644 goto fail; } return true; fail: chipSelectHigh(); 2f018: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 2f01c: e6 cf rjmp .-52 ; 0x2efea if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2f01e: 8e 3f cpi r24, 0xFE ; 254 2f020: 11 f0 breq .+4 ; 0x2f026 2f022: 8f e0 ldi r24, 0x0F ; 15 2f024: f7 cf rjmp .-18 ; 0x2f014 2f026: 8e 01 movw r16, r28 2f028: 0c 5f subi r16, 0xFC ; 252 2f02a: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 2f02c: 0f 94 f1 25 call 0x24be2 ; 0x24be2 2f030: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 2f032: c0 17 cp r28, r16 2f034: d1 07 cpc r29, r17 2f036: d1 f7 brne .-12 ; 0x2f02c 2f038: ce ef ldi r28, 0xFE ; 254 2f03a: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 2f03c: 0f 94 f1 25 call 0x24be2 ; 0x24be2 2f040: 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) { 2f042: e1 f7 brne .-8 ; 0x2f03c spiRec(); } chipSelectHigh(); 2f044: 0f 94 52 65 call 0x2caa4 ; 0x2caa4 spiSend(0xFF); // dummy clock to force FlashAir finish the command. 2f048: 8f ef ldi r24, 0xFF ; 255 2f04a: 0f 94 ec 25 call 0x24bd8 ; 0x24bd8 2f04e: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 2f050: df 91 pop r29 2f052: cf 91 pop r28 2f054: 1f 91 pop r17 2f056: 0f 91 pop r16 2f058: 08 95 ret 0002f05a : } 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) 2f05a: cf 92 push r12 2f05c: df 92 push r13 2f05e: ef 92 push r14 2f060: ff 92 push r15 2f062: 0f 93 push r16 2f064: 1f 93 push r17 2f066: cf 93 push r28 2f068: df 93 push r29 2f06a: ec 01 movw r28, r24 2f06c: 8b 01 movw r16, r22 2f06e: 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) 2f070: 01 15 cp r16, r1 2f072: 11 05 cpc r17, r1 2f074: 09 f4 brne .+2 ; 0x2f078 2f076: 41 c0 rjmp .+130 ; 0x2f0fa void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); #endif print_hex_byte((val >> 8) & 0xFF); 2f078: 8d 2f mov r24, r29 2f07a: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 print_hex_byte(val & 0xFF); 2f07e: 8c 2f mov r24, r28 2f080: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 2f084: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 2f088: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 2f08c: 80 e2 ldi r24, 0x20 ; 32 2f08e: 90 e0 ldi r25, 0x00 ; 0 2f090: 0f 94 a6 a2 call 0x3454c ; 0x3454c 2f094: 6e 01 movw r12, r28 2f096: 80 e1 ldi r24, 0x10 ; 16 2f098: c8 0e add r12, r24 2f09a: d1 1c adc r13, r1 uint8_t count_line = countperline; while (count && count_line) { uint8_t data = 0; switch (type) 2f09c: 81 e0 ldi r24, 0x01 ; 1 2f09e: e8 16 cp r14, r24 2f0a0: 39 f1 breq .+78 ; 0x2f0f0 { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 2f0a2: 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; 2f0a4: 21 96 adiw r28, 0x01 ; 1 putchar(' '); 2f0a6: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 2f0aa: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 2f0ae: 80 e2 ldi r24, 0x20 ; 32 2f0b0: 90 e0 ldi r25, 0x00 ; 0 2f0b2: 0f 94 a6 a2 call 0x3454c ; 0x3454c print_hex_byte(data); 2f0b6: 8f 2d mov r24, r15 2f0b8: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 count_line--; count--; 2f0bc: 01 50 subi r16, 0x01 ; 1 2f0be: 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)) 2f0c0: 0f b6 in r0, 0x3f ; 63 2f0c2: 07 fe sbrs r0, 7 2f0c4: 06 c0 rjmp .+12 ; 0x2f0d2 2f0c6: c8 01 movw r24, r16 2f0c8: 9f 71 andi r25, 0x1F ; 31 2f0ca: 89 2b or r24, r25 2f0cc: 29 f4 brne .+10 ; 0x2f0d8 manage_heater(); 2f0ce: 0f 94 43 37 call 0x26e86 ; 0x26e86 while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 2f0d2: 01 15 cp r16, r1 2f0d4: 11 05 cpc r17, r1 2f0d6: 19 f0 breq .+6 ; 0x2f0de 2f0d8: cc 15 cp r28, r12 2f0da: dd 05 cpc r29, r13 2f0dc: f9 f6 brne .-66 ; 0x2f09c // 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'); 2f0de: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 2f0e2: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 2f0e6: 8a e0 ldi r24, 0x0A ; 10 2f0e8: 90 e0 ldi r25, 0x00 ; 0 2f0ea: 0f 94 a6 a2 call 0x3454c ; 0x3454c 2f0ee: c0 cf rjmp .-128 ; 0x2f070 { 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; 2f0f0: ce 01 movw r24, r28 2f0f2: 0f 94 3e a4 call 0x3487c ; 0x3487c 2f0f6: f8 2e mov r15, r24 2f0f8: d5 cf rjmp .-86 ; 0x2f0a4 if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 2f0fa: df 91 pop r29 2f0fc: cf 91 pop r28 2f0fe: 1f 91 pop r17 2f100: 0f 91 pop r16 2f102: ff 90 pop r15 2f104: ef 90 pop r14 2f106: df 90 pop r13 2f108: cf 90 pop r12 2f10a: 08 95 ret 0002f10c : #include "planner.h" #include "temperature.h" #include "ultralcd.h" #ifdef FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { 2f10c: cf 93 push r28 2f10e: 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; 2f110: c1 ef ldi r28, 0xF1 ; 241 2f112: d6 e1 ldi r29, 0x16 ; 22 2f114: 1a 82 std Y+2, r1 ; 0x02 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2f116: 19 82 std Y+1, r1 ; 0x01 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 2f118: 1e 86 std Y+14, r1 ; 0x0e oldPos = pat9125_y; 2f11a: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 2f11e: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 2f122: 98 8b std Y+16, r25 ; 0x10 2f124: 8f 87 std Y+15, r24 ; 0x0f resetStepCount(); 2f126: 0f 94 d5 6c call 0x2d9aa ; 0x2d9aa jamErrCnt = 0; 2f12a: 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"); } 2f12c: df 91 pop r29 2f12e: cf 91 pop r28 2f130: 08 95 ret 0002f132 : //! //! @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) 2f132: cf 92 push r12 2f134: df 92 push r13 2f136: ef 92 push r14 2f138: ff 92 push r15 2f13a: 69 01 movw r12, r18 2f13c: 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); 2f13e: 2d ec ldi r18, 0xCD ; 205 2f140: 3c ec ldi r19, 0xCC ; 204 2f142: 4c e4 ldi r20, 0x4C ; 76 2f144: 5e e3 ldi r21, 0x3E ; 62 2f146: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2f14a: 2d ec ldi r18, 0xCD ; 205 2f14c: 3c ec ldi r19, 0xCC ; 204 2f14e: 4c e4 ldi r20, 0x4C ; 76 2f150: 5e e3 ldi r21, 0x3E ; 62 2f152: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f156: 2d ef ldi r18, 0xFD ; 253 2f158: 3d ea ldi r19, 0xAD ; 173 2f15a: 40 e0 ldi r20, 0x00 ; 0 2f15c: 5d e3 ldi r21, 0x3D ; 61 2f15e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2f162: a7 01 movw r20, r14 2f164: 96 01 movw r18, r12 2f166: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f16a: 24 e2 ldi r18, 0x24 ; 36 2f16c: 30 ef ldi r19, 0xF0 ; 240 2f16e: 49 e1 ldi r20, 0x19 ; 25 2f170: 50 e4 ldi r21, 0x40 ; 64 2f172: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> } 2f176: ff 90 pop r15 2f178: ef 90 pop r14 2f17a: df 90 pop r13 2f17c: cf 90 pop r12 2f17e: 08 95 ret 0002f180 : //! //! This function needs to be called 4 times with step of 0,4,8,12 //! //! @param cmd_buffer character buffer needed to format gcodes //! @param i iteration void lay1cal_square(uint8_t step, float layer_height, float extrusion_width) 2f180: 2f 92 push r2 2f182: 3f 92 push r3 2f184: 4f 92 push r4 2f186: 5f 92 push r5 2f188: 6f 92 push r6 2f18a: 7f 92 push r7 2f18c: 8f 92 push r8 2f18e: 9f 92 push r9 2f190: af 92 push r10 2f192: bf 92 push r11 2f194: cf 92 push r12 2f196: df 92 push r13 2f198: ef 92 push r14 2f19a: ff 92 push r15 2f19c: 0f 93 push r16 2f19e: 1f 93 push r17 2f1a0: cf 93 push r28 2f1a2: df 93 push r29 2f1a4: 00 d0 rcall .+0 ; 0x2f1a6 2f1a6: 1f 92 push r1 2f1a8: 1f 92 push r1 2f1aa: cd b7 in r28, 0x3d ; 61 2f1ac: de b7 in r29, 0x3e ; 62 2f1ae: 8c 83 std Y+4, r24 ; 0x04 2f1b0: 4a 01 movw r8, r20 2f1b2: 5b 01 movw r10, r22 //! @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); 2f1b4: 23 e4 ldi r18, 0x43 ; 67 2f1b6: 3d ec ldi r19, 0xCD ; 205 2f1b8: 4f e2 ldi r20, 0x2F ; 47 2f1ba: 5d e3 ldi r21, 0x3D ; 61 2f1bc: cb 01 movw r24, r22 2f1be: b4 01 movw r22, r8 2f1c0: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2f1c4: 6b 01 movw r12, r22 2f1c6: 7c 01 movw r14, r24 //! @param i iteration void lay1cal_square(uint8_t step, float layer_height, float extrusion_width) { const float long_length = 20; const float short_length = spacing(layer_height, extrusion_width); const float long_extrusion = count_e(layer_height, extrusion_width, long_length); 2f1c8: 20 e0 ldi r18, 0x00 ; 0 2f1ca: 30 e0 ldi r19, 0x00 ; 0 2f1cc: 40 ea ldi r20, 0xA0 ; 160 2f1ce: 51 e4 ldi r21, 0x41 ; 65 2f1d0: c5 01 movw r24, r10 2f1d2: b4 01 movw r22, r8 2f1d4: 0f 94 99 78 call 0x2f132 ; 0x2f132 2f1d8: 56 2e mov r5, r22 2f1da: 47 2e mov r4, r23 2f1dc: 38 2e mov r3, r24 2f1de: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 2f1e0: a7 01 movw r20, r14 2f1e2: 96 01 movw r18, r12 2f1e4: c5 01 movw r24, r10 2f1e6: b4 01 movw r22, r8 2f1e8: 0f 94 99 78 call 0x2f132 ; 0x2f132 2f1ec: 69 83 std Y+1, r22 ; 0x01 2f1ee: 7a 83 std Y+2, r23 ; 0x02 2f1f0: 8b 83 std Y+3, r24 ; 0x03 2f1f2: a9 2e mov r10, r25 static const char fmt1[] PROGMEM = "G1 X%d Y%-.2f E%-.3f"; for (uint8_t i = step; i < step+4; ++i) 2f1f4: bc 80 ldd r11, Y+4 ; 0x04 2f1f6: 8b 2d mov r24, r11 2f1f8: 90 e0 ldi r25, 0x00 ; 0 2f1fa: 9c 01 movw r18, r24 2f1fc: 2d 5f subi r18, 0xFD ; 253 2f1fe: 3f 4f sbci r19, 0xFF ; 255 2f200: 3d 83 std Y+5, r19 ; 0x05 2f202: 2c 83 std Y+4, r18 ; 0x04 2f204: 0b 2d mov r16, r11 2f206: 10 e0 ldi r17, 0x00 ; 0 2f208: 8c 81 ldd r24, Y+4 ; 0x04 2f20a: 9d 81 ldd r25, Y+5 ; 0x05 2f20c: 80 17 cp r24, r16 2f20e: 91 07 cpc r25, r17 2f210: 0c f4 brge .+2 ; 0x2f214 2f212: a1 c0 rjmp .+322 ; 0x2f356 { enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion); 2f214: 2f 92 push r2 2f216: 3f 92 push r3 2f218: 4f 92 push r4 2f21a: 5f 92 push r5 2f21c: b8 01 movw r22, r16 2f21e: 01 2e mov r0, r17 2f220: 00 0c add r0, r0 2f222: 88 0b sbc r24, r24 2f224: 99 0b sbc r25, r25 2f226: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2f22a: a7 01 movw r20, r14 2f22c: 96 01 movw r18, r12 2f22e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f232: 9b 01 movw r18, r22 2f234: ac 01 movw r20, r24 2f236: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2f23a: 9b 01 movw r18, r22 2f23c: ac 01 movw r20, r24 2f23e: 60 e0 ldi r22, 0x00 ; 0 2f240: 70 e0 ldi r23, 0x00 ; 0 2f242: 8c e0 ldi r24, 0x0C ; 12 2f244: 92 e4 ldi r25, 0x42 ; 66 2f246: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2f24a: 9f 93 push r25 2f24c: 8f 93 push r24 2f24e: 7f 93 push r23 2f250: 6f 93 push r22 2f252: 1f 92 push r1 2f254: 96 e4 ldi r25, 0x46 ; 70 2f256: 9f 93 push r25 2f258: 23 e2 ldi r18, 0x23 ; 35 2f25a: 3f e9 ldi r19, 0x9F ; 159 2f25c: 3f 93 push r19 2f25e: 2f 93 push r18 2f260: 0e 94 2b 8e call 0x11c56 ; 0x11c56 enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion); 2f264: b8 01 movw r22, r16 2f266: 66 0f add r22, r22 2f268: 77 1f adc r23, r23 2f26a: 6f 5f subi r22, 0xFF ; 255 2f26c: 7f 4f sbci r23, 0xFF ; 255 2f26e: 07 2e mov r0, r23 2f270: 00 0c add r0, r0 2f272: 88 0b sbc r24, r24 2f274: 99 0b sbc r25, r25 2f276: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2f27a: a7 01 movw r20, r14 2f27c: 96 01 movw r18, r12 2f27e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f282: 9b 01 movw r18, r22 2f284: ac 01 movw r20, r24 2f286: 60 e0 ldi r22, 0x00 ; 0 2f288: 70 e0 ldi r23, 0x00 ; 0 2f28a: 8c e0 ldi r24, 0x0C ; 12 2f28c: 92 e4 ldi r25, 0x42 ; 66 2f28e: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2f292: 96 2e mov r9, r22 2f294: 87 2e mov r8, r23 2f296: 78 2e mov r7, r24 2f298: 69 2e mov r6, r25 2f29a: af 92 push r10 2f29c: 9b 81 ldd r25, Y+3 ; 0x03 2f29e: 9f 93 push r25 2f2a0: 2a 81 ldd r18, Y+2 ; 0x02 2f2a2: 2f 93 push r18 2f2a4: 39 81 ldd r19, Y+1 ; 0x01 2f2a6: 3f 93 push r19 2f2a8: 6f 92 push r6 2f2aa: 7f 92 push r7 2f2ac: 8f 92 push r8 2f2ae: 9f 92 push r9 2f2b0: 1f 92 push r1 2f2b2: 86 e4 ldi r24, 0x46 ; 70 2f2b4: 8f 93 push r24 2f2b6: 23 e2 ldi r18, 0x23 ; 35 2f2b8: 3f e9 ldi r19, 0x9F ; 159 2f2ba: 3f 93 push r19 2f2bc: 2f 93 push r18 2f2be: 0e 94 2b 8e call 0x11c56 ; 0x11c56 enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion); 2f2c2: 2f 92 push r2 2f2c4: 3f 92 push r3 2f2c6: 4f 92 push r4 2f2c8: 5f 92 push r5 2f2ca: 6f 92 push r6 2f2cc: 7f 92 push r7 2f2ce: 8f 92 push r8 2f2d0: 9f 92 push r9 2f2d2: 1f 92 push r1 2f2d4: 92 e3 ldi r25, 0x32 ; 50 2f2d6: 9f 93 push r25 2f2d8: 23 e2 ldi r18, 0x23 ; 35 2f2da: 3f e9 ldi r19, 0x9F ; 159 2f2dc: 3f 93 push r19 2f2de: 2f 93 push r18 2f2e0: 0e 94 2b 8e call 0x11c56 ; 0x11c56 enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion); 2f2e4: 0f b6 in r0, 0x3f ; 63 2f2e6: f8 94 cli 2f2e8: de bf out 0x3e, r29 ; 62 2f2ea: 0f be out 0x3f, r0 ; 63 2f2ec: cd bf out 0x3d, r28 ; 61 2f2ee: af 92 push r10 2f2f0: 3b 81 ldd r19, Y+3 ; 0x03 2f2f2: 3f 93 push r19 2f2f4: 8a 81 ldd r24, Y+2 ; 0x02 2f2f6: 8f 93 push r24 2f2f8: 99 81 ldd r25, Y+1 ; 0x01 2f2fa: 9f 93 push r25 2f2fc: b8 01 movw r22, r16 2f2fe: 6f 5f subi r22, 0xFF ; 255 2f300: 7f 4f sbci r23, 0xFF ; 255 2f302: 07 2e mov r0, r23 2f304: 00 0c add r0, r0 2f306: 88 0b sbc r24, r24 2f308: 99 0b sbc r25, r25 2f30a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2f30e: a7 01 movw r20, r14 2f310: 96 01 movw r18, r12 2f312: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f316: 9b 01 movw r18, r22 2f318: ac 01 movw r20, r24 2f31a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2f31e: 9b 01 movw r18, r22 2f320: ac 01 movw r20, r24 2f322: 60 e0 ldi r22, 0x00 ; 0 2f324: 70 e0 ldi r23, 0x00 ; 0 2f326: 8c e0 ldi r24, 0x0C ; 12 2f328: 92 e4 ldi r25, 0x42 ; 66 2f32a: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2f32e: 9f 93 push r25 2f330: 8f 93 push r24 2f332: 7f 93 push r23 2f334: 6f 93 push r22 2f336: 1f 92 push r1 2f338: 22 e3 ldi r18, 0x32 ; 50 2f33a: 2f 93 push r18 2f33c: 83 e2 ldi r24, 0x23 ; 35 2f33e: 9f e9 ldi r25, 0x9F ; 159 2f340: 9f 93 push r25 2f342: 8f 93 push r24 2f344: 0e 94 2b 8e call 0x11c56 ; 0x11c56 const float short_length = spacing(layer_height, 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); static const char fmt1[] PROGMEM = "G1 X%d Y%-.2f E%-.3f"; for (uint8_t i = step; i < step+4; ++i) 2f348: b3 94 inc r11 2f34a: 0f b6 in r0, 0x3f ; 63 2f34c: f8 94 cli 2f34e: de bf out 0x3e, r29 ; 62 2f350: 0f be out 0x3f, r0 ; 63 2f352: cd bf out 0x3d, r28 ; 61 2f354: 57 cf rjmp .-338 ; 0x2f204 enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion); enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion); enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion); enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion); } } 2f356: 0f 90 pop r0 2f358: 0f 90 pop r0 2f35a: 0f 90 pop r0 2f35c: 0f 90 pop r0 2f35e: 0f 90 pop r0 2f360: df 91 pop r29 2f362: cf 91 pop r28 2f364: 1f 91 pop r17 2f366: 0f 91 pop r16 2f368: ff 90 pop r15 2f36a: ef 90 pop r14 2f36c: df 90 pop r13 2f36e: cf 90 pop r12 2f370: bf 90 pop r11 2f372: af 90 pop r10 2f374: 9f 90 pop r9 2f376: 8f 90 pop r8 2f378: 7f 90 pop r7 2f37a: 6f 90 pop r6 2f37c: 5f 90 pop r5 2f37e: 4f 90 pop r4 2f380: 3f 90 pop r3 2f382: 2f 90 pop r2 2f384: 08 95 ret 0002f386 : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 2f386: 9f b7 in r25, 0x3f ; 63 2f388: 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)); 2f38a: 80 e1 ldi r24, 0x10 ; 16 2f38c: ec e3 ldi r30, 0x3C ; 60 2f38e: f6 e0 ldi r31, 0x06 ; 6 2f390: ac e4 ldi r26, 0x4C ; 76 2f392: b6 e0 ldi r27, 0x06 ; 6 2f394: 01 90 ld r0, Z+ 2f396: 0d 92 st X+, r0 2f398: 8a 95 dec r24 2f39a: e1 f7 brne .-8 ; 0x2f394 CRITICAL_SECTION_END; 2f39c: 9f bf out 0x3f, r25 ; 63 } 2f39e: 08 95 ret 0002f3a0 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 2f3a0: 89 e0 ldi r24, 0x09 ; 9 2f3a2: 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])) 2f3a6: e0 e6 ldi r30, 0x60 ; 96 2f3a8: ff e9 ldi r31, 0x9F ; 159 2f3aa: 85 91 lpm r24, Z+ 2f3ac: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 2f3ae: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2f3b2: 0c 94 7f dc jmp 0x1b8fe ; 0x1b8fe 0002f3b6 : 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) { 2f3b6: 1f 93 push r17 2f3b8: cf 93 push r28 2f3ba: df 93 push r29 2f3bc: ec 01 movw r28, r24 2f3be: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2f3c0: 0f 94 5b 18 call 0x230b6 ; 0x230b6 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))); 2f3c4: fe 01 movw r30, r28 2f3c6: 34 96 adiw r30, 0x04 ; 4 2f3c8: 25 91 lpm r18, Z+ 2f3ca: 35 91 lpm r19, Z+ 2f3cc: 45 91 lpm r20, Z+ 2f3ce: 54 91 lpm r21, Z 2f3d0: fe 01 movw r30, r28 2f3d2: 65 91 lpm r22, Z+ 2f3d4: 75 91 lpm r23, Z+ 2f3d6: 85 91 lpm r24, Z+ 2f3d8: 94 91 lpm r25, Z 2f3da: 0f 94 3a 4e call 0x29c74 ; 0x29c74 step++; 2f3de: 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) { 2f3e0: 11 50 subi r17, 0x01 ; 1 2f3e2: 81 f7 brne .-32 ; 0x2f3c4 2f3e4: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // 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(); } 2f3e8: df 91 pop r29 2f3ea: cf 91 pop r28 2f3ec: 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(); 2f3ee: 0d 94 38 4e jmp 0x29c70 ; 0x29c70 0002f3f2 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 2f3f2: 0e 94 9b 66 call 0xcd36 ; 0xcd36 2f3f6: 81 11 cpse r24, r1 2f3f8: 04 c0 rjmp .+8 ; 0x2f402 lcd_setstatuspgm(MSG_WELCOME); 2f3fa: 8a e8 ldi r24, 0x8A ; 138 2f3fc: 9c e6 ldi r25, 0x6C ; 108 2f3fe: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe } custom_message_type = CustomMsg::Status; 2f402: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d } 2f406: 08 95 ret 0002f408 : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 2f408: 80 91 01 13 lds r24, 0x1301 ; 0x801301 2f40c: 88 23 and r24, r24 2f40e: 11 f0 breq .+4 ; 0x2f414 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; 2f410: 81 e0 ldi r24, 0x01 ; 1 2f412: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 2f414: 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; } } 2f416: 08 95 ret 0002f418 : } #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) 2f418: 2f 92 push r2 2f41a: 3f 92 push r3 2f41c: 4f 92 push r4 2f41e: 5f 92 push r5 2f420: 6f 92 push r6 2f422: 7f 92 push r7 2f424: 8f 92 push r8 2f426: 9f 92 push r9 2f428: af 92 push r10 2f42a: bf 92 push r11 2f42c: cf 92 push r12 2f42e: df 92 push r13 2f430: ef 92 push r14 2f432: ff 92 push r15 2f434: 0f 93 push r16 2f436: 1f 93 push r17 2f438: cf 93 push r28 2f43a: df 93 push r29 2f43c: 00 d0 rcall .+0 ; 0x2f43e 2f43e: 00 d0 rcall .+0 ; 0x2f440 2f440: 00 d0 rcall .+0 ; 0x2f442 2f442: 1f 92 push r1 2f444: 1f 92 push r1 2f446: cd b7 in r28, 0x3d ; 61 2f448: de b7 in r29, 0x3e ; 62 2f44a: 8b 83 std Y+3, r24 ; 0x03 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2f44c: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.386> 2f450: 2d 83 std Y+5, r18 ; 0x05 check_endstops = check; 2f452: 81 e0 ldi r24, 0x01 ; 1 2f454: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.386> #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) 2f458: 9b 81 ldd r25, Y+3 ; 0x03 2f45a: 92 30 cpi r25, 0x02 ; 2 2f45c: 09 f4 brne .+2 ; 0x2f460 2f45e: 5b c1 rjmp .+694 ; 0x2f716 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); 2f460: a9 2f mov r26, r25 2f462: b0 e0 ldi r27, 0x00 ; 0 2f464: ba 83 std Y+2, r27 ; 0x02 2f466: a9 83 std Y+1, r26 ; 0x01 2f468: fd 01 movw r30, r26 2f46a: e6 5e subi r30, 0xE6 ; 230 2f46c: f1 46 sbci r31, 0x61 ; 97 #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); 2f46e: 24 91 lpm r18, Z 2f470: 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]; 2f472: 8d 01 movw r16, r26 2f474: 00 0f add r16, r16 2f476: 11 1f adc r17, r17 2f478: 00 0f add r16, r16 2f47a: 11 1f adc r17, r17 2f47c: f8 01 movw r30, r16 2f47e: ee 50 subi r30, 0x0E ; 14 2f480: fd 4f sbci r31, 0xFD ; 253 2f482: 40 80 ld r4, Z 2f484: 51 80 ldd r5, Z+1 ; 0x01 2f486: 62 80 ldd r6, Z+2 ; 0x02 2f488: 73 80 ldd r7, Z+3 ; 0x03 2f48a: 40 92 7a 02 sts 0x027A, r4 ; 0x80027a 2f48e: 50 92 7b 02 sts 0x027B, r5 ; 0x80027b 2f492: 60 92 7c 02 sts 0x027C, r6 ; 0x80027c 2f496: 70 92 7d 02 sts 0x027D, r7 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f49a: c3 01 movw r24, r6 2f49c: b2 01 movw r22, r4 2f49e: 0e 94 a0 65 call 0xcb40 ; 0xcb40 2f4a2: 4b 01 movw r8, r22 2f4a4: 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; 2f4a6: c8 01 movw r24, r16 2f4a8: 8f 59 subi r24, 0x9F ; 159 2f4aa: 9d 4e sbci r25, 0xED ; 237 2f4ac: 1c 01 movw r2, r24 2f4ae: dc 01 movw r26, r24 2f4b0: 1d 92 st X+, r1 2f4b2: 1d 92 st X+, r1 2f4b4: 1d 92 st X+, r1 2f4b6: 1c 92 st X, r1 2f4b8: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); 2f4ba: 0f 94 68 48 call 0x290d0 ; 0x290d0 set_destination_to_current(); 2f4be: 0e 94 09 67 call 0xce12 ; 0xce12 // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; 2f4c2: bc 81 ldd r27, Y+4 ; 0x04 2f4c4: 6b 2f mov r22, r27 2f4c6: bb 0f add r27, r27 2f4c8: 77 0b sbc r23, r23 2f4ca: 88 0b sbc r24, r24 2f4cc: 99 0b sbc r25, r25 2f4ce: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2f4d2: 6b 01 movw r12, r22 2f4d4: 7c 01 movw r14, r24 2f4d6: f8 01 movw r30, r16 2f4d8: e7 5d subi r30, 0xD7 ; 215 2f4da: f9 4f sbci r31, 0xF9 ; 249 2f4dc: fb 87 std Y+11, r31 ; 0x0b 2f4de: ea 87 std Y+10, r30 ; 0x0a 2f4e0: 20 e0 ldi r18, 0x00 ; 0 2f4e2: 30 e0 ldi r19, 0x00 ; 0 2f4e4: 40 e4 ldi r20, 0x40 ; 64 2f4e6: 50 ec ldi r21, 0xC0 ; 192 2f4e8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f4ec: aa 85 ldd r26, Y+10 ; 0x0a 2f4ee: bb 85 ldd r27, Y+11 ; 0x0b 2f4f0: 6d 93 st X+, r22 2f4f2: 7d 93 st X+, r23 2f4f4: 8d 93 st X+, r24 2f4f6: 9c 93 st X, r25 2f4f8: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f4fa: c5 01 movw r24, r10 2f4fc: b4 01 movw r22, r8 2f4fe: 0f 94 75 49 call 0x292ea ; 0x292ea st_synchronize(); 2f502: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); 2f506: 0f 94 fd 22 call 0x245fa ; 0x245fa 2f50a: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.386> enable_endstops(false); current_position[axis] = 0; 2f50e: f1 01 movw r30, r2 2f510: 10 82 st Z, r1 2f512: 11 82 std Z+1, r1 ; 0x01 2f514: 12 82 std Z+2, r1 ; 0x02 2f516: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2f518: 0f 94 68 48 call 0x290d0 ; 0x290d0 destination[axis] = 1. * axis_home_dir; 2f51c: aa 85 ldd r26, Y+10 ; 0x0a 2f51e: bb 85 ldd r27, Y+11 ; 0x0b 2f520: cd 92 st X+, r12 2f522: dd 92 st X+, r13 2f524: ed 92 st X+, r14 2f526: fc 92 st X, r15 2f528: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f52a: c5 01 movw r24, r10 2f52c: b4 01 movw r22, r8 2f52e: 0f 94 75 49 call 0x292ea ; 0x292ea st_synchronize(); 2f532: 0f 94 5b 18 call 0x230b6 ; 0x230b6 2f536: b1 e0 ldi r27, 0x01 ; 1 2f538: b0 93 77 02 sts 0x0277, r27 ; 0x800277 <_ZL14check_endstops.lto_priv.386> { 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); 2f53c: f8 01 movw r30, r16 2f53e: e2 5f subi r30, 0xF2 ; 242 2f540: f1 46 sbci r31, 0x61 ; 97 #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); 2f542: 85 91 lpm r24, Z+ 2f544: 95 91 lpm r25, Z+ 2f546: a5 91 lpm r26, Z+ 2f548: b4 91 lpm r27, Z 2f54a: 8e 83 std Y+6, r24 ; 0x06 2f54c: 9f 83 std Y+7, r25 ; 0x07 2f54e: a8 87 std Y+8, r26 ; 0x08 2f550: 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); 2f552: 2d ec ldi r18, 0xCD ; 205 2f554: 3c ec ldi r19, 0xCC ; 204 2f556: 4c e8 ldi r20, 0x8C ; 140 2f558: 5f e3 ldi r21, 0x3F ; 63 2f55a: c7 01 movw r24, r14 2f55c: b6 01 movw r22, r12 2f55e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f562: 2e 81 ldd r18, Y+6 ; 0x06 2f564: 3f 81 ldd r19, Y+7 ; 0x07 2f566: 48 85 ldd r20, Y+8 ; 0x08 2f568: 59 85 ldd r21, Y+9 ; 0x09 2f56a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f56e: aa 85 ldd r26, Y+10 ; 0x0a 2f570: bb 85 ldd r27, Y+11 ; 0x0b 2f572: 6d 93 st X+, r22 2f574: 7d 93 st X+, r23 2f576: 8d 93 st X+, r24 2f578: 9c 93 st X, r25 2f57a: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f57c: c5 01 movw r24, r10 2f57e: b4 01 movw r22, r8 2f580: 0f 94 75 49 call 0x292ea ; 0x292ea st_synchronize(); 2f584: 0f 94 5b 18 call 0x230b6 ; 0x230b6 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(); 2f588: 0f 94 fd 22 call 0x245fa ; 0x245fa 2f58c: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.386> enable_endstops(false); current_position[axis] = 0; 2f590: f1 01 movw r30, r2 2f592: 10 82 st Z, r1 2f594: 11 82 std Z+1, r1 ; 0x01 2f596: 12 82 std Z+2, r1 ; 0x02 2f598: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2f59a: 0f 94 68 48 call 0x290d0 ; 0x290d0 destination[axis] = -10.f * axis_home_dir; 2f59e: 20 e0 ldi r18, 0x00 ; 0 2f5a0: 30 e0 ldi r19, 0x00 ; 0 2f5a2: 40 e2 ldi r20, 0x20 ; 32 2f5a4: 51 ec ldi r21, 0xC1 ; 193 2f5a6: c7 01 movw r24, r14 2f5a8: b6 01 movw r22, r12 2f5aa: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f5ae: aa 85 ldd r26, Y+10 ; 0x0a 2f5b0: bb 85 ldd r27, Y+11 ; 0x0b 2f5b2: 6d 93 st X+, r22 2f5b4: 7d 93 st X+, r23 2f5b6: 8d 93 st X+, r24 2f5b8: 9c 93 st X, r25 2f5ba: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f5bc: c5 01 movw r24, r10 2f5be: b4 01 movw r22, r8 2f5c0: 0f 94 75 49 call 0x292ea ; 0x292ea st_synchronize(); 2f5c4: 0f 94 5b 18 call 0x230b6 ; 0x230b6 endstops_hit_on_purpose(); 2f5c8: 0f 94 fd 22 call 0x245fa ; 0x245fa 2f5cc: b1 e0 ldi r27, 0x01 ; 1 2f5ce: b0 93 77 02 sts 0x0277, r27 ; 0x800277 <_ZL14check_endstops.lto_priv.386> // Now move left up to the collision, this time with a repeatable velocity. enable_endstops(true); destination[axis] = 11.f * axis_home_dir; 2f5d2: 20 e0 ldi r18, 0x00 ; 0 2f5d4: 30 e0 ldi r19, 0x00 ; 0 2f5d6: 40 e3 ldi r20, 0x30 ; 48 2f5d8: 51 e4 ldi r21, 0x41 ; 65 2f5da: c7 01 movw r24, r14 2f5dc: b6 01 movw r22, r12 2f5de: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f5e2: ea 85 ldd r30, Y+10 ; 0x0a 2f5e4: fb 85 ldd r31, Y+11 ; 0x0b 2f5e6: 60 83 st Z, r22 2f5e8: 71 83 std Z+1, r23 ; 0x01 2f5ea: 82 83 std Z+2, r24 ; 0x02 2f5ec: 93 83 std Z+3, r25 ; 0x03 #ifdef TMC2130 feedrate = homing_feedrate[axis]; #else //TMC2130 feedrate = homing_feedrate[axis] / 2; 2f5ee: 20 e0 ldi r18, 0x00 ; 0 2f5f0: 30 e0 ldi r19, 0x00 ; 0 2f5f2: 40 e0 ldi r20, 0x00 ; 0 2f5f4: 5f e3 ldi r21, 0x3F ; 63 2f5f6: c3 01 movw r24, r6 2f5f8: b2 01 movw r22, r4 2f5fa: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f5fe: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 2f602: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 2f606: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 2f60a: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f60e: 0e 94 a0 65 call 0xcb40 ; 0xcb40 2f612: 6b 01 movw r12, r22 2f614: 7c 01 movw r14, r24 #endif //TMC2130 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f616: 0f 94 75 49 call 0x292ea ; 0x292ea st_synchronize(); 2f61a: 0f 94 5b 18 call 0x230b6 ; 0x230b6 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(); 2f61e: 0f 94 fd 22 call 0x245fa ; 0x245fa 2f622: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.386> else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); tmc2130_home_exit(); #endif //TMC2130 axis_is_at_home(axis); 2f626: 8b 81 ldd r24, Y+3 ; 0x03 2f628: 0e 94 ea 65 call 0xcbd4 ; 0xcbd4 axis_known_position[axis] = true; 2f62c: e9 81 ldd r30, Y+1 ; 0x01 2f62e: fa 81 ldd r31, Y+2 ; 0x02 2f630: e7 5c subi r30, 0xC7 ; 199 2f632: f9 4f sbci r31, 0xF9 ; 249 2f634: 21 e0 ldi r18, 0x01 ; 1 2f636: 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; 2f638: 8c 81 ldd r24, Y+4 ; 0x04 2f63a: 99 27 eor r25, r25 2f63c: 81 95 neg r24 2f63e: 0c f4 brge .+2 ; 0x2f642 2f640: 90 95 com r25 2f642: bc 01 movw r22, r24 2f644: 07 2e mov r0, r23 2f646: 00 0c add r0, r0 2f648: 88 0b sbc r24, r24 2f64a: 99 0b sbc r25, r25 2f64c: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2f650: 2a e0 ldi r18, 0x0A ; 10 2f652: 37 ed ldi r19, 0xD7 ; 215 2f654: 43 e2 ldi r20, 0x23 ; 35 2f656: 5c e3 ldi r21, 0x3C ; 60 2f658: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f65c: 20 e0 ldi r18, 0x00 ; 0 2f65e: 30 e0 ldi r19, 0x00 ; 0 2f660: 40 e8 ldi r20, 0x80 ; 128 2f662: 52 e4 ldi r21, 0x42 ; 66 2f664: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f668: 4b 01 movw r8, r22 2f66a: 5c 01 movw r10, r24 #endif //TMC2130 current_position[axis] -= dist; 2f66c: ac 01 movw r20, r24 2f66e: 9b 01 movw r18, r22 2f670: d1 01 movw r26, r2 2f672: 6d 91 ld r22, X+ 2f674: 7d 91 ld r23, X+ 2f676: 8d 91 ld r24, X+ 2f678: 9c 91 ld r25, X 2f67a: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2f67e: f1 01 movw r30, r2 2f680: 60 83 st Z, r22 2f682: 71 83 std Z+1, r23 ; 0x01 2f684: 82 83 std Z+2, r24 ; 0x02 2f686: 93 83 std Z+3, r25 ; 0x03 plan_set_position_curposXYZE(); 2f688: 0f 94 68 48 call 0x290d0 ; 0x290d0 current_position[axis] += dist; 2f68c: d1 01 movw r26, r2 2f68e: 2d 91 ld r18, X+ 2f690: 3d 91 ld r19, X+ 2f692: 4d 91 ld r20, X+ 2f694: 5c 91 ld r21, X 2f696: c5 01 movw r24, r10 2f698: b4 01 movw r22, r8 2f69a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2f69e: f1 01 movw r30, r2 2f6a0: 60 83 st Z, r22 2f6a2: 71 83 std Z+1, r23 ; 0x01 2f6a4: 82 83 std Z+2, r24 ; 0x02 2f6a6: 93 83 std Z+3, r25 ; 0x03 destination[axis] = current_position[axis]; 2f6a8: aa 85 ldd r26, Y+10 ; 0x0a 2f6aa: bb 85 ldd r27, Y+11 ; 0x0b 2f6ac: 6d 93 st X+, r22 2f6ae: 7d 93 st X+, r23 2f6b0: 8d 93 st X+, r24 2f6b2: 9c 93 st X, r25 2f6b4: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); 2f6b6: 20 e0 ldi r18, 0x00 ; 0 2f6b8: 30 e0 ldi r19, 0x00 ; 0 2f6ba: 40 e0 ldi r20, 0x00 ; 0 2f6bc: 5f e3 ldi r21, 0x3F ; 63 2f6be: c7 01 movw r24, r14 2f6c0: b6 01 movw r22, r12 2f6c2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f6c6: 0f 94 75 49 call 0x292ea ; 0x292ea st_synchronize(); 2f6ca: 0f 94 5b 18 call 0x230b6 ; 0x230b6 feedrate = 0.0; 2f6ce: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2f6d2: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2f6d6: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2f6da: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d 2f6de: 2d 81 ldd r18, Y+5 ; 0x05 2f6e0: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.386> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } 2f6e4: 2b 96 adiw r28, 0x0b ; 11 2f6e6: 0f b6 in r0, 0x3f ; 63 2f6e8: f8 94 cli 2f6ea: de bf out 0x3e, r29 ; 62 2f6ec: 0f be out 0x3f, r0 ; 63 2f6ee: cd bf out 0x3d, r28 ; 61 2f6f0: df 91 pop r29 2f6f2: cf 91 pop r28 2f6f4: 1f 91 pop r17 2f6f6: 0f 91 pop r16 2f6f8: ff 90 pop r15 2f6fa: ef 90 pop r14 2f6fc: df 90 pop r13 2f6fe: cf 90 pop r12 2f700: bf 90 pop r11 2f702: af 90 pop r10 2f704: 9f 90 pop r9 2f706: 8f 90 pop r8 2f708: 7f 90 pop r7 2f70a: 6f 90 pop r6 2f70c: 5f 90 pop r5 2f70e: 4f 90 pop r4 2f710: 3f 90 pop r3 2f712: 2f 90 pop r2 2f714: 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); 2f716: ec e1 ldi r30, 0x1C ; 28 2f718: fe e9 ldi r31, 0x9E ; 158 2f71a: b4 91 lpm r27, Z 2f71c: 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; 2f71e: 10 92 69 12 sts 0x1269, r1 ; 0x801269 2f722: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 2f726: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 2f72a: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c plan_set_position_curposXYZE(); 2f72e: 0f 94 68 48 call 0x290d0 ; 0x290d0 #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); 2f732: e6 e1 ldi r30, 0x16 ; 22 2f734: fe e9 ldi r31, 0x9E ; 158 2f736: 85 90 lpm r8, Z+ 2f738: 95 90 lpm r9, Z+ 2f73a: a5 90 lpm r10, Z+ 2f73c: 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; 2f73e: e9 81 ldd r30, Y+1 ; 0x01 2f740: 6e 2f mov r22, r30 2f742: ee 0f add r30, r30 2f744: 77 0b sbc r23, r23 2f746: 88 0b sbc r24, r24 2f748: 99 0b sbc r25, r25 2f74a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2f74e: 6b 01 movw r12, r22 2f750: 7c 01 movw r14, r24 2f752: 20 e0 ldi r18, 0x00 ; 0 2f754: 30 e0 ldi r19, 0x00 ; 0 2f756: 40 ec ldi r20, 0xC0 ; 192 2f758: 5f e3 ldi r21, 0x3F ; 63 2f75a: c5 01 movw r24, r10 2f75c: b4 01 movw r22, r8 2f75e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f762: a7 01 movw r20, r14 2f764: 96 01 movw r18, r12 2f766: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f76a: 60 93 31 06 sts 0x0631, r22 ; 0x800631 2f76e: 70 93 32 06 sts 0x0632, r23 ; 0x800632 2f772: 80 93 33 06 sts 0x0633, r24 ; 0x800633 2f776: 90 93 34 06 sts 0x0634, r25 ; 0x800634 feedrate = homing_feedrate[axis]; 2f77a: 80 e0 ldi r24, 0x00 ; 0 2f77c: 90 e0 ldi r25, 0x00 ; 0 2f77e: a8 e4 ldi r26, 0x48 ; 72 2f780: b4 e4 ldi r27, 0x44 ; 68 2f782: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2f786: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2f78a: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2f78e: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f792: bc 01 movw r22, r24 2f794: cd 01 movw r24, r26 2f796: 0e 94 a0 65 call 0xcb40 ; 0xcb40 2f79a: 4b 01 movw r8, r22 2f79c: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f79e: 0f 94 75 49 call 0x292ea ; 0x292ea st_synchronize(); 2f7a2: 0f 94 5b 18 call 0x230b6 ; 0x230b6 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 current_position[axis] = 0; 2f7a6: 10 92 69 12 sts 0x1269, r1 ; 0x801269 2f7aa: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 2f7ae: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 2f7b2: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c plan_set_position_curposXYZE(); 2f7b6: 0f 94 68 48 call 0x290d0 ; 0x290d0 #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); 2f7ba: 0a e0 ldi r16, 0x0A ; 10 2f7bc: 1e e9 ldi r17, 0x9E ; 158 2f7be: f8 01 movw r30, r16 2f7c0: 65 91 lpm r22, Z+ 2f7c2: 75 91 lpm r23, Z+ 2f7c4: 85 91 lpm r24, Z+ 2f7c6: 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; 2f7c8: 90 58 subi r25, 0x80 ; 128 2f7ca: a7 01 movw r20, r14 2f7cc: 96 01 movw r18, r12 2f7ce: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f7d2: 60 93 31 06 sts 0x0631, r22 ; 0x800631 2f7d6: 70 93 32 06 sts 0x0632, r23 ; 0x800632 2f7da: 80 93 33 06 sts 0x0633, r24 ; 0x800633 2f7de: 90 93 34 06 sts 0x0634, r25 ; 0x800634 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f7e2: c5 01 movw r24, r10 2f7e4: b4 01 movw r22, r8 2f7e6: 0f 94 75 49 call 0x292ea ; 0x292ea st_synchronize(); 2f7ea: 0f 94 5b 18 call 0x230b6 ; 0x230b6 #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); 2f7ee: f8 01 movw r30, r16 2f7f0: 65 91 lpm r22, Z+ 2f7f2: 75 91 lpm r23, Z+ 2f7f4: 85 91 lpm r24, Z+ 2f7f6: 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; 2f7f8: 9b 01 movw r18, r22 2f7fa: ac 01 movw r20, r24 2f7fc: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2f800: a7 01 movw r20, r14 2f802: 96 01 movw r18, r12 2f804: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 2f808: 60 93 31 06 sts 0x0631, r22 ; 0x800631 2f80c: 70 93 32 06 sts 0x0632, r23 ; 0x800632 2f810: 80 93 33 06 sts 0x0633, r24 ; 0x800633 2f814: 90 93 34 06 sts 0x0634, r25 ; 0x800634 feedrate = homing_feedrate[axis] / 2; 2f818: 80 e0 ldi r24, 0x00 ; 0 2f81a: 90 e0 ldi r25, 0x00 ; 0 2f81c: a8 ec ldi r26, 0xC8 ; 200 2f81e: b3 e4 ldi r27, 0x43 ; 67 2f820: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2f824: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2f828: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2f82c: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f830: bc 01 movw r22, r24 2f832: cd 01 movw r24, r26 2f834: 0e 94 a0 65 call 0xcb40 ; 0xcb40 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f838: 0f 94 75 49 call 0x292ea ; 0x292ea st_synchronize(); 2f83c: 0f 94 5b 18 call 0x230b6 ; 0x230b6 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 axis_is_at_home(axis); 2f840: 82 e0 ldi r24, 0x02 ; 2 2f842: 0e 94 ea 65 call 0xcbd4 ; 0xcbd4 destination[axis] = current_position[axis]; 2f846: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2f84a: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2f84e: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2f852: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2f856: 80 93 31 06 sts 0x0631, r24 ; 0x800631 2f85a: 90 93 32 06 sts 0x0632, r25 ; 0x800632 2f85e: a0 93 33 06 sts 0x0633, r26 ; 0x800633 2f862: b0 93 34 06 sts 0x0634, r27 ; 0x800634 feedrate = 0.0; 2f866: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2f86a: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2f86e: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2f872: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d endstops_hit_on_purpose(); 2f876: 0f 94 fd 22 call 0x245fa ; 0x245fa axis_known_position[axis] = true; 2f87a: f1 e0 ldi r31, 0x01 ; 1 2f87c: f0 93 3b 06 sts 0x063B, r31 ; 0x80063b 2f880: 2e cf rjmp .-420 ; 0x2f6de 0002f882 : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 2f882: 10 92 09 13 sts 0x1309, r1 ; 0x801309 memset(z_values, 0, sizeof(z_values)); 2f886: ea e0 ldi r30, 0x0A ; 10 2f888: f3 e1 ldi r31, 0x13 ; 19 2f88a: 84 ec ldi r24, 0xC4 ; 196 2f88c: df 01 movw r26, r30 2f88e: 1d 92 st X+, r1 2f890: 8a 95 dec r24 2f892: e9 f7 brne .-6 ; 0x2f88e } 2f894: 08 95 ret 0002f896 : 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 2f896: 2f 92 push r2 2f898: 3f 92 push r3 2f89a: 4f 92 push r4 2f89c: 5f 92 push r5 2f89e: 6f 92 push r6 2f8a0: 7f 92 push r7 2f8a2: 8f 92 push r8 2f8a4: 9f 92 push r9 2f8a6: af 92 push r10 2f8a8: bf 92 push r11 2f8aa: cf 92 push r12 2f8ac: df 92 push r13 2f8ae: ef 92 push r14 2f8b0: ff 92 push r15 2f8b2: 0f 93 push r16 2f8b4: 1f 93 push r17 2f8b6: cf 93 push r28 2f8b8: df 93 push r29 2f8ba: 00 d0 rcall .+0 ; 0x2f8bc 2f8bc: cd b7 in r28, 0x3d ; 61 2f8be: de b7 in r29, 0x3e ; 62 2f8c0: 4b 01 movw r8, r22 2f8c2: 5c 01 movw r10, r24 2f8c4: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 2f8c6: 81 e0 ldi r24, 0x01 ; 1 2f8c8: 80 93 28 06 sts 0x0628, r24 ; 0x800628 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2f8cc: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.386> 2f8d0: 29 83 std Y+1, r18 ; 0x01 check_endstops = check; 2f8d2: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.386> //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); 2f8d6: 80 e0 ldi r24, 0x00 ; 0 2f8d8: 0f 94 e1 22 call 0x245c2 ; 0x245c2 2f8dc: 18 2f mov r17, r24 float z = 0.f; endstop_z_hit_on_purpose(); 2f8de: 0f 94 ef 22 call 0x245de ; 0x245de // move down until you find the bed current_position[Z_AXIS] = minimum_z; 2f8e2: 80 92 69 12 sts 0x1269, r8 ; 0x801269 2f8e6: 90 92 6a 12 sts 0x126A, r9 ; 0x80126a 2f8ea: a0 92 6b 12 sts 0x126B, r10 ; 0x80126b 2f8ee: b0 92 6c 12 sts 0x126C, r11 ; 0x80126c go_to_current(homing_feedrate[Z_AXIS]/60); 2f8f2: 65 e5 ldi r22, 0x55 ; 85 2f8f4: 75 e5 ldi r23, 0x55 ; 85 2f8f6: 85 e5 ldi r24, 0x55 ; 85 2f8f8: 91 e4 ldi r25, 0x41 ; 65 2f8fa: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 // 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(); 2f8fe: 0e 94 4e 5f call 0xbe9c ; 0xbe9c if (! endstop_z_hit_on_purpose()) 2f902: 0f 94 ef 22 call 0x245de ; 0x245de 2f906: 8b 83 std Y+3, r24 ; 0x03 2f908: 88 23 and r24, r24 2f90a: 09 f4 brne .+2 ; 0x2f90e 2f90c: eb c0 rjmp .+470 ; 0x2fae4 { //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) 2f90e: 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; 2f910: c1 2c mov r12, r1 2f912: d1 2c mov r13, r1 2f914: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 2f916: 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) 2f918: 8a 81 ldd r24, Y+2 ; 0x02 2f91a: 80 17 cp r24, r16 2f91c: 08 f0 brcs .+2 ; 0x2f920 2f91e: a4 c0 rjmp .+328 ; 0x2fa68 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 2f920: 60 91 69 12 lds r22, 0x1269 ; 0x801269 2f924: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 2f928: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 2f92c: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 2f930: 20 e0 ldi r18, 0x00 ; 0 2f932: 30 e0 ldi r19, 0x00 ; 0 2f934: 40 e0 ldi r20, 0x00 ; 0 2f936: 5f e3 ldi r21, 0x3F ; 63 2f938: 31 10 cpse r3, r1 2f93a: 04 c0 rjmp .+8 ; 0x2f944 2f93c: 2d ec ldi r18, 0xCD ; 205 2f93e: 3c ec ldi r19, 0xCC ; 204 2f940: 4c e4 ldi r20, 0x4C ; 76 2f942: 5e e3 ldi r21, 0x3E ; 62 2f944: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2f948: 2b 01 movw r4, r22 2f94a: 3c 01 movw r6, r24 2f94c: 40 92 69 12 sts 0x1269, r4 ; 0x801269 2f950: 50 92 6a 12 sts 0x126A, r5 ; 0x80126a 2f954: 60 92 6b 12 sts 0x126B, r6 ; 0x80126b 2f958: 70 92 6c 12 sts 0x126C, r7 ; 0x80126c float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 2f95c: 65 e5 ldi r22, 0x55 ; 85 2f95e: 75 e5 ldi r23, 0x55 ; 85 2f960: 85 e5 ldi r24, 0x55 ; 85 2f962: 91 e4 ldi r25, 0x41 ; 65 2f964: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 2f968: 80 92 69 12 sts 0x1269, r8 ; 0x801269 2f96c: 90 92 6a 12 sts 0x126A, r9 ; 0x80126a 2f970: a0 92 6b 12 sts 0x126B, r10 ; 0x80126b 2f974: 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)); 2f978: 65 e5 ldi r22, 0x55 ; 85 2f97a: 75 e5 ldi r23, 0x55 ; 85 2f97c: 85 e5 ldi r24, 0x55 ; 85 2f97e: 90 e4 ldi r25, 0x40 ; 64 2f980: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 // 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(); 2f984: 0e 94 4e 5f call 0xbe9c ; 0xbe9c //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) { 2f988: a3 01 movw r20, r6 2f98a: 92 01 movw r18, r4 2f98c: 60 91 69 12 lds r22, 0x1269 ; 0x801269 2f990: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 2f994: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 2f998: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 2f99c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2f9a0: 9f 77 andi r25, 0x7F ; 127 2f9a2: 2d ec ldi r18, 0xCD ; 205 2f9a4: 3c ec ldi r19, 0xCC ; 204 2f9a6: 4c ec ldi r20, 0xCC ; 204 2f9a8: 5c e3 ldi r21, 0x3C ; 60 2f9aa: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2f9ae: 87 ff sbrs r24, 7 2f9b0: 16 c0 rjmp .+44 ; 0x2f9de //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 2f9b2: 60 e0 ldi r22, 0x00 ; 0 2f9b4: 70 e0 ldi r23, 0x00 ; 0 2f9b6: 80 e0 ldi r24, 0x00 ; 0 2f9b8: 9f e3 ldi r25, 0x3F ; 63 2f9ba: 0e 94 ef 6c call 0xd9de ; 0xd9de current_position[Z_AXIS] = minimum_z; 2f9be: 80 92 69 12 sts 0x1269, r8 ; 0x801269 2f9c2: 90 92 6a 12 sts 0x126A, r9 ; 0x80126a 2f9c6: a0 92 6b 12 sts 0x126B, r10 ; 0x80126b 2f9ca: b0 92 6c 12 sts 0x126C, r11 ; 0x80126c go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 2f9ce: 65 e5 ldi r22, 0x55 ; 85 2f9d0: 75 e5 ldi r23, 0x55 ; 85 2f9d2: 85 e5 ldi r24, 0x55 ; 85 2f9d4: 90 e4 ldi r25, 0x40 ; 64 2f9d6: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 // 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(); 2f9da: 0e 94 4e 5f call 0xbe9c ; 0xbe9c } if (!endstop_z_hit_on_purpose()) 2f9de: 0f 94 ef 22 call 0x245de ; 0x245de 2f9e2: 28 2e mov r2, r24 2f9e4: 88 23 and r24, r24 2f9e6: 09 f4 brne .+2 ; 0x2f9ea 2f9e8: 7d c0 rjmp .+250 ; 0x2fae4 2f9ea: 40 90 69 12 lds r4, 0x1269 ; 0x801269 2f9ee: 50 90 6a 12 lds r5, 0x126A ; 0x80126a 2f9f2: 60 90 6b 12 lds r6, 0x126B ; 0x80126b 2f9f6: 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; 2f9fa: 9a 81 ldd r25, Y+2 ; 0x02 2f9fc: 99 23 and r25, r25 2f9fe: d9 f0 breq .+54 ; 0x2fa36 2fa00: 69 2f mov r22, r25 2fa02: 70 e0 ldi r23, 0x00 ; 0 2fa04: 90 e0 ldi r25, 0x00 ; 0 2fa06: 80 e0 ldi r24, 0x00 ; 0 2fa08: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 2fa0c: 9b 01 movw r18, r22 2fa0e: ac 01 movw r20, r24 2fa10: c7 01 movw r24, r14 2fa12: b6 01 movw r22, r12 2fa14: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 2fa18: 9b 01 movw r18, r22 2fa1a: ac 01 movw r20, r24 2fa1c: c3 01 movw r24, r6 2fa1e: b2 01 movw r22, r4 2fa20: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 2fa24: 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 2fa26: 2d ec ldi r18, 0xCD ; 205 2fa28: 3c ec ldi r19, 0xCC ; 204 2fa2a: 4c e4 ldi r20, 0x4C ; 76 2fa2c: 5d e3 ldi r21, 0x3D ; 61 2fa2e: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2fa32: 18 16 cp r1, r24 2fa34: 64 f0 brlt .+24 ; 0x2fa4e #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]; 2fa36: a3 01 movw r20, r6 2fa38: 92 01 movw r18, r4 2fa3a: c7 01 movw r24, r14 2fa3c: b6 01 movw r22, r12 2fa3e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2fa42: 6b 01 movw r12, r22 2fa44: 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) 2fa46: 8a 81 ldd r24, Y+2 ; 0x02 2fa48: 8f 5f subi r24, 0xFF ; 255 2fa4a: 8a 83 std Y+2, r24 ; 0x02 2fa4c: 65 cf rjmp .-310 ; 0x2f918 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 2fa4e: 31 10 cpse r3, r1 2fa50: 49 c0 rjmp .+146 ; 0x2fae4 //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 2fa52: 84 ef ldi r24, 0xF4 ; 244 2fa54: 91 e0 ldi r25, 0x01 ; 1 2fa56: 0e 94 0a 8d call 0x11a14 ; 0x11a14 //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; 2fa5a: 32 2c mov r3, r2 i = -1; 2fa5c: 2f ef ldi r18, 0xFF ; 255 2fa5e: 2a 83 std Y+2, r18 ; 0x02 z = 0; 2fa60: c1 2c mov r12, r1 2fa62: d1 2c mov r13, r1 2fa64: 76 01 movw r14, r12 2fa66: ef cf rjmp .-34 ; 0x2fa46 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 2fa68: 02 30 cpi r16, 0x02 ; 2 2fa6a: 38 f5 brcc .+78 ; 0x2faba goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 2fa6c: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2fa70: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2fa74: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2fa78: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c 2fa7c: 99 81 ldd r25, Y+1 ; 0x01 2fa7e: 90 93 77 02 sts 0x0277, r25 ; 0x800277 <_ZL14check_endstops.lto_priv.386> if (n_iter > 1) current_position[Z_AXIS] /= float(n_iter); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2fa82: 81 2f mov r24, r17 2fa84: 0f 94 e1 22 call 0x245c2 ; 0x245c2 // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2fa88: 10 92 28 06 sts 0x0628, r1 ; 0x800628 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 2fa8c: 8b 81 ldd r24, Y+3 ; 0x03 2fa8e: 0f 90 pop r0 2fa90: 0f 90 pop r0 2fa92: 0f 90 pop r0 2fa94: df 91 pop r29 2fa96: cf 91 pop r28 2fa98: 1f 91 pop r17 2fa9a: 0f 91 pop r16 2fa9c: ff 90 pop r15 2fa9e: ef 90 pop r14 2faa0: df 90 pop r13 2faa2: cf 90 pop r12 2faa4: bf 90 pop r11 2faa6: af 90 pop r10 2faa8: 9f 90 pop r9 2faaa: 8f 90 pop r8 2faac: 7f 90 pop r7 2faae: 6f 90 pop r6 2fab0: 5f 90 pop r5 2fab2: 4f 90 pop r4 2fab4: 3f 90 pop r3 2fab6: 2f 90 pop r2 2fab8: 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); 2faba: 60 2f mov r22, r16 2fabc: 70 e0 ldi r23, 0x00 ; 0 2fabe: 90 e0 ldi r25, 0x00 ; 0 2fac0: 80 e0 ldi r24, 0x00 ; 0 2fac2: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 2fac6: 9b 01 movw r18, r22 2fac8: ac 01 movw r20, r24 2faca: c7 01 movw r24, r14 2facc: b6 01 movw r22, r12 2face: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 2fad2: 60 93 69 12 sts 0x1269, r22 ; 0x801269 2fad6: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 2fada: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 2fade: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c 2fae2: cc cf rjmp .-104 ; 0x2fa7c 2fae4: 29 81 ldd r18, Y+1 ; 0x01 2fae6: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.386> return true; error: // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 4"); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2faea: 81 2f mov r24, r17 2faec: 0f 94 e1 22 call 0x245c2 ; 0x245c2 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2faf0: 10 92 28 06 sts 0x0628, r1 ; 0x800628 return false; 2faf4: 1b 82 std Y+3, r1 ; 0x03 2faf6: ca cf rjmp .-108 ; 0x2fa8c 0002faf8 : //! @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) 2faf8: 2f 92 push r2 2fafa: 3f 92 push r3 2fafc: 4f 92 push r4 2fafe: 5f 92 push r5 2fb00: 6f 92 push r6 2fb02: 7f 92 push r7 2fb04: 8f 92 push r8 2fb06: 9f 92 push r9 2fb08: af 92 push r10 2fb0a: bf 92 push r11 2fb0c: cf 92 push r12 2fb0e: df 92 push r13 2fb10: ef 92 push r14 2fb12: ff 92 push r15 2fb14: 0f 93 push r16 2fb16: 1f 93 push r17 2fb18: cf 93 push r28 2fb1a: df 93 push r29 2fb1c: cd b7 in r28, 0x3d ; 61 2fb1e: de b7 in r29, 0x3e ; 62 2fb20: ce 5c subi r28, 0xCE ; 206 2fb22: d1 09 sbc r29, r1 2fb24: 0f b6 in r0, 0x3f ; 63 2fb26: f8 94 cli 2fb28: de bf out 0x3e, r29 ; 62 2fb2a: 0f be out 0x3f, r0 ; 63 2fb2c: cd bf out 0x3d, r28 ; 61 2fb2e: 18 2f mov r17, r24 #endif // TMC2130 FORCE_BL_ON_START; // Only Z calibration? if (!onlyZ) 2fb30: 81 11 cpse r24, r1 2fb32: 04 c0 rjmp .+8 ; 0x2fb3c { disable_heater(); 2fb34: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 eeprom_adjust_bed_reset(); //reset bed level correction 2fb38: 0e 94 3a 79 call 0xf274 ; 0xf274 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 2fb3c: 80 e0 ldi r24, 0x00 ; 0 2fb3e: 0e 94 93 70 call 0xe126 ; 0xe126 // Let the planner use the uncorrected coordinates. mbl.reset(); 2fb42: 0f 94 41 7c call 0x2f882 ; 0x2f882 // 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(); 2fb46: 0e 94 88 62 call 0xc510 ; 0xc510 babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 2fb4a: 10 92 27 06 sts 0x0627, r1 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.451+0x1> 2fb4e: 10 92 26 06 sts 0x0626, r1 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.451> // 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)); 2fb52: e9 e3 ldi r30, 0x39 ; 57 2fb54: f6 e0 ldi r31, 0x06 ; 6 2fb56: 83 e0 ldi r24, 0x03 ; 3 2fb58: df 01 movw r26, r30 2fb5a: 1d 92 st X+, r1 2fb5c: 8a 95 dec r24 2fb5e: e9 f7 brne .-6 ; 0x2fb5a // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 2fb60: 81 e0 ldi r24, 0x01 ; 1 2fb62: 0e 94 c1 65 call 0xcb82 ; 0xcb82 2fb66: c7 55 subi r28, 0x57 ; 87 2fb68: df 4f sbci r29, 0xFF ; 255 2fb6a: 99 83 std Y+1, r25 ; 0x01 2fb6c: 88 83 st Y, r24 2fb6e: c9 5a subi r28, 0xA9 ; 169 2fb70: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 2fb72: 83 e8 ldi r24, 0x83 ; 131 2fb74: 92 e6 ldi r25, 0x62 ; 98 2fb76: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2fb7a: 0e 94 94 de call 0x1bd28 ; 0x1bd28 raise_z_above(MESH_HOME_Z_SEARCH); 2fb7e: 60 e0 ldi r22, 0x00 ; 0 2fb80: 70 e0 ldi r23, 0x00 ; 0 2fb82: 80 ea ldi r24, 0xA0 ; 160 2fb84: 90 e4 ldi r25, 0x40 ; 64 2fb86: 0e 94 51 6d call 0xdaa2 ; 0xdaa2 } /**/ void home_xy() { set_destination_to_current(); 2fb8a: 0e 94 09 67 call 0xce12 ; 0xce12 homeaxis(X_AXIS); 2fb8e: 80 e0 ldi r24, 0x00 ; 0 2fb90: 0f 94 0c 7a call 0x2f418 ; 0x2f418 homeaxis(Y_AXIS); 2fb94: 81 e0 ldi r24, 0x01 ; 1 2fb96: 0f 94 0c 7a call 0x2f418 ; 0x2f418 plan_set_position_curposXYZE(); 2fb9a: 0f 94 68 48 call 0x290d0 ; 0x290d0 endstops_hit_on_purpose(); 2fb9e: 0f 94 fd 22 call 0x245fa ; 0x245fa 2fba2: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.386> 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; 2fba6: 20 e0 ldi r18, 0x00 ; 0 2fba8: 30 e0 ldi r19, 0x00 ; 0 2fbaa: 40 ea ldi r20, 0xA0 ; 160 2fbac: 50 e4 ldi r21, 0x40 ; 64 2fbae: 60 91 61 12 lds r22, 0x1261 ; 0x801261 2fbb2: 70 91 62 12 lds r23, 0x1262 ; 0x801262 2fbb6: 80 91 63 12 lds r24, 0x1263 ; 0x801263 2fbba: 90 91 64 12 lds r25, 0x1264 ; 0x801264 2fbbe: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2fbc2: 60 93 61 12 sts 0x1261, r22 ; 0x801261 2fbc6: 70 93 62 12 sts 0x1262, r23 ; 0x801262 2fbca: 80 93 63 12 sts 0x1263, r24 ; 0x801263 2fbce: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] += 5; 2fbd2: 20 e0 ldi r18, 0x00 ; 0 2fbd4: 30 e0 ldi r19, 0x00 ; 0 2fbd6: 40 ea ldi r20, 0xA0 ; 160 2fbd8: 50 e4 ldi r21, 0x40 ; 64 2fbda: 60 91 65 12 lds r22, 0x1265 ; 0x801265 2fbde: 70 91 66 12 lds r23, 0x1266 ; 0x801266 2fbe2: 80 91 67 12 lds r24, 0x1267 ; 0x801267 2fbe6: 90 91 68 12 lds r25, 0x1268 ; 0x801268 2fbea: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 2fbee: 60 93 65 12 sts 0x1265, r22 ; 0x801265 2fbf2: 70 93 66 12 sts 0x1266, r23 ; 0x801266 2fbf6: 80 93 67 12 sts 0x1267, r24 ; 0x801267 2fbfa: 90 93 68 12 sts 0x1268, r25 ; 0x801268 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 2fbfe: 60 e0 ldi r22, 0x00 ; 0 2fc00: 70 e0 ldi r23, 0x00 ; 0 2fc02: 80 ea ldi r24, 0xA0 ; 160 2fc04: 91 e4 ldi r25, 0x41 ; 65 2fc06: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 2fc0a: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // 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)) 2fc0e: 81 2f mov r24, r17 2fc10: 0e 94 70 f9 call 0x1f2e0 ; 0x1f2e0 2fc14: e5 96 adiw r28, 0x35 ; 53 2fc16: 8f af std Y+63, r24 ; 0x3f 2fc18: e5 97 sbiw r28, 0x35 ; 53 2fc1a: 81 11 cpse r24, r1 2fc1c: 04 c0 rjmp .+8 ; 0x2fc26 //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 2fc1e: e5 96 adiw r28, 0x35 ; 53 2fc20: 1f ae std Y+63, r1 ; 0x3f 2fc22: e5 97 sbiw r28, 0x35 ; 53 2fc24: 6f c4 rjmp .+2270 ; 0x30504 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 2fc26: 87 e4 ldi r24, 0x47 ; 71 2fc28: 92 e6 ldi r25, 0x62 ; 98 2fc2a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2fc2e: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 if(onlyZ){ 2fc32: 11 23 and r17, r17 2fc34: 09 f4 brne .+2 ; 0x2fc38 2fc36: 41 c4 rjmp .+2178 ; 0x304ba prompt_steel_sheet_on_bed(true); 2fc38: 81 e0 ldi r24, 0x01 ; 1 2fc3a: 0e 94 24 e9 call 0x1d248 ; 0x1d248 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 2fc3e: 85 e1 ldi r24, 0x15 ; 21 2fc40: 92 e6 ldi r25, 0x62 ; 98 2fc42: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2fc46: 0e 94 94 de call 0x1bd28 ; 0x1bd28 lcd_puts_at_P(0,3,_n("1/9")); 2fc4a: 46 e8 ldi r20, 0x86 ; 134 2fc4c: 5c e6 ldi r21, 0x6C ; 108 }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")); 2fc4e: 63 e0 ldi r22, 0x03 ; 3 2fc50: 80 e0 ldi r24, 0x00 ; 0 2fc52: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 } refresh_cmd_timeout(); 2fc56: 0e 94 9c 65 call 0xcb38 ; 0xcb38 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 2fc5a: 11 11 cpse r17, r1 2fc5c: 1b c0 rjmp .+54 ; 0x2fc94 { KEEPALIVE_STATE(PAUSED_FOR_USER); 2fc5e: 84 e0 ldi r24, 0x04 ; 4 2fc60: 80 93 78 02 sts 0x0278, r24 ; 0x800278 prompt_steel_sheet_on_bed(false); 2fc64: 80 e0 ldi r24, 0x00 ; 0 2fc66: 0e 94 24 e9 call 0x1d248 ; 0x1d248 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 2fc6a: 8b e5 ldi r24, 0x5B ; 91 2fc6c: 91 e6 ldi r25, 0x61 ; 97 2fc6e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2fc72: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 KEEPALIVE_STATE(IN_HANDLER); 2fc76: 82 e0 ldi r24, 0x02 ; 2 2fc78: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 2fc7c: 83 ef ldi r24, 0xF3 ; 243 2fc7e: 91 e6 ldi r25, 0x61 ; 97 2fc80: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2fc84: 0e 94 94 de call 0x1bd28 ; 0x1bd28 lcd_puts_at_P(0,3,_n("1/4")); 2fc88: 4e e7 ldi r20, 0x7E ; 126 2fc8a: 5c e6 ldi r21, 0x6C ; 108 2fc8c: 63 e0 ldi r22, 0x03 ; 3 2fc8e: 80 e0 ldi r24, 0x00 ; 0 2fc90: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2fc94: 00 91 77 02 lds r16, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.386> check_endstops = check; 2fc98: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.386> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 2fc9c: 60 e0 ldi r22, 0x00 ; 0 2fc9e: 70 e0 ldi r23, 0x00 ; 0 2fca0: 80 e8 ldi r24, 0x80 ; 128 2fca2: 9f eb ldi r25, 0xBF ; 191 2fca4: 0e 94 ef 6c call 0xd9de ; 0xd9de // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 2fca8: c1 2c mov r12, r1 2fcaa: d1 2c mov r13, r1 2fcac: b0 ea ldi r27, 0xA0 ; 160 2fcae: eb 2e mov r14, r27 2fcb0: b0 e4 ldi r27, 0x40 ; 64 2fcb2: fb 2e mov r15, r27 2fcb4: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2fcb8: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2fcbc: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2fcc0: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c 2fcc4: 81 e0 ldi r24, 0x01 ; 1 2fcc6: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.386> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 2fcca: 60 e0 ldi r22, 0x00 ; 0 2fccc: 70 e0 ldi r23, 0x00 ; 0 2fcce: 80 ea ldi r24, 0xA0 ; 160 2fcd0: 91 e4 ldi r25, 0x41 ; 65 2fcd2: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 2fcd6: 0f 94 5b 18 call 0x230b6 ; 0x230b6 2fcda: 00 93 77 02 sts 0x0277, r16 ; 0x800277 <_ZL14check_endstops.lto_priv.386> #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)) && 2fcde: 82 e0 ldi r24, 0x02 ; 2 2fce0: 0f 94 47 18 call 0x2308e ; 0x2308e 2fce4: 2d ec ldi r18, 0xCD ; 205 2fce6: 3c ec ldi r19, 0xCC ; 204 2fce8: 44 ea ldi r20, 0xA4 ; 164 2fcea: 50 e4 ldi r21, 0x40 ; 64 2fcec: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 2fcf0: 18 16 cp r1, r24 2fcf2: 0c f4 brge .+2 ; 0x2fcf6 2fcf4: eb c3 rjmp .+2006 ; 0x304cc (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 2fcf6: 82 e0 ldi r24, 0x02 ; 2 2fcf8: 0f 94 47 18 call 0x2308e ; 0x2308e #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)) && 2fcfc: 23 e3 ldi r18, 0x33 ; 51 2fcfe: 33 e3 ldi r19, 0x33 ; 51 2fd00: 4b e9 ldi r20, 0x9B ; 155 2fd02: 50 e4 ldi r21, 0x40 ; 64 2fd04: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 2fd08: 87 fd sbrc r24, 7 2fd0a: e0 c3 rjmp .+1984 ; 0x304cc (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 2fd0c: 11 11 cpse r17, r1 2fd0e: e3 c3 rjmp .+1990 ; 0x304d6 } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 2fd10: 80 e1 ldi r24, 0x10 ; 16 2fd12: 0e 94 e4 d4 call 0x1a9c8 ; 0x1a9c8 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 2fd16: 81 ea ldi r24, 0xA1 ; 161 2fd18: 9d e0 ldi r25, 0x0D ; 13 2fd1a: 0f 94 3e a4 call 0x3487c ; 0x3487c 2fd1e: bb e0 ldi r27, 0x0B ; 11 2fd20: 8b 9f mul r24, r27 2fd22: c0 01 movw r24, r0 2fd24: 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); 2fd26: 70 e0 ldi r23, 0x00 ; 0 2fd28: 60 e0 ldi r22, 0x00 ; 0 2fd2a: 80 5b subi r24, 0xB0 ; 176 2fd2c: 92 4f sbci r25, 0xF2 ; 242 2fd2e: 0f 94 80 a4 call 0x34900 ; 0x34900 } 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(); 2fd32: 0e 94 9c 65 call 0xcb38 ; 0xcb38 // 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); 2fd36: ea e0 ldi r30, 0x0A ; 10 2fd38: f3 e1 ldi r31, 0x13 ; 19 2fd3a: 84 ec ldi r24, 0xC4 ; 196 2fd3c: df 01 movw r26, r30 2fd3e: 1d 92 st X+, r1 2fd40: 8a 95 dec r24 2fd42: e9 f7 brne .-6 ; 0x2fd3e { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 2fd44: 86 e2 ldi r24, 0x26 ; 38 2fd46: 9d e9 ldi r25, 0x9D ; 157 2fd48: 0e 94 1f 7b call 0xf63e ; 0xf63e MYSERIAL.println(int(iteration + 1)); 2fd4c: 81 e0 ldi r24, 0x01 ; 1 2fd4e: 90 e0 ldi r25, 0x00 ; 0 2fd50: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a 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)); 2fd54: 83 ef ldi r24, 0xF3 ; 243 2fd56: 91 e6 ldi r25, 0x61 ; 97 2fd58: 0e 94 95 75 call 0xeb2a ; 0xeb2a 2fd5c: 0e 94 94 de call 0x1bd28 ; 0x1bd28 #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; 2fd60: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2fd64: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2fd68: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2fd6c: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c 2fd70: b2 e0 ldi r27, 0x02 ; 2 2fd72: e1 96 adiw r28, 0x31 ; 49 2fd74: bf af std Y+63, r27 ; 0x3f 2fd76: e1 97 sbiw r28, 0x31 ; 49 2fd78: 21 e0 ldi r18, 0x01 ; 1 2fd7a: 3d e9 ldi r19, 0x9D ; 157 2fd7c: cd 56 subi r28, 0x6D ; 109 2fd7e: df 4f sbci r29, 0xFF ; 255 2fd80: 39 83 std Y+1, r19 ; 0x01 2fd82: 28 83 st Y, r18 2fd84: c3 59 subi r28, 0x93 ; 147 2fd86: d0 40 sbci r29, 0x00 ; 0 2fd88: 49 e0 ldi r20, 0x09 ; 9 2fd8a: 53 e1 ldi r21, 0x13 ; 19 2fd8c: cf 56 subi r28, 0x6F ; 111 2fd8e: df 4f sbci r29, 0xFF ; 255 2fd90: 59 83 std Y+1, r21 ; 0x01 2fd92: 48 83 st Y, r20 2fd94: c1 59 subi r28, 0x91 ; 145 2fd96: d0 40 sbci r29, 0x00 ; 0 2fd98: a0 96 adiw r28, 0x20 ; 32 2fd9a: 5f af std Y+63, r21 ; 0x3f 2fd9c: 4e af std Y+62, r20 ; 0x3e 2fd9e: a0 97 sbiw r28, 0x20 ; 32 2fda0: e0 96 adiw r28, 0x30 ; 48 2fda2: 3f af std Y+63, r19 ; 0x3f 2fda4: 2e af std Y+62, r18 ; 0x3e 2fda6: 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; 2fda8: a7 96 adiw r28, 0x27 ; 39 2fdaa: 1f ae std Y+63, r1 ; 0x3f 2fdac: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 2fdae: 31 2c mov r3, r1 2fdb0: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 2fdb2: 0e 94 9c 65 call 0xcb38 ; 0xcb38 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 2fdb6: 63 e0 ldi r22, 0x03 ; 3 2fdb8: 80 e0 ldi r24, 0x00 ; 0 2fdba: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%d/4"),(k+1)); 2fdbe: bf ef ldi r27, 0xFF ; 255 2fdc0: 2b 1a sub r2, r27 2fdc2: 3b 0a sbc r3, r27 2fdc4: 3f 92 push r3 2fdc6: 2f 92 push r2 2fdc8: e1 e2 ldi r30, 0x21 ; 33 2fdca: fd e9 ldi r31, 0x9D ; 157 2fdcc: ff 93 push r31 2fdce: ef 93 push r30 2fdd0: 0e 94 66 6f call 0xdecc ; 0xdecc } #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ float *pt = pts + k * 2; // Go up to z_initial. go_to_current(homing_feedrate[Z_AXIS] / 60.f); 2fdd4: 65 e5 ldi r22, 0x55 ; 85 2fdd6: 75 e5 ldi r23, 0x55 ; 85 2fdd8: 85 e5 ldi r24, 0x55 ; 85 2fdda: 91 e4 ldi r25, 0x41 ; 65 2fddc: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 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); 2fde0: e0 96 adiw r28, 0x30 ; 48 2fde2: ee ad ldd r30, Y+62 ; 0x3e 2fde4: ff ad ldd r31, Y+63 ; 0x3f 2fde6: e0 97 sbiw r28, 0x30 ; 48 2fde8: 85 91 lpm r24, Z+ 2fdea: 95 91 lpm r25, Z+ 2fdec: a5 91 lpm r26, Z+ 2fdee: b4 91 lpm r27, Z 2fdf0: 80 93 61 12 sts 0x1261, r24 ; 0x801261 2fdf4: 90 93 62 12 sts 0x1262, r25 ; 0x801262 2fdf8: a0 93 63 12 sts 0x1263, r26 ; 0x801263 2fdfc: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 2fe00: e0 96 adiw r28, 0x30 ; 48 2fe02: ee ad ldd r30, Y+62 ; 0x3e 2fe04: ff ad ldd r31, Y+63 ; 0x3f 2fe06: e0 97 sbiw r28, 0x30 ; 48 2fe08: 34 96 adiw r30, 0x04 ; 4 2fe0a: 85 91 lpm r24, Z+ 2fe0c: 95 91 lpm r25, Z+ 2fe0e: a5 91 lpm r26, Z+ 2fe10: b4 91 lpm r27, Z 2fe12: 80 93 65 12 sts 0x1265, r24 ; 0x801265 2fe16: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2fe1a: a0 93 67 12 sts 0x1267, r26 ; 0x801267 2fe1e: 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); 2fe22: 60 e0 ldi r22, 0x00 ; 0 2fe24: 70 e0 ldi r23, 0x00 ; 0 2fe26: 88 e4 ldi r24, 0x48 ; 72 2fe28: 92 e4 ldi r25, 0x42 ; 66 2fe2a: 0f 94 5a 4e call 0x29cb4 ; 0x29cb4 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 2fe2e: 46 e8 ldi r20, 0x86 ; 134 2fe30: 5b e9 ldi r21, 0x9B ; 155 2fe32: 5f 93 push r21 2fe34: 4f 93 push r20 2fe36: 0f 94 00 a3 call 0x34600 ; 0x34600 lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 2fe3a: 45 e7 ldi r20, 0x75 ; 117 2fe3c: 5b e9 ldi r21, 0x9B ; 155 2fe3e: 63 e0 ldi r22, 0x03 ; 3 2fe40: 84 e0 ldi r24, 0x04 ; 4 2fe42: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 // disable heaters and stop motion before we initialize sm4 disable_heater(); 2fe46: 0f 94 e8 0d call 0x21bd0 ; 0x21bd0 st_synchronize(); 2fe4a: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 2fe4e: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 2fe52: 8d 7f andi r24, 0xFD ; 253 2fe54: 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" ); 2fe58: 0f b6 in r0, 0x3f ; 63 2fe5a: f8 94 cli 2fe5c: a8 95 wdr 2fe5e: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2fe62: 88 61 ori r24, 0x18 ; 24 2fe64: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2fe68: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2fe6c: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 2fe6e: 10 92 25 06 sts 0x0625, r1 ; 0x800625 2fe72: 10 92 24 06 sts 0x0624, r1 ; 0x800624 sm4_update_pos_cb = xyzcal_update_pos; 2fe76: 88 e4 ldi r24, 0x48 ; 72 2fe78: 9b eb ldi r25, 0xBB ; 187 2fe7a: 90 93 23 06 sts 0x0623, r25 ; 0x800623 2fe7e: 80 93 22 06 sts 0x0622, r24 ; 0x800622 sm4_calc_delay_cb = xyzcal_calc_delay; 2fe82: a3 e4 ldi r26, 0x43 ; 67 2fe84: bb eb ldi r27, 0xBB ; 187 2fe86: b0 93 21 06 sts 0x0621, r27 ; 0x800621 2fe8a: 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]); 2fe8e: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2fe92: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2fe96: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2fe9a: 30 91 57 06 lds r19, 0x0657 ; 0x800657 2fe9e: 40 91 50 06 lds r20, 0x0650 ; 0x800650 2fea2: 50 91 51 06 lds r21, 0x0651 ; 0x800651 2fea6: 60 91 52 06 lds r22, 0x0652 ; 0x800652 2feaa: 70 91 53 06 lds r23, 0x0653 ; 0x800653 2feae: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2feb2: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 2feb6: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 2feba: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 2febe: 3f 93 push r19 2fec0: 2f 93 push r18 2fec2: 1f 93 push r17 2fec4: 0f 93 push r16 2fec6: 7f 93 push r23 2fec8: 6f 93 push r22 2feca: 5f 93 push r21 2fecc: 4f 93 push r20 2fece: bf 93 push r27 2fed0: af 93 push r26 2fed2: 9f 93 push r25 2fed4: 8f 93 push r24 2fed6: e5 e2 ldi r30, 0x25 ; 37 2fed8: fc e9 ldi r31, 0x9C ; 156 2feda: ff 93 push r31 2fedc: ef 93 push r30 2fede: 0f 94 00 a3 call 0x34600 ; 0x34600 int16_t x0 = _X; 2fee2: 40 90 4c 06 lds r4, 0x064C ; 0x80064c 2fee6: 50 90 4d 06 lds r5, 0x064D ; 0x80064d 2feea: 60 90 4e 06 lds r6, 0x064E ; 0x80064e 2feee: 70 90 4f 06 lds r7, 0x064F ; 0x80064f 2fef2: b4 2c mov r11, r4 2fef4: a5 2c mov r10, r5 int16_t y0 = _Y; 2fef6: 80 91 50 06 lds r24, 0x0650 ; 0x800650 2fefa: 90 91 51 06 lds r25, 0x0651 ; 0x800651 2fefe: a0 91 52 06 lds r26, 0x0652 ; 0x800652 2ff02: b0 91 53 06 lds r27, 0x0653 ; 0x800653 2ff06: a6 96 adiw r28, 0x26 ; 38 2ff08: 8c af std Y+60, r24 ; 0x3c 2ff0a: 9d af std Y+61, r25 ; 0x3d 2ff0c: ae af std Y+62, r26 ; 0x3e 2ff0e: bf af std Y+63, r27 ; 0x3f 2ff10: a6 97 sbiw r28, 0x26 ; 38 2ff12: a3 96 adiw r28, 0x23 ; 35 2ff14: 9f ac ldd r9, Y+63 ; 0x3f 2ff16: a3 97 sbiw r28, 0x23 ; 35 2ff18: a4 96 adiw r28, 0x24 ; 36 2ff1a: 8f ac ldd r8, Y+63 ; 0x3f 2ff1c: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 2ff1e: c0 90 54 06 lds r12, 0x0654 ; 0x800654 2ff22: d0 90 55 06 lds r13, 0x0655 ; 0x800655 2ff26: e0 90 56 06 lds r14, 0x0656 ; 0x800656 2ff2a: f0 90 57 06 lds r15, 0x0657 ; 0x800657 2ff2e: 0f b6 in r0, 0x3f ; 63 2ff30: f8 94 cli 2ff32: de bf out 0x3e, r29 ; 62 2ff34: 0f be out 0x3f, r0 ; 63 2ff36: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 2ff38: b5 e0 ldi r27, 0x05 ; 5 2ff3a: cb 16 cp r12, r27 2ff3c: b7 ef ldi r27, 0xF7 ; 247 2ff3e: db 06 cpc r13, r27 2ff40: 0c f4 brge .+2 ; 0x2ff44 2ff42: 3a c3 rjmp .+1652 ; 0x305b8 } 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; 2ff44: 1a 82 std Y+2, r1 ; 0x02 2ff46: 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); 2ff48: 1f 92 push r1 2ff4a: 1f 92 push r1 2ff4c: e3 e0 ldi r30, 0x03 ; 3 2ff4e: ef 93 push r30 2ff50: f4 e8 ldi r31, 0x84 ; 132 2ff52: ff 93 push r31 2ff54: 1f 92 push r1 2ff56: 24 e6 ldi r18, 0x64 ; 100 2ff58: 2f 93 push r18 2ff5a: df 92 push r13 2ff5c: cf 92 push r12 2ff5e: 8f 92 push r8 2ff60: 9f 92 push r9 2ff62: af 92 push r10 2ff64: bf 92 push r11 2ff66: 4c e9 ldi r20, 0x9C ; 156 2ff68: 5b e9 ldi r21, 0x9B ; 155 2ff6a: 5f 93 push r21 2ff6c: 4f 93 push r20 2ff6e: 0f 94 00 a3 call 0x34600 ; 0x34600 if (!ret && (ad < 720)) 2ff72: 0f b6 in r0, 0x3f ; 63 2ff74: f8 94 cli 2ff76: de bf out 0x3e, r29 ; 62 2ff78: 0f be out 0x3f, r0 ; 63 2ff7a: cd bf out 0x3d, r28 ; 61 2ff7c: 89 81 ldd r24, Y+1 ; 0x01 2ff7e: 9a 81 ldd r25, Y+2 ; 0x02 2ff80: 80 3d cpi r24, 0xD0 ; 208 2ff82: 92 40 sbci r25, 0x02 ; 2 2ff84: 08 f4 brcc .+2 ; 0x2ff88 2ff86: e3 c2 rjmp .+1478 ; 0x3054e if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 2ff88: 89 81 ldd r24, Y+1 ; 0x01 2ff8a: 9a 81 ldd r25, Y+2 ; 0x02 2ff8c: 80 3a cpi r24, 0xA0 ; 160 2ff8e: 95 40 sbci r25, 0x05 ; 5 2ff90: 10 f0 brcs .+4 ; 0x2ff96 2ff92: 0d 94 b1 8e jmp 0x31d62 ; 0x31d62 if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 2ff96: 9e 01 movw r18, r28 2ff98: 2f 5f subi r18, 0xFF ; 255 2ff9a: 3f 4f sbci r19, 0xFF ; 255 2ff9c: 79 01 movw r14, r18 2ff9e: 10 e0 ldi r17, 0x00 ; 0 2ffa0: 00 e0 ldi r16, 0x00 ; 0 2ffa2: 2c e7 ldi r18, 0x7C ; 124 2ffa4: 3c ef ldi r19, 0xFC ; 252 2ffa6: a6 01 movw r20, r12 2ffa8: 44 56 subi r20, 0x64 ; 100 2ffaa: 51 09 sbc r21, r1 2ffac: 69 2d mov r22, r9 2ffae: 78 2d mov r23, r8 2ffb0: 8b 2d mov r24, r11 2ffb2: 9a 2d mov r25, r10 2ffb4: 0f 94 eb 5e call 0x2bdd6 ; 0x2bdd6 2ffb8: 88 23 and r24, r24 2ffba: 11 f4 brne .+4 ; 0x2ffc0 2ffbc: 0d 94 b1 8e jmp 0x31d62 ; 0x31d62 ad += 720; 2ffc0: 89 81 ldd r24, Y+1 ; 0x01 2ffc2: 9a 81 ldd r25, Y+2 ; 0x02 2ffc4: 80 53 subi r24, 0x30 ; 48 2ffc6: 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); 2ffc8: c0 90 54 06 lds r12, 0x0654 ; 0x800654 2ffcc: d0 90 55 06 lds r13, 0x0655 ; 0x800655 2ffd0: e0 90 56 06 lds r14, 0x0656 ; 0x800656 2ffd4: f0 90 57 06 lds r15, 0x0657 ; 0x800657 2ffd8: 00 91 50 06 lds r16, 0x0650 ; 0x800650 2ffdc: 10 91 51 06 lds r17, 0x0651 ; 0x800651 2ffe0: 20 91 52 06 lds r18, 0x0652 ; 0x800652 2ffe4: 30 91 53 06 lds r19, 0x0653 ; 0x800653 2ffe8: 40 91 4c 06 lds r20, 0x064C ; 0x80064c 2ffec: 50 91 4d 06 lds r21, 0x064D ; 0x80064d 2fff0: 60 91 4e 06 lds r22, 0x064E ; 0x80064e 2fff4: 70 91 4f 06 lds r23, 0x064F ; 0x80064f 2fff8: 9f 93 push r25 2fffa: 8f 93 push r24 2fffc: df 92 push r13 2fffe: cf 92 push r12 30000: 1f 93 push r17 30002: 0f 93 push r16 30004: 5f 93 push r21 30006: 4f 93 push r20 30008: 81 e0 ldi r24, 0x01 ; 1 3000a: 9c e9 ldi r25, 0x9C ; 156 3000c: 9f 93 push r25 3000e: 8f 93 push r24 30010: 0f 94 00 a3 call 0x34600 ; 0x34600 /// 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); 30014: 40 91 54 06 lds r20, 0x0654 ; 0x800654 30018: 50 91 55 06 lds r21, 0x0655 ; 0x800655 3001c: 60 91 56 06 lds r22, 0x0656 ; 0x800656 30020: 70 91 57 06 lds r23, 0x0657 ; 0x800657 30024: 48 54 subi r20, 0x48 ; 72 30026: 51 09 sbc r21, r1 30028: 00 e0 ldi r16, 0x00 ; 0 3002a: 28 ec ldi r18, 0xC8 ; 200 3002c: 30 e0 ldi r19, 0x00 ; 0 3002e: a3 96 adiw r28, 0x23 ; 35 30030: 6f ad ldd r22, Y+63 ; 0x3f 30032: a3 97 sbiw r28, 0x23 ; 35 30034: a4 96 adiw r28, 0x24 ; 36 30036: 7f ad ldd r23, Y+63 ; 0x3f 30038: a4 97 sbiw r28, 0x24 ; 36 3003a: c2 01 movw r24, r4 3003c: 0e 94 ba d3 call 0x1a774 ; 0x1a774 /// 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; 30040: 20 91 4c 06 lds r18, 0x064C ; 0x80064c 30044: 30 91 4d 06 lds r19, 0x064D ; 0x80064d 30048: 40 91 4e 06 lds r20, 0x064E ; 0x80064e 3004c: 50 91 4f 06 lds r21, 0x064F ; 0x80064f 30050: 6e 96 adiw r28, 0x1e ; 30 30052: 2c af std Y+60, r18 ; 0x3c 30054: 3d af std Y+61, r19 ; 0x3d 30056: 4e af std Y+62, r20 ; 0x3e 30058: 5f af std Y+63, r21 ; 0x3f 3005a: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 3005c: 80 91 50 06 lds r24, 0x0650 ; 0x800650 30060: 90 91 51 06 lds r25, 0x0651 ; 0x800651 30064: a0 91 52 06 lds r26, 0x0652 ; 0x800652 30068: b0 91 53 06 lds r27, 0x0653 ; 0x800653 3006c: ae 96 adiw r28, 0x2e ; 46 3006e: 8c af std Y+60, r24 ; 0x3c 30070: 9d af std Y+61, r25 ; 0x3d 30072: ae af std Y+62, r26 ; 0x3e 30074: bf af std Y+63, r27 ; 0x3f 30076: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 30078: 20 91 54 06 lds r18, 0x0654 ; 0x800654 3007c: 30 91 55 06 lds r19, 0x0655 ; 0x800655 30080: 40 91 56 06 lds r20, 0x0656 ; 0x800656 30084: 50 91 57 06 lds r21, 0x0657 ; 0x800657 30088: e9 96 adiw r28, 0x39 ; 57 3008a: 2c af std Y+60, r18 ; 0x3c 3008c: 3d af std Y+61, r19 ; 0x3d 3008e: 4e af std Y+62, r20 ; 0x3e 30090: 5f af std Y+63, r21 ; 0x3f 30092: e9 97 sbiw r28, 0x39 ; 57 30094: ae e5 ldi r26, 0x5E ; 94 30096: ba e0 ldi r27, 0x0A ; 10 30098: 0f b6 in r0, 0x3f ; 63 3009a: f8 94 cli 3009c: de bf out 0x3e, r29 ; 62 3009e: 0f be out 0x3f, r0 ; 63 300a0: cd bf out 0x3d, r28 ; 61 300a2: 90 e0 ldi r25, 0x00 ; 0 300a4: 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)); 300a6: fc 01 movw r30, r24 300a8: e4 56 subi r30, 0x64 ; 100 300aa: f3 46 sbci r31, 0x63 ; 99 300ac: 25 91 lpm r18, Z+ 300ae: 34 91 lpm r19, Z 300b0: 2d 93 st X+, r18 300b2: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 300b4: fc 01 movw r30, r24 300b6: ec 57 subi r30, 0x7C ; 124 300b8: f3 46 sbci r31, 0x63 ; 99 300ba: 25 91 lpm r18, Z+ 300bc: 34 91 lpm r19, Z 300be: 57 96 adiw r26, 0x17 ; 23 300c0: 3c 93 st X, r19 300c2: 2e 93 st -X, r18 300c4: 56 97 sbiw r26, 0x16 ; 22 300c6: 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++){ 300c8: 88 31 cpi r24, 0x18 ; 24 300ca: 91 05 cpc r25, r1 300cc: 61 f7 brne .-40 ; 0x300a6 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); 300ce: e7 96 adiw r28, 0x37 ; 55 300d0: 4e ad ldd r20, Y+62 ; 0x3e 300d2: 5f ad ldd r21, Y+63 ; 0x3f 300d4: e7 97 sbiw r28, 0x37 ; 55 300d6: ac 96 adiw r28, 0x2c ; 44 300d8: 6e ad ldd r22, Y+62 ; 0x3e 300da: 7f ad ldd r23, Y+63 ; 0x3f 300dc: ac 97 sbiw r28, 0x2c ; 44 300de: 6c 96 adiw r28, 0x1c ; 28 300e0: 8e ad ldd r24, Y+62 ; 0x3e 300e2: 9f ad ldd r25, Y+63 ; 0x3f 300e4: 6c 97 sbiw r28, 0x1c ; 28 300e6: 0f 94 27 60 call 0x2c04e ; 0x2c04e 300ea: 2e e5 ldi r18, 0x5E ; 94 300ec: 36 e0 ldi r19, 0x06 ; 6 300ee: a4 96 adiw r28, 0x24 ; 36 300f0: 3f af std Y+63, r19 ; 0x3f 300f2: 2e af std Y+62, r18 ; 0x3e 300f4: a4 97 sbiw r28, 0x24 ; 36 300f6: 79 01 movw r14, r18 300f8: f0 e2 ldi r31, 0x20 ; 32 300fa: 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]); 300fc: a7 e4 ldi r26, 0x47 ; 71 300fe: ca 2e mov r12, r26 30100: ac e9 ldi r26, 0x9C ; 156 30102: da 2e mov r13, r26 } DBG(endl); 30104: 0c e9 ldi r16, 0x9C ; 156 30106: 1d e9 ldi r17, 0x9D ; 157 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); 30108: 57 01 movw r10, r14 3010a: e0 e2 ldi r30, 0x20 ; 32 3010c: 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]); 3010e: d5 01 movw r26, r10 30110: 8d 91 ld r24, X+ 30112: 5d 01 movw r10, r26 30114: 1f 92 push r1 30116: 8f 93 push r24 30118: df 92 push r13 3011a: cf 92 push r12 3011c: 0f 94 00 a3 call 0x34600 ; 0x34600 30120: 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){ 30122: 0f 90 pop r0 30124: 0f 90 pop r0 30126: 0f 90 pop r0 30128: 0f 90 pop r0 3012a: 81 10 cpse r8, r1 3012c: f0 cf rjmp .-32 ; 0x3010e DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 3012e: 1f 93 push r17 30130: 0f 93 push r16 30132: 0f 94 00 a3 call 0x34600 ; 0x34600 30136: 9a 94 dec r9 30138: b0 e2 ldi r27, 0x20 ; 32 3013a: eb 0e add r14, r27 3013c: 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){ 3013e: 0f 90 pop r0 30140: 0f 90 pop r0 30142: 91 10 cpse r9, r1 30144: e1 cf rjmp .-62 ; 0x30108 for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 30146: 1f 93 push r17 30148: 0f 93 push r16 3014a: 0f 94 00 a3 call 0x34600 ; 0x34600 3014e: 6e e5 ldi r22, 0x5E ; 94 30150: 7a e0 ldi r23, 0x0A ; 10 30152: 0f 90 pop r0 30154: 0f 90 pop r0 30156: ee e5 ldi r30, 0x5E ; 94 30158: 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; 3015a: 90 e0 ldi r25, 0x00 ; 0 3015c: 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; 3015e: 50 e0 ldi r21, 0x00 ; 0 30160: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 30162: 21 91 ld r18, Z+ 30164: 21 11 cpse r18, r1 30166: 67 c4 rjmp .+2254 ; 0x30a36 ++mins; 30168: 4f 5f subi r20, 0xFF ; 255 3016a: 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){ 3016c: 6e 17 cp r22, r30 3016e: 7f 07 cpc r23, r31 30170: c1 f7 brne .-16 ; 0x30162 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 30172: 9a 01 movw r18, r20 30174: 28 0f add r18, r24 30176: 39 1f adc r19, r25 30178: 25 38 cpi r18, 0x85 ; 133 3017a: 33 40 sbci r19, 0x03 ; 3 3017c: a4 f0 brlt .+40 ; 0x301a6 && mins > threshold_extreme 3017e: 43 33 cpi r20, 0x33 ; 51 30180: 51 05 cpc r21, r1 30182: 8c f0 brlt .+34 ; 0x301a6 && maxs > threshold_extreme 30184: 83 33 cpi r24, 0x33 ; 51 30186: 91 05 cpc r25, r1 30188: 74 f0 brlt .+28 ; 0x301a6 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 3018a: 20 e0 ldi r18, 0x00 ; 0 3018c: 34 e0 ldi r19, 0x04 ; 4 3018e: 24 1b sub r18, r20 30190: 35 0b sbc r19, r21 30192: 28 1b sub r18, r24 30194: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 30196: 24 17 cp r18, r20 30198: 35 07 cpc r19, r21 3019a: 2c f4 brge .+10 ; 0x301a6 } 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; 3019c: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 3019e: 28 17 cp r18, r24 301a0: 39 07 cpc r19, r25 301a2: 0c f4 brge .+2 ; 0x301a6 301a4: 39 c2 rjmp .+1138 ; 0x30618 } /// 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; 301a6: 66 96 adiw r28, 0x16 ; 22 301a8: 1f ae std Y+63, r1 ; 0x3f 301aa: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 301ac: 62 96 adiw r28, 0x12 ; 18 301ae: 1f ae std Y+63, r1 ; 0x3f 301b0: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 301b2: 22 96 adiw r28, 0x02 ; 2 301b4: 1f ae std Y+63, r1 ; 0x3f 301b6: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 301b8: 19 82 std Y+1, r1 ; 0x01 301ba: ae 01 movw r20, r28 301bc: 4f 5a subi r20, 0xAF ; 175 301be: 5f 4f sbci r21, 0xFF ; 255 301c0: be 01 movw r22, r28 301c2: 6b 5a subi r22, 0xAB ; 171 301c4: 7f 4f sbci r23, 0xFF ; 255 301c6: 8e e5 ldi r24, 0x5E ; 94 301c8: 9a e0 ldi r25, 0x0A ; 10 301ca: 0f 94 10 58 call 0x2b020 ; 0x2b020 301ce: 08 2f mov r16, r24 301d0: ae 01 movw r20, r28 301d2: 4f 5f subi r20, 0xFF ; 255 301d4: 5f 4f sbci r21, 0xFF ; 255 301d6: be 01 movw r22, r28 301d8: 6f 5b subi r22, 0xBF ; 191 301da: 7f 4f sbci r23, 0xFF ; 255 301dc: 86 e7 ldi r24, 0x76 ; 118 301de: 9a e0 ldi r25, 0x0A ; 10 301e0: 0f 94 10 58 call 0x2b020 ; 0x2b020 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; 301e4: 66 96 adiw r28, 0x16 ; 22 301e6: 6f ad ldd r22, Y+63 ; 0x3f 301e8: 66 97 sbiw r28, 0x16 ; 22 row = r08; 301ea: 62 96 adiw r28, 0x12 ; 18 301ec: 1f ad ldd r17, Y+63 ; 0x3f 301ee: 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){ 301f0: 80 17 cp r24, r16 301f2: 28 f0 brcs .+10 ; 0x301fe col = c08; row = r08; return match08; } col = c10; 301f4: 22 96 adiw r28, 0x02 ; 2 301f6: 6f ad ldd r22, Y+63 ; 0x3f 301f8: 22 97 sbiw r28, 0x02 ; 2 row = r10; 301fa: 19 81 ldd r17, Y+1 ; 0x01 301fc: 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){ 301fe: 08 35 cpi r16, 0x58 ; 88 30200: 08 f4 brcc .+2 ; 0x30204 30202: 1e c4 rjmp .+2108 ; 0x30a40 /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 30204: 70 e0 ldi r23, 0x00 ; 0 30206: 90 e0 ldi r25, 0x00 ; 0 30208: 80 e0 ldi r24, 0x00 ; 0 3020a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 3020e: 20 e0 ldi r18, 0x00 ; 0 30210: 30 e0 ldi r19, 0x00 ; 0 30212: 40 eb ldi r20, 0xB0 ; 176 30214: 50 e4 ldi r21, 0x40 ; 64 30216: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3021a: 2b 01 movw r4, r22 3021c: 3c 01 movw r6, r24 3021e: 65 96 adiw r28, 0x15 ; 21 30220: 4c ae std Y+60, r4 ; 0x3c 30222: 5d ae std Y+61, r5 ; 0x3d 30224: 6e ae std Y+62, r6 ; 0x3e 30226: 7f ae std Y+63, r7 ; 0x3f 30228: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 3022a: 61 2f mov r22, r17 3022c: 70 e0 ldi r23, 0x00 ; 0 3022e: 90 e0 ldi r25, 0x00 ; 0 30230: 80 e0 ldi r24, 0x00 ; 0 30232: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 30236: 20 e0 ldi r18, 0x00 ; 0 30238: 30 e0 ldi r19, 0x00 ; 0 3023a: 40 eb ldi r20, 0xB0 ; 176 3023c: 50 e4 ldi r21, 0x40 ; 64 3023e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 30242: 4b 01 movw r8, r22 30244: 5c 01 movw r10, r24 30246: 25 96 adiw r28, 0x05 ; 5 30248: 8c ae std Y+60, r8 ; 0x3c 3024a: 9d ae std Y+61, r9 ; 0x3d 3024c: ae ae std Y+62, r10 ; 0x3e 3024e: bf ae std Y+63, r11 ; 0x3f 30250: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 30252: 20 e0 ldi r18, 0x00 ; 0 30254: 30 e0 ldi r19, 0x00 ; 0 30256: 40 e9 ldi r20, 0x90 ; 144 30258: 50 e4 ldi r21, 0x40 ; 64 3025a: 29 83 std Y+1, r18 ; 0x01 3025c: 3a 83 std Y+2, r19 ; 0x02 3025e: 4b 83 std Y+3, r20 ; 0x03 30260: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 30262: ae 01 movw r20, r28 30264: 4f 5f subi r20, 0xFF ; 255 30266: 5f 4f sbci r21, 0xFF ; 255 30268: be 01 movw r22, r28 3026a: 6f 5b subi r22, 0xBF ; 191 3026c: 7f 4f sbci r23, 0xFF ; 255 3026e: ce 01 movw r24, r28 30270: 8f 5a subi r24, 0xAF ; 175 30272: 9f 4f sbci r25, 0xFF ; 255 30274: 0f 94 6b 5b call 0x2b6d6 ; 0x2b6d6 if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 30278: a3 01 movw r20, r6 3027a: 92 01 movw r18, r4 3027c: 65 96 adiw r28, 0x15 ; 21 3027e: 6c ad ldd r22, Y+60 ; 0x3c 30280: 7d ad ldd r23, Y+61 ; 0x3d 30282: 8e ad ldd r24, Y+62 ; 0x3e 30284: 9f ad ldd r25, Y+63 ; 0x3f 30286: 65 97 sbiw r28, 0x15 ; 21 30288: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 3028c: 6b 01 movw r12, r22 3028e: 7c 01 movw r14, r24 30290: 9f 77 andi r25, 0x7F ; 127 30292: 20 e0 ldi r18, 0x00 ; 0 30294: 30 e0 ldi r19, 0x00 ; 0 30296: 40 e4 ldi r20, 0x40 ; 64 30298: 50 e4 ldi r21, 0x40 ; 64 3029a: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 3029e: 18 16 cp r1, r24 302a0: 34 f1 brlt .+76 ; 0x302ee 302a2: a5 01 movw r20, r10 302a4: 94 01 movw r18, r8 302a6: 25 96 adiw r28, 0x05 ; 5 302a8: 6c ad ldd r22, Y+60 ; 0x3c 302aa: 7d ad ldd r23, Y+61 ; 0x3d 302ac: 8e ad ldd r24, Y+62 ; 0x3e 302ae: 9f ad ldd r25, Y+63 ; 0x3f 302b0: 25 97 sbiw r28, 0x05 ; 5 302b2: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 302b6: 9f 77 andi r25, 0x7F ; 127 302b8: 20 e0 ldi r18, 0x00 ; 0 302ba: 30 e0 ldi r19, 0x00 ; 0 302bc: 40 e4 ldi r20, 0x40 ; 64 302be: 50 e4 ldi r21, 0x40 ; 64 302c0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 302c4: 18 16 cp r1, r24 302c6: 9c f0 brlt .+38 ; 0x302ee 302c8: 20 e0 ldi r18, 0x00 ; 0 302ca: 30 e0 ldi r19, 0x00 ; 0 302cc: 40 ea ldi r20, 0xA0 ; 160 302ce: 50 e4 ldi r21, 0x40 ; 64 302d0: 69 81 ldd r22, Y+1 ; 0x01 302d2: 7a 81 ldd r23, Y+2 ; 0x02 302d4: 8b 81 ldd r24, Y+3 ; 0x03 302d6: 9c 81 ldd r25, Y+4 ; 0x04 302d8: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 302dc: 9f 77 andi r25, 0x7F ; 127 302de: 20 e0 ldi r18, 0x00 ; 0 302e0: 30 e0 ldi r19, 0x00 ; 0 302e2: 40 e4 ldi r20, 0x40 ; 64 302e4: 50 e4 ldi r21, 0x40 ; 64 302e6: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 302ea: 18 16 cp r1, r24 302ec: bc f5 brge .+110 ; 0x3035c //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 302ee: 20 e0 ldi r18, 0x00 ; 0 302f0: 30 e0 ldi r19, 0x00 ; 0 302f2: 40 ea ldi r20, 0xA0 ; 160 302f4: 50 e4 ldi r21, 0x40 ; 64 302f6: 69 81 ldd r22, Y+1 ; 0x01 302f8: 7a 81 ldd r23, Y+2 ; 0x02 302fa: 8b 81 ldd r24, Y+3 ; 0x03 302fc: 9c 81 ldd r25, Y+4 ; 0x04 302fe: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 30302: 9f 93 push r25 30304: 8f 93 push r24 30306: 7f 93 push r23 30308: 6f 93 push r22 3030a: a5 01 movw r20, r10 3030c: 94 01 movw r18, r8 3030e: 25 96 adiw r28, 0x05 ; 5 30310: 6c ad ldd r22, Y+60 ; 0x3c 30312: 7d ad ldd r23, Y+61 ; 0x3d 30314: 8e ad ldd r24, Y+62 ; 0x3e 30316: 9f ad ldd r25, Y+63 ; 0x3f 30318: 25 97 sbiw r28, 0x05 ; 5 3031a: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 3031e: 9f 93 push r25 30320: 8f 93 push r24 30322: 7f 93 push r23 30324: 6f 93 push r22 30326: ff 92 push r15 30328: ef 92 push r14 3032a: df 92 push r13 3032c: cf 92 push r12 3032e: 88 e6 ldi r24, 0x68 ; 104 30330: 9c e9 ldi r25, 0x9C ; 156 30332: 9f 93 push r25 30334: 8f 93 push r24 30336: 0f 94 00 a3 call 0x34600 ; 0x34600 /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 3033a: 65 96 adiw r28, 0x15 ; 21 3033c: 4c ae std Y+60, r4 ; 0x3c 3033e: 5d ae std Y+61, r5 ; 0x3d 30340: 6e ae std Y+62, r6 ; 0x3e 30342: 7f ae std Y+63, r7 ; 0x3f 30344: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 30346: 25 96 adiw r28, 0x05 ; 5 30348: 8c ae std Y+60, r8 ; 0x3c 3034a: 9d ae std Y+61, r9 ; 0x3d 3034c: ae ae std Y+62, r10 ; 0x3e 3034e: bf ae std Y+63, r11 ; 0x3f 30350: 25 97 sbiw r28, 0x05 ; 5 30352: 0f b6 in r0, 0x3f ; 63 30354: f8 94 cli 30356: de bf out 0x3e, r29 ; 62 30358: 0f be out 0x3f, r0 ; 63 3035a: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 3035c: 20 e0 ldi r18, 0x00 ; 0 3035e: 30 e0 ldi r19, 0x00 ; 0 30360: 48 e7 ldi r20, 0x78 ; 120 30362: 51 e4 ldi r21, 0x41 ; 65 30364: 65 96 adiw r28, 0x15 ; 21 30366: 6c ad ldd r22, Y+60 ; 0x3c 30368: 7d ad ldd r23, Y+61 ; 0x3d 3036a: 8e ad ldd r24, Y+62 ; 0x3e 3036c: 9f ad ldd r25, Y+63 ; 0x3f 3036e: 65 97 sbiw r28, 0x15 ; 21 30370: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 30374: 20 e0 ldi r18, 0x00 ; 0 30376: 30 e0 ldi r19, 0x00 ; 0 30378: 40 e8 ldi r20, 0x80 ; 128 3037a: 52 e4 ldi r21, 0x42 ; 66 3037c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30380: 6b 01 movw r12, r22 30382: 7c 01 movw r14, r24 30384: 6c 96 adiw r28, 0x1c ; 28 30386: ae ad ldd r26, Y+62 ; 0x3e 30388: bf ad ldd r27, Y+63 ; 0x3f 3038a: 6c 97 sbiw r28, 0x1c ; 28 3038c: bd 01 movw r22, r26 3038e: bb 0f add r27, r27 30390: 88 0b sbc r24, r24 30392: 99 0b sbc r25, r25 30394: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 30398: 9b 01 movw r18, r22 3039a: ac 01 movw r20, r24 3039c: c7 01 movw r24, r14 3039e: b6 01 movw r22, r12 303a0: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 303a4: 6b 01 movw r12, r22 303a6: 7c 01 movw r14, r24 303a8: 65 96 adiw r28, 0x15 ; 21 303aa: cc ae std Y+60, r12 ; 0x3c 303ac: dd ae std Y+61, r13 ; 0x3d 303ae: ee ae std Y+62, r14 ; 0x3e 303b0: ff ae std Y+63, r15 ; 0x3f 303b2: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 303b4: 20 e0 ldi r18, 0x00 ; 0 303b6: 30 e0 ldi r19, 0x00 ; 0 303b8: 48 e7 ldi r20, 0x78 ; 120 303ba: 51 e4 ldi r21, 0x41 ; 65 303bc: 25 96 adiw r28, 0x05 ; 5 303be: 6c ad ldd r22, Y+60 ; 0x3c 303c0: 7d ad ldd r23, Y+61 ; 0x3d 303c2: 8e ad ldd r24, Y+62 ; 0x3e 303c4: 9f ad ldd r25, Y+63 ; 0x3f 303c6: 25 97 sbiw r28, 0x05 ; 5 303c8: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 303cc: 20 e0 ldi r18, 0x00 ; 0 303ce: 30 e0 ldi r19, 0x00 ; 0 303d0: 40 e8 ldi r20, 0x80 ; 128 303d2: 52 e4 ldi r21, 0x42 ; 66 303d4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 303d8: 4b 01 movw r8, r22 303da: 5c 01 movw r10, r24 303dc: ac 96 adiw r28, 0x2c ; 44 303de: ee ad ldd r30, Y+62 ; 0x3e 303e0: ff ad ldd r31, Y+63 ; 0x3f 303e2: ac 97 sbiw r28, 0x2c ; 44 303e4: bf 01 movw r22, r30 303e6: ff 0f add r31, r31 303e8: 88 0b sbc r24, r24 303ea: 99 0b sbc r25, r25 303ec: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 303f0: 9b 01 movw r18, r22 303f2: ac 01 movw r20, r24 303f4: c5 01 movw r24, r10 303f6: b4 01 movw r22, r8 303f8: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 303fc: 25 96 adiw r28, 0x05 ; 5 303fe: 6c af std Y+60, r22 ; 0x3c 30400: 7d af std Y+61, r23 ; 0x3d 30402: 8e af std Y+62, r24 ; 0x3e 30404: 9f af std Y+63, r25 ; 0x3f 30406: 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; 30408: 2a e0 ldi r18, 0x0A ; 10 3040a: 37 ed ldi r19, 0xD7 ; 215 3040c: 43 e2 ldi r20, 0x23 ; 35 3040e: 5c e3 ldi r21, 0x3C ; 60 30410: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__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)); 30414: 9f 93 push r25 30416: 8f 93 push r24 30418: 7f 93 push r23 3041a: 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; 3041c: 2a e0 ldi r18, 0x0A ; 10 3041e: 37 ed ldi r19, 0xD7 ; 215 30420: 43 e2 ldi r20, 0x23 ; 35 30422: 5c e3 ldi r21, 0x3C ; 60 30424: c7 01 movw r24, r14 30426: b6 01 movw r22, r12 30428: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__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)); 3042c: 9f 93 push r25 3042e: 8f 93 push r24 30430: 7f 93 push r23 30432: 6f 93 push r22 30434: 8c e4 ldi r24, 0x4C ; 76 30436: 9c e9 ldi r25, 0x9C ; 156 30438: 9f 93 push r25 3043a: 8f 93 push r24 3043c: 0f 94 00 a3 call 0x34600 ; 0x34600 uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 30440: 20 e0 ldi r18, 0x00 ; 0 30442: 30 e0 ldi r19, 0x00 ; 0 30444: 40 e0 ldi r20, 0x00 ; 0 30446: 5f e3 ldi r21, 0x3F ; 63 30448: 25 96 adiw r28, 0x05 ; 5 3044a: 6c ad ldd r22, Y+60 ; 0x3c 3044c: 7d ad ldd r23, Y+61 ; 0x3d 3044e: 8e ad ldd r24, Y+62 ; 0x3e 30450: 9f ad ldd r25, Y+63 ; 0x3f 30452: 25 97 sbiw r28, 0x05 ; 5 30454: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 30458: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 3045c: 6b 01 movw r12, r22 3045e: 20 e0 ldi r18, 0x00 ; 0 30460: 30 e0 ldi r19, 0x00 ; 0 30462: 40 e0 ldi r20, 0x00 ; 0 30464: 5f e3 ldi r21, 0x3F ; 63 30466: 65 96 adiw r28, 0x15 ; 21 30468: 6c ad ldd r22, Y+60 ; 0x3c 3046a: 7d ad ldd r23, Y+61 ; 0x3d 3046c: 8e ad ldd r24, Y+62 ; 0x3e 3046e: 9f ad ldd r25, Y+63 ; 0x3f 30470: 65 97 sbiw r28, 0x15 ; 21 30472: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 30476: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> 3047a: 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); 3047c: 00 e0 ldi r16, 0x00 ; 0 3047e: 28 ec ldi r18, 0xC8 ; 200 30480: 30 e0 ldi r19, 0x00 ; 0 30482: e7 96 adiw r28, 0x37 ; 55 30484: 4e ad ldd r20, Y+62 ; 0x3e 30486: 5f ad ldd r21, Y+63 ; 0x3f 30488: e7 97 sbiw r28, 0x37 ; 55 3048a: b6 01 movw r22, r12 3048c: 0e 94 ba d3 call 0x1a774 ; 0x1a774 30490: 0f b6 in r0, 0x3f ; 63 30492: f8 94 cli 30494: de bf out 0x3e, r29 ; 62 30496: 0f be out 0x3f, r0 ; 63 30498: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 3049a: 10 e0 ldi r17, 0x00 ; 0 3049c: 8e e3 ldi r24, 0x3E ; 62 3049e: 9d e0 ldi r25, 0x0D ; 13 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 304a0: a4 96 adiw r28, 0x24 ; 36 304a2: ae ad ldd r26, Y+62 ; 0x3e 304a4: bf ad ldd r27, Y+63 ; 0x3f 304a6: a4 97 sbiw r28, 0x24 ; 36 304a8: 1d 92 st X+, r1 304aa: a4 96 adiw r28, 0x24 ; 36 304ac: bf af std Y+63, r27 ; 0x3f 304ae: ae af std Y+62, r26 ; 0x3e 304b0: 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++) 304b2: 8a 17 cp r24, r26 304b4: 9b 07 cpc r25, r27 304b6: a1 f7 brne .-24 ; 0x304a0 304b8: af c0 rjmp .+350 ; 0x30618 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)); 304ba: 83 ef ldi r24, 0xF3 ; 243 304bc: 91 e6 ldi r25, 0x61 ; 97 304be: 0e 94 95 75 call 0xeb2a ; 0xeb2a 304c2: 0e 94 94 de call 0x1bd28 ; 0x1bd28 lcd_puts_at_P(0,3,_n("1/4")); 304c6: 42 e8 ldi r20, 0x82 ; 130 304c8: 5c e6 ldi r21, 0x6C ; 108 304ca: c1 cb rjmp .-2174 ; 0x2fc4e } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 304cc: 82 e3 ldi r24, 0x32 ; 50 304ce: 9d e9 ldi r25, 0x9D ; 157 // 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); 304d0: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 304d4: a4 cb rjmp .-2232 ; 0x2fc1e 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); 304d6: c7 55 subi r28, 0x57 ; 87 304d8: df 4f sbci r29, 0xFF ; 255 304da: 88 81 ld r24, Y 304dc: 99 81 ldd r25, Y+1 ; 0x01 304de: c9 5a subi r28, 0xA9 ; 169 304e0: d0 40 sbci r29, 0x00 ; 0 304e2: 0e 94 a7 65 call 0xcb4e ; 0xcb4e // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 304e6: 0e 94 21 61 call 0xc242 ; 0xc242 // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 304ea: 0e 94 5d 5f call 0xbeba ; 0xbeba //FIXME bool result = sample_mesh_and_store_reference(); 304ee: 0f 94 63 52 call 0x2a4c6 ; 0x2a4c6 304f2: e5 96 adiw r28, 0x35 ; 53 304f4: 8f af std Y+63, r24 ; 0x3f 304f6: e5 97 sbiw r28, 0x35 ; 53 if (result) 304f8: 88 23 and r24, r24 304fa: 09 f4 brne .+2 ; 0x304fe 304fc: 90 cb rjmp .-2272 ; 0x2fc1e { calibration_status_set(CALIBRATION_STATUS_Z); 304fe: 84 e0 ldi r24, 0x04 ; 4 30500: 0e 94 39 d5 call 0x1aa72 ; 0x1aa72 } else { // Timeouted. } lcd_update_enable(true); 30504: 81 e0 ldi r24, 0x01 ; 1 30506: 0e 94 93 70 call 0xe126 ; 0xe126 #endif // TMC2130 FORCE_BL_ON_END; return final_result; } 3050a: e5 96 adiw r28, 0x35 ; 53 3050c: 8f ad ldd r24, Y+63 ; 0x3f 3050e: e5 97 sbiw r28, 0x35 ; 53 30510: c2 53 subi r28, 0x32 ; 50 30512: df 4f sbci r29, 0xFF ; 255 30514: 0f b6 in r0, 0x3f ; 63 30516: f8 94 cli 30518: de bf out 0x3e, r29 ; 62 3051a: 0f be out 0x3f, r0 ; 63 3051c: cd bf out 0x3d, r28 ; 61 3051e: df 91 pop r29 30520: cf 91 pop r28 30522: 1f 91 pop r17 30524: 0f 91 pop r16 30526: ff 90 pop r15 30528: ef 90 pop r14 3052a: df 90 pop r13 3052c: cf 90 pop r12 3052e: bf 90 pop r11 30530: af 90 pop r10 30532: 9f 90 pop r9 30534: 8f 90 pop r8 30536: 7f 90 pop r7 30538: 6f 90 pop r6 3053a: 5f 90 pop r5 3053c: 4f 90 pop r4 3053e: 3f 90 pop r3 30540: 2f 90 pop r2 30542: 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) { 30544: e1 e0 ldi r30, 0x01 ; 1 30546: e1 96 adiw r28, 0x31 ; 49 30548: ef af std Y+63, r30 ; 0x3f 3054a: e1 97 sbiw r28, 0x31 ; 49 3054c: 15 cc rjmp .-2006 ; 0x2fd78 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) 3054e: fe 01 movw r30, r28 30550: 31 96 adiw r30, 0x01 ; 1 30552: 7f 01 movw r14, r30 30554: 10 e0 ldi r17, 0x00 ; 0 30556: 00 e0 ldi r16, 0x00 ; 0 30558: 24 e8 ldi r18, 0x84 ; 132 3055a: 33 e0 ldi r19, 0x03 ; 3 3055c: a6 01 movw r20, r12 3055e: 69 2d mov r22, r9 30560: 78 2d mov r23, r8 30562: 8b 2d mov r24, r11 30564: 9a 2d mov r25, r10 30566: 0f 94 eb 5e call 0x2bdd6 ; 0x2bdd6 ad += 0; if (!ret && (ad < 1440)) 3056a: 88 23 and r24, r24 3056c: 09 f4 brne .+2 ; 0x30570 3056e: 0c cd rjmp .-1512 ; 0x2ff88 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; 30570: 89 81 ldd r24, Y+1 ; 0x01 30572: 9a 81 ldd r25, Y+2 ; 0x02 30574: 29 cd rjmp .-1454 ; 0x2ffc8 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)) 30576: 89 81 ldd r24, Y+1 ; 0x01 30578: 9a 81 ldd r25, Y+2 ; 0x02 3057a: 80 34 cpi r24, 0x40 ; 64 3057c: 9b 40 sbci r25, 0x0B ; 11 3057e: b8 f4 brcc .+46 ; 0x305ae if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 30580: ce 01 movw r24, r28 30582: 01 96 adiw r24, 0x01 ; 1 30584: 7c 01 movw r14, r24 30586: 04 eb ldi r16, 0xB4 ; 180 30588: 10 e0 ldi r17, 0x00 ; 0 3058a: 2c e7 ldi r18, 0x7C ; 124 3058c: 3c ef ldi r19, 0xFC ; 252 3058e: a6 01 movw r20, r12 30590: 4c 52 subi r20, 0x2C ; 44 30592: 51 40 sbci r21, 0x01 ; 1 30594: 69 2d mov r22, r9 30596: 78 2d mov r23, r8 30598: 8b 2d mov r24, r11 3059a: 9a 2d mov r25, r10 3059c: 0f 94 eb 5e call 0x2bdd6 ; 0x2bdd6 305a0: 88 23 and r24, r24 305a2: 29 f0 breq .+10 ; 0x305ae ad += 2160; 305a4: 89 81 ldd r24, Y+1 ; 0x01 305a6: 9a 81 ldd r25, Y+2 ; 0x02 305a8: 80 59 subi r24, 0x90 ; 144 305aa: 97 4f sbci r25, 0xF7 ; 247 305ac: 0d cd rjmp .-1510 ; 0x2ffc8 /// 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; 305ae: 90 e9 ldi r25, 0x90 ; 144 305b0: c9 1a sub r12, r25 305b2: 91 e0 ldi r25, 0x01 ; 1 305b4: d9 0a sbc r13, r25 305b6: c0 cc rjmp .-1664 ; 0x2ff38 } //@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]); 305b8: 00 91 54 06 lds r16, 0x0654 ; 0x800654 305bc: 10 91 55 06 lds r17, 0x0655 ; 0x800655 305c0: 20 91 56 06 lds r18, 0x0656 ; 0x800656 305c4: 30 91 57 06 lds r19, 0x0657 ; 0x800657 305c8: 40 91 50 06 lds r20, 0x0650 ; 0x800650 305cc: 50 91 51 06 lds r21, 0x0651 ; 0x800651 305d0: 60 91 52 06 lds r22, 0x0652 ; 0x800652 305d4: 70 91 53 06 lds r23, 0x0653 ; 0x800653 305d8: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 305dc: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 305e0: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 305e4: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 305e8: 3f 93 push r19 305ea: 2f 93 push r18 305ec: 1f 93 push r17 305ee: 0f 93 push r16 305f0: 7f 93 push r23 305f2: 6f 93 push r22 305f4: 5f 93 push r21 305f6: 4f 93 push r20 305f8: bf 93 push r27 305fa: af 93 push r26 305fc: 9f 93 push r25 305fe: 8f 93 push r24 30600: 84 ed ldi r24, 0xD4 ; 212 30602: 9b e9 ldi r25, 0x9B ; 155 30604: 9f 93 push r25 30606: 8f 93 push r24 30608: 0f 94 00 a3 call 0x34600 ; 0x34600 3060c: 0f b6 in r0, 0x3f ; 63 3060e: f8 94 cli 30610: de bf out 0x3e, r29 ; 62 30612: 0f be out 0x3f, r0 ; 63 30614: 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; 30616: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 30618: 84 eb ldi r24, 0xB4 ; 180 3061a: 9c e9 ldi r25, 0x9C ; 156 3061c: 9f 93 push r25 3061e: 8f 93 push r24 30620: 0f 94 00 a3 call 0x34600 ; 0x34600 lcd_set_cursor(4,3); 30624: 63 e0 ldi r22, 0x03 ; 3 30626: 84 e0 ldi r24, 0x04 ; 4 30628: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_space(16); 3062c: 80 e1 ldi r24, 0x10 ; 16 3062e: 0e 94 83 6f call 0xdf06 ; 0xdf06 // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 30632: 0f 94 db 4a call 0x295b6 ; 0x295b6 : "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" ); 30636: 88 e1 ldi r24, 0x18 ; 24 30638: 98 e2 ldi r25, 0x28 ; 40 3063a: 0f b6 in r0, 0x3f ; 63 3063c: f8 94 cli 3063e: a8 95 wdr 30640: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 30644: 0f be out 0x3f, r0 ; 63 30646: 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); 3064a: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3064e: 80 64 ori r24, 0x40 ; 64 30650: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 30654: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30658: 82 60 ori r24, 0x02 ; 2 3065a: 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){ 3065e: 0f 90 pop r0 30660: 0f 90 pop r0 30662: 1d 3f cpi r17, 0xFD ; 253 30664: 09 f4 brne .+2 ; 0x30668 30666: ee c1 rjmp .+988 ; 0x30a44 30668: 1f 3f cpi r17, 0xFF ; 255 3066a: 11 f4 brne .+4 ; 0x30670 3066c: 0d 94 6d 8e jmp 0x31cda ; 0x31cda 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); 30670: 20 e0 ldi r18, 0x00 ; 0 30672: 30 e0 ldi r19, 0x00 ; 0 30674: a9 01 movw r20, r18 30676: a0 96 adiw r28, 0x20 ; 32 30678: ee ad ldd r30, Y+62 ; 0x3e 3067a: ff ad ldd r31, Y+63 ; 0x3f 3067c: a0 97 sbiw r28, 0x20 ; 32 3067e: 61 81 ldd r22, Z+1 ; 0x01 30680: 72 81 ldd r23, Z+2 ; 0x02 30682: 83 81 ldd r24, Z+3 ; 0x03 30684: 94 81 ldd r25, Z+4 ; 0x04 30686: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 3068a: 20 91 61 12 lds r18, 0x1261 ; 0x801261 3068e: 30 91 62 12 lds r19, 0x1262 ; 0x801262 30692: 40 91 63 12 lds r20, 0x1263 ; 0x801263 30696: 50 91 64 12 lds r21, 0x1264 ; 0x801264 3069a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3069e: a0 96 adiw r28, 0x20 ; 32 306a0: ae ad ldd r26, Y+62 ; 0x3e 306a2: bf ad ldd r27, Y+63 ; 0x3f 306a4: a0 97 sbiw r28, 0x20 ; 32 306a6: 11 96 adiw r26, 0x01 ; 1 306a8: 6d 93 st X+, r22 306aa: 7d 93 st X+, r23 306ac: 8d 93 st X+, r24 306ae: 9c 93 st X, r25 306b0: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 306b2: c0 90 65 12 lds r12, 0x1265 ; 0x801265 306b6: d0 90 66 12 lds r13, 0x1266 ; 0x801266 306ba: e0 90 67 12 lds r14, 0x1267 ; 0x801267 306be: 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); 306c2: 20 e0 ldi r18, 0x00 ; 0 306c4: 30 e0 ldi r19, 0x00 ; 0 306c6: a9 01 movw r20, r18 306c8: 15 96 adiw r26, 0x05 ; 5 306ca: 6d 91 ld r22, X+ 306cc: 7d 91 ld r23, X+ 306ce: 8d 91 ld r24, X+ 306d0: 9c 91 ld r25, X 306d2: 18 97 sbiw r26, 0x08 ; 8 306d4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 306d8: a7 01 movw r20, r14 306da: 96 01 movw r18, r12 306dc: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 306e0: a0 96 adiw r28, 0x20 ; 32 306e2: ee ad ldd r30, Y+62 ; 0x3e 306e4: ff ad ldd r31, Y+63 ; 0x3f 306e6: a0 97 sbiw r28, 0x20 ; 32 306e8: 65 83 std Z+5, r22 ; 0x05 306ea: 76 83 std Z+6, r23 ; 0x06 306ec: 87 83 std Z+7, r24 ; 0x07 306ee: 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) 306f0: 20 e0 ldi r18, 0x00 ; 0 306f2: 30 e0 ldi r19, 0x00 ; 0 306f4: 40 e8 ldi r20, 0x80 ; 128 306f6: 50 ec ldi r21, 0xC0 ; 192 306f8: c7 01 movw r24, r14 306fa: b6 01 movw r22, r12 306fc: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 30700: 87 ff sbrs r24, 7 30702: 0c c0 rjmp .+24 ; 0x3071c current_position[Y_AXIS] = Y_MIN_POS; 30704: 80 e0 ldi r24, 0x00 ; 0 30706: 90 e0 ldi r25, 0x00 ; 0 30708: a0 e8 ldi r26, 0x80 ; 128 3070a: b0 ec ldi r27, 0xC0 ; 192 3070c: 80 93 65 12 sts 0x1265, r24 ; 0x801265 30710: 90 93 66 12 sts 0x1266, r25 ; 0x801266 30714: a0 93 67 12 sts 0x1267, r26 ; 0x801267 30718: 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; 3071c: 20 e0 ldi r18, 0x00 ; 0 3071e: 30 e0 ldi r19, 0x00 ; 0 30720: 40 e4 ldi r20, 0x40 ; 64 30722: 50 e4 ldi r21, 0x40 ; 64 30724: 60 91 69 12 lds r22, 0x1269 ; 0x801269 30728: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 3072c: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 30730: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 30734: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 30738: 60 93 69 12 sts 0x1269, r22 ; 0x801269 3073c: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 30740: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 30744: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c 30748: e0 96 adiw r28, 0x30 ; 48 3074a: 2e ad ldd r18, Y+62 ; 0x3e 3074c: 3f ad ldd r19, Y+63 ; 0x3f 3074e: e0 97 sbiw r28, 0x30 ; 48 30750: 28 5f subi r18, 0xF8 ; 248 30752: 3f 4f sbci r19, 0xFF ; 255 30754: e0 96 adiw r28, 0x30 ; 48 30756: 3f af std Y+63, r19 ; 0x3f 30758: 2e af std Y+62, r18 ; 0x3e 3075a: e0 97 sbiw r28, 0x30 ; 48 3075c: a0 96 adiw r28, 0x20 ; 32 3075e: 4e ad ldd r20, Y+62 ; 0x3e 30760: 5f ad ldd r21, Y+63 ; 0x3f 30762: a0 97 sbiw r28, 0x20 ; 32 30764: 48 5f subi r20, 0xF8 ; 248 30766: 5f 4f sbci r21, 0xFF ; 255 30768: a0 96 adiw r28, 0x20 ; 32 3076a: 5f af std Y+63, r21 ; 0x3f 3076c: 4e af std Y+62, r20 ; 0x3e 3076e: 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) { 30770: 54 e0 ldi r21, 0x04 ; 4 30772: 25 16 cp r2, r21 30774: 31 04 cpc r3, r1 30776: 09 f0 breq .+2 ; 0x3077a 30778: 1c cb rjmp .-2504 ; 0x2fdb2 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 3077a: a7 96 adiw r28, 0x27 ; 39 3077c: 6f ad ldd r22, Y+63 ; 0x3f 3077e: a7 97 sbiw r28, 0x27 ; 39 30780: 66 23 and r22, r22 30782: 31 f0 breq .+12 ; 0x30790 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) { 30784: e1 96 adiw r28, 0x31 ; 49 30786: 8f ad ldd r24, Y+63 ; 0x3f 30788: e1 97 sbiw r28, 0x31 ; 49 3078a: 81 30 cpi r24, 0x01 ; 1 3078c: 09 f0 breq .+2 ; 0x30790 3078e: da ce rjmp .-588 ; 0x30544 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 30790: 8d e5 ldi r24, 0x5D ; 93 30792: 9c e6 ldi r25, 0x6C ; 108 30794: 9f 93 push r25 30796: 8f 93 push r24 30798: 0f 94 00 a3 call 0x34600 ; 0x34600 delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 3079c: 90 e0 ldi r25, 0x00 ; 0 3079e: 80 e0 ldi r24, 0x00 ; 0 307a0: 0e 94 0a 8d call 0x11a14 ; 0x11a14 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) { 307a4: 0f 90 pop r0 307a6: 0f 90 pop r0 307a8: 20 e0 ldi r18, 0x00 ; 0 307aa: 30 e0 ldi r19, 0x00 ; 0 307ac: 40 e9 ldi r20, 0x90 ; 144 307ae: 50 ec ldi r21, 0xC0 ; 192 307b0: 60 91 0e 13 lds r22, 0x130E ; 0x80130e 307b4: 70 91 0f 13 lds r23, 0x130F ; 0x80130f 307b8: 80 91 10 13 lds r24, 0x1310 ; 0x801310 307bc: 90 91 11 13 lds r25, 0x1311 ; 0x801311 307c0: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 307c4: 87 ff sbrs r24, 7 307c6: 45 c1 rjmp .+650 ; 0x30a52 too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 307c8: 80 e0 ldi r24, 0x00 ; 0 307ca: 9d e9 ldi r25, 0x9D ; 157 307cc: 0e 94 18 7d call 0xfa30 ; 0xfa30 SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 307d0: 8e ec ldi r24, 0xCE ; 206 307d2: 9c e9 ldi r25, 0x9C ; 156 307d4: 0e 94 1f 7b call 0xf63e ; 0xf63e else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 307d8: 60 91 0e 13 lds r22, 0x130E ; 0x80130e 307dc: 70 91 0f 13 lds r23, 0x130F ; 0x80130f 307e0: 80 91 10 13 lds r24, 0x1310 ; 0x801310 307e4: 90 91 11 13 lds r25, 0x1311 ; 0x801311 307e8: 42 e0 ldi r20, 0x02 ; 2 307ea: 0e 94 a1 7a call 0xf542 ; 0xf542 MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 307ee: 8a ec ldi r24, 0xCA ; 202 307f0: 9c e9 ldi r25, 0x9C ; 156 307f2: 0e 94 1f 7b call 0xf63e ; 0xf63e MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 307f6: 60 e0 ldi r22, 0x00 ; 0 307f8: 70 e0 ldi r23, 0x00 ; 0 307fa: 80 e9 ldi r24, 0x90 ; 144 307fc: 90 ec ldi r25, 0xC0 ; 192 307fe: 0f 94 18 65 call 0x2ca30 ; 0x2ca30 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 30802: 92 e0 ldi r25, 0x02 ; 2 30804: af 96 adiw r28, 0x2f ; 47 30806: 9f af std Y+63, r25 ; 0x3f 30808: 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; 3080a: 10 92 3a 13 sts 0x133A, r1 ; 0x80133a 3080e: 10 92 3b 13 sts 0x133B, r1 ; 0x80133b 30812: 10 92 3c 13 sts 0x133C, r1 ; 0x80133c 30816: 10 92 3d 13 sts 0x133D, r1 ; 0x80133d cntr[1] = 0.f; 3081a: 10 92 3e 13 sts 0x133E, r1 ; 0x80133e 3081e: 10 92 3f 13 sts 0x133F, r1 ; 0x80133f 30822: 10 92 40 13 sts 0x1340, r1 ; 0x801340 30826: 10 92 41 13 sts 0x1341, r1 ; 0x801341 3082a: a4 e6 ldi r26, 0x64 ; 100 3082c: e6 96 adiw r28, 0x36 ; 54 3082e: af af std Y+63, r26 ; 0x3f 30830: 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; 30832: a2 96 adiw r28, 0x22 ; 34 30834: 1c ae std Y+60, r1 ; 0x3c 30836: 1d ae std Y+61, r1 ; 0x3d 30838: 1e ae std Y+62, r1 ; 0x3e 3083a: 1f ae std Y+63, r1 ; 0x3f 3083c: 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; 3083e: a6 96 adiw r28, 0x26 ; 38 30840: 1c ae std Y+60, r1 ; 0x3c 30842: 1d ae std Y+61, r1 ; 0x3d 30844: 1e ae std Y+62, r1 ; 0x3e 30846: 1f ae std Y+63, r1 ; 0x3f 30848: 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 }; 3084a: fe 01 movw r30, r28 3084c: 31 96 adiw r30, 0x01 ; 1 3084e: 68 96 adiw r28, 0x18 ; 24 30850: ff af std Y+63, r31 ; 0x3f 30852: ee af std Y+62, r30 ; 0x3e 30854: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 30856: 9e 01 movw r18, r28 30858: 2f 5b subi r18, 0xBF ; 191 3085a: 3f 4f sbci r19, 0xFF ; 255 3085c: 6a 96 adiw r28, 0x1a ; 26 3085e: 3f af std Y+63, r19 ; 0x3f 30860: 2e af std Y+62, r18 ; 0x3e 30862: 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; 30864: a6 96 adiw r28, 0x26 ; 38 30866: 6c ad ldd r22, Y+60 ; 0x3c 30868: 7d ad ldd r23, Y+61 ; 0x3d 3086a: 8e ad ldd r24, Y+62 ; 0x3e 3086c: 9f ad ldd r25, Y+63 ; 0x3f 3086e: a6 97 sbiw r28, 0x26 ; 38 30870: 0f 94 60 a6 call 0x34cc0 ; 0x34cc0 30874: 6e 96 adiw r28, 0x1e ; 30 30876: 6c af std Y+60, r22 ; 0x3c 30878: 7d af std Y+61, r23 ; 0x3d 3087a: 8e af std Y+62, r24 ; 0x3e 3087c: 9f af std Y+63, r25 ; 0x3f 3087e: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 30880: a6 96 adiw r28, 0x26 ; 38 30882: 6c ad ldd r22, Y+60 ; 0x3c 30884: 7d ad ldd r23, Y+61 ; 0x3d 30886: 8e ad ldd r24, Y+62 ; 0x3e 30888: 9f ad ldd r25, Y+63 ; 0x3f 3088a: a6 97 sbiw r28, 0x26 ; 38 3088c: 0f 94 26 a9 call 0x3524c ; 0x3524c 30890: cb 57 subi r28, 0x7B ; 123 30892: df 4f sbci r29, 0xFF ; 255 30894: 68 83 st Y, r22 30896: 79 83 std Y+1, r23 ; 0x01 30898: 8a 83 std Y+2, r24 ; 0x02 3089a: 9b 83 std Y+3, r25 ; 0x03 3089c: c5 58 subi r28, 0x85 ; 133 3089e: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 308a0: a2 96 adiw r28, 0x22 ; 34 308a2: 6c ad ldd r22, Y+60 ; 0x3c 308a4: 7d ad ldd r23, Y+61 ; 0x3d 308a6: 8e ad ldd r24, Y+62 ; 0x3e 308a8: 9f ad ldd r25, Y+63 ; 0x3f 308aa: a2 97 sbiw r28, 0x22 ; 34 308ac: 0f 94 60 a6 call 0x34cc0 ; 0x34cc0 308b0: c7 57 subi r28, 0x77 ; 119 308b2: df 4f sbci r29, 0xFF ; 255 308b4: 68 83 st Y, r22 308b6: 79 83 std Y+1, r23 ; 0x01 308b8: 8a 83 std Y+2, r24 ; 0x02 308ba: 9b 83 std Y+3, r25 ; 0x03 308bc: c9 58 subi r28, 0x89 ; 137 308be: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 308c0: a2 96 adiw r28, 0x22 ; 34 308c2: 6c ad ldd r22, Y+60 ; 0x3c 308c4: 7d ad ldd r23, Y+61 ; 0x3d 308c6: 8e ad ldd r24, Y+62 ; 0x3e 308c8: 9f ad ldd r25, Y+63 ; 0x3f 308ca: a2 97 sbiw r28, 0x22 ; 34 308cc: 0f 94 26 a9 call 0x3524c ; 0x3524c 308d0: cb 56 subi r28, 0x6B ; 107 308d2: df 4f sbci r29, 0xFF ; 255 308d4: 68 83 st Y, r22 308d6: 79 83 std Y+1, r23 ; 0x01 308d8: 8a 83 std Y+2, r24 ; 0x02 308da: 9b 83 std Y+3, r25 ; 0x03 308dc: c5 59 subi r28, 0x95 ; 149 308de: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 308e0: 68 96 adiw r28, 0x18 ; 24 308e2: ae ad ldd r26, Y+62 ; 0x3e 308e4: bf ad ldd r27, Y+63 ; 0x3f 308e6: 68 97 sbiw r28, 0x18 ; 24 308e8: e0 e4 ldi r30, 0x40 ; 64 308ea: 1d 92 st X+, r1 308ec: ea 95 dec r30 308ee: e9 f7 brne .-6 ; 0x308ea float b[4] = { 0.f }; 308f0: 80 e1 ldi r24, 0x10 ; 16 308f2: 6a 96 adiw r28, 0x1a ; 26 308f4: ae ad ldd r26, Y+62 ; 0x3e 308f6: bf ad ldd r27, Y+63 ; 0x3f 308f8: 6a 97 sbiw r28, 0x1a ; 26 308fa: 1d 92 st X+, r1 308fc: 8a 95 dec r24 308fe: e9 f7 brne .-6 ; 0x308fa float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 30900: 90 e0 ldi r25, 0x00 ; 0 30902: 80 e0 ldi r24, 0x00 ; 0 30904: 0e 94 0a 8d call 0x11a14 ; 0x11a14 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); 30908: 20 91 3a 13 lds r18, 0x133A ; 0x80133a 3090c: 30 91 3b 13 lds r19, 0x133B ; 0x80133b 30910: 40 91 3c 13 lds r20, 0x133C ; 0x80133c 30914: 50 91 3d 13 lds r21, 0x133D ; 0x80133d 30918: c5 55 subi r28, 0x55 ; 85 3091a: df 4f sbci r29, 0xFF ; 255 3091c: 28 83 st Y, r18 3091e: 39 83 std Y+1, r19 ; 0x01 30920: 4a 83 std Y+2, r20 ; 0x02 30922: 5b 83 std Y+3, r21 ; 0x03 30924: cb 5a subi r28, 0xAB ; 171 30926: 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); 30928: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 3092c: 90 91 3f 13 lds r25, 0x133F ; 0x80133f 30930: a0 91 40 13 lds r26, 0x1340 ; 0x801340 30934: b0 91 41 13 lds r27, 0x1341 ; 0x801341 30938: c1 55 subi r28, 0x51 ; 81 3093a: df 4f sbci r29, 0xFF ; 255 3093c: 88 83 st Y, r24 3093e: 99 83 std Y+1, r25 ; 0x01 30940: aa 83 std Y+2, r26 ; 0x02 30942: bb 83 std Y+3, r27 ; 0x03 30944: cf 5a subi r28, 0xAF ; 175 30946: d0 40 sbci r29, 0x00 ; 0 30948: de 01 movw r26, r28 3094a: af 5b subi r26, 0xBF ; 191 3094c: bf 4f sbci r27, 0xFF ; 255 3094e: c7 56 subi r28, 0x67 ; 103 30950: df 4f sbci r29, 0xFF ; 255 30952: b9 83 std Y+1, r27 ; 0x01 30954: a8 83 st Y, r26 30956: c9 59 subi r28, 0x99 ; 153 30958: d0 40 sbci r29, 0x00 ; 0 3095a: fe 01 movw r30, r28 3095c: 31 96 adiw r30, 0x01 ; 1 3095e: ac 96 adiw r28, 0x2c ; 44 30960: ff af std Y+63, r31 ; 0x3f 30962: ee af std Y+62, r30 ; 0x3e 30964: 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) { 30966: 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])); 30968: cb 56 subi r28, 0x6B ; 107 3096a: df 4f sbci r29, 0xFF ; 255 3096c: 28 81 ld r18, Y 3096e: 39 81 ldd r19, Y+1 ; 0x01 30970: 4a 81 ldd r20, Y+2 ; 0x02 30972: 5b 81 ldd r21, Y+3 ; 0x03 30974: c5 59 subi r28, 0x95 ; 149 30976: d0 40 sbci r29, 0x00 ; 0 30978: 50 58 subi r21, 0x80 ; 128 3097a: ed 96 adiw r28, 0x3d ; 61 3097c: 2c af std Y+60, r18 ; 0x3c 3097e: 3d af std Y+61, r19 ; 0x3d 30980: 4e af std Y+62, r20 ; 0x3e 30982: 5f af std Y+63, r21 ; 0x3f 30984: 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])); 30986: c7 57 subi r28, 0x77 ; 119 30988: df 4f sbci r29, 0xFF ; 255 3098a: 88 81 ld r24, Y 3098c: 99 81 ldd r25, Y+1 ; 0x01 3098e: aa 81 ldd r26, Y+2 ; 0x02 30990: bb 81 ldd r27, Y+3 ; 0x03 30992: c9 58 subi r28, 0x89 ; 137 30994: d0 40 sbci r29, 0x00 ; 0 30996: b0 58 subi r27, 0x80 ; 128 30998: c3 58 subi r28, 0x83 ; 131 3099a: df 4f sbci r29, 0xFF ; 255 3099c: 88 83 st Y, r24 3099e: 99 83 std Y+1, r25 ; 0x01 309a0: aa 83 std Y+2, r26 ; 0x02 309a2: bb 83 std Y+3, r27 ; 0x03 309a4: cd 57 subi r28, 0x7D ; 125 309a6: 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]) : 309a8: cb 57 subi r28, 0x7B ; 123 309aa: df 4f sbci r29, 0xFF ; 255 309ac: 28 81 ld r18, Y 309ae: 39 81 ldd r19, Y+1 ; 0x01 309b0: 4a 81 ldd r20, Y+2 ; 0x02 309b2: 5b 81 ldd r21, Y+3 ; 0x03 309b4: c5 58 subi r28, 0x85 ; 133 309b6: d0 40 sbci r29, 0x00 ; 0 309b8: 50 58 subi r21, 0x80 ; 128 309ba: cf 57 subi r28, 0x7F ; 127 309bc: df 4f sbci r29, 0xFF ; 255 309be: 28 83 st Y, r18 309c0: 39 83 std Y+1, r19 ; 0x01 309c2: 4a 83 std Y+2, r20 ; 0x02 309c4: 5b 83 std Y+3, r21 ; 0x03 309c6: c1 58 subi r28, 0x81 ; 129 309c8: 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) { 309ca: ac 96 adiw r28, 0x2c ; 44 309cc: 2e ac ldd r2, Y+62 ; 0x3e 309ce: 3f ac ldd r3, Y+63 ; 0x3f 309d0: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 309d2: 10 e0 ldi r17, 0x00 ; 0 309d4: 69 e0 ldi r22, 0x09 ; 9 309d6: 46 2e mov r4, r22 309d8: 63 e1 ldi r22, 0x13 ; 19 309da: 56 2e mov r5, r22 309dc: 74 e0 ldi r23, 0x04 ; 4 309de: 77 2e mov r7, r23 acc = 0; 309e0: c1 2c mov r12, r1 309e2: d1 2c mov r13, r1 309e4: 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) { 309e6: 01 30 cpi r16, 0x01 ; 1 309e8: 11 f4 brne .+4 ; 0x309ee 309ea: 0d 94 21 8f jmp 0x31e42 ; 0x31e42 309ee: 11 30 cpi r17, 0x01 ; 1 309f0: 11 f4 brne .+4 ; 0x309f6 309f2: 0d 94 d3 8e jmp 0x31da6 ; 0x31da6 float a = (r == 0) ? 1.f : 309f6: 00 23 and r16, r16 309f8: 11 f4 brne .+4 ; 0x309fe 309fa: 0d 94 13 8f jmp 0x31e26 ; 0x31e26 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 309fe: 02 30 cpi r16, 0x02 ; 2 30a00: 61 f5 brne .+88 ; 0x30a5a 30a02: d2 01 movw r26, r4 30a04: 11 96 adiw r26, 0x01 ; 1 30a06: 2d 91 ld r18, X+ 30a08: 3d 91 ld r19, X+ 30a0a: 4d 91 ld r20, X+ 30a0c: 5c 91 ld r21, X 30a0e: 14 97 sbiw r26, 0x04 ; 4 30a10: cf 57 subi r28, 0x7F ; 127 30a12: df 4f sbci r29, 0xFF ; 255 30a14: 68 81 ld r22, Y 30a16: 79 81 ldd r23, Y+1 ; 0x01 30a18: 8a 81 ldd r24, Y+2 ; 0x02 30a1a: 9b 81 ldd r25, Y+3 ; 0x03 30a1c: c1 58 subi r28, 0x81 ; 129 30a1e: d0 40 sbci r29, 0x00 ; 0 30a20: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30a24: 4b 01 movw r8, r22 30a26: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 30a28: 11 11 cpse r17, r1 30a2a: 25 c0 rjmp .+74 ; 0x30a76 30a2c: 60 e0 ldi r22, 0x00 ; 0 30a2e: 70 e0 ldi r23, 0x00 ; 0 30a30: 80 e8 ldi r24, 0x80 ; 128 30a32: 9f e3 ldi r25, 0x3F ; 63 30a34: 35 c0 rjmp .+106 ; 0x30aa0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 30a36: 2f 3f cpi r18, 0xFF ; 255 30a38: 09 f0 breq .+2 ; 0x30a3c 30a3a: 98 cb rjmp .-2256 ; 0x3016c ++maxs; 30a3c: 01 96 adiw r24, 0x01 ; 1 30a3e: 96 cb rjmp .-2260 ; 0x3016c /// 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; 30a40: 1f ef ldi r17, 0xFF ; 255 30a42: 2c cd rjmp .-1448 ; 0x3049c 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; 30a44: e5 96 adiw r28, 0x35 ; 53 30a46: bf ad ldd r27, Y+63 ; 0x3f 30a48: e5 97 sbiw r28, 0x35 ; 53 30a4a: a7 96 adiw r28, 0x27 ; 39 30a4c: bf af std Y+63, r27 ; 0x3f 30a4e: a7 97 sbiw r28, 0x27 ; 39 30a50: 0f ce rjmp .-994 ; 0x30670 // 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; 30a52: af 96 adiw r28, 0x2f ; 47 30a54: 1f ae std Y+63, r1 ; 0x3f 30a56: af 97 sbiw r28, 0x2f ; 47 30a58: d8 ce rjmp .-592 ; 0x3080a 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]) : 30a5a: f2 01 movw r30, r4 30a5c: 25 81 ldd r18, Z+5 ; 0x05 30a5e: 36 81 ldd r19, Z+6 ; 0x06 30a60: 47 81 ldd r20, Z+7 ; 0x07 30a62: 50 85 ldd r21, Z+8 ; 0x08 30a64: c3 58 subi r28, 0x83 ; 131 30a66: df 4f sbci r29, 0xFF ; 255 30a68: 68 81 ld r22, Y 30a6a: 79 81 ldd r23, Y+1 ; 0x01 30a6c: 8a 81 ldd r24, Y+2 ; 0x02 30a6e: 9b 81 ldd r25, Y+3 ; 0x03 30a70: cd 57 subi r28, 0x7D ; 125 30a72: d0 40 sbci r29, 0x00 ; 0 30a74: d5 cf rjmp .-86 ; 0x30a20 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 30a76: 12 30 cpi r17, 0x02 ; 2 30a78: 11 f0 breq .+4 ; 0x30a7e 30a7a: 0d 94 14 8e jmp 0x31c28 ; 0x31c28 30a7e: d2 01 movw r26, r4 30a80: 11 96 adiw r26, 0x01 ; 1 30a82: 2d 91 ld r18, X+ 30a84: 3d 91 ld r19, X+ 30a86: 4d 91 ld r20, X+ 30a88: 5c 91 ld r21, X 30a8a: 14 97 sbiw r26, 0x04 ; 4 30a8c: cf 57 subi r28, 0x7F ; 127 30a8e: df 4f sbci r29, 0xFF ; 255 30a90: 68 81 ld r22, Y 30a92: 79 81 ldd r23, Y+1 ; 0x01 30a94: 8a 81 ldd r24, Y+2 ; 0x02 30a96: 9b 81 ldd r25, Y+3 ; 0x03 30a98: c1 58 subi r28, 0x81 ; 129 30a9a: d0 40 sbci r29, 0x00 ; 0 30a9c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 30aa0: 9b 01 movw r18, r22 30aa2: ac 01 movw r20, r24 30aa4: c5 01 movw r24, r10 30aa6: b4 01 movw r22, r8 30aa8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30aac: 9b 01 movw r18, r22 30aae: ac 01 movw r20, r24 30ab0: c7 01 movw r24, r14 30ab2: b6 01 movw r22, r12 30ab4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 30ab8: 6b 01 movw r12, r22 30aba: 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) { 30abc: 01 11 cpse r16, r1 30abe: 0d 94 2b 8f jmp 0x31e56 ; 0x31e56 30ac2: 7a 94 dec r7 30ac4: f8 e0 ldi r31, 0x08 ; 8 30ac6: 4f 0e add r4, r31 30ac8: 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) { 30aca: 71 10 cpse r7, r1 30acc: 8c cf rjmp .-232 ; 0x309e6 (-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; 30ace: d1 01 movw r26, r2 30ad0: cd 92 st X+, r12 30ad2: dd 92 st X+, r13 30ad4: ed 92 st X+, r14 30ad6: fd 92 st X+, r15 30ad8: 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) { 30ada: 1f 5f subi r17, 0xFF ; 255 30adc: 14 30 cpi r17, 0x04 ; 4 30ade: 09 f0 breq .+2 ; 0x30ae2 30ae0: 79 cf rjmp .-270 ; 0x309d4 30ae2: 31 e0 ldi r19, 0x01 ; 1 30ae4: 23 2e mov r2, r19 30ae6: 3d e9 ldi r19, 0x9D ; 157 30ae8: 33 2e mov r3, r19 30aea: e9 e0 ldi r30, 0x09 ; 9 30aec: f3 e1 ldi r31, 0x13 ; 19 30aee: a8 96 adiw r28, 0x28 ; 40 30af0: ff af std Y+63, r31 ; 0x3f 30af2: ee af std Y+62, r30 ; 0x3e 30af4: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 30af6: c3 57 subi r28, 0x73 ; 115 30af8: df 4f sbci r29, 0xFF ; 255 30afa: 18 82 st Y, r1 30afc: cd 58 subi r28, 0x8D ; 141 30afe: d0 40 sbci r29, 0x00 ; 0 30b00: c3 56 subi r28, 0x63 ; 99 30b02: df 4f sbci r29, 0xFF ; 255 30b04: 18 82 st Y, r1 30b06: cd 59 subi r28, 0x9D ; 157 30b08: d0 40 sbci r29, 0x00 ; 0 30b0a: cf 55 subi r28, 0x5F ; 95 30b0c: df 4f sbci r29, 0xFF ; 255 30b0e: 18 82 st Y, r1 30b10: c1 5a subi r28, 0xA1 ; 161 30b12: d0 40 sbci r29, 0x00 ; 0 30b14: 10 e0 ldi r17, 0x00 ; 0 30b16: a8 96 adiw r28, 0x28 ; 40 30b18: ae ad ldd r26, Y+62 ; 0x3e 30b1a: bf ad ldd r27, Y+63 ; 0x3f 30b1c: a8 97 sbiw r28, 0x28 ; 40 30b1e: 11 96 adiw r26, 0x01 ; 1 30b20: 2d 91 ld r18, X+ 30b22: 3d 91 ld r19, X+ 30b24: 4d 91 ld r20, X+ 30b26: 5c 91 ld r21, X 30b28: 14 97 sbiw r26, 0x04 ; 4 30b2a: e4 96 adiw r28, 0x34 ; 52 30b2c: 2c af std Y+60, r18 ; 0x3c 30b2e: 3d af std Y+61, r19 ; 0x3d 30b30: 4e af std Y+62, r20 ; 0x3e 30b32: 5f af std Y+63, r21 ; 0x3f 30b34: e4 97 sbiw r28, 0x34 ; 52 30b36: 15 96 adiw r26, 0x05 ; 5 30b38: 4d 90 ld r4, X+ 30b3a: 5d 90 ld r5, X+ 30b3c: 6d 90 ld r6, X+ 30b3e: 7c 90 ld r7, X 30b40: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 30b42: 00 23 and r16, r16 30b44: 11 f4 brne .+4 ; 0x30b4a 30b46: 0d 94 47 8e jmp 0x31c8e ; 0x31c8e ((r == 1) ? 0.f : 30b4a: 81 2c mov r8, r1 30b4c: 91 2c mov r9, r1 30b4e: 54 01 movw r10, r8 30b50: 01 30 cpi r16, 0x01 ; 1 30b52: 81 f0 breq .+32 ; 0x30b74 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 30b54: 02 30 cpi r16, 0x02 ; 2 30b56: 11 f0 breq .+4 ; 0x30b5c 30b58: 0d 94 3b 8e jmp 0x31c76 ; 0x31c76 30b5c: cf 57 subi r28, 0x7F ; 127 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: c1 58 subi r28, 0x81 ; 129 30b6a: d0 40 sbci r29, 0x00 ; 0 30b6c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30b70: 4b 01 movw r8, r22 30b72: 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); 30b74: e4 96 adiw r28, 0x34 ; 52 30b76: 2c ad ldd r18, Y+60 ; 0x3c 30b78: 3d ad ldd r19, Y+61 ; 0x3d 30b7a: 4e ad ldd r20, Y+62 ; 0x3e 30b7c: 5f ad ldd r21, Y+63 ; 0x3f 30b7e: e4 97 sbiw r28, 0x34 ; 52 30b80: 6e 96 adiw r28, 0x1e ; 30 30b82: 6c ad ldd r22, Y+60 ; 0x3c 30b84: 7d ad ldd r23, Y+61 ; 0x3d 30b86: 8e ad ldd r24, Y+62 ; 0x3e 30b88: 9f ad ldd r25, Y+63 ; 0x3f 30b8a: 6e 97 sbiw r28, 0x1e ; 30 30b8c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30b90: 6b 01 movw r12, r22 30b92: 7c 01 movw r14, r24 30b94: f1 01 movw r30, r2 30b96: 25 91 lpm r18, Z+ 30b98: 35 91 lpm r19, Z+ 30b9a: 45 91 lpm r20, Z+ 30b9c: 54 91 lpm r21, Z 30b9e: cb 55 subi r28, 0x5B ; 91 30ba0: df 4f sbci r29, 0xFF ; 255 30ba2: 28 83 st Y, r18 30ba4: 39 83 std Y+1, r19 ; 0x01 30ba6: 4a 83 std Y+2, r20 ; 0x02 30ba8: 5b 83 std Y+3, r21 ; 0x03 30baa: c5 5a subi r28, 0xA5 ; 165 30bac: d0 40 sbci r29, 0x00 ; 0 30bae: a3 01 movw r20, r6 30bb0: 92 01 movw r18, r4 30bb2: cb 56 subi r28, 0x6B ; 107 30bb4: df 4f sbci r29, 0xFF ; 255 30bb6: 68 81 ld r22, Y 30bb8: 79 81 ldd r23, Y+1 ; 0x01 30bba: 8a 81 ldd r24, Y+2 ; 0x02 30bbc: 9b 81 ldd r25, Y+3 ; 0x03 30bbe: c5 59 subi r28, 0x95 ; 149 30bc0: d0 40 sbci r29, 0x00 ; 0 30bc2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30bc6: 9b 01 movw r18, r22 30bc8: ac 01 movw r20, r24 30bca: c7 01 movw r24, r14 30bcc: b6 01 movw r22, r12 30bce: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 30bd2: c5 55 subi r28, 0x55 ; 85 30bd4: df 4f sbci r29, 0xFF ; 255 30bd6: 28 81 ld r18, Y 30bd8: 39 81 ldd r19, Y+1 ; 0x01 30bda: 4a 81 ldd r20, Y+2 ; 0x02 30bdc: 5b 81 ldd r21, Y+3 ; 0x03 30bde: cb 5a subi r28, 0xAB ; 171 30be0: d0 40 sbci r29, 0x00 ; 0 30be2: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 30be6: cb 55 subi r28, 0x5B ; 91 30be8: df 4f sbci r29, 0xFF ; 255 30bea: 28 81 ld r18, Y 30bec: 39 81 ldd r19, Y+1 ; 0x01 30bee: 4a 81 ldd r20, Y+2 ; 0x02 30bf0: 5b 81 ldd r21, Y+3 ; 0x03 30bf2: c5 5a subi r28, 0xA5 ; 165 30bf4: d0 40 sbci r29, 0x00 ; 0 30bf6: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 30bfa: a5 01 movw r20, r10 30bfc: 94 01 movw r18, r8 30bfe: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30c02: c3 57 subi r28, 0x73 ; 115 30c04: df 4f sbci r29, 0xFF ; 255 30c06: 28 81 ld r18, Y 30c08: cd 58 subi r28, 0x8D ; 141 30c0a: d0 40 sbci r29, 0x00 ; 0 30c0c: c3 56 subi r28, 0x63 ; 99 30c0e: df 4f sbci r29, 0xFF ; 255 30c10: 38 81 ld r19, Y 30c12: cd 59 subi r28, 0x9D ; 157 30c14: d0 40 sbci r29, 0x00 ; 0 30c16: cf 55 subi r28, 0x5F ; 95 30c18: df 4f sbci r29, 0xFF ; 255 30c1a: 48 81 ld r20, Y 30c1c: c1 5a subi r28, 0xA1 ; 161 30c1e: d0 40 sbci r29, 0x00 ; 0 30c20: 51 2f mov r21, r17 30c22: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 30c26: c3 57 subi r28, 0x73 ; 115 30c28: df 4f sbci r29, 0xFF ; 255 30c2a: 68 83 st Y, r22 30c2c: 79 83 std Y+1, r23 ; 0x01 30c2e: 8a 83 std Y+2, r24 ; 0x02 30c30: 9b 83 std Y+3, r25 ; 0x03 30c32: cd 58 subi r28, 0x8D ; 141 30c34: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 30c36: 00 23 and r16, r16 30c38: 11 f4 brne .+4 ; 0x30c3e 30c3a: 0d 94 4f 8e jmp 0x31c9e ; 0x31c9e ((r == 1) ? 1.f : 30c3e: 01 30 cpi r16, 0x01 ; 1 30c40: 11 f4 brne .+4 ; 0x30c46 30c42: 0d 94 54 8e jmp 0x31ca8 ; 0x31ca8 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 30c46: 02 30 cpi r16, 0x02 ; 2 30c48: 61 f0 breq .+24 ; 0x30c62 30c4a: a3 01 movw r20, r6 30c4c: 92 01 movw r18, r4 30c4e: ed 96 adiw r28, 0x3d ; 61 30c50: 6c ad ldd r22, Y+60 ; 0x3c 30c52: 7d ad ldd r23, Y+61 ; 0x3d 30c54: 8e ad ldd r24, Y+62 ; 0x3e 30c56: 9f ad ldd r25, Y+63 ; 0x3f 30c58: ed 97 sbiw r28, 0x3d ; 61 30c5a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30c5e: 6b 01 movw r12, r22 30c60: 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); 30c62: f1 01 movw r30, r2 30c64: 34 96 adiw r30, 0x04 ; 4 30c66: 85 90 lpm r8, Z+ 30c68: 95 90 lpm r9, Z+ 30c6a: a5 90 lpm r10, Z+ 30c6c: b4 90 lpm r11, Z 30c6e: e4 96 adiw r28, 0x34 ; 52 30c70: 2c ad ldd r18, Y+60 ; 0x3c 30c72: 3d ad ldd r19, Y+61 ; 0x3d 30c74: 4e ad ldd r20, Y+62 ; 0x3e 30c76: 5f ad ldd r21, Y+63 ; 0x3f 30c78: e4 97 sbiw r28, 0x34 ; 52 30c7a: cb 57 subi r28, 0x7B ; 123 30c7c: df 4f sbci r29, 0xFF ; 255 30c7e: 68 81 ld r22, Y 30c80: 79 81 ldd r23, Y+1 ; 0x01 30c82: 8a 81 ldd r24, Y+2 ; 0x02 30c84: 9b 81 ldd r25, Y+3 ; 0x03 30c86: c5 58 subi r28, 0x85 ; 133 30c88: d0 40 sbci r29, 0x00 ; 0 30c8a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30c8e: e4 96 adiw r28, 0x34 ; 52 30c90: 6c af std Y+60, r22 ; 0x3c 30c92: 7d af std Y+61, r23 ; 0x3d 30c94: 8e af std Y+62, r24 ; 0x3e 30c96: 9f af std Y+63, r25 ; 0x3f 30c98: e4 97 sbiw r28, 0x34 ; 52 30c9a: a3 01 movw r20, r6 30c9c: 92 01 movw r18, r4 30c9e: c7 57 subi r28, 0x77 ; 119 30ca0: df 4f sbci r29, 0xFF ; 255 30ca2: 68 81 ld r22, Y 30ca4: 79 81 ldd r23, Y+1 ; 0x01 30ca6: 8a 81 ldd r24, Y+2 ; 0x02 30ca8: 9b 81 ldd r25, Y+3 ; 0x03 30caa: c9 58 subi r28, 0x89 ; 137 30cac: d0 40 sbci r29, 0x00 ; 0 30cae: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30cb2: 9b 01 movw r18, r22 30cb4: ac 01 movw r20, r24 30cb6: e4 96 adiw r28, 0x34 ; 52 30cb8: 6c ad ldd r22, Y+60 ; 0x3c 30cba: 7d ad ldd r23, Y+61 ; 0x3d 30cbc: 8e ad ldd r24, Y+62 ; 0x3e 30cbe: 9f ad ldd r25, Y+63 ; 0x3f 30cc0: e4 97 sbiw r28, 0x34 ; 52 30cc2: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 30cc6: c1 55 subi r28, 0x51 ; 81 30cc8: df 4f sbci r29, 0xFF ; 255 30cca: 28 81 ld r18, Y 30ccc: 39 81 ldd r19, Y+1 ; 0x01 30cce: 4a 81 ldd r20, Y+2 ; 0x02 30cd0: 5b 81 ldd r21, Y+3 ; 0x03 30cd2: cf 5a subi r28, 0xAF ; 175 30cd4: d0 40 sbci r29, 0x00 ; 0 30cd6: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 30cda: a5 01 movw r20, r10 30cdc: 94 01 movw r18, r8 30cde: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 30ce2: a7 01 movw r20, r14 30ce4: 96 01 movw r18, r12 30ce6: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30cea: c3 57 subi r28, 0x73 ; 115 30cec: df 4f sbci r29, 0xFF ; 255 30cee: 28 81 ld r18, Y 30cf0: 39 81 ldd r19, Y+1 ; 0x01 30cf2: 4a 81 ldd r20, Y+2 ; 0x02 30cf4: 5b 81 ldd r21, Y+3 ; 0x03 30cf6: cd 58 subi r28, 0x8D ; 141 30cf8: d0 40 sbci r29, 0x00 ; 0 30cfa: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 30cfe: c3 57 subi r28, 0x73 ; 115 30d00: df 4f sbci r29, 0xFF ; 255 30d02: 68 83 st Y, r22 30d04: cd 58 subi r28, 0x8D ; 141 30d06: d0 40 sbci r29, 0x00 ; 0 30d08: c3 56 subi r28, 0x63 ; 99 30d0a: df 4f sbci r29, 0xFF ; 255 30d0c: 78 83 st Y, r23 30d0e: cd 59 subi r28, 0x9D ; 157 30d10: d0 40 sbci r29, 0x00 ; 0 30d12: cf 55 subi r28, 0x5F ; 95 30d14: df 4f sbci r29, 0xFF ; 255 30d16: 88 83 st Y, r24 30d18: c1 5a subi r28, 0xA1 ; 161 30d1a: d0 40 sbci r29, 0x00 ; 0 30d1c: 19 2f mov r17, r25 30d1e: a8 96 adiw r28, 0x28 ; 40 30d20: 4e ad ldd r20, Y+62 ; 0x3e 30d22: 5f ad ldd r21, Y+63 ; 0x3f 30d24: a8 97 sbiw r28, 0x28 ; 40 30d26: 48 5f subi r20, 0xF8 ; 248 30d28: 5f 4f sbci r21, 0xFF ; 255 30d2a: a8 96 adiw r28, 0x28 ; 40 30d2c: 5f af std Y+63, r21 ; 0x3f 30d2e: 4e af std Y+62, r20 ; 0x3e 30d30: a8 97 sbiw r28, 0x28 ; 40 30d32: 58 e0 ldi r21, 0x08 ; 8 30d34: 25 0e add r2, r21 30d36: 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) { 30d38: a9 e2 ldi r26, 0x29 ; 41 30d3a: b3 e1 ldi r27, 0x13 ; 19 30d3c: a8 96 adiw r28, 0x28 ; 40 30d3e: ee ad ldd r30, Y+62 ; 0x3e 30d40: ff ad ldd r31, Y+63 ; 0x3f 30d42: a8 97 sbiw r28, 0x28 ; 40 30d44: ae 17 cp r26, r30 30d46: bf 07 cpc r27, r31 30d48: 09 f0 breq .+2 ; 0x30d4c 30d4a: e5 ce rjmp .-566 ; 0x30b16 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; 30d4c: 90 58 subi r25, 0x80 ; 128 30d4e: c7 56 subi r28, 0x67 ; 103 30d50: df 4f sbci r29, 0xFF ; 255 30d52: a8 81 ld r26, Y 30d54: b9 81 ldd r27, Y+1 ; 0x01 30d56: c9 59 subi r28, 0x99 ; 153 30d58: d0 40 sbci r29, 0x00 ; 0 30d5a: 6d 93 st X+, r22 30d5c: 7d 93 st X+, r23 30d5e: 8d 93 st X+, r24 30d60: 9d 93 st X+, r25 30d62: c7 56 subi r28, 0x67 ; 103 30d64: df 4f sbci r29, 0xFF ; 255 30d66: b9 83 std Y+1, r27 ; 0x01 30d68: a8 83 st Y, r26 30d6a: c9 59 subi r28, 0x99 ; 153 30d6c: 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) { 30d6e: 0f 5f subi r16, 0xFF ; 255 30d70: ac 96 adiw r28, 0x2c ; 44 30d72: ee ad ldd r30, Y+62 ; 0x3e 30d74: ff ad ldd r31, Y+63 ; 0x3f 30d76: ac 97 sbiw r28, 0x2c ; 44 30d78: 70 96 adiw r30, 0x10 ; 16 30d7a: ac 96 adiw r28, 0x2c ; 44 30d7c: ff af std Y+63, r31 ; 0x3f 30d7e: ee af std Y+62, r30 ; 0x3e 30d80: ac 97 sbiw r28, 0x2c ; 44 30d82: 04 30 cpi r16, 0x04 ; 4 30d84: 09 f0 breq .+2 ; 0x30d88 30d86: 21 ce rjmp .-958 ; 0x309ca } // 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]; 30d88: 25 96 adiw r28, 0x05 ; 5 30d8a: 2c ad ldd r18, Y+60 ; 0x3c 30d8c: 3d ad ldd r19, Y+61 ; 0x3d 30d8e: 4e ad ldd r20, Y+62 ; 0x3e 30d90: 5f ad ldd r21, Y+63 ; 0x3f 30d92: 25 97 sbiw r28, 0x05 ; 5 30d94: ae 96 adiw r28, 0x2e ; 46 30d96: 2c af std Y+60, r18 ; 0x3c 30d98: 3d af std Y+61, r19 ; 0x3d 30d9a: 4e af std Y+62, r20 ; 0x3e 30d9c: 5f af std Y+63, r21 ; 0x3f 30d9e: ae 97 sbiw r28, 0x2e ; 46 30da0: 8d 81 ldd r24, Y+5 ; 0x05 30da2: 9e 81 ldd r25, Y+6 ; 0x06 30da4: af 81 ldd r26, Y+7 ; 0x07 30da6: b8 85 ldd r27, Y+8 ; 0x08 30da8: e4 96 adiw r28, 0x34 ; 52 30daa: 8c af std Y+60, r24 ; 0x3c 30dac: 9d af std Y+61, r25 ; 0x3d 30dae: ae af std Y+62, r26 ; 0x3e 30db0: bf af std Y+63, r27 ; 0x3f 30db2: e4 97 sbiw r28, 0x34 ; 52 30db4: 29 85 ldd r18, Y+9 ; 0x09 30db6: 3a 85 ldd r19, Y+10 ; 0x0a 30db8: 4b 85 ldd r20, Y+11 ; 0x0b 30dba: 5c 85 ldd r21, Y+12 ; 0x0c 30dbc: ed 96 adiw r28, 0x3d ; 61 30dbe: 2c af std Y+60, r18 ; 0x3c 30dc0: 3d af std Y+61, r19 ; 0x3d 30dc2: 4e af std Y+62, r20 ; 0x3e 30dc4: 5f af std Y+63, r21 ; 0x3f 30dc6: ed 97 sbiw r28, 0x3d ; 61 30dc8: 8d 85 ldd r24, Y+13 ; 0x0d 30dca: 9e 85 ldd r25, Y+14 ; 0x0e 30dcc: af 85 ldd r26, Y+15 ; 0x0f 30dce: b8 89 ldd r27, Y+16 ; 0x10 30dd0: c3 58 subi r28, 0x83 ; 131 30dd2: df 4f sbci r29, 0xFF ; 255 30dd4: 88 83 st Y, r24 30dd6: 99 83 std Y+1, r25 ; 0x01 30dd8: aa 83 std Y+2, r26 ; 0x02 30dda: bb 83 std Y+3, r27 ; 0x03 30ddc: cd 57 subi r28, 0x7D ; 125 30dde: d0 40 sbci r29, 0x00 ; 0 30de0: 29 81 ldd r18, Y+1 ; 0x01 30de2: 3a 81 ldd r19, Y+2 ; 0x02 30de4: 4b 81 ldd r20, Y+3 ; 0x03 30de6: 5c 81 ldd r21, Y+4 ; 0x04 30de8: cf 57 subi r28, 0x7F ; 127 30dea: df 4f sbci r29, 0xFF ; 255 30dec: 28 83 st Y, r18 30dee: 39 83 std Y+1, r19 ; 0x01 30df0: 4a 83 std Y+2, r20 ; 0x02 30df2: 5b 83 std Y+3, r21 ; 0x03 30df4: c1 58 subi r28, 0x81 ; 129 30df6: 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]; 30df8: 29 96 adiw r28, 0x09 ; 9 30dfa: 8c ad ldd r24, Y+60 ; 0x3c 30dfc: 9d ad ldd r25, Y+61 ; 0x3d 30dfe: ae ad ldd r26, Y+62 ; 0x3e 30e00: bf ad ldd r27, Y+63 ; 0x3f 30e02: 29 97 sbiw r28, 0x09 ; 9 30e04: cb 57 subi r28, 0x7B ; 123 30e06: df 4f sbci r29, 0xFF ; 255 30e08: 88 83 st Y, r24 30e0a: 99 83 std Y+1, r25 ; 0x01 30e0c: aa 83 std Y+2, r26 ; 0x02 30e0e: bb 83 std Y+3, r27 ; 0x03 30e10: c5 58 subi r28, 0x85 ; 133 30e12: d0 40 sbci r29, 0x00 ; 0 30e14: 29 89 ldd r18, Y+17 ; 0x11 30e16: 3a 89 ldd r19, Y+18 ; 0x12 30e18: 4b 89 ldd r20, Y+19 ; 0x13 30e1a: 5c 89 ldd r21, Y+20 ; 0x14 30e1c: c7 57 subi r28, 0x77 ; 119 30e1e: df 4f sbci r29, 0xFF ; 255 30e20: 28 83 st Y, r18 30e22: 39 83 std Y+1, r19 ; 0x01 30e24: 4a 83 std Y+2, r20 ; 0x02 30e26: 5b 83 std Y+3, r21 ; 0x03 30e28: c9 58 subi r28, 0x89 ; 137 30e2a: d0 40 sbci r29, 0x00 ; 0 30e2c: 89 8d ldd r24, Y+25 ; 0x19 30e2e: 9a 8d ldd r25, Y+26 ; 0x1a 30e30: ab 8d ldd r26, Y+27 ; 0x1b 30e32: bc 8d ldd r27, Y+28 ; 0x1c 30e34: cb 56 subi r28, 0x6B ; 107 30e36: df 4f sbci r29, 0xFF ; 255 30e38: 88 83 st Y, r24 30e3a: 99 83 std Y+1, r25 ; 0x01 30e3c: aa 83 std Y+2, r26 ; 0x02 30e3e: bb 83 std Y+3, r27 ; 0x03 30e40: c5 59 subi r28, 0x95 ; 149 30e42: d0 40 sbci r29, 0x00 ; 0 30e44: 2d 8d ldd r18, Y+29 ; 0x1d 30e46: 3e 8d ldd r19, Y+30 ; 0x1e 30e48: 4f 8d ldd r20, Y+31 ; 0x1f 30e4a: 58 a1 ldd r21, Y+32 ; 0x20 30e4c: c7 56 subi r28, 0x67 ; 103 30e4e: df 4f sbci r29, 0xFF ; 255 30e50: 28 83 st Y, r18 30e52: 39 83 std Y+1, r19 ; 0x01 30e54: 4a 83 std Y+2, r20 ; 0x02 30e56: 5b 83 std Y+3, r21 ; 0x03 30e58: c9 59 subi r28, 0x99 ; 153 30e5a: d0 40 sbci r29, 0x00 ; 0 30e5c: 8d 89 ldd r24, Y+21 ; 0x15 30e5e: 9e 89 ldd r25, Y+22 ; 0x16 30e60: af 89 ldd r26, Y+23 ; 0x17 30e62: b8 8d ldd r27, Y+24 ; 0x18 30e64: c3 57 subi r28, 0x73 ; 115 30e66: df 4f sbci r29, 0xFF ; 255 30e68: 88 83 st Y, r24 30e6a: 99 83 std Y+1, r25 ; 0x01 30e6c: aa 83 std Y+2, r26 ; 0x02 30e6e: bb 83 std Y+3, r27 ; 0x03 30e70: cd 58 subi r28, 0x8D ; 141 30e72: 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]; 30e74: 2d 96 adiw r28, 0x0d ; 13 30e76: 2c ad ldd r18, Y+60 ; 0x3c 30e78: 3d ad ldd r19, Y+61 ; 0x3d 30e7a: 4e ad ldd r20, Y+62 ; 0x3e 30e7c: 5f ad ldd r21, Y+63 ; 0x3f 30e7e: 2d 97 sbiw r28, 0x0d ; 13 30e80: c3 56 subi r28, 0x63 ; 99 30e82: df 4f sbci r29, 0xFF ; 255 30e84: 28 83 st Y, r18 30e86: 39 83 std Y+1, r19 ; 0x01 30e88: 4a 83 std Y+2, r20 ; 0x02 30e8a: 5b 83 std Y+3, r21 ; 0x03 30e8c: cd 59 subi r28, 0x9D ; 157 30e8e: d0 40 sbci r29, 0x00 ; 0 30e90: 89 a1 ldd r24, Y+33 ; 0x21 30e92: 9a a1 ldd r25, Y+34 ; 0x22 30e94: ab a1 ldd r26, Y+35 ; 0x23 30e96: bc a1 ldd r27, Y+36 ; 0x24 30e98: cf 55 subi r28, 0x5F ; 95 30e9a: df 4f sbci r29, 0xFF ; 255 30e9c: 88 83 st Y, r24 30e9e: 99 83 std Y+1, r25 ; 0x01 30ea0: aa 83 std Y+2, r26 ; 0x02 30ea2: bb 83 std Y+3, r27 ; 0x03 30ea4: c1 5a subi r28, 0xA1 ; 161 30ea6: d0 40 sbci r29, 0x00 ; 0 30ea8: 2d a1 ldd r18, Y+37 ; 0x25 30eaa: 3e a1 ldd r19, Y+38 ; 0x26 30eac: 4f a1 ldd r20, Y+39 ; 0x27 30eae: 58 a5 ldd r21, Y+40 ; 0x28 30eb0: cb 55 subi r28, 0x5B ; 91 30eb2: df 4f sbci r29, 0xFF ; 255 30eb4: 28 83 st Y, r18 30eb6: 39 83 std Y+1, r19 ; 0x01 30eb8: 4a 83 std Y+2, r20 ; 0x02 30eba: 5b 83 std Y+3, r21 ; 0x03 30ebc: c5 5a subi r28, 0xA5 ; 165 30ebe: d0 40 sbci r29, 0x00 ; 0 30ec0: 8d a5 ldd r24, Y+45 ; 0x2d 30ec2: 9e a5 ldd r25, Y+46 ; 0x2e 30ec4: af a5 ldd r26, Y+47 ; 0x2f 30ec6: b8 a9 ldd r27, Y+48 ; 0x30 30ec8: cd 54 subi r28, 0x4D ; 77 30eca: df 4f sbci r29, 0xFF ; 255 30ecc: 88 83 st Y, r24 30ece: 99 83 std Y+1, r25 ; 0x01 30ed0: aa 83 std Y+2, r26 ; 0x02 30ed2: bb 83 std Y+3, r27 ; 0x03 30ed4: c3 5b subi r28, 0xB3 ; 179 30ed6: d0 40 sbci r29, 0x00 ; 0 30ed8: 29 a5 ldd r18, Y+41 ; 0x29 30eda: 3a a5 ldd r19, Y+42 ; 0x2a 30edc: 4b a5 ldd r20, Y+43 ; 0x2b 30ede: 5c a5 ldd r21, Y+44 ; 0x2c 30ee0: c9 54 subi r28, 0x49 ; 73 30ee2: df 4f sbci r29, 0xFF ; 255 30ee4: 28 83 st Y, r18 30ee6: 39 83 std Y+1, r19 ; 0x01 30ee8: 4a 83 std Y+2, r20 ; 0x02 30eea: 5b 83 std Y+3, r21 ; 0x03 30eec: c7 5b subi r28, 0xB7 ; 183 30eee: 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]; 30ef0: 61 96 adiw r28, 0x11 ; 17 30ef2: 8c ad ldd r24, Y+60 ; 0x3c 30ef4: 9d ad ldd r25, Y+61 ; 0x3d 30ef6: ae ad ldd r26, Y+62 ; 0x3e 30ef8: bf ad ldd r27, Y+63 ; 0x3f 30efa: 61 97 sbiw r28, 0x11 ; 17 30efc: c5 54 subi r28, 0x45 ; 69 30efe: df 4f sbci r29, 0xFF ; 255 30f00: 88 83 st Y, r24 30f02: 99 83 std Y+1, r25 ; 0x01 30f04: aa 83 std Y+2, r26 ; 0x02 30f06: bb 83 std Y+3, r27 ; 0x03 30f08: cb 5b subi r28, 0xBB ; 187 30f0a: d0 40 sbci r29, 0x00 ; 0 30f0c: 29 a9 ldd r18, Y+49 ; 0x31 30f0e: 3a a9 ldd r19, Y+50 ; 0x32 30f10: 4b a9 ldd r20, Y+51 ; 0x33 30f12: 5c a9 ldd r21, Y+52 ; 0x34 30f14: c1 54 subi r28, 0x41 ; 65 30f16: df 4f sbci r29, 0xFF ; 255 30f18: 28 83 st Y, r18 30f1a: 39 83 std Y+1, r19 ; 0x01 30f1c: 4a 83 std Y+2, r20 ; 0x02 30f1e: 5b 83 std Y+3, r21 ; 0x03 30f20: cf 5b subi r28, 0xBF ; 191 30f22: d0 40 sbci r29, 0x00 ; 0 30f24: 8d a9 ldd r24, Y+53 ; 0x35 30f26: 9e a9 ldd r25, Y+54 ; 0x36 30f28: af a9 ldd r26, Y+55 ; 0x37 30f2a: b8 ad ldd r27, Y+56 ; 0x38 30f2c: cd 53 subi r28, 0x3D ; 61 30f2e: df 4f sbci r29, 0xFF ; 255 30f30: 88 83 st Y, r24 30f32: 99 83 std Y+1, r25 ; 0x01 30f34: aa 83 std Y+2, r26 ; 0x02 30f36: bb 83 std Y+3, r27 ; 0x03 30f38: c3 5c subi r28, 0xC3 ; 195 30f3a: d0 40 sbci r29, 0x00 ; 0 30f3c: 29 ad ldd r18, Y+57 ; 0x39 30f3e: 3a ad ldd r19, Y+58 ; 0x3a 30f40: 4b ad ldd r20, Y+59 ; 0x3b 30f42: 5c ad ldd r21, Y+60 ; 0x3c 30f44: c9 53 subi r28, 0x39 ; 57 30f46: df 4f sbci r29, 0xFF ; 255 30f48: 28 83 st Y, r18 30f4a: 39 83 std Y+1, r19 ; 0x01 30f4c: 4a 83 std Y+2, r20 ; 0x02 30f4e: 5b 83 std Y+3, r21 ; 0x03 30f50: c7 5c subi r28, 0xC7 ; 199 30f52: d0 40 sbci r29, 0x00 ; 0 30f54: 21 96 adiw r28, 0x01 ; 1 30f56: 8c ad ldd r24, Y+60 ; 0x3c 30f58: 9d ad ldd r25, Y+61 ; 0x3d 30f5a: ae ad ldd r26, Y+62 ; 0x3e 30f5c: bf ad ldd r27, Y+63 ; 0x3f 30f5e: 21 97 sbiw r28, 0x01 ; 1 30f60: c5 53 subi r28, 0x35 ; 53 30f62: df 4f sbci r29, 0xFF ; 255 30f64: 88 83 st Y, r24 30f66: 99 83 std Y+1, r25 ; 0x01 30f68: aa 83 std Y+2, r26 ; 0x02 30f6a: bb 83 std Y+3, r27 ; 0x03 30f6c: cb 5c subi r28, 0xCB ; 203 30f6e: d0 40 sbci r29, 0x00 ; 0 30f70: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 30f72: c1 2c mov r12, r1 30f74: d1 2c mov r13, r1 30f76: 76 01 movw r14, r12 30f78: 46 01 movw r8, r12 30f7a: 57 01 movw r10, r14 30f7c: 26 01 movw r4, r12 30f7e: 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]; 30f80: a3 01 movw r20, r6 30f82: 92 01 movw r18, r4 30f84: e4 96 adiw r28, 0x34 ; 52 30f86: 6c ad ldd r22, Y+60 ; 0x3c 30f88: 7d ad ldd r23, Y+61 ; 0x3d 30f8a: 8e ad ldd r24, Y+62 ; 0x3e 30f8c: 9f ad ldd r25, Y+63 ; 0x3f 30f8e: e4 97 sbiw r28, 0x34 ; 52 30f90: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30f94: 9b 01 movw r18, r22 30f96: ac 01 movw r20, r24 30f98: ae 96 adiw r28, 0x2e ; 46 30f9a: 6c ad ldd r22, Y+60 ; 0x3c 30f9c: 7d ad ldd r23, Y+61 ; 0x3d 30f9e: 8e ad ldd r24, Y+62 ; 0x3e 30fa0: 9f ad ldd r25, Y+63 ; 0x3f 30fa2: ae 97 sbiw r28, 0x2e ; 46 30fa4: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 30fa8: 2b 01 movw r4, r22 30faa: 3c 01 movw r6, r24 30fac: a5 01 movw r20, r10 30fae: 94 01 movw r18, r8 30fb0: ed 96 adiw r28, 0x3d ; 61 30fb2: 6c ad ldd r22, Y+60 ; 0x3c 30fb4: 7d ad ldd r23, Y+61 ; 0x3d 30fb6: 8e ad ldd r24, Y+62 ; 0x3e 30fb8: 9f ad ldd r25, Y+63 ; 0x3f 30fba: ed 97 sbiw r28, 0x3d ; 61 30fbc: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30fc0: 9b 01 movw r18, r22 30fc2: ac 01 movw r20, r24 30fc4: c3 01 movw r24, r6 30fc6: b2 01 movw r22, r4 30fc8: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 30fcc: 2b 01 movw r4, r22 30fce: 3c 01 movw r6, r24 30fd0: a7 01 movw r20, r14 30fd2: 96 01 movw r18, r12 30fd4: c3 58 subi r28, 0x83 ; 131 30fd6: df 4f sbci r29, 0xFF ; 255 30fd8: 68 81 ld r22, Y 30fda: 79 81 ldd r23, Y+1 ; 0x01 30fdc: 8a 81 ldd r24, Y+2 ; 0x02 30fde: 9b 81 ldd r25, Y+3 ; 0x03 30fe0: cd 57 subi r28, 0x7D ; 125 30fe2: d0 40 sbci r29, 0x00 ; 0 30fe4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 30fe8: 9b 01 movw r18, r22 30fea: ac 01 movw r20, r24 30fec: c3 01 movw r24, r6 30fee: b2 01 movw r22, r4 30ff0: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 30ff4: cf 57 subi r28, 0x7F ; 127 30ff6: df 4f sbci r29, 0xFF ; 255 30ff8: 28 81 ld r18, Y 30ffa: 39 81 ldd r19, Y+1 ; 0x01 30ffc: 4a 81 ldd r20, Y+2 ; 0x02 30ffe: 5b 81 ldd r21, Y+3 ; 0x03 31000: c1 58 subi r28, 0x81 ; 129 31002: d0 40 sbci r29, 0x00 ; 0 31004: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 31008: 6e 96 adiw r28, 0x1e ; 30 3100a: 6c af std Y+60, r22 ; 0x3c 3100c: 7d af std Y+61, r23 ; 0x3d 3100e: 8e af std Y+62, r24 ; 0x3e 31010: 9f af std Y+63, r25 ; 0x3f 31012: 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]; 31014: c7 57 subi r28, 0x77 ; 119 31016: df 4f sbci r29, 0xFF ; 255 31018: 28 81 ld r18, Y 3101a: 39 81 ldd r19, Y+1 ; 0x01 3101c: 4a 81 ldd r20, Y+2 ; 0x02 3101e: 5b 81 ldd r21, Y+3 ; 0x03 31020: c9 58 subi r28, 0x89 ; 137 31022: d0 40 sbci r29, 0x00 ; 0 31024: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31028: 9b 01 movw r18, r22 3102a: ac 01 movw r20, r24 3102c: cb 57 subi r28, 0x7B ; 123 3102e: df 4f sbci r29, 0xFF ; 255 31030: 68 81 ld r22, Y 31032: 79 81 ldd r23, Y+1 ; 0x01 31034: 8a 81 ldd r24, Y+2 ; 0x02 31036: 9b 81 ldd r25, Y+3 ; 0x03 31038: c5 58 subi r28, 0x85 ; 133 3103a: d0 40 sbci r29, 0x00 ; 0 3103c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 31040: 2b 01 movw r4, r22 31042: 3c 01 movw r6, r24 31044: a5 01 movw r20, r10 31046: 94 01 movw r18, r8 31048: cb 56 subi r28, 0x6B ; 107 3104a: df 4f sbci r29, 0xFF ; 255 3104c: 68 81 ld r22, Y 3104e: 79 81 ldd r23, Y+1 ; 0x01 31050: 8a 81 ldd r24, Y+2 ; 0x02 31052: 9b 81 ldd r25, Y+3 ; 0x03 31054: c5 59 subi r28, 0x95 ; 149 31056: d0 40 sbci r29, 0x00 ; 0 31058: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3105c: 9b 01 movw r18, r22 3105e: ac 01 movw r20, r24 31060: c3 01 movw r24, r6 31062: b2 01 movw r22, r4 31064: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 31068: 4b 01 movw r8, r22 3106a: 5c 01 movw r10, r24 3106c: a7 01 movw r20, r14 3106e: 96 01 movw r18, r12 31070: c7 56 subi r28, 0x67 ; 103 31072: df 4f sbci r29, 0xFF ; 255 31074: 68 81 ld r22, Y 31076: 79 81 ldd r23, Y+1 ; 0x01 31078: 8a 81 ldd r24, Y+2 ; 0x02 3107a: 9b 81 ldd r25, Y+3 ; 0x03 3107c: c9 59 subi r28, 0x99 ; 153 3107e: d0 40 sbci r29, 0x00 ; 0 31080: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31084: 9b 01 movw r18, r22 31086: ac 01 movw r20, r24 31088: c5 01 movw r24, r10 3108a: b4 01 movw r22, r8 3108c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 31090: c3 57 subi r28, 0x73 ; 115 31092: df 4f sbci r29, 0xFF ; 255 31094: 28 81 ld r18, Y 31096: 39 81 ldd r19, Y+1 ; 0x01 31098: 4a 81 ldd r20, Y+2 ; 0x02 3109a: 5b 81 ldd r21, Y+3 ; 0x03 3109c: cd 58 subi r28, 0x8D ; 141 3109e: d0 40 sbci r29, 0x00 ; 0 310a0: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 310a4: 2b 01 movw r4, r22 310a6: 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]; 310a8: cf 55 subi r28, 0x5F ; 95 310aa: df 4f sbci r29, 0xFF ; 255 310ac: 28 81 ld r18, Y 310ae: 39 81 ldd r19, Y+1 ; 0x01 310b0: 4a 81 ldd r20, Y+2 ; 0x02 310b2: 5b 81 ldd r21, Y+3 ; 0x03 310b4: c1 5a subi r28, 0xA1 ; 161 310b6: d0 40 sbci r29, 0x00 ; 0 310b8: 6e 96 adiw r28, 0x1e ; 30 310ba: 6c ad ldd r22, Y+60 ; 0x3c 310bc: 7d ad ldd r23, Y+61 ; 0x3d 310be: 8e ad ldd r24, Y+62 ; 0x3e 310c0: 9f ad ldd r25, Y+63 ; 0x3f 310c2: 6e 97 sbiw r28, 0x1e ; 30 310c4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 310c8: 9b 01 movw r18, r22 310ca: ac 01 movw r20, r24 310cc: c3 56 subi r28, 0x63 ; 99 310ce: df 4f sbci r29, 0xFF ; 255 310d0: 68 81 ld r22, Y 310d2: 79 81 ldd r23, Y+1 ; 0x01 310d4: 8a 81 ldd r24, Y+2 ; 0x02 310d6: 9b 81 ldd r25, Y+3 ; 0x03 310d8: cd 59 subi r28, 0x9D ; 157 310da: d0 40 sbci r29, 0x00 ; 0 310dc: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 310e0: 4b 01 movw r8, r22 310e2: 5c 01 movw r10, r24 310e4: cb 55 subi r28, 0x5B ; 91 310e6: df 4f sbci r29, 0xFF ; 255 310e8: 28 81 ld r18, Y 310ea: 39 81 ldd r19, Y+1 ; 0x01 310ec: 4a 81 ldd r20, Y+2 ; 0x02 310ee: 5b 81 ldd r21, Y+3 ; 0x03 310f0: c5 5a subi r28, 0xA5 ; 165 310f2: d0 40 sbci r29, 0x00 ; 0 310f4: c3 01 movw r24, r6 310f6: b2 01 movw r22, r4 310f8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 310fc: 9b 01 movw r18, r22 310fe: ac 01 movw r20, r24 31100: c5 01 movw r24, r10 31102: b4 01 movw r22, r8 31104: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 31108: 4b 01 movw r8, r22 3110a: 5c 01 movw r10, r24 3110c: a7 01 movw r20, r14 3110e: 96 01 movw r18, r12 31110: cd 54 subi r28, 0x4D ; 77 31112: df 4f sbci r29, 0xFF ; 255 31114: 68 81 ld r22, Y 31116: 79 81 ldd r23, Y+1 ; 0x01 31118: 8a 81 ldd r24, Y+2 ; 0x02 3111a: 9b 81 ldd r25, Y+3 ; 0x03 3111c: c3 5b subi r28, 0xB3 ; 179 3111e: d0 40 sbci r29, 0x00 ; 0 31120: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31124: 9b 01 movw r18, r22 31126: ac 01 movw r20, r24 31128: c5 01 movw r24, r10 3112a: b4 01 movw r22, r8 3112c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 31130: c9 54 subi r28, 0x49 ; 73 31132: df 4f sbci r29, 0xFF ; 255 31134: 28 81 ld r18, Y 31136: 39 81 ldd r19, Y+1 ; 0x01 31138: 4a 81 ldd r20, Y+2 ; 0x02 3113a: 5b 81 ldd r21, Y+3 ; 0x03 3113c: c7 5b subi r28, 0xB7 ; 183 3113e: d0 40 sbci r29, 0x00 ; 0 31140: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 31144: 4b 01 movw r8, r22 31146: 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]; 31148: c1 54 subi r28, 0x41 ; 65 3114a: df 4f sbci r29, 0xFF ; 255 3114c: 28 81 ld r18, Y 3114e: 39 81 ldd r19, Y+1 ; 0x01 31150: 4a 81 ldd r20, Y+2 ; 0x02 31152: 5b 81 ldd r21, Y+3 ; 0x03 31154: cf 5b subi r28, 0xBF ; 191 31156: d0 40 sbci r29, 0x00 ; 0 31158: 6e 96 adiw r28, 0x1e ; 30 3115a: 6c ad ldd r22, Y+60 ; 0x3c 3115c: 7d ad ldd r23, Y+61 ; 0x3d 3115e: 8e ad ldd r24, Y+62 ; 0x3e 31160: 9f ad ldd r25, Y+63 ; 0x3f 31162: 6e 97 sbiw r28, 0x1e ; 30 31164: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31168: 9b 01 movw r18, r22 3116a: ac 01 movw r20, r24 3116c: c5 54 subi r28, 0x45 ; 69 3116e: df 4f sbci r29, 0xFF ; 255 31170: 68 81 ld r22, Y 31172: 79 81 ldd r23, Y+1 ; 0x01 31174: 8a 81 ldd r24, Y+2 ; 0x02 31176: 9b 81 ldd r25, Y+3 ; 0x03 31178: cb 5b subi r28, 0xBB ; 187 3117a: d0 40 sbci r29, 0x00 ; 0 3117c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 31180: 6b 01 movw r12, r22 31182: 7c 01 movw r14, r24 31184: cd 53 subi r28, 0x3D ; 61 31186: df 4f sbci r29, 0xFF ; 255 31188: 28 81 ld r18, Y 3118a: 39 81 ldd r19, Y+1 ; 0x01 3118c: 4a 81 ldd r20, Y+2 ; 0x02 3118e: 5b 81 ldd r21, Y+3 ; 0x03 31190: c3 5c subi r28, 0xC3 ; 195 31192: d0 40 sbci r29, 0x00 ; 0 31194: c3 01 movw r24, r6 31196: b2 01 movw r22, r4 31198: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3119c: 9b 01 movw r18, r22 3119e: ac 01 movw r20, r24 311a0: c7 01 movw r24, r14 311a2: b6 01 movw r22, r12 311a4: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 311a8: 6b 01 movw r12, r22 311aa: 7c 01 movw r14, r24 311ac: c9 53 subi r28, 0x39 ; 57 311ae: df 4f sbci r29, 0xFF ; 255 311b0: 28 81 ld r18, Y 311b2: 39 81 ldd r19, Y+1 ; 0x01 311b4: 4a 81 ldd r20, Y+2 ; 0x02 311b6: 5b 81 ldd r21, Y+3 ; 0x03 311b8: c7 5c subi r28, 0xC7 ; 199 311ba: d0 40 sbci r29, 0x00 ; 0 311bc: c5 01 movw r24, r10 311be: b4 01 movw r22, r8 311c0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 311c4: 9b 01 movw r18, r22 311c6: ac 01 movw r20, r24 311c8: c7 01 movw r24, r14 311ca: b6 01 movw r22, r12 311cc: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 311d0: c5 53 subi r28, 0x35 ; 53 311d2: df 4f sbci r29, 0xFF ; 255 311d4: 28 81 ld r18, Y 311d6: 39 81 ldd r19, Y+1 ; 0x01 311d8: 4a 81 ldd r20, Y+2 ; 0x02 311da: 5b 81 ldd r21, Y+3 ; 0x03 311dc: cb 5c subi r28, 0xCB ; 203 311de: d0 40 sbci r29, 0x00 ; 0 311e0: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 311e4: 6b 01 movw r12, r22 311e6: 7c 01 movw r14, r24 311e8: 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) { 311ea: 09 f0 breq .+2 ; 0x311ee 311ec: c9 ce rjmp .-622 ; 0x30f80 // 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]; 311ee: 6e 96 adiw r28, 0x1e ; 30 311f0: 2c ad ldd r18, Y+60 ; 0x3c 311f2: 3d ad ldd r19, Y+61 ; 0x3d 311f4: 4e ad ldd r20, Y+62 ; 0x3e 311f6: 5f ad ldd r21, Y+63 ; 0x3f 311f8: 6e 97 sbiw r28, 0x1e ; 30 311fa: c5 55 subi r28, 0x55 ; 85 311fc: df 4f sbci r29, 0xFF ; 255 311fe: 68 81 ld r22, Y 31200: 79 81 ldd r23, Y+1 ; 0x01 31202: 8a 81 ldd r24, Y+2 ; 0x02 31204: 9b 81 ldd r25, Y+3 ; 0x03 31206: cb 5a subi r28, 0xAB ; 171 31208: d0 40 sbci r29, 0x00 ; 0 3120a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3120e: 60 93 3a 13 sts 0x133A, r22 ; 0x80133a 31212: 70 93 3b 13 sts 0x133B, r23 ; 0x80133b 31216: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c 3121a: 90 93 3d 13 sts 0x133D, r25 ; 0x80133d cntr[1] += h[1]; 3121e: a3 01 movw r20, r6 31220: 92 01 movw r18, r4 31222: c1 55 subi r28, 0x51 ; 81 31224: df 4f sbci r29, 0xFF ; 255 31226: 68 81 ld r22, Y 31228: 79 81 ldd r23, Y+1 ; 0x01 3122a: 8a 81 ldd r24, Y+2 ; 0x02 3122c: 9b 81 ldd r25, Y+3 ; 0x03 3122e: cf 5a subi r28, 0xAF ; 175 31230: d0 40 sbci r29, 0x00 ; 0 31232: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 31236: 60 93 3e 13 sts 0x133E, r22 ; 0x80133e 3123a: 70 93 3f 13 sts 0x133F, r23 ; 0x80133f 3123e: 80 93 40 13 sts 0x1340, r24 ; 0x801340 31242: 90 93 41 13 sts 0x1341, r25 ; 0x801341 a1 += h[2]; 31246: a5 01 movw r20, r10 31248: 94 01 movw r18, r8 3124a: a6 96 adiw r28, 0x26 ; 38 3124c: 6c ad ldd r22, Y+60 ; 0x3c 3124e: 7d ad ldd r23, Y+61 ; 0x3d 31250: 8e ad ldd r24, Y+62 ; 0x3e 31252: 9f ad ldd r25, Y+63 ; 0x3f 31254: a6 97 sbiw r28, 0x26 ; 38 31256: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3125a: a6 96 adiw r28, 0x26 ; 38 3125c: 6c af std Y+60, r22 ; 0x3c 3125e: 7d af std Y+61, r23 ; 0x3d 31260: 8e af std Y+62, r24 ; 0x3e 31262: 9f af std Y+63, r25 ; 0x3f 31264: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 31266: a7 01 movw r20, r14 31268: 96 01 movw r18, r12 3126a: a2 96 adiw r28, 0x22 ; 34 3126c: 6c ad ldd r22, Y+60 ; 0x3c 3126e: 7d ad ldd r23, Y+61 ; 0x3d 31270: 8e ad ldd r24, Y+62 ; 0x3e 31272: 9f ad ldd r25, Y+63 ; 0x3f 31274: a2 97 sbiw r28, 0x22 ; 34 31276: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3127a: a2 96 adiw r28, 0x22 ; 34 3127c: 6c af std Y+60, r22 ; 0x3c 3127e: 7d af std Y+61, r23 ; 0x3d 31280: 8e af std Y+62, r24 ; 0x3e 31282: 9f af std Y+63, r25 ; 0x3f 31284: a2 97 sbiw r28, 0x22 ; 34 31286: e6 96 adiw r28, 0x36 ; 54 31288: 9f ad ldd r25, Y+63 ; 0x3f 3128a: e6 97 sbiw r28, 0x36 ; 54 3128c: 91 50 subi r25, 0x01 ; 1 3128e: e6 96 adiw r28, 0x36 ; 54 31290: 9f af std Y+63, r25 ; 0x3f 31292: 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) { 31294: 91 11 cpse r25, r1 31296: e6 ca rjmp .-2612 ; 0x30864 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 31298: a6 96 adiw r28, 0x26 ; 38 3129a: 6c ad ldd r22, Y+60 ; 0x3c 3129c: 7d ad ldd r23, Y+61 ; 0x3d 3129e: 8e ad ldd r24, Y+62 ; 0x3e 312a0: 9f ad ldd r25, Y+63 ; 0x3f 312a2: a6 97 sbiw r28, 0x26 ; 38 312a4: 0f 94 60 a6 call 0x34cc0 ; 0x34cc0 312a8: 60 93 2a 13 sts 0x132A, r22 ; 0x80132a 312ac: 70 93 2b 13 sts 0x132B, r23 ; 0x80132b 312b0: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 312b4: 90 93 2d 13 sts 0x132D, r25 ; 0x80132d vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 312b8: a6 96 adiw r28, 0x26 ; 38 312ba: 6c ad ldd r22, Y+60 ; 0x3c 312bc: 7d ad ldd r23, Y+61 ; 0x3d 312be: 8e ad ldd r24, Y+62 ; 0x3e 312c0: 9f ad ldd r25, Y+63 ; 0x3f 312c2: a6 97 sbiw r28, 0x26 ; 38 312c4: 0f 94 26 a9 call 0x3524c ; 0x3524c 312c8: 60 93 2e 13 sts 0x132E, r22 ; 0x80132e 312cc: 70 93 2f 13 sts 0x132F, r23 ; 0x80132f 312d0: 80 93 30 13 sts 0x1330, r24 ; 0x801330 312d4: 90 93 31 13 sts 0x1331, r25 ; 0x801331 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 312d8: a2 96 adiw r28, 0x22 ; 34 312da: 6c ad ldd r22, Y+60 ; 0x3c 312dc: 7d ad ldd r23, Y+61 ; 0x3d 312de: 8e ad ldd r24, Y+62 ; 0x3e 312e0: 9f ad ldd r25, Y+63 ; 0x3f 312e2: a2 97 sbiw r28, 0x22 ; 34 312e4: 0f 94 26 a9 call 0x3524c ; 0x3524c 312e8: 90 58 subi r25, 0x80 ; 128 312ea: 60 93 32 13 sts 0x1332, r22 ; 0x801332 312ee: 70 93 33 13 sts 0x1333, r23 ; 0x801333 312f2: 80 93 34 13 sts 0x1334, r24 ; 0x801334 312f6: 90 93 35 13 sts 0x1335, r25 ; 0x801335 vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 312fa: a2 96 adiw r28, 0x22 ; 34 312fc: 6c ad ldd r22, Y+60 ; 0x3c 312fe: 7d ad ldd r23, Y+61 ; 0x3d 31300: 8e ad ldd r24, Y+62 ; 0x3e 31302: 9f ad ldd r25, Y+63 ; 0x3f 31304: a2 97 sbiw r28, 0x22 ; 34 31306: 0f 94 60 a6 call 0x34cc0 ; 0x34cc0 3130a: 60 93 36 13 sts 0x1336, r22 ; 0x801336 3130e: 70 93 37 13 sts 0x1337, r23 ; 0x801337 31312: 80 93 38 13 sts 0x1338, r24 ; 0x801338 31316: 90 93 39 13 sts 0x1339, r25 ; 0x801339 BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 3131a: a6 96 adiw r28, 0x26 ; 38 3131c: 2c ad ldd r18, Y+60 ; 0x3c 3131e: 3d ad ldd r19, Y+61 ; 0x3d 31320: 4e ad ldd r20, Y+62 ; 0x3e 31322: 5f ad ldd r21, Y+63 ; 0x3f 31324: a6 97 sbiw r28, 0x26 ; 38 31326: a2 96 adiw r28, 0x22 ; 34 31328: 6c ad ldd r22, Y+60 ; 0x3c 3132a: 7d ad ldd r23, Y+61 ; 0x3d 3132c: 8e ad ldd r24, Y+62 ; 0x3e 3132e: 9f ad ldd r25, Y+63 ; 0x3f 31330: a2 97 sbiw r28, 0x22 ; 34 31332: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 31336: 4b 01 movw r8, r22 31338: 5c 01 movw r10, r24 3133a: 7c 01 movw r14, r24 3133c: 6b 01 movw r12, r22 3133e: e8 94 clt 31340: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 31342: 21 ee ldi r18, 0xE1 ; 225 31344: 3e e2 ldi r19, 0x2E ; 46 31346: 45 e6 ldi r20, 0x65 ; 101 31348: 52 e4 ldi r21, 0x42 ; 66 3134a: a2 96 adiw r28, 0x22 ; 34 3134c: 6c ad ldd r22, Y+60 ; 0x3c 3134e: 7d ad ldd r23, Y+61 ; 0x3d 31350: 8e ad ldd r24, Y+62 ; 0x3e 31352: 9f ad ldd r25, Y+63 ; 0x3f 31354: a2 97 sbiw r28, 0x22 ; 34 31356: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3135a: 9f 93 push r25 3135c: 8f 93 push r24 3135e: 7f 93 push r23 31360: 6f 93 push r22 31362: 21 ee ldi r18, 0xE1 ; 225 31364: 3e e2 ldi r19, 0x2E ; 46 31366: 45 e6 ldi r20, 0x65 ; 101 31368: 52 e4 ldi r21, 0x42 ; 66 3136a: c5 01 movw r24, r10 3136c: b4 01 movw r22, r8 3136e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31372: 9f 93 push r25 31374: 8f 93 push r24 31376: 7f 93 push r23 31378: 6f 93 push r22 3137a: 89 e0 ldi r24, 0x09 ; 9 3137c: 9c e6 ldi r25, 0x6C ; 108 3137e: 9f 93 push r25 31380: 8f 93 push r24 31382: 0f 94 00 a3 call 0x34600 ; 0x34600 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 31386: b7 01 movw r22, r14 31388: a6 01 movw r20, r12 3138a: 80 e6 ldi r24, 0x60 ; 96 3138c: 9f e0 ldi r25, 0x0F ; 15 3138e: 0f 94 74 a4 call 0x348e8 ; 0x348e8 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) 31392: 0f b6 in r0, 0x3f ; 63 31394: f8 94 cli 31396: de bf out 0x3e, r29 ; 62 31398: 0f be out 0x3f, r0 ; 63 3139a: cd bf out 0x3d, r28 ; 61 3139c: 2f e1 ldi r18, 0x1F ; 31 3139e: 32 e4 ldi r19, 0x42 ; 66 313a0: 49 e0 ldi r20, 0x09 ; 9 313a2: 5b e3 ldi r21, 0x3B ; 59 313a4: c7 01 movw r24, r14 313a6: b6 01 movw r22, r12 313a8: 0f 94 ef a7 call 0x34fde ; 0x34fde <__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; 313ac: 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) 313ae: 18 16 cp r1, r24 313b0: 64 f4 brge .+24 ; 0x313ca result = (angleDiff > bed_skew_angle_extreme) ? 313b2: 25 e3 ldi r18, 0x35 ; 53 313b4: 3a ef ldi r19, 0xFA ; 250 313b6: 4e e8 ldi r20, 0x8E ; 142 313b8: 5b e3 ldi r21, 0x3B ; 59 313ba: c7 01 movw r24, r14 313bc: b6 01 movw r22, r12 313be: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 313c2: 12 e0 ldi r17, 0x02 ; 2 313c4: 18 16 cp r1, r24 313c6: 0c f0 brlt .+2 ; 0x313ca 313c8: 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 || 313ca: 25 e3 ldi r18, 0x35 ; 53 313cc: 3a ef ldi r19, 0xFA ; 250 313ce: 4e e8 ldi r20, 0x8E ; 142 313d0: 5b e3 ldi r21, 0x3B ; 59 313d2: a6 96 adiw r28, 0x26 ; 38 313d4: 6c ad ldd r22, Y+60 ; 0x3c 313d6: 7d ad ldd r23, Y+61 ; 0x3d 313d8: 8e ad ldd r24, Y+62 ; 0x3e 313da: 9f ad ldd r25, Y+63 ; 0x3f 313dc: a6 97 sbiw r28, 0x26 ; 38 313de: 9f 77 andi r25, 0x7F ; 127 313e0: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 313e4: 18 16 cp r1, r24 313e6: 0c f4 brge .+2 ; 0x313ea 313e8: 67 c4 rjmp .+2254 ; 0x31cb8 313ea: 25 e3 ldi r18, 0x35 ; 53 313ec: 3a ef ldi r19, 0xFA ; 250 313ee: 4e e8 ldi r20, 0x8E ; 142 313f0: 5b e3 ldi r21, 0x3B ; 59 313f2: a2 96 adiw r28, 0x22 ; 34 313f4: 6c ad ldd r22, Y+60 ; 0x3c 313f6: 7d ad ldd r23, Y+61 ; 0x3d 313f8: 8e ad ldd r24, Y+62 ; 0x3e 313fa: 9f ad ldd r25, Y+63 ; 0x3f 313fc: a2 97 sbiw r28, 0x22 ; 34 313fe: 9f 77 andi r25, 0x7F ; 127 31400: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 31404: 18 16 cp r1, r24 31406: 0c f4 brge .+2 ; 0x3140a 31408: 57 c4 rjmp .+2222 ; 0x31cb8 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]; 3140a: 20 91 2a 13 lds r18, 0x132A ; 0x80132a 3140e: 30 91 2b 13 lds r19, 0x132B ; 0x80132b 31412: 40 91 2c 13 lds r20, 0x132C ; 0x80132c 31416: 50 91 2d 13 lds r21, 0x132D ; 0x80132d 3141a: ae 96 adiw r28, 0x2e ; 46 3141c: 2c af std Y+60, r18 ; 0x3c 3141e: 3d af std Y+61, r19 ; 0x3d 31420: 4e af std Y+62, r20 ; 0x3e 31422: 5f af std Y+63, r21 ; 0x3f 31424: ae 97 sbiw r28, 0x2e ; 46 31426: 80 91 32 13 lds r24, 0x1332 ; 0x801332 3142a: 90 91 33 13 lds r25, 0x1333 ; 0x801333 3142e: a0 91 34 13 lds r26, 0x1334 ; 0x801334 31432: b0 91 35 13 lds r27, 0x1335 ; 0x801335 31436: e9 96 adiw r28, 0x39 ; 57 31438: 8c af std Y+60, r24 ; 0x3c 3143a: 9d af std Y+61, r25 ; 0x3d 3143c: ae af std Y+62, r26 ; 0x3e 3143e: bf af std Y+63, r27 ; 0x3f 31440: e9 97 sbiw r28, 0x39 ; 57 31442: 20 91 3a 13 lds r18, 0x133A ; 0x80133a 31446: 30 91 3b 13 lds r19, 0x133B ; 0x80133b 3144a: 40 91 3c 13 lds r20, 0x133C ; 0x80133c 3144e: 50 91 3d 13 lds r21, 0x133D ; 0x80133d 31452: e4 96 adiw r28, 0x34 ; 52 31454: 2c af std Y+60, r18 ; 0x3c 31456: 3d af std Y+61, r19 ; 0x3d 31458: 4e af std Y+62, r20 ; 0x3e 3145a: 5f af std Y+63, r21 ; 0x3f 3145c: 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]; 3145e: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 31462: 90 91 2f 13 lds r25, 0x132F ; 0x80132f 31466: a0 91 30 13 lds r26, 0x1330 ; 0x801330 3146a: b0 91 31 13 lds r27, 0x1331 ; 0x801331 3146e: ed 96 adiw r28, 0x3d ; 61 31470: 8c af std Y+60, r24 ; 0x3c 31472: 9d af std Y+61, r25 ; 0x3d 31474: ae af std Y+62, r26 ; 0x3e 31476: bf af std Y+63, r27 ; 0x3f 31478: ed 97 sbiw r28, 0x3d ; 61 3147a: 20 91 36 13 lds r18, 0x1336 ; 0x801336 3147e: 30 91 37 13 lds r19, 0x1337 ; 0x801337 31482: 40 91 38 13 lds r20, 0x1338 ; 0x801338 31486: 50 91 39 13 lds r21, 0x1339 ; 0x801339 3148a: c3 58 subi r28, 0x83 ; 131 3148c: df 4f sbci r29, 0xFF ; 255 3148e: 28 83 st Y, r18 31490: 39 83 std Y+1, r19 ; 0x01 31492: 4a 83 std Y+2, r20 ; 0x02 31494: 5b 83 std Y+3, r21 ; 0x03 31496: cd 57 subi r28, 0x7D ; 125 31498: d0 40 sbci r29, 0x00 ; 0 3149a: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 3149e: 90 91 3f 13 lds r25, 0x133F ; 0x80133f 314a2: a0 91 40 13 lds r26, 0x1340 ; 0x801340 314a6: b0 91 41 13 lds r27, 0x1341 ; 0x801341 314aa: cf 57 subi r28, 0x7F ; 127 314ac: df 4f sbci r29, 0xFF ; 255 314ae: 88 83 st Y, r24 314b0: 99 83 std Y+1, r25 ; 0x01 314b2: aa 83 std Y+2, r26 ; 0x02 314b4: bb 83 std Y+3, r27 ; 0x03 314b6: c1 58 subi r28, 0x81 ; 129 314b8: d0 40 sbci r29, 0x00 ; 0 314ba: a1 e0 ldi r26, 0x01 ; 1 314bc: bd e9 ldi r27, 0x9D ; 157 314be: 6c 96 adiw r28, 0x1c ; 28 314c0: bf af std Y+63, r27 ; 0x3f 314c2: ae af std Y+62, r26 ; 0x3e 314c4: 6c 97 sbiw r28, 0x1c ; 28 314c6: 89 e0 ldi r24, 0x09 ; 9 314c8: 28 2e mov r2, r24 314ca: 83 e1 ldi r24, 0x13 ; 19 314cc: 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]; 314ce: f1 01 movw r30, r2 314d0: c1 80 ldd r12, Z+1 ; 0x01 314d2: d2 80 ldd r13, Z+2 ; 0x02 314d4: e3 80 ldd r14, Z+3 ; 0x03 314d6: f4 80 ldd r15, Z+4 ; 0x04 314d8: 45 80 ldd r4, Z+5 ; 0x05 314da: 56 80 ldd r5, Z+6 ; 0x06 314dc: 67 80 ldd r6, Z+7 ; 0x07 314de: 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; 314e0: 6c 96 adiw r28, 0x1c ; 28 314e2: ee ad ldd r30, Y+62 ; 0x3e 314e4: ff ad ldd r31, Y+63 ; 0x3f 314e6: 6c 97 sbiw r28, 0x1c ; 28 314e8: 25 91 lpm r18, Z+ 314ea: 35 91 lpm r19, Z+ 314ec: 45 91 lpm r20, Z+ 314ee: 54 91 lpm r21, Z 314f0: cb 57 subi r28, 0x7B ; 123 314f2: df 4f sbci r29, 0xFF ; 255 314f4: 28 83 st Y, r18 314f6: 39 83 std Y+1, r19 ; 0x01 314f8: 4a 83 std Y+2, r20 ; 0x02 314fa: 5b 83 std Y+3, r21 ; 0x03 314fc: c5 58 subi r28, 0x85 ; 133 314fe: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 31500: 6c 96 adiw r28, 0x1c ; 28 31502: ee ad ldd r30, Y+62 ; 0x3e 31504: ff ad ldd r31, Y+63 ; 0x3f 31506: 6c 97 sbiw r28, 0x1c ; 28 31508: 34 96 adiw r30, 0x04 ; 4 3150a: 85 90 lpm r8, Z+ 3150c: 95 90 lpm r9, Z+ 3150e: a5 90 lpm r10, Z+ 31510: 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]; 31512: ed 96 adiw r28, 0x3d ; 61 31514: 2c ad ldd r18, Y+60 ; 0x3c 31516: 3d ad ldd r19, Y+61 ; 0x3d 31518: 4e ad ldd r20, Y+62 ; 0x3e 3151a: 5f ad ldd r21, Y+63 ; 0x3f 3151c: ed 97 sbiw r28, 0x3d ; 61 3151e: c7 01 movw r24, r14 31520: b6 01 movw r22, r12 31522: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31526: c7 57 subi r28, 0x77 ; 119 31528: df 4f sbci r29, 0xFF ; 255 3152a: 68 83 st Y, r22 3152c: 79 83 std Y+1, r23 ; 0x01 3152e: 8a 83 std Y+2, r24 ; 0x02 31530: 9b 83 std Y+3, r25 ; 0x03 31532: c9 58 subi r28, 0x89 ; 137 31534: d0 40 sbci r29, 0x00 ; 0 31536: c3 58 subi r28, 0x83 ; 131 31538: df 4f sbci r29, 0xFF ; 255 3153a: 28 81 ld r18, Y 3153c: 39 81 ldd r19, Y+1 ; 0x01 3153e: 4a 81 ldd r20, Y+2 ; 0x02 31540: 5b 81 ldd r21, Y+3 ; 0x03 31542: cd 57 subi r28, 0x7D ; 125 31544: d0 40 sbci r29, 0x00 ; 0 31546: c3 01 movw r24, r6 31548: b2 01 movw r22, r4 3154a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3154e: 9b 01 movw r18, r22 31550: ac 01 movw r20, r24 31552: c7 57 subi r28, 0x77 ; 119 31554: df 4f sbci r29, 0xFF ; 255 31556: 68 81 ld r22, Y 31558: 79 81 ldd r23, Y+1 ; 0x01 3155a: 8a 81 ldd r24, Y+2 ; 0x02 3155c: 9b 81 ldd r25, Y+3 ; 0x03 3155e: c9 58 subi r28, 0x89 ; 137 31560: d0 40 sbci r29, 0x00 ; 0 31562: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 31566: cf 57 subi r28, 0x7F ; 127 31568: df 4f sbci r29, 0xFF ; 255 3156a: 28 81 ld r18, Y 3156c: 39 81 ldd r19, Y+1 ; 0x01 3156e: 4a 81 ldd r20, Y+2 ; 0x02 31570: 5b 81 ldd r21, Y+3 ; 0x03 31572: c1 58 subi r28, 0x81 ; 129 31574: d0 40 sbci r29, 0x00 ; 0 31576: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3157a: 9b 01 movw r18, r22 3157c: 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; 3157e: c5 01 movw r24, r10 31580: b4 01 movw r22, r8 31582: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 31586: 4b 01 movw r8, r22 31588: 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]; 3158a: a7 01 movw r20, r14 3158c: 96 01 movw r18, r12 3158e: ae 96 adiw r28, 0x2e ; 46 31590: 6c ad ldd r22, Y+60 ; 0x3c 31592: 7d ad ldd r23, Y+61 ; 0x3d 31594: 8e ad ldd r24, Y+62 ; 0x3e 31596: 9f ad ldd r25, Y+63 ; 0x3f 31598: ae 97 sbiw r28, 0x2e ; 46 3159a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3159e: 6b 01 movw r12, r22 315a0: 7c 01 movw r14, r24 315a2: a3 01 movw r20, r6 315a4: 92 01 movw r18, r4 315a6: e9 96 adiw r28, 0x39 ; 57 315a8: 6c ad ldd r22, Y+60 ; 0x3c 315aa: 7d ad ldd r23, Y+61 ; 0x3d 315ac: 8e ad ldd r24, Y+62 ; 0x3e 315ae: 9f ad ldd r25, Y+63 ; 0x3f 315b0: e9 97 sbiw r28, 0x39 ; 57 315b2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 315b6: 9b 01 movw r18, r22 315b8: ac 01 movw r20, r24 315ba: c7 01 movw r24, r14 315bc: b6 01 movw r22, r12 315be: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 315c2: e4 96 adiw r28, 0x34 ; 52 315c4: 2c ad ldd r18, Y+60 ; 0x3c 315c6: 3d ad ldd r19, Y+61 ; 0x3d 315c8: 4e ad ldd r20, Y+62 ; 0x3e 315ca: 5f ad ldd r21, Y+63 ; 0x3f 315cc: e4 97 sbiw r28, 0x34 ; 52 315ce: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 315d2: 9b 01 movw r18, r22 315d4: 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; 315d6: cb 57 subi r28, 0x7B ; 123 315d8: df 4f sbci r29, 0xFF ; 255 315da: 68 81 ld r22, Y 315dc: 79 81 ldd r23, Y+1 ; 0x01 315de: 8a 81 ldd r24, Y+2 ; 0x02 315e0: 9b 81 ldd r25, Y+3 ; 0x03 315e2: c5 58 subi r28, 0x85 ; 133 315e4: d0 40 sbci r29, 0x00 ; 0 315e6: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 315ea: a5 01 movw r20, r10 315ec: 94 01 movw r18, r8 315ee: 0f 94 02 a8 call 0x35004 ; 0x35004 } 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) { 315f2: 2d ec ldi r18, 0xCD ; 205 315f4: 3c ec ldi r19, 0xCC ; 204 315f6: 4c e4 ldi r20, 0x4C ; 76 315f8: 5f e3 ldi r21, 0x3F ; 63 315fa: 0f 94 ef a7 call 0x34fde ; 0x34fde <__gesf2> 315fe: 18 16 cp r1, r24 31600: 0c f4 brge .+2 ; 0x31604 result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 31602: 1e ef ldi r17, 0xFE ; 254 31604: 38 e0 ldi r19, 0x08 ; 8 31606: 23 0e add r2, r19 31608: 31 1c adc r3, r1 3160a: 6c 96 adiw r28, 0x1c ; 28 3160c: 4e ad ldd r20, Y+62 ; 0x3e 3160e: 5f ad ldd r21, Y+63 ; 0x3f 31610: 6c 97 sbiw r28, 0x1c ; 28 31612: 48 5f subi r20, 0xF8 ; 248 31614: 5f 4f sbci r21, 0xFF ; 255 31616: 6c 96 adiw r28, 0x1c ; 28 31618: 5f af std Y+63, r21 ; 0x3f 3161a: 4e af std Y+62, r20 ; 0x3e 3161c: 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) { 3161e: a8 96 adiw r28, 0x28 ; 40 31620: 8e ad ldd r24, Y+62 ; 0x3e 31622: 9f ad ldd r25, Y+63 ; 0x3f 31624: a8 97 sbiw r28, 0x28 ; 40 31626: 82 15 cp r24, r2 31628: 93 05 cpc r25, r3 3162a: 09 f0 breq .+2 ; 0x3162e 3162c: 50 cf rjmp .-352 ; 0x314ce MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 3162e: 11 11 cpse r17, r1 31630: 62 c1 rjmp .+708 ; 0x318f6 #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); 31632: a2 96 adiw r28, 0x22 ; 34 31634: 2c ad ldd r18, Y+60 ; 0x3c 31636: 3d ad ldd r19, Y+61 ; 0x3d 31638: 4e ad ldd r20, Y+62 ; 0x3e 3163a: 5f ad ldd r21, Y+63 ; 0x3f 3163c: a2 97 sbiw r28, 0x22 ; 34 3163e: a6 96 adiw r28, 0x26 ; 38 31640: 6c ad ldd r22, Y+60 ; 0x3c 31642: 7d ad ldd r23, Y+61 ; 0x3d 31644: 8e ad ldd r24, Y+62 ; 0x3e 31646: 9f ad ldd r25, Y+63 ; 0x3f 31648: a6 97 sbiw r28, 0x26 ; 38 3164a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3164e: 20 e0 ldi r18, 0x00 ; 0 31650: 30 e0 ldi r19, 0x00 ; 0 31652: 40 e0 ldi r20, 0x00 ; 0 31654: 5f e3 ldi r21, 0x3F ; 63 31656: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3165a: 6b 01 movw r12, r22 3165c: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 3165e: 0f 94 60 a6 call 0x34cc0 ; 0x34cc0 31662: a2 96 adiw r28, 0x22 ; 34 31664: 6c af std Y+60, r22 ; 0x3c 31666: 7d af std Y+61, r23 ; 0x3d 31668: 8e af std Y+62, r24 ; 0x3e 3166a: 9f af std Y+63, r25 ; 0x3f 3166c: a2 97 sbiw r28, 0x22 ; 34 3166e: 60 93 2a 13 sts 0x132A, r22 ; 0x80132a 31672: 70 93 2b 13 sts 0x132B, r23 ; 0x80132b 31676: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 3167a: 90 93 2d 13 sts 0x132D, r25 ; 0x80132d vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 3167e: c7 01 movw r24, r14 31680: b6 01 movw r22, r12 31682: 0f 94 26 a9 call 0x3524c ; 0x3524c 31686: a6 96 adiw r28, 0x26 ; 38 31688: 6c af std Y+60, r22 ; 0x3c 3168a: 7d af std Y+61, r23 ; 0x3d 3168c: 8e af std Y+62, r24 ; 0x3e 3168e: 9f af std Y+63, r25 ; 0x3f 31690: a6 97 sbiw r28, 0x26 ; 38 31692: 60 93 2e 13 sts 0x132E, r22 ; 0x80132e 31696: 70 93 2f 13 sts 0x132F, r23 ; 0x80132f 3169a: 80 93 30 13 sts 0x1330, r24 ; 0x801330 3169e: 90 93 31 13 sts 0x1331, r25 ; 0x801331 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 316a2: 9b 01 movw r18, r22 316a4: ac 01 movw r20, r24 316a6: 50 58 subi r21, 0x80 ; 128 316a8: aa 96 adiw r28, 0x2a ; 42 316aa: 2c af std Y+60, r18 ; 0x3c 316ac: 3d af std Y+61, r19 ; 0x3d 316ae: 4e af std Y+62, r20 ; 0x3e 316b0: 5f af std Y+63, r21 ; 0x3f 316b2: aa 97 sbiw r28, 0x2a ; 42 316b4: 20 93 32 13 sts 0x1332, r18 ; 0x801332 316b8: 30 93 33 13 sts 0x1333, r19 ; 0x801333 316bc: 40 93 34 13 sts 0x1334, r20 ; 0x801334 316c0: 50 93 35 13 sts 0x1335, r21 ; 0x801335 vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 316c4: a2 96 adiw r28, 0x22 ; 34 316c6: 8c ad ldd r24, Y+60 ; 0x3c 316c8: 9d ad ldd r25, Y+61 ; 0x3d 316ca: ae ad ldd r26, Y+62 ; 0x3e 316cc: bf ad ldd r27, Y+63 ; 0x3f 316ce: a2 97 sbiw r28, 0x22 ; 34 316d0: 80 93 36 13 sts 0x1336, r24 ; 0x801336 316d4: 90 93 37 13 sts 0x1337, r25 ; 0x801337 316d8: a0 93 38 13 sts 0x1338, r26 ; 0x801338 316dc: b0 93 39 13 sts 0x1339, r27 ; 0x801339 // Refresh the offset. cntr[0] = 0.f; 316e0: 10 92 3a 13 sts 0x133A, r1 ; 0x80133a 316e4: 10 92 3b 13 sts 0x133B, r1 ; 0x80133b 316e8: 10 92 3c 13 sts 0x133C, r1 ; 0x80133c 316ec: 10 92 3d 13 sts 0x133D, r1 ; 0x80133d cntr[1] = 0.f; 316f0: 10 92 3e 13 sts 0x133E, r1 ; 0x80133e 316f4: 10 92 3f 13 sts 0x133F, r1 ; 0x80133f 316f8: 10 92 40 13 sts 0x1340, r1 ; 0x801340 316fc: 10 92 41 13 sts 0x1341, r1 ; 0x801341 float wx = 0.f; 31700: 41 2c mov r4, r1 31702: 51 2c mov r5, r1 31704: 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]; 31706: cf 56 subi r28, 0x6F ; 111 31708: df 4f sbci r29, 0xFF ; 255 3170a: a8 81 ld r26, Y 3170c: b9 81 ldd r27, Y+1 ; 0x01 3170e: c1 59 subi r28, 0x91 ; 145 31710: d0 40 sbci r29, 0x00 ; 0 31712: 11 96 adiw r26, 0x01 ; 1 31714: 8d 90 ld r8, X+ 31716: 9d 90 ld r9, X+ 31718: ad 90 ld r10, X+ 3171a: bc 90 ld r11, X 3171c: 14 97 sbiw r26, 0x04 ; 4 3171e: 15 96 adiw r26, 0x05 ; 5 31720: 2d 91 ld r18, X+ 31722: 3d 91 ld r19, X+ 31724: 4d 91 ld r20, X+ 31726: 5c 91 ld r21, X 31728: 18 97 sbiw r26, 0x08 ; 8 3172a: 6e 96 adiw r28, 0x1e ; 30 3172c: 2c af std Y+60, r18 ; 0x3c 3172e: 3d af std Y+61, r19 ; 0x3d 31730: 4e af std Y+62, r20 ; 0x3e 31732: 5f af std Y+63, r21 ; 0x3f 31734: 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); 31736: cd 56 subi r28, 0x6D ; 109 31738: df 4f sbci r29, 0xFF ; 255 3173a: e8 81 ld r30, Y 3173c: f9 81 ldd r31, Y+1 ; 0x01 3173e: c3 59 subi r28, 0x93 ; 147 31740: d0 40 sbci r29, 0x00 ; 0 31742: c5 90 lpm r12, Z+ 31744: d5 90 lpm r13, Z+ 31746: e5 90 lpm r14, Z+ 31748: 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]; 3174a: a5 01 movw r20, r10 3174c: 94 01 movw r18, r8 3174e: a2 96 adiw r28, 0x22 ; 34 31750: 6c ad ldd r22, Y+60 ; 0x3c 31752: 7d ad ldd r23, Y+61 ; 0x3d 31754: 8e ad ldd r24, Y+62 ; 0x3e 31756: 9f ad ldd r25, Y+63 ; 0x3f 31758: a2 97 sbiw r28, 0x22 ; 34 3175a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3175e: ae 96 adiw r28, 0x2e ; 46 31760: 6c af std Y+60, r22 ; 0x3c 31762: 7d af std Y+61, r23 ; 0x3d 31764: 8e af std Y+62, r24 ; 0x3e 31766: 9f af std Y+63, r25 ; 0x3f 31768: ae 97 sbiw r28, 0x2e ; 46 3176a: 6e 96 adiw r28, 0x1e ; 30 3176c: 2c ad ldd r18, Y+60 ; 0x3c 3176e: 3d ad ldd r19, Y+61 ; 0x3d 31770: 4e ad ldd r20, Y+62 ; 0x3e 31772: 5f ad ldd r21, Y+63 ; 0x3f 31774: 6e 97 sbiw r28, 0x1e ; 30 31776: aa 96 adiw r28, 0x2a ; 42 31778: 6c ad ldd r22, Y+60 ; 0x3c 3177a: 7d ad ldd r23, Y+61 ; 0x3d 3177c: 8e ad ldd r24, Y+62 ; 0x3e 3177e: 9f ad ldd r25, Y+63 ; 0x3f 31780: aa 97 sbiw r28, 0x2a ; 42 31782: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31786: 9b 01 movw r18, r22 31788: ac 01 movw r20, r24 3178a: ae 96 adiw r28, 0x2e ; 46 3178c: 6c ad ldd r22, Y+60 ; 0x3c 3178e: 7d ad ldd r23, Y+61 ; 0x3d 31790: 8e ad ldd r24, Y+62 ; 0x3e 31792: 9f ad ldd r25, Y+63 ; 0x3f 31794: ae 97 sbiw r28, 0x2e ; 46 31796: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3179a: 9b 01 movw r18, r22 3179c: 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); 3179e: c7 01 movw r24, r14 317a0: b6 01 movw r22, r12 317a2: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 317a6: 20 91 3a 13 lds r18, 0x133A ; 0x80133a 317aa: 30 91 3b 13 lds r19, 0x133B ; 0x80133b 317ae: 40 91 3c 13 lds r20, 0x133C ; 0x80133c 317b2: 50 91 3d 13 lds r21, 0x133D ; 0x80133d 317b6: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 317ba: 6b 01 movw r12, r22 317bc: 7c 01 movw r14, r24 317be: c0 92 3a 13 sts 0x133A, r12 ; 0x80133a 317c2: d0 92 3b 13 sts 0x133B, r13 ; 0x80133b 317c6: e0 92 3c 13 sts 0x133C, r14 ; 0x80133c 317ca: f0 92 3d 13 sts 0x133D, r15 ; 0x80133d wx += w; 317ce: 20 e0 ldi r18, 0x00 ; 0 317d0: 30 e0 ldi r19, 0x00 ; 0 317d2: 40 e8 ldi r20, 0x80 ; 128 317d4: 5f e3 ldi r21, 0x3F ; 63 317d6: c3 01 movw r24, r6 317d8: b2 01 movw r22, r4 317da: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 317de: 2b 01 movw r4, r22 317e0: 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); 317e2: cd 56 subi r28, 0x6D ; 109 317e4: df 4f sbci r29, 0xFF ; 255 317e6: e8 81 ld r30, Y 317e8: f9 81 ldd r31, Y+1 ; 0x01 317ea: c3 59 subi r28, 0x93 ; 147 317ec: d0 40 sbci r29, 0x00 ; 0 317ee: 34 96 adiw r30, 0x04 ; 4 317f0: 25 91 lpm r18, Z+ 317f2: 35 91 lpm r19, Z+ 317f4: 45 91 lpm r20, Z+ 317f6: 54 91 lpm r21, Z 317f8: ae 96 adiw r28, 0x2e ; 46 317fa: 2c af std Y+60, r18 ; 0x3c 317fc: 3d af std Y+61, r19 ; 0x3d 317fe: 4e af std Y+62, r20 ; 0x3e 31800: 5f af std Y+63, r21 ; 0x3f 31802: 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]; 31804: a5 01 movw r20, r10 31806: 94 01 movw r18, r8 31808: a6 96 adiw r28, 0x26 ; 38 3180a: 6c ad ldd r22, Y+60 ; 0x3c 3180c: 7d ad ldd r23, Y+61 ; 0x3d 3180e: 8e ad ldd r24, Y+62 ; 0x3e 31810: 9f ad ldd r25, Y+63 ; 0x3f 31812: a6 97 sbiw r28, 0x26 ; 38 31814: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31818: 4b 01 movw r8, r22 3181a: 5c 01 movw r10, r24 3181c: 6e 96 adiw r28, 0x1e ; 30 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: 6e 97 sbiw r28, 0x1e ; 30 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 0b 9f call 0x33e16 ; 0x33e16 <__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 66 a5 call 0x34acc ; 0x34acc <__addsf3> 31844: 9b 01 movw r18, r22 31846: 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); 31848: ae 96 adiw r28, 0x2e ; 46 3184a: 6c ad ldd r22, Y+60 ; 0x3c 3184c: 7d ad ldd r23, Y+61 ; 0x3d 3184e: 8e ad ldd r24, Y+62 ; 0x3e 31850: 9f ad ldd r25, Y+63 ; 0x3f 31852: ae 97 sbiw r28, 0x2e ; 46 31854: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 31858: 20 91 3e 13 lds r18, 0x133E ; 0x80133e 3185c: 30 91 3f 13 lds r19, 0x133F ; 0x80133f 31860: 40 91 40 13 lds r20, 0x1340 ; 0x801340 31864: 50 91 41 13 lds r21, 0x1341 ; 0x801341 31868: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3186c: 4b 01 movw r8, r22 3186e: 5c 01 movw r10, r24 31870: 80 92 3e 13 sts 0x133E, r8 ; 0x80133e 31874: 90 92 3f 13 sts 0x133F, r9 ; 0x80133f 31878: a0 92 40 13 sts 0x1340, r10 ; 0x801340 3187c: b0 92 41 13 sts 0x1341, r11 ; 0x801341 31880: cf 56 subi r28, 0x6F ; 111 31882: df 4f sbci r29, 0xFF ; 255 31884: 48 81 ld r20, Y 31886: 59 81 ldd r21, Y+1 ; 0x01 31888: c1 59 subi r28, 0x91 ; 145 3188a: d0 40 sbci r29, 0x00 ; 0 3188c: 48 5f subi r20, 0xF8 ; 248 3188e: 5f 4f sbci r21, 0xFF ; 255 31890: cf 56 subi r28, 0x6F ; 111 31892: df 4f sbci r29, 0xFF ; 255 31894: 59 83 std Y+1, r21 ; 0x01 31896: 48 83 st Y, r20 31898: c1 59 subi r28, 0x91 ; 145 3189a: d0 40 sbci r29, 0x00 ; 0 3189c: cd 56 subi r28, 0x6D ; 109 3189e: df 4f sbci r29, 0xFF ; 255 318a0: 88 81 ld r24, Y 318a2: 99 81 ldd r25, Y+1 ; 0x01 318a4: c3 59 subi r28, 0x93 ; 147 318a6: d0 40 sbci r29, 0x00 ; 0 318a8: 08 96 adiw r24, 0x08 ; 8 318aa: cd 56 subi r28, 0x6D ; 109 318ac: df 4f sbci r29, 0xFF ; 255 318ae: 99 83 std Y+1, r25 ; 0x01 318b0: 88 83 st Y, r24 318b2: c3 59 subi r28, 0x93 ; 147 318b4: 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) { 318b6: 24 16 cp r2, r20 318b8: 35 06 cpc r3, r21 318ba: 09 f0 breq .+2 ; 0x318be 318bc: 24 cf rjmp .-440 ; 0x31706 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 318be: a3 01 movw r20, r6 318c0: 92 01 movw r18, r4 318c2: c7 01 movw r24, r14 318c4: b6 01 movw r22, r12 318c6: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 318ca: 60 93 3a 13 sts 0x133A, r22 ; 0x80133a 318ce: 70 93 3b 13 sts 0x133B, r23 ; 0x80133b 318d2: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c 318d6: 90 93 3d 13 sts 0x133D, r25 ; 0x80133d cntr[1] /= wy; 318da: a3 01 movw r20, r6 318dc: 92 01 movw r18, r4 318de: c5 01 movw r24, r10 318e0: b4 01 movw r22, r8 318e2: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 318e6: 60 93 3e 13 sts 0x133E, r22 ; 0x80133e 318ea: 70 93 3f 13 sts 0x133F, r23 ; 0x80133f 318ee: 80 93 40 13 sts 0x1340, r24 ; 0x801340 318f2: 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]; 318f6: 40 90 2a 13 lds r4, 0x132A ; 0x80132a 318fa: 50 90 2b 13 lds r5, 0x132B ; 0x80132b 318fe: 60 90 2c 13 lds r6, 0x132C ; 0x80132c 31902: 70 90 2d 13 lds r7, 0x132D ; 0x80132d 31906: c0 90 36 13 lds r12, 0x1336 ; 0x801336 3190a: d0 90 37 13 lds r13, 0x1337 ; 0x801337 3190e: e0 90 38 13 lds r14, 0x1338 ; 0x801338 31912: f0 90 39 13 lds r15, 0x1339 ; 0x801339 31916: 20 91 2e 13 lds r18, 0x132E ; 0x80132e 3191a: 30 91 2f 13 lds r19, 0x132F ; 0x80132f 3191e: 40 91 30 13 lds r20, 0x1330 ; 0x801330 31922: 50 91 31 13 lds r21, 0x1331 ; 0x801331 31926: a2 96 adiw r28, 0x22 ; 34 31928: 2c af std Y+60, r18 ; 0x3c 3192a: 3d af std Y+61, r19 ; 0x3d 3192c: 4e af std Y+62, r20 ; 0x3e 3192e: 5f af std Y+63, r21 ; 0x3f 31930: a2 97 sbiw r28, 0x22 ; 34 31932: 80 91 32 13 lds r24, 0x1332 ; 0x801332 31936: 90 91 33 13 lds r25, 0x1333 ; 0x801333 3193a: a0 91 34 13 lds r26, 0x1334 ; 0x801334 3193e: b0 91 35 13 lds r27, 0x1335 ; 0x801335 31942: a6 96 adiw r28, 0x26 ; 38 31944: 8c af std Y+60, r24 ; 0x3c 31946: 9d af std Y+61, r25 ; 0x3d 31948: ae af std Y+62, r26 ; 0x3e 3194a: bf af std Y+63, r27 ; 0x3f 3194c: a6 97 sbiw r28, 0x26 ; 38 3194e: a7 01 movw r20, r14 31950: 96 01 movw r18, r12 31952: c3 01 movw r24, r6 31954: b2 01 movw r22, r4 31956: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3195a: 4b 01 movw r8, r22 3195c: 5c 01 movw r10, r24 3195e: a6 96 adiw r28, 0x26 ; 38 31960: 2c ad ldd r18, Y+60 ; 0x3c 31962: 3d ad ldd r19, Y+61 ; 0x3d 31964: 4e ad ldd r20, Y+62 ; 0x3e 31966: 5f ad ldd r21, Y+63 ; 0x3f 31968: a6 97 sbiw r28, 0x26 ; 38 3196a: a2 96 adiw r28, 0x22 ; 34 3196c: 6c ad ldd r22, Y+60 ; 0x3c 3196e: 7d ad ldd r23, Y+61 ; 0x3d 31970: 8e ad ldd r24, Y+62 ; 0x3e 31972: 9f ad ldd r25, Y+63 ; 0x3f 31974: a2 97 sbiw r28, 0x22 ; 34 31976: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3197a: 9b 01 movw r18, r22 3197c: ac 01 movw r20, r24 3197e: c5 01 movw r24, r10 31980: b4 01 movw r22, r8 31982: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 31986: 4b 01 movw r8, r22 31988: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 3198a: ac 01 movw r20, r24 3198c: 9b 01 movw r18, r22 3198e: c7 01 movw r24, r14 31990: b6 01 movw r22, r12 31992: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 31996: 6b 01 movw r12, r22 31998: 7c 01 movw r14, r24 3199a: a6 96 adiw r28, 0x26 ; 38 3199c: 6c ad ldd r22, Y+60 ; 0x3c 3199e: 7d ad ldd r23, Y+61 ; 0x3d 319a0: 8e ad ldd r24, Y+62 ; 0x3e 319a2: 9f ad ldd r25, Y+63 ; 0x3f 319a4: a6 97 sbiw r28, 0x26 ; 38 319a6: 90 58 subi r25, 0x80 ; 128 319a8: a5 01 movw r20, r10 319aa: 94 01 movw r18, r8 319ac: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 319b0: a6 96 adiw r28, 0x26 ; 38 319b2: 6c af std Y+60, r22 ; 0x3c 319b4: 7d af std Y+61, r23 ; 0x3d 319b6: 8e af std Y+62, r24 ; 0x3e 319b8: 9f af std Y+63, r25 ; 0x3f 319ba: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 319bc: a2 96 adiw r28, 0x22 ; 34 319be: 6c ad ldd r22, Y+60 ; 0x3c 319c0: 7d ad ldd r23, Y+61 ; 0x3d 319c2: 8e ad ldd r24, Y+62 ; 0x3e 319c4: 9f ad ldd r25, Y+63 ; 0x3f 319c6: a2 97 sbiw r28, 0x22 ; 34 319c8: 90 58 subi r25, 0x80 ; 128 319ca: a5 01 movw r20, r10 319cc: 94 01 movw r18, r8 319ce: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 319d2: aa 96 adiw r28, 0x2a ; 42 319d4: 6c af std Y+60, r22 ; 0x3c 319d6: 7d af std Y+61, r23 ; 0x3d 319d8: 8e af std Y+62, r24 ; 0x3e 319da: 9f af std Y+63, r25 ; 0x3f 319dc: aa 97 sbiw r28, 0x2a ; 42 319de: a5 01 movw r20, r10 319e0: 94 01 movw r18, r8 319e2: c3 01 movw r24, r6 319e4: b2 01 movw r22, r4 319e6: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 319ea: 4b 01 movw r8, r22 319ec: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 319ee: 40 90 3a 13 lds r4, 0x133A ; 0x80133a 319f2: 50 90 3b 13 lds r5, 0x133B ; 0x80133b 319f6: 60 90 3c 13 lds r6, 0x133C ; 0x80133c 319fa: 70 90 3d 13 lds r7, 0x133D ; 0x80133d 319fe: 20 91 3e 13 lds r18, 0x133E ; 0x80133e 31a02: 30 91 3f 13 lds r19, 0x133F ; 0x80133f 31a06: 40 91 40 13 lds r20, 0x1340 ; 0x801340 31a0a: 50 91 41 13 lds r21, 0x1341 ; 0x801341 31a0e: a2 96 adiw r28, 0x22 ; 34 31a10: 2c af std Y+60, r18 ; 0x3c 31a12: 3d af std Y+61, r19 ; 0x3d 31a14: 4e af std Y+62, r20 ; 0x3e 31a16: 5f af std Y+63, r21 ; 0x3f 31a18: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 31a1a: c0 92 2a 13 sts 0x132A, r12 ; 0x80132a 31a1e: d0 92 2b 13 sts 0x132B, r13 ; 0x80132b 31a22: e0 92 2c 13 sts 0x132C, r14 ; 0x80132c 31a26: f0 92 2d 13 sts 0x132D, r15 ; 0x80132d vec_x[1] = Ainv[1][0]; 31a2a: aa 96 adiw r28, 0x2a ; 42 31a2c: 8c ad ldd r24, Y+60 ; 0x3c 31a2e: 9d ad ldd r25, Y+61 ; 0x3d 31a30: ae ad ldd r26, Y+62 ; 0x3e 31a32: bf ad ldd r27, Y+63 ; 0x3f 31a34: aa 97 sbiw r28, 0x2a ; 42 31a36: 80 93 2e 13 sts 0x132E, r24 ; 0x80132e 31a3a: 90 93 2f 13 sts 0x132F, r25 ; 0x80132f 31a3e: a0 93 30 13 sts 0x1330, r26 ; 0x801330 31a42: b0 93 31 13 sts 0x1331, r27 ; 0x801331 vec_y[0] = Ainv[0][1]; 31a46: a6 96 adiw r28, 0x26 ; 38 31a48: 2c ad ldd r18, Y+60 ; 0x3c 31a4a: 3d ad ldd r19, Y+61 ; 0x3d 31a4c: 4e ad ldd r20, Y+62 ; 0x3e 31a4e: 5f ad ldd r21, Y+63 ; 0x3f 31a50: a6 97 sbiw r28, 0x26 ; 38 31a52: 20 93 32 13 sts 0x1332, r18 ; 0x801332 31a56: 30 93 33 13 sts 0x1333, r19 ; 0x801333 31a5a: 40 93 34 13 sts 0x1334, r20 ; 0x801334 31a5e: 50 93 35 13 sts 0x1335, r21 ; 0x801335 vec_y[1] = Ainv[1][1]; 31a62: 80 92 36 13 sts 0x1336, r8 ; 0x801336 31a66: 90 92 37 13 sts 0x1337, r9 ; 0x801337 31a6a: a0 92 38 13 sts 0x1338, r10 ; 0x801338 31a6e: 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], 31a72: c7 01 movw r24, r14 31a74: b6 01 movw r22, r12 31a76: 90 58 subi r25, 0x80 ; 128 31a78: a3 01 movw r20, r6 31a7a: 92 01 movw r18, r4 31a7c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31a80: 6b 01 movw r12, r22 31a82: 7c 01 movw r14, r24 31a84: a2 96 adiw r28, 0x22 ; 34 31a86: 2c ad ldd r18, Y+60 ; 0x3c 31a88: 3d ad ldd r19, Y+61 ; 0x3d 31a8a: 4e ad ldd r20, Y+62 ; 0x3e 31a8c: 5f ad ldd r21, Y+63 ; 0x3f 31a8e: a2 97 sbiw r28, 0x22 ; 34 31a90: a6 96 adiw r28, 0x26 ; 38 31a92: 6c ad ldd r22, Y+60 ; 0x3c 31a94: 7d ad ldd r23, Y+61 ; 0x3d 31a96: 8e ad ldd r24, Y+62 ; 0x3e 31a98: 9f ad ldd r25, Y+63 ; 0x3f 31a9a: a6 97 sbiw r28, 0x26 ; 38 31a9c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31aa0: 9b 01 movw r18, r22 31aa2: ac 01 movw r20, r24 31aa4: c7 01 movw r24, r14 31aa6: b6 01 movw r22, r12 31aa8: 0f 94 65 a5 call 0x34aca ; 0x34aca <__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]; 31aac: 60 93 3a 13 sts 0x133A, r22 ; 0x80133a 31ab0: 70 93 3b 13 sts 0x133B, r23 ; 0x80133b 31ab4: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c 31ab8: 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] 31abc: aa 96 adiw r28, 0x2a ; 42 31abe: 6c ad ldd r22, Y+60 ; 0x3c 31ac0: 7d ad ldd r23, Y+61 ; 0x3d 31ac2: 8e ad ldd r24, Y+62 ; 0x3e 31ac4: 9f ad ldd r25, Y+63 ; 0x3f 31ac6: aa 97 sbiw r28, 0x2a ; 42 31ac8: 90 58 subi r25, 0x80 ; 128 31aca: a3 01 movw r20, r6 31acc: 92 01 movw r18, r4 31ace: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31ad2: 6b 01 movw r12, r22 31ad4: 7c 01 movw r14, r24 31ad6: a2 96 adiw r28, 0x22 ; 34 31ad8: 2c ad ldd r18, Y+60 ; 0x3c 31ada: 3d ad ldd r19, Y+61 ; 0x3d 31adc: 4e ad ldd r20, Y+62 ; 0x3e 31ade: 5f ad ldd r21, Y+63 ; 0x3f 31ae0: a2 97 sbiw r28, 0x22 ; 34 31ae2: c5 01 movw r24, r10 31ae4: b4 01 movw r22, r8 31ae6: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31aea: 9b 01 movw r18, r22 31aec: ac 01 movw r20, r24 31aee: c7 01 movw r24, r14 31af0: b6 01 movw r22, r12 31af2: 0f 94 65 a5 call 0x34aca ; 0x34aca <__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]; 31af6: 60 93 3e 13 sts 0x133E, r22 ; 0x80133e 31afa: 70 93 3f 13 sts 0x133F, r23 ; 0x80133f 31afe: 80 93 40 13 sts 0x1340, r24 ; 0x801340 31b02: 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 31b06: 90 e0 ldi r25, 0x00 ; 0 31b08: 80 e0 ldi r24, 0x00 ; 0 31b0a: 0e 94 0a 8d call 0x11a14 ; 0x11a14 if (result >= 0) { 31b0e: 17 fd sbrc r17, 7 31b10: d5 c0 rjmp .+426 ; 0x31cbc DBG(_n("Calibration success.\n")); 31b12: 87 e4 ldi r24, 0x47 ; 71 31b14: 9c e6 ldi r25, 0x6C ; 108 31b16: 9f 93 push r25 31b18: 8f 93 push r24 31b1a: 0f 94 00 a3 call 0x34600 ; 0x34600 world2machine_update(vec_x, vec_y, cntr); 31b1e: 4a e3 ldi r20, 0x3A ; 58 31b20: 53 e1 ldi r21, 0x13 ; 19 31b22: 62 e3 ldi r22, 0x32 ; 50 31b24: 73 e1 ldi r23, 0x13 ; 19 31b26: 8a e2 ldi r24, 0x2A ; 42 31b28: 93 e1 ldi r25, 0x13 ; 19 31b2a: 0e 94 d8 5f call 0xbfb0 ; 0xbfb0 #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); 31b2e: 48 e0 ldi r20, 0x08 ; 8 31b30: 50 e0 ldi r21, 0x00 ; 0 31b32: 65 ee ldi r22, 0xE5 ; 229 31b34: 7f e0 ldi r23, 0x0F ; 15 31b36: 8a e3 ldi r24, 0x3A ; 58 31b38: 93 e1 ldi r25, 0x13 ; 19 31b3a: 0f 94 52 a4 call 0x348a4 ; 0x348a4 31b3e: 48 e0 ldi r20, 0x08 ; 8 31b40: 50 e0 ldi r21, 0x00 ; 0 31b42: 6d ed ldi r22, 0xDD ; 221 31b44: 7f e0 ldi r23, 0x0F ; 15 31b46: 8a e2 ldi r24, 0x2A ; 42 31b48: 93 e1 ldi r25, 0x13 ; 19 31b4a: 0f 94 52 a4 call 0x348a4 ; 0x348a4 31b4e: 48 e0 ldi r20, 0x08 ; 8 31b50: 50 e0 ldi r21, 0x00 ; 0 31b52: 65 ed ldi r22, 0xD5 ; 213 31b54: 7f e0 ldi r23, 0x0F ; 15 31b56: 82 e3 ldi r24, 0x32 ; 50 31b58: 93 e1 ldi r25, 0x13 ; 19 31b5a: 0f 94 52 a4 call 0x348a4 ; 0x348a4 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(); 31b5e: 0e 94 5d 5f call 0xbeba ; 0xbeba } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 31b62: 0f 90 pop r0 31b64: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 31b66: c7 55 subi r28, 0x57 ; 87 31b68: df 4f sbci r29, 0xFF ; 255 31b6a: 88 81 ld r24, Y 31b6c: 99 81 ldd r25, Y+1 ; 0x01 31b6e: c9 5a subi r28, 0xA9 ; 169 31b70: d0 40 sbci r29, 0x00 ; 0 31b72: 0e 94 a7 65 call 0xcb4e ; 0xcb4e // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31b76: 80 e0 ldi r24, 0x00 ; 0 31b78: 90 e0 ldi r25, 0x00 ; 0 31b7a: a0 ea ldi r26, 0xA0 ; 160 31b7c: b0 e4 ldi r27, 0x40 ; 64 31b7e: 80 93 69 12 sts 0x1269, r24 ; 0x801269 31b82: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 31b86: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 31b8a: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 31b8e: 60 e0 ldi r22, 0x00 ; 0 31b90: 70 e0 ldi r23, 0x00 ; 0 31b92: 80 ea ldi r24, 0xA0 ; 160 31b94: 91 e4 ldi r25, 0x41 ; 65 31b96: 0f 94 a8 49 call 0x29350 ; 0x29350 st_synchronize(); 31b9a: 0f 94 5b 18 call 0x230b6 ; 0x230b6 //#ifndef NEW_XYZCAL if (result >= 0) 31b9e: 17 fd sbrc r17, 7 31ba0: 22 c0 rjmp .+68 ; 0x31be6 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; 31ba2: 10 92 69 12 sts 0x1269, r1 ; 0x801269 31ba6: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 31baa: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 31bae: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c destination[Z_AXIS] = 150.F; 31bb2: 80 e0 ldi r24, 0x00 ; 0 31bb4: 90 e0 ldi r25, 0x00 ; 0 31bb6: a6 e1 ldi r26, 0x16 ; 22 31bb8: b3 e4 ldi r27, 0x43 ; 67 31bba: 80 93 31 06 sts 0x0631, r24 ; 0x800631 31bbe: 90 93 32 06 sts 0x0632, r25 ; 0x800632 31bc2: a0 93 33 06 sts 0x0633, r26 ; 0x800633 31bc6: b0 93 34 06 sts 0x0634, r27 ; 0x800634 plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 31bca: 65 e5 ldi r22, 0x55 ; 85 31bcc: 75 e5 ldi r23, 0x55 ; 85 31bce: 85 e5 ldi r24, 0x55 ; 85 31bd0: 91 e4 ldi r25, 0x41 ; 65 31bd2: 0f 94 75 49 call 0x292ea ; 0x292ea lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 31bd6: 85 e9 ldi r24, 0x95 ; 149 31bd8: 90 e6 ldi r25, 0x60 ; 96 31bda: 0e 94 95 75 call 0xeb2a ; 0xeb2a 31bde: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 // 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()) 31be2: 0f 94 63 52 call 0x2a4c6 ; 0x2a4c6 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 31be6: 81 e0 ldi r24, 0x01 ; 1 31be8: 0e 94 93 70 call 0xe126 ; 0xe126 lcd_update(2); 31bec: 82 e0 ldi r24, 0x02 ; 2 31bee: 0e 94 54 6f call 0xdea8 ; 0xdea8 void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, uint8_t point_too_far_mask) { const char *msg = NULL; if (result == BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND) { lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND)); 31bf2: 86 e5 ldi r24, 0x56 ; 86 31bf4: 90 e6 ldi r25, 0x60 ; 96 } 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) { 31bf6: 1f 3f cpi r17, 0xFF ; 255 31bf8: 99 f0 breq .+38 ; 0x31c20 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) { 31bfa: 1e 3f cpi r17, 0xFE ; 254 31bfc: 09 f0 breq .+2 ; 0x31c00 31bfe: 73 c0 rjmp .+230 ; 0x31ce6 if (point_too_far_mask == 0) 31c00: af 96 adiw r28, 0x2f ; 47 31c02: 4f ad ldd r20, Y+63 ; 0x3f 31c04: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 31c06: 81 e2 ldi r24, 0x21 ; 33 31c08: 90 e6 ldi r25, 0x60 ; 96 { 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) 31c0a: 44 23 and r20, r20 31c0c: 49 f0 breq .+18 ; 0x31c20 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 31c0e: af 96 adiw r28, 0x2f ; 47 31c10: 5f ad ldd r21, Y+63 ; 0x3f 31c12: 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); 31c14: 8f ed ldi r24, 0xDF ; 223 31c16: 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) 31c18: 52 30 cpi r21, 0x02 ; 2 31c1a: 11 f0 breq .+4 ; 0x31c20 // 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); 31c1c: 88 e9 ldi r24, 0x98 ; 152 31c1e: 9f e5 ldi r25, 0x5F ; 95 31c20: 0e 94 95 75 call 0xeb2a ; 0xeb2a 31c24: 0d 94 68 82 jmp 0x304d0 ; 0x304d0 (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]) : 31c28: f2 01 movw r30, r4 31c2a: 25 81 ldd r18, Z+5 ; 0x05 31c2c: 36 81 ldd r19, Z+6 ; 0x06 31c2e: 47 81 ldd r20, Z+7 ; 0x07 31c30: 50 85 ldd r21, Z+8 ; 0x08 31c32: c3 58 subi r28, 0x83 ; 131 31c34: df 4f sbci r29, 0xFF ; 255 31c36: 68 81 ld r22, Y 31c38: 79 81 ldd r23, Y+1 ; 0x01 31c3a: 8a 81 ldd r24, Y+2 ; 0x02 31c3c: 9b 81 ldd r25, Y+3 ; 0x03 31c3e: cd 57 subi r28, 0x7D ; 125 31c40: d0 40 sbci r29, 0x00 ; 0 31c42: 0d 94 4e 85 jmp 0x30a9c ; 0x30a9c // 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]) : 31c46: f2 01 movw r30, r4 31c48: 25 81 ldd r18, Z+5 ; 0x05 31c4a: 36 81 ldd r19, Z+6 ; 0x06 31c4c: 47 81 ldd r20, Z+7 ; 0x07 31c4e: 50 85 ldd r21, Z+8 ; 0x08 31c50: ed 96 adiw r28, 0x3d ; 61 31c52: 6c ad ldd r22, Y+60 ; 0x3c 31c54: 7d ad ldd r23, Y+61 ; 0x3d 31c56: 8e ad ldd r24, Y+62 ; 0x3e 31c58: 9f ad ldd r25, Y+63 ; 0x3f 31c5a: ed 97 sbiw r28, 0x3d ; 61 31c5c: b8 c0 rjmp .+368 ; 0x31dce (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 31c5e: f2 01 movw r30, r4 31c60: 25 81 ldd r18, Z+5 ; 0x05 31c62: 36 81 ldd r19, Z+6 ; 0x06 31c64: 47 81 ldd r20, Z+7 ; 0x07 31c66: 50 85 ldd r21, Z+8 ; 0x08 31c68: ed 96 adiw r28, 0x3d ; 61 31c6a: 6c ad ldd r22, Y+60 ; 0x3c 31c6c: 7d ad ldd r23, Y+61 ; 0x3d 31c6e: 8e ad ldd r24, Y+62 ; 0x3e 31c70: 9f ad ldd r25, Y+63 ; 0x3f 31c72: ed 97 sbiw r28, 0x3d ; 61 31c74: c6 c0 rjmp .+396 ; 0x31e02 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]) : 31c76: a3 01 movw r20, r6 31c78: 92 01 movw r18, r4 31c7a: c3 58 subi r28, 0x83 ; 131 31c7c: df 4f sbci r29, 0xFF ; 255 31c7e: 68 81 ld r22, Y 31c80: 79 81 ldd r23, Y+1 ; 0x01 31c82: 8a 81 ldd r24, Y+2 ; 0x02 31c84: 9b 81 ldd r25, Y+3 ; 0x03 31c86: cd 57 subi r28, 0x7D ; 125 31c88: d0 40 sbci r29, 0x00 ; 0 31c8a: 0d 94 b6 85 jmp 0x30b6c ; 0x30b6c // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 31c8e: 81 2c mov r8, r1 31c90: 91 2c mov r9, r1 31c92: 20 e8 ldi r18, 0x80 ; 128 31c94: a2 2e mov r10, r18 31c96: 2f e3 ldi r18, 0x3F ; 63 31c98: b2 2e mov r11, r18 31c9a: 0d 94 ba 85 jmp 0x30b74 ; 0x30b74 float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 31c9e: c1 2c mov r12, r1 31ca0: d1 2c mov r13, r1 31ca2: 76 01 movw r14, r12 31ca4: 0d 94 31 86 jmp 0x30c62 ; 0x30c62 ((r == 1) ? 1.f : 31ca8: c1 2c mov r12, r1 31caa: d1 2c mov r13, r1 31cac: 90 e8 ldi r25, 0x80 ; 128 31cae: e9 2e mov r14, r25 31cb0: 9f e3 ldi r25, 0x3F ; 63 31cb2: f9 2e mov r15, r25 31cb4: 0d 94 31 86 jmp 0x30c62 ; 0x30c62 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; 31cb8: 12 e0 ldi r17, 0x02 ; 2 31cba: a7 cb rjmp .-2226 ; 0x3140a } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 31cbc: 1e 3f cpi r17, 0xFE ; 254 31cbe: 89 f4 brne .+34 ; 0x31ce2 31cc0: af 96 adiw r28, 0x2f ; 47 31cc2: 3f ad ldd r19, Y+63 ; 0x3f 31cc4: af 97 sbiw r28, 0x2f ; 47 31cc6: 32 30 cpi r19, 0x02 ; 2 31cc8: 09 f0 breq .+2 ; 0x31ccc 31cca: 4d cf rjmp .-358 ; 0x31b66 DBG(_n("Fitting failed => calibration failed.\n")); 31ccc: 80 e2 ldi r24, 0x20 ; 32 31cce: 9c e6 ldi r25, 0x6C ; 108 31cd0: 9f 93 push r25 31cd2: 8f 93 push r24 31cd4: 0f 94 00 a3 call 0x34600 ; 0x34600 31cd8: 44 cf rjmp .-376 ; 0x31b62 // 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; 31cda: af 96 adiw r28, 0x2f ; 47 31cdc: 1f ae std Y+63, r1 ; 0x3f 31cde: af 97 sbiw r28, 0x2f ; 47 31ce0: 42 cf rjmp .-380 ; 0x31b66 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 31ce2: 1f ef ldi r17, 0xFF ; 255 31ce4: 40 cf rjmp .-384 ; 0x31b66 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) { 31ce6: af 96 adiw r28, 0x2f ; 47 31ce8: 6f ad ldd r22, Y+63 ; 0x3f 31cea: af 97 sbiw r28, 0x2f ; 47 31cec: 61 11 cpse r22, r1 31cee: 13 c0 rjmp .+38 ; 0x31d16 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); 31cf0: 8d e7 ldi r24, 0x7D ; 125 31cf2: 9e e5 ldi r25, 0x5E ; 94 // 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) { 31cf4: 11 30 cpi r17, 0x01 ; 1 31cf6: 51 f0 breq .+20 ; 0x31d0c 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); 31cf8: 8a e3 ldi r24, 0x3A ; 58 31cfa: 9e e5 ldi r25, 0x5E ; 94 // 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) { 31cfc: 12 30 cpi r17, 0x02 ; 2 31cfe: 31 f0 breq .+12 ; 0x31d0c default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 31d00: 81 e2 ldi r24, 0x21 ; 33 31d02: 90 e6 ldi r25, 0x60 ; 96 // 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) { 31d04: 11 11 cpse r17, r1 31d06: 02 c0 rjmp .+4 ; 0x31d0c 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); 31d08: 82 ec ldi r24, 0xC2 ; 194 31d0a: 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); 31d0c: 0e 94 95 75 call 0xeb2a ; 0xeb2a break; } lcd_show_fullscreen_message_and_wait_P(msg); 31d10: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 31d14: 0d c0 rjmp .+26 ; 0x31d30 // 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) 31d16: af 96 adiw r28, 0x2f ; 47 31d18: 8f ad ldd r24, Y+63 ; 0x3f 31d1a: af 97 sbiw r28, 0x2f ; 47 31d1c: 82 30 cpi r24, 0x02 ; 2 31d1e: f1 f4 brne .+60 ; 0x31d5c // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 31d20: 81 e5 ldi r24, 0x51 ; 81 31d22: 9f e5 ldi r25, 0x5F ; 95 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); 31d24: 0e 94 95 75 call 0xeb2a ; 0xeb2a 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); 31d28: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 } if (point_too_far_mask == 0 || result > 0) { 31d2c: 11 16 cp r1, r17 31d2e: 04 f3 brlt .-64 ; 0x31cf0 //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 31d30: 1f 3f cpi r17, 0xFF ; 255 31d32: 11 f4 brne .+4 ; 0x31d38 31d34: 0d 94 0f 7e jmp 0x2fc1e ; 0x2fc1e { // 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); 31d38: 86 e0 ldi r24, 0x06 ; 6 31d3a: 0e 94 39 d5 call 0x1aa72 ; 0x1aa72 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 31d3e: 8f e5 ldi r24, 0x5F ; 95 31d40: 9f e0 ldi r25, 0x0F ; 15 31d42: 0f 94 3e a4 call 0x3487c ; 0x3487c 31d46: 81 11 cpse r24, r1 31d48: 0d 94 82 82 jmp 0x30504 ; 0x30504 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 31d4c: 8c eb ldi r24, 0xBC ; 188 31d4e: 90 e6 ldi r25, 0x60 ; 96 31d50: 0e 94 95 75 call 0xeb2a ; 0xeb2a 31d54: 0e 94 58 e8 call 0x1d0b0 ; 0x1d0b0 31d58: 0d 94 82 82 jmp 0x30504 ; 0x30504 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); 31d5c: 85 e0 ldi r24, 0x05 ; 5 31d5e: 9f e5 ldi r25, 0x5F ; 95 31d60: e1 cf rjmp .-62 ; 0x31d24 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)) 31d62: 89 81 ldd r24, Y+1 ; 0x01 31d64: 9a 81 ldd r25, Y+2 ; 0x02 31d66: 80 37 cpi r24, 0x70 ; 112 31d68: 98 40 sbci r25, 0x08 ; 8 31d6a: 10 f0 brcs .+4 ; 0x31d70 31d6c: 0d 94 bb 82 jmp 0x30576 ; 0x30576 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 31d70: ae 01 movw r20, r28 31d72: 4f 5f subi r20, 0xFF ; 255 31d74: 5f 4f sbci r21, 0xFF ; 255 31d76: 7a 01 movw r14, r20 31d78: 04 eb ldi r16, 0xB4 ; 180 31d7a: 10 e0 ldi r17, 0x00 ; 0 31d7c: 24 e8 ldi r18, 0x84 ; 132 31d7e: 33 e0 ldi r19, 0x03 ; 3 31d80: a6 01 movw r20, r12 31d82: 48 5c subi r20, 0xC8 ; 200 31d84: 51 09 sbc r21, r1 31d86: 69 2d mov r22, r9 31d88: 78 2d mov r23, r8 31d8a: 8b 2d mov r24, r11 31d8c: 9a 2d mov r25, r10 31d8e: 0f 94 eb 5e call 0x2bdd6 ; 0x2bdd6 31d92: 88 23 and r24, r24 31d94: 11 f4 brne .+4 ; 0x31d9a 31d96: 0d 94 bb 82 jmp 0x30576 ; 0x30576 ad += 1440; 31d9a: 89 81 ldd r24, Y+1 ; 0x01 31d9c: 9a 81 ldd r25, Y+2 ; 0x02 31d9e: 80 56 subi r24, 0x60 ; 96 31da0: 9a 4f sbci r25, 0xFA ; 250 31da2: 0d 94 e4 7f jmp 0x2ffc8 ; 0x2ffc8 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) { 31da6: 00 23 and r16, r16 31da8: 11 f4 brne .+4 ; 0x31dae 31daa: 0d 94 61 85 jmp 0x30ac2 ; 0x30ac2 float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 31dae: 02 30 cpi r16, 0x02 ; 2 31db0: 09 f0 breq .+2 ; 0x31db4 31db2: 49 cf rjmp .-366 ; 0x31c46 31db4: d2 01 movw r26, r4 31db6: 11 96 adiw r26, 0x01 ; 1 31db8: 2d 91 ld r18, X+ 31dba: 3d 91 ld r19, X+ 31dbc: 4d 91 ld r20, X+ 31dbe: 5c 91 ld r21, X 31dc0: 14 97 sbiw r26, 0x04 ; 4 31dc2: 6e 96 adiw r28, 0x1e ; 30 31dc4: 6c ad ldd r22, Y+60 ; 0x3c 31dc6: 7d ad ldd r23, Y+61 ; 0x3d 31dc8: 8e ad ldd r24, Y+62 ; 0x3e 31dca: 9f ad ldd r25, Y+63 ; 0x3f 31dcc: 6e 97 sbiw r28, 0x1e ; 30 31dce: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31dd2: 4b 01 movw r8, r22 31dd4: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 31dd6: 60 e0 ldi r22, 0x00 ; 0 31dd8: 70 e0 ldi r23, 0x00 ; 0 31dda: 80 e8 ldi r24, 0x80 ; 128 31ddc: 9f e3 ldi r25, 0x3F ; 63 31dde: 11 30 cpi r17, 0x01 ; 1 31de0: 91 f0 breq .+36 ; 0x31e06 ((c == 2) ? ( c1 * measured_pts[2 * i]) : 31de2: 12 30 cpi r17, 0x02 ; 2 31de4: 09 f0 breq .+2 ; 0x31de8 31de6: 3b cf rjmp .-394 ; 0x31c5e 31de8: d2 01 movw r26, r4 31dea: 11 96 adiw r26, 0x01 ; 1 31dec: 2d 91 ld r18, X+ 31dee: 3d 91 ld r19, X+ 31df0: 4d 91 ld r20, X+ 31df2: 5c 91 ld r21, X 31df4: 14 97 sbiw r26, 0x04 ; 4 31df6: 6e 96 adiw r28, 0x1e ; 30 31df8: 6c ad ldd r22, Y+60 ; 0x3c 31dfa: 7d ad ldd r23, Y+61 ; 0x3d 31dfc: 8e ad ldd r24, Y+62 ; 0x3e 31dfe: 9f ad ldd r25, Y+63 ; 0x3f 31e00: 6e 97 sbiw r28, 0x1e ; 30 31e02: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 31e06: 9b 01 movw r18, r22 31e08: ac 01 movw r20, r24 31e0a: c5 01 movw r24, r10 31e0c: b4 01 movw r22, r8 31e0e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 31e12: 9b 01 movw r18, r22 31e14: ac 01 movw r20, r24 31e16: c7 01 movw r24, r14 31e18: b6 01 movw r22, r12 31e1a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 31e1e: 6b 01 movw r12, r22 31e20: 7c 01 movw r14, r24 31e22: 0d 94 61 85 jmp 0x30ac2 ; 0x30ac2 // 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 : 31e26: 81 2c mov r8, r1 31e28: 91 2c mov r9, r1 31e2a: 50 e8 ldi r21, 0x80 ; 128 31e2c: a5 2e mov r10, r21 31e2e: 5f e3 ldi r21, 0x3F ; 63 31e30: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 31e32: 11 11 cpse r17, r1 31e34: 0d 94 3b 85 jmp 0x30a76 ; 0x30a76 ((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; 31e38: 20 e0 ldi r18, 0x00 ; 0 31e3a: 30 e0 ldi r19, 0x00 ; 0 31e3c: 40 e8 ldi r20, 0x80 ; 128 31e3e: 5f e3 ldi r21, 0x3F ; 63 31e40: ea cf rjmp .-44 ; 0x31e16 // 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 : 31e42: 81 2c mov r8, r1 31e44: 91 2c mov r9, r1 31e46: 40 e8 ldi r20, 0x80 ; 128 31e48: a4 2e mov r10, r20 31e4a: 4f e3 ldi r20, 0x3F ; 63 31e4c: 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) { 31e4e: 11 11 cpse r17, r1 31e50: c2 cf rjmp .-124 ; 0x31dd6 31e52: 0d 94 61 85 jmp 0x30ac2 ; 0x30ac2 31e56: 11 11 cpse r17, r1 31e58: aa cf rjmp .-172 ; 0x31dae 31e5a: 0d 94 61 85 jmp 0x30ac2 ; 0x30ac2 00031e5e : 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, 31e5e: 1f 93 push r17 31e60: cf 93 push r28 31e62: df 93 push r29 31e64: c8 2f mov r28, r24 31e66: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 31e68: 0e 94 81 70 call 0xe102 ; 0xe102 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 31e6c: 8f e2 ldi r24, 0x2F ; 47 31e6e: 9e e5 ldi r25, 0x5E ; 94 31e70: 0e 94 95 75 call 0xeb2a ; 0xeb2a 31e74: ac 01 movw r20, r24 31e76: 60 e0 ldi r22, 0x00 ; 0 31e78: 80 e0 ldi r24, 0x00 ; 0 31e7a: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 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)); 31e7e: 89 e0 ldi r24, 0x09 ; 9 31e80: 9e e5 ldi r25, 0x5E ; 94 31e82: c1 11 cpse r28, r1 31e84: 02 c0 rjmp .+4 ; 0x31e8a 31e86: 8c e1 ldi r24, 0x1C ; 28 31e88: 9e e5 ldi r25, 0x5E ; 94 31e8a: 0e 94 95 75 call 0xeb2a ; 0xeb2a 31e8e: ac 01 movw r20, r24 31e90: 61 e0 ldi r22, 0x01 ; 1 31e92: 80 e0 ldi r24, 0x00 ; 0 31e94: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 31e98: 8f ef ldi r24, 0xFF ; 255 31e9a: 80 93 55 12 sts 0x1255, r24 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 31e9e: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d #endif manage_heater(); 31ea2: 0f 94 43 37 call 0x26e86 ; 0x26e86 // 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); 31ea6: 64 ef ldi r22, 0xF4 ; 244 31ea8: 71 e0 ldi r23, 0x01 ; 1 31eaa: 80 e0 ldi r24, 0x00 ; 0 31eac: 90 e0 ldi r25, 0x00 ; 0 31eae: 0f 94 ce 0a call 0x2159c ; 0x2159c lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 31eb2: 8e ef ldi r24, 0xFE ; 254 31eb4: 9d e5 ldi r25, 0x5D ; 93 31eb6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 31eba: ac 01 movw r20, r24 31ebc: 62 e0 ldi r22, 0x02 ; 2 31ebe: 81 e0 ldi r24, 0x01 ; 1 31ec0: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 lcd_putc_at(0, 3, '>'); 31ec4: 4e e3 ldi r20, 0x3E ; 62 31ec6: 63 e0 ldi r22, 0x03 ; 3 31ec8: 80 e0 ldi r24, 0x00 ; 0 31eca: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 31ece: 8f ee ldi r24, 0xEF ; 239 31ed0: 9d e5 ldi r25, 0x5D ; 93 31ed2: 0e 94 95 75 call 0xeb2a ; 0xeb2a 31ed6: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_encoder = _default; 31eda: 6d 2f mov r22, r29 31edc: 70 e0 ldi r23, 0x00 ; 0 31ede: 70 93 1f 06 sts 0x061F, r23 ; 0x80061f 31ee2: 60 93 1e 06 sts 0x061E, r22 ; 0x80061e KEEPALIVE_STATE(PAUSED_FOR_USER); 31ee6: 84 e0 ldi r24, 0x04 ; 4 31ee8: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 31eec: 0e 94 cb 73 call 0xe796 ; 0xe796 31ef0: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 31ef2: 11 e0 ldi r17, 0x01 ; 1 31ef4: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 31ef6: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 31efa: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 31efe: 00 97 sbiw r24, 0x00 ; 0 31f00: 19 f1 breq .+70 ; 0x31f48 if (lcd_encoder < 0) { 31f02: 97 ff sbrs r25, 7 31f04: 0b c0 rjmp .+22 ; 0x31f1c _result = !check_opposite; 31f06: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 31f08: 4e e3 ldi r20, 0x3E ; 62 31f0a: 62 e0 ldi r22, 0x02 ; 2 31f0c: 80 e0 ldi r24, 0x00 ; 0 31f0e: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_putc_at(0, 3, ' '); 31f12: 40 e2 ldi r20, 0x20 ; 32 31f14: 63 e0 ldi r22, 0x03 ; 3 31f16: 80 e0 ldi r24, 0x00 ; 0 31f18: 0e 94 6e 70 call 0xe0dc ; 0xe0dc } if (lcd_encoder > 0) { 31f1c: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 31f20: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 31f24: 18 16 cp r1, r24 31f26: 19 06 cpc r1, r25 31f28: 5c f4 brge .+22 ; 0x31f40 _result = check_opposite; lcd_putc_at(0, 2, ' '); 31f2a: 40 e2 ldi r20, 0x20 ; 32 31f2c: 62 e0 ldi r22, 0x02 ; 2 31f2e: 80 e0 ldi r24, 0x00 ; 0 31f30: 0e 94 6e 70 call 0xe0dc ; 0xe0dc lcd_putc_at(0, 3, '>'); 31f34: 4e e3 ldi r20, 0x3E ; 62 31f36: 63 e0 ldi r22, 0x03 ; 3 31f38: 80 e0 ldi r24, 0x00 ; 0 31f3a: 0e 94 6e 70 call 0xe0dc ; 0xe0dc 31f3e: dc 2f mov r29, r28 } lcd_encoder = 0; 31f40: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 31f44: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } manage_heater(); 31f48: 0f 94 43 37 call 0x26e86 ; 0x26e86 manage_inactivity(true); 31f4c: 81 e0 ldi r24, 0x01 ; 1 31f4e: 0e 94 b0 8a call 0x11560 ; 0x11560 _delay(100); 31f52: 64 e6 ldi r22, 0x64 ; 100 31f54: 70 e0 ldi r23, 0x00 ; 0 31f56: 80 e0 ldi r24, 0x00 ; 0 31f58: 90 e0 ldi r25, 0x00 ; 0 31f5a: 0f 94 ce 0a call 0x2159c ; 0x2159c } while (!lcd_clicked()); 31f5e: 0e 94 d0 73 call 0xe7a0 ; 0xe7a0 31f62: 88 23 and r24, r24 31f64: 41 f2 breq .-112 ; 0x31ef6 KEEPALIVE_STATE(IN_HANDLER); 31f66: 82 e0 ldi r24, 0x02 ; 2 31f68: 80 93 78 02 sts 0x0278, r24 ; 0x800278 setExtruderAutoFanState(0); // Turn off hotend fan 31f6c: 80 e0 ldi r24, 0x00 ; 0 31f6e: 0e 94 0a 78 call 0xf014 ; 0xf014 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 31f72: 10 92 55 12 sts 0x1255, r1 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 31f76: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d #endif manage_heater(); 31f7a: 0f 94 43 37 call 0x26e86 ; 0x26e86 KEEPALIVE_STATE(IN_HANDLER); setExtruderAutoFanState(0); // Turn off hotend fan lcd_selftest_setfan(0); // Turn off print fan return _result; } 31f7e: 8d 2f mov r24, r29 31f80: df 91 pop r29 31f82: cf 91 pop r28 31f84: 1f 91 pop r17 31f86: 08 95 ret 00031f88 : #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) { 31f88: 4f 92 push r4 31f8a: 5f 92 push r5 31f8c: 6f 92 push r6 31f8e: 7f 92 push r7 31f90: af 92 push r10 31f92: bf 92 push r11 31f94: cf 92 push r12 31f96: df 92 push r13 31f98: ef 92 push r14 31f9a: ff 92 push r15 31f9c: 0f 93 push r16 31f9e: 1f 93 push r17 31fa0: cf 93 push r28 31fa2: df 93 push r29 31fa4: 24 e0 ldi r18, 0x04 ; 4 31fa6: 30 e0 ldi r19, 0x00 ; 0 31fa8: 41 e0 ldi r20, 0x01 ; 1 31faa: 50 e0 ldi r21, 0x00 ; 0 31fac: d9 01 movw r26, r18 31fae: ab 50 subi r26, 0x0B ; 11 31fb0: b5 46 sbci r27, 0x65 ; 101 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 31fb2: fd 01 movw r30, r26 31fb4: 65 91 lpm r22, Z+ 31fb6: 74 91 lpm r23, Z 31fb8: 86 17 cp r24, r22 31fba: 97 07 cpc r25, r23 31fbc: 0c f0 brlt .+2 ; 0x31fc0 31fbe: 66 c0 rjmp .+204 ; 0x3208c { celsius = PGM_RD_W((*tt)[i-1][1]) + 31fc0: 41 50 subi r20, 0x01 ; 1 31fc2: 51 09 sbc r21, r1 31fc4: 44 0f add r20, r20 31fc6: 55 1f adc r21, r21 31fc8: 44 0f add r20, r20 31fca: 55 1f adc r21, r21 31fcc: ea 01 movw r28, r20 31fce: c9 50 subi r28, 0x09 ; 9 31fd0: d5 46 sbci r29, 0x65 ; 101 31fd2: fe 01 movw r30, r28 31fd4: 05 91 lpm r16, Z+ 31fd6: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 31fd8: 4b 50 subi r20, 0x0B ; 11 31fda: 55 46 sbci r21, 0x65 ; 101 31fdc: fa 01 movw r30, r20 31fde: 65 91 lpm r22, Z+ 31fe0: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 31fe2: f9 01 movw r30, r18 31fe4: e9 50 subi r30, 0x09 ; 9 31fe6: f5 46 sbci r31, 0x65 ; 101 31fe8: e5 90 lpm r14, Z+ 31fea: f4 90 lpm r15, Z 31fec: fe 01 movw r30, r28 31fee: c5 90 lpm r12, Z+ 31ff0: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 31ff2: fd 01 movw r30, r26 31ff4: c5 91 lpm r28, Z+ 31ff6: d4 91 lpm r29, Z 31ff8: fa 01 movw r30, r20 31ffa: a5 90 lpm r10, Z+ 31ffc: 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])) * 31ffe: 86 1b sub r24, r22 32000: 97 0b sbc r25, r23 32002: bc 01 movw r22, r24 32004: 99 0f add r25, r25 32006: 88 0b sbc r24, r24 32008: 99 0b sbc r25, r25 3200a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 3200e: 2b 01 movw r4, r22 32010: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 32012: b7 01 movw r22, r14 32014: 6c 19 sub r22, r12 32016: 7d 09 sbc r23, r13 32018: 07 2e mov r0, r23 3201a: 00 0c add r0, r0 3201c: 88 0b sbc r24, r24 3201e: 99 0b sbc r25, r25 32020: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 32024: 9b 01 movw r18, r22 32026: 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])) * 32028: c3 01 movw r24, r6 3202a: b2 01 movw r22, r4 3202c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 32030: 6b 01 movw r12, r22 32032: 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])); 32034: be 01 movw r22, r28 32036: 6a 19 sub r22, r10 32038: 7b 09 sbc r23, r11 3203a: 07 2e mov r0, r23 3203c: 00 0c add r0, r0 3203e: 88 0b sbc r24, r24 32040: 99 0b sbc r25, r25 32042: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 32046: 9b 01 movw r18, r22 32048: 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])) / 3204a: c7 01 movw r24, r14 3204c: b6 01 movw r22, r12 3204e: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 32052: 6b 01 movw r12, r22 32054: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 32056: b8 01 movw r22, r16 32058: 11 0f add r17, r17 3205a: 88 0b sbc r24, r24 3205c: 99 0b sbc r25, r25 3205e: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 32062: 9b 01 movw r18, r22 32064: ac 01 movw r20, r24 32066: c7 01 movw r24, r14 32068: b6 01 movw r22, r12 3206a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__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; } 3206e: df 91 pop r29 32070: cf 91 pop r28 32072: 1f 91 pop r17 32074: 0f 91 pop r16 32076: ff 90 pop r15 32078: ef 90 pop r14 3207a: df 90 pop r13 3207c: cf 90 pop r12 3207e: bf 90 pop r11 32080: af 90 pop r10 32082: 7f 90 pop r7 32084: 6f 90 pop r6 32086: 5f 90 pop r5 32088: 4f 90 pop r4 3208a: 08 95 ret 3208c: 4f 5f subi r20, 0xFF ; 255 3208e: 5f 4f sbci r21, 0xFF ; 255 32090: 2c 5f subi r18, 0xFC ; 252 32092: 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 3209a: 88 cf rjmp .-240 ; 0x31fac break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 3209c: e3 e7 ldi r30, 0x73 ; 115 3209e: fb e9 ldi r31, 0x9B ; 155 320a0: 65 91 lpm r22, Z+ 320a2: 74 91 lpm r23, Z 320a4: 07 2e mov r0, r23 320a6: 00 0c add r0, r0 320a8: 88 0b sbc r24, r24 320aa: 99 0b sbc r25, r25 320ac: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 320b0: de cf rjmp .-68 ; 0x3206e 000320b2 : useU2X = false; } #endif // set up the first (original serial port) if (useU2X) { M_UCSRxA = 1 << M_U2Xx; 320b2: 22 e0 ldi r18, 0x02 ; 2 320b4: 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; 320b8: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> M_UBRRxL = baud_setting; 320bc: 90 e1 ldi r25, 0x10 ; 16 320be: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> sbi(M_UCSRxB, M_RXENx); 320c2: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 320c6: 80 61 ori r24, 0x10 ; 16 320c8: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_TXENx); 320cc: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 320d0: 88 60 ori r24, 0x08 ; 8 320d2: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_RXCIEx); 320d6: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 320da: 80 68 ori r24, 0x80 ; 128 320dc: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> if (selectedSerialPort == 1) { //set up also the second serial port 320e0: 80 91 1c 06 lds r24, 0x061C ; 0x80061c 320e4: 81 30 cpi r24, 0x01 ; 1 320e6: a9 f4 brne .+42 ; 0x32112 if (useU2X) { UCSR1A = 1 << U2X1; 320e8: 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; 320ec: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> UBRR1L = baud_setting; 320f0: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> sbi(UCSR1B, RXEN1); 320f4: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 320f8: 80 61 ori r24, 0x10 ; 16 320fa: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, TXEN1); 320fe: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 32102: 88 60 ori r24, 0x08 ; 8 32104: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, RXCIE1); 32108: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 3210c: 80 68 ori r24, 0x80 ; 128 3210e: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> } } 32112: 08 95 ret 00032114 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 32114: 8f 92 push r8 32116: 9f 92 push r9 32118: af 92 push r10 3211a: bf 92 push r11 3211c: cf 92 push r12 3211e: df 92 push r13 32120: ef 92 push r14 32122: ff 92 push r15 32124: 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]) { 32128: 88 23 and r24, r24 3212a: 09 f4 brne .+2 ; 0x3212e 3212c: 9d c0 rjmp .+314 ; 0x32268 3212e: 91 11 cpse r25, r1 32130: 92 c0 rjmp .+292 ; 0x32256 st_synchronize(); 32132: 0f 94 5b 18 call 0x230b6 ; 0x230b6 set_destination_to_current(); 32136: 0e 94 09 67 call 0xce12 ; 0xce12 current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 3213a: 60 91 75 02 lds r22, 0x0275 ; 0x800275 3213e: 70 91 76 02 lds r23, 0x0276 ; 0x800276 32142: 07 2e mov r0, r23 32144: 00 0c add r0, r0 32146: 88 0b sbc r24, r24 32148: 99 0b sbc r25, r25 3214a: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 3214e: 20 91 ea 0d lds r18, 0x0DEA ; 0x800dea 32152: 30 91 eb 0d lds r19, 0x0DEB ; 0x800deb 32156: 40 91 ec 0d lds r20, 0x0DEC ; 0x800dec 3215a: 50 91 ed 0d lds r21, 0x0DED ; 0x800ded 3215e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 32162: 2a e0 ldi r18, 0x0A ; 10 32164: 37 ed ldi r19, 0xD7 ; 215 32166: 43 e2 ldi r20, 0x23 ; 35 32168: 5c e3 ldi r21, 0x3C ; 60 3216a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3216e: 20 91 6d 12 lds r18, 0x126D ; 0x80126d 32172: 30 91 6e 12 lds r19, 0x126E ; 0x80126e 32176: 40 91 6f 12 lds r20, 0x126F ; 0x80126f 3217a: 50 91 70 12 lds r21, 0x1270 ; 0x801270 3217e: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 32182: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 32186: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 3218a: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 3218e: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_set_e_position(current_position[E_AXIS]); 32192: 8d e6 ldi r24, 0x6D ; 109 32194: 92 e1 ldi r25, 0x12 ; 18 32196: 0f 94 00 3a call 0x27400 ; 0x27400 float oldFeedrate = feedrate; 3219a: c0 90 7a 02 lds r12, 0x027A ; 0x80027a 3219e: d0 90 7b 02 lds r13, 0x027B ; 0x80027b 321a2: e0 90 7c 02 lds r14, 0x027C ; 0x80027c 321a6: f0 90 7d 02 lds r15, 0x027D ; 0x80027d feedrate=cs.retract_feedrate*60; 321aa: 20 e0 ldi r18, 0x00 ; 0 321ac: 30 e0 ldi r19, 0x00 ; 0 321ae: 40 e7 ldi r20, 0x70 ; 112 321b0: 52 e4 ldi r21, 0x42 ; 66 321b2: 60 91 ee 0d lds r22, 0x0DEE ; 0x800dee 321b6: 70 91 ef 0d lds r23, 0x0DEF ; 0x800def 321ba: 80 91 f0 0d lds r24, 0x0DF0 ; 0x800df0 321be: 90 91 f1 0d lds r25, 0x0DF1 ; 0x800df1 321c2: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 321c6: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 321ca: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 321ce: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 321d2: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d retracted[active_extruder]=true; 321d6: 81 e0 ldi r24, 0x01 ; 1 321d8: 80 93 1b 06 sts 0x061B, r24 ; 0x80061b prepare_move(); 321dc: 90 e0 ldi r25, 0x00 ; 0 321de: 80 e0 ldi r24, 0x00 ; 0 321e0: 0e 94 16 6b call 0xd62c ; 0xd62c if(cs.retract_zlift) { 321e4: 20 e0 ldi r18, 0x00 ; 0 321e6: 30 e0 ldi r19, 0x00 ; 0 321e8: a9 01 movw r20, r18 321ea: 60 91 f2 0d lds r22, 0x0DF2 ; 0x800df2 321ee: 70 91 f3 0d lds r23, 0x0DF3 ; 0x800df3 321f2: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 321f6: 90 91 f5 0d lds r25, 0x0DF5 ; 0x800df5 321fa: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 321fe: 88 23 and r24, r24 32200: 11 f1 breq .+68 ; 0x32246 st_synchronize(); 32202: 0f 94 5b 18 call 0x230b6 ; 0x230b6 current_position[Z_AXIS]-=cs.retract_zlift; 32206: 20 91 f2 0d lds r18, 0x0DF2 ; 0x800df2 3220a: 30 91 f3 0d lds r19, 0x0DF3 ; 0x800df3 3220e: 40 91 f4 0d lds r20, 0x0DF4 ; 0x800df4 32212: 50 91 f5 0d lds r21, 0x0DF5 ; 0x800df5 32216: 60 91 69 12 lds r22, 0x1269 ; 0x801269 3221a: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 3221e: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 32222: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 32226: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 3222a: 60 93 69 12 sts 0x1269, r22 ; 0x801269 3222e: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 32232: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 32236: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_set_position_curposXYZE(); 3223a: 0f 94 68 48 call 0x290d0 ; 0x290d0 prepare_move(); 3223e: 90 e0 ldi r25, 0x00 ; 0 32240: 80 e0 ldi r24, 0x00 ; 0 32242: 0e 94 16 6b call 0xd62c ; 0xd62c } feedrate = oldFeedrate; 32246: c0 92 7a 02 sts 0x027A, r12 ; 0x80027a 3224a: d0 92 7b 02 sts 0x027B, r13 ; 0x80027b 3224e: e0 92 7c 02 sts 0x027C, r14 ; 0x80027c 32252: 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 32256: ff 90 pop r15 32258: ef 90 pop r14 3225a: df 90 pop r13 3225c: cf 90 pop r12 3225e: bf 90 pop r11 32260: af 90 pop r10 32262: 9f 90 pop r9 32264: 8f 90 pop r8 32266: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 32268: 99 23 and r25, r25 3226a: a9 f3 breq .-22 ; 0x32256 st_synchronize(); 3226c: 0f 94 5b 18 call 0x230b6 ; 0x230b6 set_destination_to_current(); 32270: 0e 94 09 67 call 0xce12 ; 0xce12 float oldFeedrate = feedrate; 32274: 80 90 7a 02 lds r8, 0x027A ; 0x80027a 32278: 90 90 7b 02 lds r9, 0x027B ; 0x80027b 3227c: a0 90 7c 02 lds r10, 0x027C ; 0x80027c 32280: b0 90 7d 02 lds r11, 0x027D ; 0x80027d feedrate=cs.retract_recover_feedrate*60; 32284: 20 e0 ldi r18, 0x00 ; 0 32286: 30 e0 ldi r19, 0x00 ; 0 32288: 40 e7 ldi r20, 0x70 ; 112 3228a: 52 e4 ldi r21, 0x42 ; 66 3228c: 60 91 fa 0d lds r22, 0x0DFA ; 0x800dfa 32290: 70 91 fb 0d lds r23, 0x0DFB ; 0x800dfb 32294: 80 91 fc 0d lds r24, 0x0DFC ; 0x800dfc 32298: 90 91 fd 0d lds r25, 0x0DFD ; 0x800dfd 3229c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 322a0: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 322a4: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 322a8: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 322ac: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d if(cs.retract_zlift) { 322b0: c0 90 f2 0d lds r12, 0x0DF2 ; 0x800df2 322b4: d0 90 f3 0d lds r13, 0x0DF3 ; 0x800df3 322b8: e0 90 f4 0d lds r14, 0x0DF4 ; 0x800df4 322bc: f0 90 f5 0d lds r15, 0x0DF5 ; 0x800df5 322c0: 20 e0 ldi r18, 0x00 ; 0 322c2: 30 e0 ldi r19, 0x00 ; 0 322c4: a9 01 movw r20, r18 322c6: c7 01 movw r24, r14 322c8: b6 01 movw r22, r12 322ca: 0f 94 5b a6 call 0x34cb6 ; 0x34cb6 <__cmpsf2> 322ce: 88 23 and r24, r24 322d0: e1 f0 breq .+56 ; 0x3230a current_position[Z_AXIS]+=cs.retract_zlift; 322d2: a7 01 movw r20, r14 322d4: 96 01 movw r18, r12 322d6: 60 91 69 12 lds r22, 0x1269 ; 0x801269 322da: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 322de: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 322e2: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 322e6: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 322ea: 60 93 69 12 sts 0x1269, r22 ; 0x801269 322ee: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 322f2: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 322f6: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_set_position_curposXYZE(); 322fa: 0f 94 68 48 call 0x290d0 ; 0x290d0 prepare_move(); 322fe: 90 e0 ldi r25, 0x00 ; 0 32300: 80 e0 ldi r24, 0x00 ; 0 32302: 0e 94 16 6b call 0xd62c ; 0xd62c st_synchronize(); 32306: 0f 94 5b 18 call 0x230b6 ; 0x230b6 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 3230a: 20 91 f6 0d lds r18, 0x0DF6 ; 0x800df6 3230e: 30 91 f7 0d lds r19, 0x0DF7 ; 0x800df7 32312: 40 91 f8 0d lds r20, 0x0DF8 ; 0x800df8 32316: 50 91 f9 0d lds r21, 0x0DF9 ; 0x800df9 3231a: 60 91 ea 0d lds r22, 0x0DEA ; 0x800dea 3231e: 70 91 eb 0d lds r23, 0x0DEB ; 0x800deb 32322: 80 91 ec 0d lds r24, 0x0DEC ; 0x800dec 32326: 90 91 ed 0d lds r25, 0x0DED ; 0x800ded 3232a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3232e: 6b 01 movw r12, r22 32330: 7c 01 movw r14, r24 32332: 60 91 75 02 lds r22, 0x0275 ; 0x800275 32336: 70 91 76 02 lds r23, 0x0276 ; 0x800276 3233a: 07 2e mov r0, r23 3233c: 00 0c add r0, r0 3233e: 88 0b sbc r24, r24 32340: 99 0b sbc r25, r25 32342: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 32346: 9b 01 movw r18, r22 32348: ac 01 movw r20, r24 3234a: c7 01 movw r24, r14 3234c: b6 01 movw r22, r12 3234e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 32352: 2a e0 ldi r18, 0x0A ; 10 32354: 37 ed ldi r19, 0xD7 ; 215 32356: 43 e2 ldi r20, 0x23 ; 35 32358: 5c e3 ldi r21, 0x3C ; 60 3235a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3235e: 9b 01 movw r18, r22 32360: ac 01 movw r20, r24 32362: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 32366: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 3236a: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 3236e: 90 91 70 12 lds r25, 0x1270 ; 0x801270 32372: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 32376: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 3237a: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 3237e: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 32382: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_set_e_position(current_position[E_AXIS]); 32386: 8d e6 ldi r24, 0x6D ; 109 32388: 92 e1 ldi r25, 0x12 ; 18 3238a: 0f 94 00 3a call 0x27400 ; 0x27400 retracted[active_extruder]=false; 3238e: 10 92 1b 06 sts 0x061B, r1 ; 0x80061b prepare_move(); 32392: 90 e0 ldi r25, 0x00 ; 0 32394: 80 e0 ldi r24, 0x00 ; 0 32396: 0e 94 16 6b call 0xd62c ; 0xd62c feedrate = oldFeedrate; 3239a: 80 92 7a 02 sts 0x027A, r8 ; 0x80027a 3239e: 90 92 7b 02 sts 0x027B, r9 ; 0x80027b 323a2: a0 92 7c 02 sts 0x027C, r10 ; 0x80027c 323a6: b0 92 7d 02 sts 0x027D, r11 ; 0x80027d 323aa: 55 cf rjmp .-342 ; 0x32256 000323ac : float mesh_bed_leveling::get_z(float x, float y) { 323ac: 2f 92 push r2 323ae: 3f 92 push r3 323b0: 4f 92 push r4 323b2: 5f 92 push r5 323b4: 6f 92 push r6 323b6: 7f 92 push r7 323b8: 8f 92 push r8 323ba: 9f 92 push r9 323bc: af 92 push r10 323be: bf 92 push r11 323c0: cf 92 push r12 323c2: df 92 push r13 323c4: ef 92 push r14 323c6: ff 92 push r15 323c8: 0f 93 push r16 323ca: 1f 93 push r17 323cc: cf 93 push r28 323ce: df 93 push r29 323d0: 00 d0 rcall .+0 ; 0x323d2 323d2: 00 d0 rcall .+0 ; 0x323d4 323d4: 00 d0 rcall .+0 ; 0x323d6 323d6: 1f 92 push r1 323d8: cd b7 in r28, 0x3d ; 61 323da: de b7 in r29, 0x3e ; 62 323dc: 2b 01 movw r4, r22 323de: 3c 01 movw r6, r24 323e0: 49 01 movw r8, r18 323e2: 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)); 323e4: 20 e0 ldi r18, 0x00 ; 0 323e6: 30 e0 ldi r19, 0x00 ; 0 323e8: 40 ec ldi r20, 0xC0 ; 192 323ea: 51 e4 ldi r21, 0x41 ; 65 323ec: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 323f0: 20 e0 ldi r18, 0x00 ; 0 323f2: 30 e0 ldi r19, 0x00 ; 0 323f4: 48 e0 ldi r20, 0x08 ; 8 323f6: 52 e4 ldi r21, 0x42 ; 66 323f8: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 323fc: 6b 01 movw r12, r22 323fe: 7c 01 movw r14, r24 32400: 0f 94 0d a7 call 0x34e1a ; 0x34e1a 32404: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> if (i < 0) { i = 0; 32408: 31 2c mov r3, r1 3240a: 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) { 3240c: 77 fd sbrc r23, 7 3240e: 1e c0 rjmp .+60 ; 0x3244c 32410: 1b 01 movw r2, r22 32412: 66 30 cpi r22, 0x06 ; 6 32414: 71 05 cpc r23, r1 32416: 1c f0 brlt .+6 ; 0x3241e 32418: 45 e0 ldi r20, 0x05 ; 5 3241a: 24 2e mov r2, r20 3241c: 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; } 3241e: 82 2d mov r24, r2 32420: 0e 94 3b 5f call 0xbe76 ; 0xbe76 32424: 20 e0 ldi r18, 0x00 ; 0 32426: 30 e0 ldi r19, 0x00 ; 0 32428: 48 eb ldi r20, 0xB8 ; 184 3242a: 51 e4 ldi r21, 0x41 ; 65 3242c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 32430: 9b 01 movw r18, r22 32432: 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; 32434: c3 01 movw r24, r6 32436: b2 01 movw r22, r4 32438: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 3243c: 20 e0 ldi r18, 0x00 ; 0 3243e: 30 e0 ldi r19, 0x00 ; 0 32440: 48 e0 ldi r20, 0x08 ; 8 32442: 52 e4 ldi r21, 0x42 ; 66 32444: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 32448: 6b 01 movw r12, r22 3244a: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 3244c: 20 e0 ldi r18, 0x00 ; 0 3244e: 30 e0 ldi r19, 0x00 ; 0 32450: 40 ec ldi r20, 0xC0 ; 192 32452: 50 e4 ldi r21, 0x40 ; 64 32454: c5 01 movw r24, r10 32456: b4 01 movw r22, r8 32458: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 3245c: 20 e0 ldi r18, 0x00 ; 0 3245e: 30 e0 ldi r19, 0x00 ; 0 32460: 48 e0 ldi r20, 0x08 ; 8 32462: 52 e4 ldi r21, 0x42 ; 66 32464: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 32468: 69 83 std Y+1, r22 ; 0x01 3246a: 7a 83 std Y+2, r23 ; 0x02 3246c: 8b 83 std Y+3, r24 ; 0x03 3246e: 9c 83 std Y+4, r25 ; 0x04 32470: 0f 94 0d a7 call 0x34e1a ; 0x34e1a 32474: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> if (j < 0) { 32478: 77 fd sbrc r23, 7 3247a: da c0 rjmp .+436 ; 0x32630 3247c: 7a 87 std Y+10, r23 ; 0x0a 3247e: 69 87 std Y+9, r22 ; 0x09 32480: 66 30 cpi r22, 0x06 ; 6 32482: 71 05 cpc r23, r1 32484: 24 f0 brlt .+8 ; 0x3248e 32486: e5 e0 ldi r30, 0x05 ; 5 32488: f0 e0 ldi r31, 0x00 ; 0 3248a: fa 87 std Y+10, r31 ; 0x0a 3248c: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 3248e: 89 85 ldd r24, Y+9 ; 0x09 32490: 0e 94 3b 5f call 0xbe76 ; 0xbe76 32494: 20 e0 ldi r18, 0x00 ; 0 32496: 30 e0 ldi r19, 0x00 ; 0 32498: 40 ea ldi r20, 0xA0 ; 160 3249a: 50 e4 ldi r21, 0x40 ; 64 3249c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 324a0: 9b 01 movw r18, r22 324a2: 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; 324a4: c5 01 movw r24, r10 324a6: b4 01 movw r22, r8 324a8: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 324ac: 20 e0 ldi r18, 0x00 ; 0 324ae: 30 e0 ldi r19, 0x00 ; 0 324b0: 48 e0 ldi r20, 0x08 ; 8 324b2: 52 e4 ldi r21, 0x42 ; 66 324b4: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 324b8: 69 83 std Y+1, r22 ; 0x01 324ba: 7a 83 std Y+2, r23 ; 0x02 324bc: 8b 83 std Y+3, r24 ; 0x03 324be: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 324c0: a7 01 movw r20, r14 324c2: 96 01 movw r18, r12 324c4: 60 e0 ldi r22, 0x00 ; 0 324c6: 70 e0 ldi r23, 0x00 ; 0 324c8: 80 e8 ldi r24, 0x80 ; 128 324ca: 9f e3 ldi r25, 0x3F ; 63 324cc: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 324d0: 2b 01 movw r4, r22 324d2: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 324d4: 91 01 movw r18, r2 324d6: 2f 5f subi r18, 0xFF ; 255 324d8: 3f 4f sbci r19, 0xFF ; 255 324da: 3e 83 std Y+6, r19 ; 0x06 324dc: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 324de: 89 85 ldd r24, Y+9 ; 0x09 324e0: 9a 85 ldd r25, Y+10 ; 0x0a 324e2: 01 96 adiw r24, 0x01 ; 1 324e4: 98 87 std Y+8, r25 ; 0x08 324e6: 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]; 324e8: 27 e0 ldi r18, 0x07 ; 7 324ea: e9 85 ldd r30, Y+9 ; 0x09 324ec: fa 85 ldd r31, Y+10 ; 0x0a 324ee: 2e 9f mul r18, r30 324f0: 80 01 movw r16, r0 324f2: 2f 9f mul r18, r31 324f4: 10 0d add r17, r0 324f6: 11 24 eor r1, r1 324f8: f8 01 movw r30, r16 324fa: e2 0d add r30, r2 324fc: f3 1d adc r31, r3 324fe: ee 0f add r30, r30 32500: ff 1f adc r31, r31 32502: ee 0f add r30, r30 32504: ff 1f adc r31, r31 32506: e7 5f subi r30, 0xF7 ; 247 32508: fc 4e sbci r31, 0xEC ; 236 3250a: 21 81 ldd r18, Z+1 ; 0x01 3250c: 32 81 ldd r19, Z+2 ; 0x02 3250e: 43 81 ldd r20, Z+3 ; 0x03 32510: 54 81 ldd r21, Z+4 ; 0x04 32512: c3 01 movw r24, r6 32514: b2 01 movw r22, r4 32516: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3251a: 4b 01 movw r8, r22 3251c: 5c 01 movw r10, r24 3251e: ed 81 ldd r30, Y+5 ; 0x05 32520: fe 81 ldd r31, Y+6 ; 0x06 32522: e0 0f add r30, r16 32524: f1 1f adc r31, r17 32526: ee 0f add r30, r30 32528: ff 1f adc r31, r31 3252a: ee 0f add r30, r30 3252c: ff 1f adc r31, r31 3252e: e7 5f subi r30, 0xF7 ; 247 32530: fc 4e sbci r31, 0xEC ; 236 32532: 21 81 ldd r18, Z+1 ; 0x01 32534: 32 81 ldd r19, Z+2 ; 0x02 32536: 43 81 ldd r20, Z+3 ; 0x03 32538: 54 81 ldd r21, Z+4 ; 0x04 3253a: c7 01 movw r24, r14 3253c: b6 01 movw r22, r12 3253e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 32542: 9b 01 movw r18, r22 32544: ac 01 movw r20, r24 32546: c5 01 movw r24, r10 32548: b4 01 movw r22, r8 3254a: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3254e: 4b 01 movw r8, r22 32550: 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; 32552: 29 81 ldd r18, Y+1 ; 0x01 32554: 3a 81 ldd r19, Y+2 ; 0x02 32556: 4b 81 ldd r20, Y+3 ; 0x03 32558: 5c 81 ldd r21, Y+4 ; 0x04 3255a: 60 e0 ldi r22, 0x00 ; 0 3255c: 70 e0 ldi r23, 0x00 ; 0 3255e: 80 e8 ldi r24, 0x80 ; 128 32560: 9f e3 ldi r25, 0x3F ; 63 32562: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 32566: 9b 01 movw r18, r22 32568: ac 01 movw r20, r24 3256a: c5 01 movw r24, r10 3256c: b4 01 movw r22, r8 3256e: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 32572: 4b 01 movw r8, r22 32574: 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]; 32576: 27 e0 ldi r18, 0x07 ; 7 32578: ef 81 ldd r30, Y+7 ; 0x07 3257a: f8 85 ldd r31, Y+8 ; 0x08 3257c: 2e 9f mul r18, r30 3257e: c0 01 movw r24, r0 32580: 2f 9f mul r18, r31 32582: 90 0d add r25, r0 32584: 11 24 eor r1, r1 32586: 9a 87 std Y+10, r25 ; 0x0a 32588: 89 87 std Y+9, r24 ; 0x09 3258a: fc 01 movw r30, r24 3258c: e2 0d add r30, r2 3258e: f3 1d adc r31, r3 32590: ee 0f add r30, r30 32592: ff 1f adc r31, r31 32594: ee 0f add r30, r30 32596: ff 1f adc r31, r31 32598: e7 5f subi r30, 0xF7 ; 247 3259a: fc 4e sbci r31, 0xEC ; 236 3259c: 21 81 ldd r18, Z+1 ; 0x01 3259e: 32 81 ldd r19, Z+2 ; 0x02 325a0: 43 81 ldd r20, Z+3 ; 0x03 325a2: 54 81 ldd r21, Z+4 ; 0x04 325a4: c3 01 movw r24, r6 325a6: b2 01 movw r22, r4 325a8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 325ac: 2b 01 movw r4, r22 325ae: 3c 01 movw r6, r24 325b0: 89 85 ldd r24, Y+9 ; 0x09 325b2: 9a 85 ldd r25, Y+10 ; 0x0a 325b4: ed 81 ldd r30, Y+5 ; 0x05 325b6: fe 81 ldd r31, Y+6 ; 0x06 325b8: 8e 0f add r24, r30 325ba: 9f 1f adc r25, r31 325bc: 88 0f add r24, r24 325be: 99 1f adc r25, r25 325c0: 88 0f add r24, r24 325c2: 99 1f adc r25, r25 325c4: 87 5f subi r24, 0xF7 ; 247 325c6: 9c 4e sbci r25, 0xEC ; 236 325c8: fc 01 movw r30, r24 325ca: 21 81 ldd r18, Z+1 ; 0x01 325cc: 32 81 ldd r19, Z+2 ; 0x02 325ce: 43 81 ldd r20, Z+3 ; 0x03 325d0: 54 81 ldd r21, Z+4 ; 0x04 325d2: c7 01 movw r24, r14 325d4: b6 01 movw r22, r12 325d6: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 325da: 9b 01 movw r18, r22 325dc: ac 01 movw r20, r24 325de: c3 01 movw r24, r6 325e0: b2 01 movw r22, r4 325e2: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> return (1.f-t) * z0 + t * z1; 325e6: 29 81 ldd r18, Y+1 ; 0x01 325e8: 3a 81 ldd r19, Y+2 ; 0x02 325ea: 4b 81 ldd r20, Y+3 ; 0x03 325ec: 5c 81 ldd r21, Y+4 ; 0x04 325ee: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 325f2: 9b 01 movw r18, r22 325f4: ac 01 movw r20, r24 325f6: c5 01 movw r24, r10 325f8: b4 01 movw r22, r8 325fa: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> } 325fe: 2a 96 adiw r28, 0x0a ; 10 32600: 0f b6 in r0, 0x3f ; 63 32602: f8 94 cli 32604: de bf out 0x3e, r29 ; 62 32606: 0f be out 0x3f, r0 ; 63 32608: cd bf out 0x3d, r28 ; 61 3260a: df 91 pop r29 3260c: cf 91 pop r28 3260e: 1f 91 pop r17 32610: 0f 91 pop r16 32612: ff 90 pop r15 32614: ef 90 pop r14 32616: df 90 pop r13 32618: cf 90 pop r12 3261a: bf 90 pop r11 3261c: af 90 pop r10 3261e: 9f 90 pop r9 32620: 8f 90 pop r8 32622: 7f 90 pop r7 32624: 6f 90 pop r6 32626: 5f 90 pop r5 32628: 4f 90 pop r4 3262a: 3f 90 pop r3 3262c: 2f 90 pop r2 3262e: 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; 32630: 1a 86 std Y+10, r1 ; 0x0a 32632: 19 86 std Y+9, r1 ; 0x09 32634: 45 cf rjmp .-374 ; 0x324c0 00032636 : 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() 32636: 2f 92 push r2 32638: 3f 92 push r3 3263a: 4f 92 push r4 3263c: 5f 92 push r5 3263e: 6f 92 push r6 32640: 7f 92 push r7 32642: 8f 92 push r8 32644: 9f 92 push r9 32646: af 92 push r10 32648: bf 92 push r11 3264a: cf 92 push r12 3264c: df 92 push r13 3264e: ef 92 push r14 32650: ff 92 push r15 32652: 0f 93 push r16 32654: 1f 93 push r17 32656: cf 93 push r28 32658: df 93 push r29 3265a: 00 d0 rcall .+0 ; 0x3265c 3265c: 00 d0 rcall .+0 ; 0x3265e 3265e: 00 d0 rcall .+0 ; 0x32660 32660: cd b7 in r28, 0x3d ; 61 32662: de b7 in r29, 0x3e ; 62 32664: 09 e0 ldi r16, 0x09 ; 9 32666: 13 e1 ldi r17, 0x13 ; 19 32668: 1f 83 std Y+7, r17 ; 0x07 3266a: 0e 83 std Y+6, r16 ; 0x06 3266c: 2e 80 ldd r2, Y+6 ; 0x06 3266e: 3f 80 ldd r3, Y+7 ; 0x07 32670: 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])) 32672: f1 01 movw r30, r2 32674: 61 81 ldd r22, Z+1 ; 0x01 32676: 72 81 ldd r23, Z+2 ; 0x02 32678: 83 81 ldd r24, Z+3 ; 0x03 3267a: 94 81 ldd r25, Z+4 ; 0x04 3267c: 9b 01 movw r18, r22 3267e: ac 01 movw r20, r24 32680: 0f 94 74 a9 call 0x352e8 ; 0x352e8 <__unordsf2> 32684: 88 23 and r24, r24 32686: 09 f4 brne .+2 ; 0x3268a 32688: 7c c0 rjmp .+248 ; 0x32782 mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 3268a: 89 81 ldd r24, Y+1 ; 0x01 3268c: 0e 94 3b 5f call 0xbe76 ; 0xbe76 32690: 20 e0 ldi r18, 0x00 ; 0 32692: 30 e0 ldi r19, 0x00 ; 0 32694: 48 eb ldi r20, 0xB8 ; 184 32696: 51 e4 ldi r21, 0x41 ; 65 32698: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3269c: 6b 01 movw r12, r22 3269e: 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)) + 326a0: 20 e0 ldi r18, 0x00 ; 0 326a2: 30 e0 ldi r19, 0x00 ; 0 326a4: 4c ef ldi r20, 0xFC ; 252 326a6: 52 e4 ldi r21, 0x42 ; 66 326a8: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 326ac: 2b 01 movw r4, r22 326ae: 3c 01 movw r6, r24 326b0: 20 e0 ldi r18, 0x00 ; 0 326b2: 30 e0 ldi r19, 0x00 ; 0 326b4: 44 e6 ldi r20, 0x64 ; 100 326b6: 53 e4 ldi r21, 0x43 ; 67 326b8: c7 01 movw r24, r14 326ba: b6 01 movw r22, r12 326bc: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 326c0: 4b 01 movw r8, r22 326c2: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 326c4: 20 e0 ldi r18, 0x00 ; 0 326c6: 30 e0 ldi r19, 0x00 ; 0 326c8: 40 ec ldi r20, 0xC0 ; 192 326ca: 51 e4 ldi r21, 0x41 ; 65 326cc: c7 01 movw r24, r14 326ce: b6 01 movw r22, r12 326d0: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 326d4: 6b 01 movw r12, r22 326d6: 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)) + 326d8: ee 81 ldd r30, Y+6 ; 0x06 326da: ff 81 ldd r31, Y+7 ; 0x07 326dc: 21 81 ldd r18, Z+1 ; 0x01 326de: 32 81 ldd r19, Z+2 ; 0x02 326e0: 43 81 ldd r20, Z+3 ; 0x03 326e2: 54 81 ldd r21, Z+4 ; 0x04 326e4: c3 01 movw r24, r6 326e6: b2 01 movw r22, r4 326e8: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 326ec: a5 01 movw r20, r10 326ee: 94 01 movw r18, r8 326f0: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 326f4: 20 e0 ldi r18, 0x00 ; 0 326f6: 30 e9 ldi r19, 0x90 ; 144 326f8: 42 ea ldi r20, 0xA2 ; 162 326fa: 56 e4 ldi r21, 0x46 ; 70 326fc: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 32700: 6a 83 std Y+2, r22 ; 0x02 32702: 7b 83 std Y+3, r23 ; 0x03 32704: 8c 83 std Y+4, r24 ; 0x04 32706: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 32708: ee 81 ldd r30, Y+6 ; 0x06 3270a: ff 81 ldd r31, Y+7 ; 0x07 3270c: 25 85 ldd r18, Z+13 ; 0x0d 3270e: 36 85 ldd r19, Z+14 ; 0x0e 32710: 47 85 ldd r20, Z+15 ; 0x0f 32712: 50 89 ldd r21, Z+16 ; 0x10 32714: c7 01 movw r24, r14 32716: b6 01 movw r22, r12 32718: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3271c: a5 01 movw r20, r10 3271e: 94 01 movw r18, r8 32720: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 32724: 20 e0 ldi r18, 0x00 ; 0 32726: 30 e9 ldi r19, 0x90 ; 144 32728: 42 e2 ldi r20, 0x22 ; 34 3272a: 56 ec ldi r21, 0xC6 ; 198 3272c: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 32730: 9b 01 movw r18, r22 32732: 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)) + 32734: 6a 81 ldd r22, Y+2 ; 0x02 32736: 7b 81 ldd r23, Y+3 ; 0x03 32738: 8c 81 ldd r24, Y+4 ; 0x04 3273a: 9d 81 ldd r25, Y+5 ; 0x05 3273c: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 32740: 4b 01 movw r8, r22 32742: 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)); 32744: ee 81 ldd r30, Y+6 ; 0x06 32746: ff 81 ldd r31, Y+7 ; 0x07 32748: 21 8d ldd r18, Z+25 ; 0x19 3274a: 32 8d ldd r19, Z+26 ; 0x1a 3274c: 43 8d ldd r20, Z+27 ; 0x1b 3274e: 54 8d ldd r21, Z+28 ; 0x1c 32750: c7 01 movw r24, r14 32752: b6 01 movw r22, r12 32754: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 32758: a3 01 movw r20, r6 3275a: 92 01 movw r18, r4 3275c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 32760: 20 e0 ldi r18, 0x00 ; 0 32762: 30 e9 ldi r19, 0x90 ; 144 32764: 42 ea ldi r20, 0xA2 ; 162 32766: 56 e4 ldi r21, 0x46 ; 70 32768: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 3276c: 9b 01 movw r18, r22 3276e: 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)) + 32770: c5 01 movw r24, r10 32772: b4 01 movw r22, r8 32774: 0f 94 66 a5 call 0x34acc ; 0x34acc <__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] = 32778: f1 01 movw r30, r2 3277a: 61 83 std Z+1, r22 ; 0x01 3277c: 72 83 std Z+2, r23 ; 0x02 3277e: 83 83 std Z+3, r24 ; 0x03 32780: 94 83 std Z+4, r25 ; 0x04 32782: f4 e0 ldi r31, 0x04 ; 4 32784: 2f 0e add r2, r31 32786: 31 1c adc r3, r1 32788: 29 81 ldd r18, Y+1 ; 0x01 3278a: 2f 5f subi r18, 0xFF ; 255 3278c: 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) { 3278e: 27 30 cpi r18, 0x07 ; 7 32790: 09 f0 breq .+2 ; 0x32794 32792: 6f cf rjmp .-290 ; 0x32672 32794: 8e 81 ldd r24, Y+6 ; 0x06 32796: 9f 81 ldd r25, Y+7 ; 0x07 32798: 4c 96 adiw r24, 0x1c ; 28 3279a: 9f 83 std Y+7, r25 ; 0x07 3279c: 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) { 3279e: 8d 5c subi r24, 0xCD ; 205 327a0: 93 41 sbci r25, 0x13 ; 19 327a2: 09 f0 breq .+2 ; 0x327a6 327a4: 63 cf rjmp .-314 ; 0x3266c 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() 327a6: 19 87 std Y+9, r17 ; 0x09 327a8: 08 87 std Y+8, r16 ; 0x08 327aa: f1 e0 ldi r31, 0x01 ; 1 327ac: 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)) + 327ae: c8 01 movw r24, r16 327b0: 8b 5a subi r24, 0xAB ; 171 327b2: 9f 4f sbci r25, 0xFF ; 255 327b4: 9f 83 std Y+7, r25 ; 0x07 327b6: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 327b8: 18 01 movw r2, r16 327ba: 99 ea ldi r25, 0xA9 ; 169 327bc: 29 0e add r2, r25 327be: 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])) 327c0: e8 85 ldd r30, Y+8 ; 0x08 327c2: f9 85 ldd r31, Y+9 ; 0x09 327c4: 65 8d ldd r22, Z+29 ; 0x1d 327c6: 76 8d ldd r23, Z+30 ; 0x1e 327c8: 87 8d ldd r24, Z+31 ; 0x1f 327ca: 90 a1 ldd r25, Z+32 ; 0x20 327cc: 9b 01 movw r18, r22 327ce: ac 01 movw r20, r24 327d0: 0f 94 74 a9 call 0x352e8 ; 0x352e8 <__unordsf2> 327d4: 88 23 and r24, r24 327d6: 09 f4 brne .+2 ; 0x327da 327d8: 79 c0 rjmp .+242 ; 0x328cc static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 327da: 89 81 ldd r24, Y+1 ; 0x01 327dc: 0e 94 3b 5f call 0xbe76 ; 0xbe76 327e0: 20 e0 ldi r18, 0x00 ; 0 327e2: 30 e0 ldi r19, 0x00 ; 0 327e4: 40 ea ldi r20, 0xA0 ; 160 327e6: 50 e4 ldi r21, 0x40 ; 64 327e8: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 327ec: 6b 01 movw r12, r22 327ee: 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)) + 327f0: 20 e0 ldi r18, 0x00 ; 0 327f2: 30 e0 ldi r19, 0x00 ; 0 327f4: 48 ed ldi r20, 0xD8 ; 216 327f6: 52 e4 ldi r21, 0x42 ; 66 327f8: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 327fc: 2b 01 movw r4, r22 327fe: 3c 01 movw r6, r24 32800: 20 e0 ldi r18, 0x00 ; 0 32802: 30 e0 ldi r19, 0x00 ; 0 32804: 42 e5 ldi r20, 0x52 ; 82 32806: 53 e4 ldi r21, 0x43 ; 67 32808: c7 01 movw r24, r14 3280a: b6 01 movw r22, r12 3280c: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 32810: 4b 01 movw r8, r22 32812: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 32814: 20 e0 ldi r18, 0x00 ; 0 32816: 30 e0 ldi r19, 0x00 ; 0 32818: 40 ec ldi r20, 0xC0 ; 192 3281a: 50 e4 ldi r21, 0x40 ; 64 3281c: c7 01 movw r24, r14 3281e: b6 01 movw r22, r12 32820: 0f 94 65 a5 call 0x34aca ; 0x34aca <__subsf3> 32824: 6b 01 movw r12, r22 32826: 7c 01 movw r14, r24 32828: ee 81 ldd r30, Y+6 ; 0x06 3282a: ff 81 ldd r31, Y+7 ; 0x07 3282c: 20 81 ld r18, Z 3282e: 31 81 ldd r19, Z+1 ; 0x01 32830: 42 81 ldd r20, Z+2 ; 0x02 32832: 53 81 ldd r21, Z+3 ; 0x03 32834: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 32838: a5 01 movw r20, r10 3283a: 94 01 movw r18, r8 3283c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 32840: 20 e0 ldi r18, 0x00 ; 0 32842: 30 e9 ldi r19, 0x90 ; 144 32844: 42 e2 ldi r20, 0x22 ; 34 32846: 56 ec ldi r21, 0xC6 ; 198 32848: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 3284c: 6a 83 std Y+2, r22 ; 0x02 3284e: 7b 83 std Y+3, r23 ; 0x03 32850: 8c 83 std Y+4, r24 ; 0x04 32852: 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)) + 32854: f8 01 movw r30, r16 32856: 21 81 ldd r18, Z+1 ; 0x01 32858: 32 81 ldd r19, Z+2 ; 0x02 3285a: 43 81 ldd r20, Z+3 ; 0x03 3285c: 54 81 ldd r21, Z+4 ; 0x04 3285e: c3 01 movw r24, r6 32860: b2 01 movw r22, r4 32862: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 32866: a5 01 movw r20, r10 32868: 94 01 movw r18, r8 3286a: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 3286e: 20 e0 ldi r18, 0x00 ; 0 32870: 30 e9 ldi r19, 0x90 ; 144 32872: 42 ea ldi r20, 0xA2 ; 162 32874: 56 e4 ldi r21, 0x46 ; 70 32876: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 3287a: 9b 01 movw r18, r22 3287c: ac 01 movw r20, r24 3287e: 6a 81 ldd r22, Y+2 ; 0x02 32880: 7b 81 ldd r23, Y+3 ; 0x03 32882: 8c 81 ldd r24, Y+4 ; 0x04 32884: 9d 81 ldd r25, Y+5 ; 0x05 32886: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 3288a: 4b 01 movw r8, r22 3288c: 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)); 3288e: f1 01 movw r30, r2 32890: 20 81 ld r18, Z 32892: 31 81 ldd r19, Z+1 ; 0x01 32894: 42 81 ldd r20, Z+2 ; 0x02 32896: 53 81 ldd r21, Z+3 ; 0x03 32898: c7 01 movw r24, r14 3289a: b6 01 movw r22, r12 3289c: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 328a0: a3 01 movw r20, r6 328a2: 92 01 movw r18, r4 328a4: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 328a8: 20 e0 ldi r18, 0x00 ; 0 328aa: 30 e9 ldi r19, 0x90 ; 144 328ac: 42 ea ldi r20, 0xA2 ; 162 328ae: 56 e4 ldi r21, 0x46 ; 70 328b0: 0f 94 65 a6 call 0x34cca ; 0x34cca <__divsf3> 328b4: 9b 01 movw r18, r22 328b6: 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)) + 328b8: c5 01 movw r24, r10 328ba: b4 01 movw r22, r8 328bc: 0f 94 66 a5 call 0x34acc ; 0x34acc <__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] = 328c0: e8 85 ldd r30, Y+8 ; 0x08 328c2: f9 85 ldd r31, Y+9 ; 0x09 328c4: 65 8f std Z+29, r22 ; 0x1d 328c6: 76 8f std Z+30, r23 ; 0x1e 328c8: 87 8f std Z+31, r24 ; 0x1f 328ca: 90 a3 std Z+32, r25 ; 0x20 328cc: 88 85 ldd r24, Y+8 ; 0x08 328ce: 99 85 ldd r25, Y+9 ; 0x09 328d0: 4c 96 adiw r24, 0x1c ; 28 328d2: 99 87 std Y+9, r25 ; 0x09 328d4: 88 87 std Y+8, r24 ; 0x08 328d6: 99 81 ldd r25, Y+1 ; 0x01 328d8: 9f 5f subi r25, 0xFF ; 255 328da: 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) { 328dc: 96 30 cpi r25, 0x06 ; 6 328de: 09 f0 breq .+2 ; 0x328e2 328e0: 6f cf rjmp .-290 ; 0x327c0 328e2: 0c 5f subi r16, 0xFC ; 252 328e4: 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) { 328e6: e3 e1 ldi r30, 0x13 ; 19 328e8: 05 32 cpi r16, 0x25 ; 37 328ea: 1e 07 cpc r17, r30 328ec: 09 f0 breq .+2 ; 0x328f0 328ee: 5b cf rjmp .-330 ; 0x327a6 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 328f0: 29 96 adiw r28, 0x09 ; 9 328f2: 0f b6 in r0, 0x3f ; 63 328f4: f8 94 cli 328f6: de bf out 0x3e, r29 ; 62 328f8: 0f be out 0x3f, r0 ; 63 328fa: cd bf out 0x3d, r28 ; 61 328fc: df 91 pop r29 328fe: cf 91 pop r28 32900: 1f 91 pop r17 32902: 0f 91 pop r16 32904: ff 90 pop r15 32906: ef 90 pop r14 32908: df 90 pop r13 3290a: cf 90 pop r12 3290c: bf 90 pop r11 3290e: af 90 pop r10 32910: 9f 90 pop r9 32912: 8f 90 pop r8 32914: 7f 90 pop r7 32916: 6f 90 pop r6 32918: 5f 90 pop r5 3291a: 4f 90 pop r4 3291c: 3f 90 pop r3 3291e: 2f 90 pop r2 32920: 08 95 ret 00032922 : 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) { 32922: 1f 93 push r17 32924: cf 93 push r28 32926: df 93 push r29 32928: 00 d0 rcall .+0 ; 0x3292a 3292a: 1f 92 push r1 3292c: 1f 92 push r1 3292e: cd b7 in r28, 0x3d ; 61 32930: de b7 in r29, 0x3e ; 62 32932: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 32934: 48 2f mov r20, r24 32936: 62 e5 ldi r22, 0x52 ; 82 32938: ce 01 movw r24, r28 3293a: 01 96 adiw r24, 0x01 ; 1 3293c: 0f 94 2b 4e call 0x29c56 ; 0x29c56 32940: 49 81 ldd r20, Y+1 ; 0x01 32942: 5a 81 ldd r21, Y+2 ; 0x02 32944: 6b 81 ldd r22, Y+3 ; 0x03 32946: 7c 81 ldd r23, Y+4 ; 0x04 32948: 8d 81 ldd r24, Y+5 ; 0x05 3294a: 0f 94 ce 56 call 0x2ad9c ; 0x2ad9c scopeState = nextState; 3294e: 10 93 95 12 sts 0x1295, r17 ; 0x801295 } 32952: 0f 90 pop r0 32954: 0f 90 pop r0 32956: 0f 90 pop r0 32958: 0f 90 pop r0 3295a: 0f 90 pop r0 3295c: df 91 pop r29 3295e: cf 91 pop r28 32960: 1f 91 pop r17 32962: 08 95 ret 00032964 : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 32964: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 32968: e2 e7 ldi r30, 0x72 ; 114 3296a: f2 ea ldi r31, 0xA2 ; 162 3296c: 84 91 lpm r24, Z 3296e: 67 e0 ldi r22, 0x07 ; 7 32970: 0d 94 91 94 jmp 0x32922 ; 0x32922 00032974 : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 32974: e0 91 e0 12 lds r30, 0x12E0 ; 0x8012e0 32978: ae 2f mov r26, r30 3297a: b0 e0 ldi r27, 0x00 ; 0 3297c: aa 0f add r26, r26 3297e: bb 1f adc r27, r27 32980: a6 52 subi r26, 0x26 ; 38 32982: bd 4e sbci r27, 0xED ; 237 32984: 20 91 ad 12 lds r18, 0x12AD ; 0x8012ad 32988: 30 91 ae 12 lds r19, 0x12AE ; 0x8012ae 3298c: 2d 93 st X+, r18 3298e: 3c 93 st X, r19 ++regIndex; 32990: ef 5f subi r30, 0xFF ; 255 32992: e0 93 e0 12 sts 0x12E0, r30 ; 0x8012e0 if (regIndex >= regs16Count) { 32996: e2 30 cpi r30, 0x02 ; 2 32998: 40 f4 brcc .+16 ; 0x329aa return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 3299a: f0 e0 ldi r31, 0x00 ; 0 3299c: e7 5a subi r30, 0xA7 ; 167 3299e: fd 45 sbci r31, 0x5D ; 93 329a0: 84 91 lpm r24, Z 329a2: 68 e0 ldi r22, 0x08 ; 8 329a4: 0f 94 91 94 call 0x32922 ; 0x32922 } return ScopeState::Reading16bitRegisters; 329a8: 88 e0 ldi r24, 0x08 ; 8 } 329aa: 08 95 ret 000329ac : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 329ac: e0 91 e0 12 lds r30, 0x12E0 ; 0x8012e0 329b0: ae 2f mov r26, r30 329b2: b0 e0 ldi r27, 0x00 ; 0 329b4: a9 52 subi r26, 0x29 ; 41 329b6: bd 4e sbci r27, 0xED ; 237 329b8: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 329bc: 8c 93 st X, r24 ++regIndex; 329be: ef 5f subi r30, 0xFF ; 255 329c0: e0 93 e0 12 sts 0x12E0, r30 ; 0x8012e0 if (regIndex >= regs8Count) { 329c4: e3 30 cpi r30, 0x03 ; 3 329c6: 40 f0 brcs .+16 ; 0x329d8 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 329c8: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 329cc: e9 e5 ldi r30, 0x59 ; 89 329ce: f2 ea ldi r31, 0xA2 ; 162 329d0: 84 91 lpm r24, Z 329d2: 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); 329d4: 0d 94 91 94 jmp 0x32922 ; 0x32922 329d8: f0 e0 ldi r31, 0x00 ; 0 329da: ee 58 subi r30, 0x8E ; 142 329dc: fd 45 sbci r31, 0x5D ; 93 329de: 84 91 lpm r24, Z 329e0: 67 e0 ldi r22, 0x07 ; 7 329e2: f8 cf rjmp .-16 ; 0x329d4 000329e4 : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 329e4: cf 93 push r28 329e6: df 93 push r29 329e8: 00 d0 rcall .+0 ; 0x329ea 329ea: 00 d0 rcall .+0 ; 0x329ec 329ec: 00 d0 rcall .+0 ; 0x329ee 329ee: 1f 92 push r1 329f0: cd b7 in r28, 0x3d ; 61 329f2: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 329f4: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 329f8: 82 34 cpi r24, 0x42 ; 66 329fa: 09 f4 brne .+2 ; 0x329fe 329fc: 46 c0 rjmp .+140 ; 0x32a8a 329fe: b8 f5 brcc .+110 ; 0x32a6e 32a00: 88 23 and r24, r24 32a02: 09 f4 brne .+2 ; 0x32a06 32a04: 72 c0 rjmp .+228 ; 0x32aea plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 32a06: 84 e0 ldi r24, 0x04 ; 4 32a08: 80 93 94 12 sts 0x1294, r24 ; 0x801294 32a0c: 85 e0 ldi r24, 0x05 ; 5 32a0e: ec e9 ldi r30, 0x9C ; 156 32a10: f2 e1 ldi r31, 0x12 ; 18 32a12: de 01 movw r26, r28 32a14: 16 96 adiw r26, 0x06 ; 6 32a16: 01 90 ld r0, Z+ 32a18: 0d 92 st X+, r0 32a1a: 8a 95 dec r24 32a1c: e1 f7 brne .-8 ; 0x32a16 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 32a1e: 85 e0 ldi r24, 0x05 ; 5 32a20: fe 01 movw r30, r28 32a22: 36 96 adiw r30, 0x06 ; 6 32a24: a7 e9 ldi r26, 0x97 ; 151 32a26: b2 e1 ldi r27, 0x12 ; 18 32a28: 01 90 ld r0, Z+ 32a2a: 0d 92 st X+, r0 32a2c: 8a 95 dec r24 32a2e: e1 f7 brne .-8 ; 0x32a28 SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 32a30: 40 e0 ldi r20, 0x00 ; 0 32a32: 60 e0 ldi r22, 0x00 ; 0 32a34: ce 01 movw r24, r28 32a36: 01 96 adiw r24, 0x01 ; 1 32a38: 0f 94 2b 4e call 0x29c56 ; 0x29c56 32a3c: 85 e0 ldi r24, 0x05 ; 5 32a3e: fe 01 movw r30, r28 32a40: 31 96 adiw r30, 0x01 ; 1 32a42: ac e9 ldi r26, 0x9C ; 156 32a44: b2 e1 ldi r27, 0x12 ; 18 32a46: 01 90 ld r0, Z+ 32a48: 0d 92 st X+, r0 32a4a: 8a 95 dec r24 32a4c: e1 f7 brne .-8 ; 0x32a46 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 32a4e: 85 e0 ldi r24, 0x05 ; 5 32a50: 80 93 95 12 sts 0x1295, r24 ; 0x801295 SendMsg(rq); 32a54: 40 91 97 12 lds r20, 0x1297 ; 0x801297 32a58: 50 91 98 12 lds r21, 0x1298 ; 0x801298 32a5c: 60 91 99 12 lds r22, 0x1299 ; 0x801299 32a60: 70 91 9a 12 lds r23, 0x129A ; 0x80129a 32a64: 80 91 9b 12 lds r24, 0x129B ; 0x80129b 32a68: 0f 94 ce 56 call 0x2ad9c ; 0x2ad9c 32a6c: 2e c0 rjmp .+92 ; 0x32aca ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 32a6e: 82 35 cpi r24, 0x52 ; 82 32a70: b1 f1 breq .+108 ; 0x32ade 32a72: 87 35 cpi r24, 0x57 ; 87 32a74: 41 f6 brne .-112 ; 0x32a06 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); 32a76: 60 91 9e 12 lds r22, 0x129E ; 0x80129e 32a7a: 70 91 9f 12 lds r23, 0x129F ; 0x80129f 32a7e: 4c e0 ldi r20, 0x0C ; 12 32a80: 80 91 9d 12 lds r24, 0x129D ; 0x80129d 32a84: 0f 94 39 57 call 0x2ae72 ; 0x2ae72 32a88: 11 c0 rjmp .+34 ; 0x32aac SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 32a8a: 40 91 9d 12 lds r20, 0x129D ; 0x80129d 32a8e: 62 e4 ldi r22, 0x42 ; 66 32a90: ce 01 movw r24, r28 32a92: 01 96 adiw r24, 0x01 ; 1 32a94: 0f 94 2b 4e call 0x29c56 ; 0x29c56 32a98: 49 81 ldd r20, Y+1 ; 0x01 32a9a: 5a 81 ldd r21, Y+2 ; 0x02 32a9c: 6b 81 ldd r22, Y+3 ; 0x03 32a9e: 7c 81 ldd r23, Y+4 ; 0x04 32aa0: 8d 81 ldd r24, Y+5 ; 0x05 32aa2: 0f 94 ce 56 call 0x2ad9c ; 0x2ad9c scopeState = ScopeState::ButtonSent; 32aa6: 8a e0 ldi r24, 0x0A ; 10 32aa8: 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); 32aac: 40 e0 ldi r20, 0x00 ; 0 32aae: 60 e0 ldi r22, 0x00 ; 0 32ab0: ce 01 movw r24, r28 32ab2: 01 96 adiw r24, 0x01 ; 1 32ab4: 0f 94 2b 4e call 0x29c56 ; 0x29c56 32ab8: 85 e0 ldi r24, 0x05 ; 5 32aba: fe 01 movw r30, r28 32abc: 31 96 adiw r30, 0x01 ; 1 32abe: ac e9 ldi r26, 0x9C ; 156 32ac0: b2 e1 ldi r27, 0x12 ; 18 32ac2: 01 90 ld r0, Z+ 32ac4: 0d 92 st X+, r0 32ac6: 8a 95 dec r24 32ac8: e1 f7 brne .-8 ; 0x32ac2 default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 32aca: 81 e0 ldi r24, 0x01 ; 1 } } 32acc: 2a 96 adiw r28, 0x0a ; 10 32ace: 0f b6 in r0, 0x3f ; 63 32ad0: f8 94 cli 32ad2: de bf out 0x3e, r29 ; 62 32ad4: 0f be out 0x3f, r0 ; 63 32ad6: cd bf out 0x3d, r28 ; 61 32ad8: df 91 pop r29 32ada: cf 91 pop r28 32adc: 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); 32ade: 6b e0 ldi r22, 0x0B ; 11 32ae0: 80 91 9d 12 lds r24, 0x129D ; 0x80129d 32ae4: 0f 94 91 94 call 0x32922 ; 0x32922 32ae8: e1 cf rjmp .-62 ; 0x32aac case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 32aea: 80 e0 ldi r24, 0x00 ; 0 32aec: ef cf rjmp .-34 ; 0x32acc 00032aee : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 32aee: cf 93 push r28 32af0: df 93 push r29 32af2: 00 d0 rcall .+0 ; 0x32af4 32af4: 1f 92 push r1 32af6: 1f 92 push r1 32af8: cd b7 in r28, 0x3d ; 61 32afa: de b7 in r29, 0x3e ; 62 32afc: 49 83 std Y+1, r20 ; 0x01 32afe: 5a 83 std Y+2, r21 ; 0x02 32b00: 6b 83 std Y+3, r22 ; 0x03 32b02: 7c 83 std Y+4, r23 ; 0x04 32b04: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 32b06: 85 e0 ldi r24, 0x05 ; 5 32b08: fe 01 movw r30, r28 32b0a: 31 96 adiw r30, 0x01 ; 1 32b0c: ac e9 ldi r26, 0x9C ; 156 32b0e: b2 e1 ldi r27, 0x12 ; 18 32b10: 01 90 ld r0, Z+ 32b12: 0d 92 st X+, r0 32b14: 8a 95 dec r24 32b16: e1 f7 brne .-8 ; 0x32b10 if (!ExpectsResponse()) { 32b18: 80 91 95 12 lds r24, 0x1295 ; 0x801295 32b1c: 87 ff sbrs r24, 7 32b1e: 09 c0 rjmp .+18 ; 0x32b32 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 32b20: 0f 90 pop r0 32b22: 0f 90 pop r0 32b24: 0f 90 pop r0 32b26: 0f 90 pop r0 32b28: 0f 90 pop r0 32b2a: df 91 pop r29 32b2c: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 32b2e: 0d 94 f2 94 jmp 0x329e4 ; 0x329e4 } // otherwise wait for an empty window to activate the request } 32b32: 0f 90 pop r0 32b34: 0f 90 pop r0 32b36: 0f 90 pop r0 32b38: 0f 90 pop r0 32b3a: 0f 90 pop r0 32b3c: df 91 pop r29 32b3e: cf 91 pop r28 32b40: 08 95 ret 00032b42 : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 32b42: cf 93 push r28 32b44: df 93 push r29 32b46: 00 d0 rcall .+0 ; 0x32b48 32b48: 1f 92 push r1 32b4a: 1f 92 push r1 32b4c: cd b7 in r28, 0x3d ; 61 32b4e: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 32b50: 48 2f mov r20, r24 32b52: 68 e5 ldi r22, 0x58 ; 88 32b54: ce 01 movw r24, r28 32b56: 01 96 adiw r24, 0x01 ; 1 32b58: 0f 94 2b 4e call 0x29c56 ; 0x29c56 32b5c: 49 81 ldd r20, Y+1 ; 0x01 32b5e: 5a 81 ldd r21, Y+2 ; 0x02 32b60: 6b 81 ldd r22, Y+3 ; 0x03 32b62: 7c 81 ldd r23, Y+4 ; 0x04 32b64: 8d 81 ldd r24, Y+5 ; 0x05 32b66: 0f 94 77 95 call 0x32aee ; 0x32aee } 32b6a: 0f 90 pop r0 32b6c: 0f 90 pop r0 32b6e: 0f 90 pop r0 32b70: 0f 90 pop r0 32b72: 0f 90 pop r0 32b74: df 91 pop r29 32b76: cf 91 pop r28 32b78: 08 95 ret 00032b7a : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 32b7a: 1f 93 push r17 32b7c: cf 93 push r28 32b7e: df 93 push r29 32b80: 00 d0 rcall .+0 ; 0x32b82 32b82: 1f 92 push r1 32b84: 1f 92 push r1 32b86: cd b7 in r28, 0x3d ; 61 32b88: de b7 in r29, 0x3e ; 62 32b8a: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 32b8c: 48 2f mov r20, r24 32b8e: 63 e5 ldi r22, 0x53 ; 83 32b90: ce 01 movw r24, r28 32b92: 01 96 adiw r24, 0x01 ; 1 32b94: 0f 94 2b 4e call 0x29c56 ; 0x29c56 32b98: 49 81 ldd r20, Y+1 ; 0x01 32b9a: 5a 81 ldd r21, Y+2 ; 0x02 32b9c: 6b 81 ldd r22, Y+3 ; 0x03 32b9e: 7c 81 ldd r23, Y+4 ; 0x04 32ba0: 8d 81 ldd r24, Y+5 ; 0x05 32ba2: 0f 94 ce 56 call 0x2ad9c ; 0x2ad9c scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 32ba6: 10 93 95 12 sts 0x1295, r17 ; 0x801295 } 32baa: 0f 90 pop r0 32bac: 0f 90 pop r0 32bae: 0f 90 pop r0 32bb0: 0f 90 pop r0 32bb2: 0f 90 pop r0 32bb4: df 91 pop r29 32bb6: cf 91 pop r28 32bb8: 1f 91 pop r17 32bba: 08 95 ret 00032bbc : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 32bbc: 1f 93 push r17 32bbe: cf 93 push r28 32bc0: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 32bc2: e1 e0 ldi r30, 0x01 ; 1 32bc4: f1 e0 ldi r31, 0x01 ; 1 32bc6: 80 81 ld r24, Z 32bc8: 8e 7f andi r24, 0xFE ; 254 32bca: 80 83 st Z, r24 PORTH |= 0x01; 32bcc: e2 e0 ldi r30, 0x02 ; 2 32bce: f1 e0 ldi r31, 0x01 ; 1 32bd0: 80 81 ld r24, Z 32bd2: 81 60 ori r24, 0x01 ; 1 32bd4: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 32bd6: e5 e4 ldi r30, 0x45 ; 69 32bd8: fd e0 ldi r31, 0x0D ; 13 32bda: 90 e1 ldi r25, 0x10 ; 16 32bdc: 90 83 st Z, r25 ptr[1] = 0; 32bde: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 32be0: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 32be2: e0 ed ldi r30, 0xD0 ; 208 32be4: f0 e0 ldi r31, 0x00 ; 0 32be6: 80 81 ld r24, Z 32be8: 82 60 ori r24, 0x02 ; 2 32bea: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 32bec: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 32bf0: e1 ed ldi r30, 0xD1 ; 209 32bf2: f0 e0 ldi r31, 0x00 ; 0 32bf4: 88 e1 ldi r24, 0x18 ; 24 32bf6: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 32bf8: 80 81 ld r24, Z 32bfa: 80 68 ori r24, 0x80 ; 128 32bfc: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 32bfe: e4 e7 ldi r30, 0x74 ; 116 32c00: f2 e1 ldi r31, 0x12 ; 18 32c02: 82 eb ldi r24, 0xB2 ; 178 32c04: 9c ef ldi r25, 0xFC ; 252 32c06: 91 87 std Z+9, r25 ; 0x09 32c08: 80 87 std Z+8, r24 ; 0x08 32c0a: 8a e9 ldi r24, 0x9A ; 154 32c0c: 9c ef ldi r25, 0xFC ; 252 32c0e: 93 87 std Z+11, r25 ; 0x0b 32c10: 82 87 std Z+10, r24 ; 0x0a 32c12: 13 e0 ldi r17, 0x03 ; 3 32c14: 13 83 std Z+3, r17 ; 0x03 32c16: 15 86 std Z+13, r1 ; 0x0d 32c18: 14 86 std Z+12, r1 ; 0x0c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 32c1a: 80 e0 ldi r24, 0x00 ; 0 32c1c: 0f 94 a1 95 call 0x32b42 ; 0x32b42 mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 32c20: 83 e6 ldi r24, 0x63 ; 99 32c22: 0f 94 3d 65 call 0x2ca7a ; 0x2ca7a retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 32c26: 8e ea ldi r24, 0xAE ; 174 32c28: 90 ea ldi r25, 0xA0 ; 160 32c2a: 0e 94 18 7d call 0xfa30 ; 0xfa30 retryAttempts = MAX_RETRIES; 32c2e: c2 e9 ldi r28, 0x92 ; 146 32c30: d2 e1 ldi r29, 0x12 ; 18 32c32: 10 93 e6 12 sts 0x12E6, r17 ; 0x8012e6 } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 32c36: 87 e7 ldi r24, 0x77 ; 119 32c38: 92 ea ldi r25, 0xA2 ; 162 32c3a: 0e 94 18 7d call 0xfa30 ; 0xfa30 /// @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; } 32c3e: 8a e0 ldi r24, 0x0A ; 10 32c40: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 32c42: 82 e0 ldi r24, 0x02 ; 2 32c44: 80 93 01 13 sts 0x1301, r24 ; 0x801301 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 32c48: 81 e0 ldi r24, 0x01 ; 1 32c4a: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 32c4c: 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; 32c4e: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 32c50: 86 e0 ldi r24, 0x06 ; 6 32c52: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 32c54: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 32c56: df 91 pop r29 32c58: cf 91 pop r28 32c5a: 1f 91 pop r17 32c5c: 0d 94 bd 95 jmp 0x32b7a ; 0x32b7a 00032c60 : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 32c60: cf 93 push r28 32c62: df 93 push r29 32c64: 00 d0 rcall .+0 ; 0x32c66 32c66: 1f 92 push r1 32c68: 1f 92 push r1 32c6a: cd b7 in r28, 0x3d ; 61 32c6c: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 32c6e: 40 e0 ldi r20, 0x00 ; 0 32c70: 61 e5 ldi r22, 0x51 ; 81 32c72: ce 01 movw r24, r28 32c74: 01 96 adiw r24, 0x01 ; 1 32c76: 0f 94 2b 4e call 0x29c56 ; 0x29c56 32c7a: 49 81 ldd r20, Y+1 ; 0x01 32c7c: 5a 81 ldd r21, Y+2 ; 0x02 32c7e: 6b 81 ldd r22, Y+3 ; 0x03 32c80: 7c 81 ldd r23, Y+4 ; 0x04 32c82: 8d 81 ldd r24, Y+5 ; 0x05 32c84: 0f 94 ce 56 call 0x2ad9c ; 0x2ad9c scopeState = ScopeState::QuerySent; 32c88: 84 e0 ldi r24, 0x04 ; 4 32c8a: 80 93 95 12 sts 0x1295, r24 ; 0x801295 } 32c8e: 0f 90 pop r0 32c90: 0f 90 pop r0 32c92: 0f 90 pop r0 32c94: 0f 90 pop r0 32c96: 0f 90 pop r0 32c98: df 91 pop r29 32c9a: cf 91 pop r28 32c9c: 08 95 ret 00032c9e : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 32c9e: cf 93 push r28 32ca0: df 93 push r29 32ca2: 00 d0 rcall .+0 ; 0x32ca4 32ca4: 1f 92 push r1 32ca6: 1f 92 push r1 32ca8: cd b7 in r28, 0x3d ; 61 32caa: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 32cac: 0f 94 6e 4e call 0x29cdc ; 0x29cdc 32cb0: 80 93 d6 12 sts 0x12D6, r24 ; 0x8012d6 32cb4: 48 2f mov r20, r24 32cb6: 66 e6 ldi r22, 0x66 ; 102 32cb8: ce 01 movw r24, r28 32cba: 01 96 adiw r24, 0x01 ; 1 32cbc: 0f 94 2b 4e call 0x29c56 ; 0x29c56 32cc0: 49 81 ldd r20, Y+1 ; 0x01 32cc2: 5a 81 ldd r21, Y+2 ; 0x02 32cc4: 6b 81 ldd r22, Y+3 ; 0x03 32cc6: 7c 81 ldd r23, Y+4 ; 0x04 32cc8: 8d 81 ldd r24, Y+5 ; 0x05 32cca: 0f 94 ce 56 call 0x2ad9c ; 0x2ad9c scopeState = ScopeState::FilamentSensorStateSent; 32cce: 86 e0 ldi r24, 0x06 ; 6 32cd0: 80 93 95 12 sts 0x1295, r24 ; 0x801295 } 32cd4: 0f 90 pop r0 32cd6: 0f 90 pop r0 32cd8: 0f 90 pop r0 32cda: 0f 90 pop r0 32cdc: 0f 90 pop r0 32cde: df 91 pop r29 32ce0: cf 91 pop r28 32ce2: 08 95 ret 00032ce4 : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 32ce4: cf 93 push r28 32ce6: df 93 push r29 32ce8: 00 d0 rcall .+0 ; 0x32cea 32cea: 1f 92 push r1 32cec: 1f 92 push r1 32cee: cd b7 in r28, 0x3d ; 61 32cf0: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 32cf2: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 32cf6: 85 34 cpi r24, 0x45 ; 69 32cf8: f1 f0 breq .+60 ; 0x32d36 32cfa: 20 f4 brcc .+8 ; 0x32d04 32cfc: 82 34 cpi r24, 0x42 ; 66 32cfe: 51 f1 breq .+84 ; 0x32d54 } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 32d00: 85 e0 ldi r24, 0x05 ; 5 32d02: 11 c0 rjmp .+34 ; 0x32d26 } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 32d04: 86 34 cpi r24, 0x46 ; 70 32d06: 71 f1 breq .+92 ; 0x32d64 32d08: 80 35 cpi r24, 0x50 ; 80 32d0a: d1 f7 brne .-12 ; 0x32d00 case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 32d0c: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 32d10: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = ErrorCode::OK; 32d14: 81 e0 ldi r24, 0x01 ; 1 32d16: 90 e0 ldi r25, 0x00 ; 0 32d18: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 32d1c: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 32d20: 0f 94 4f 96 call 0x32c9e ; 0x32c9e return Processing; 32d24: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 32d26: 0f 90 pop r0 32d28: 0f 90 pop r0 32d2a: 0f 90 pop r0 32d2c: 0f 90 pop r0 32d2e: 0f 90 pop r0 32d30: df 91 pop r29 32d32: cf 91 pop r28 32d34: 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; 32d36: 8c e0 ldi r24, 0x0C ; 12 32d38: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = static_cast(rsp.paramValue); 32d3c: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 32d40: 90 91 ae 12 lds r25, 0x12AE ; 0x8012ae 32d44: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 32d48: 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(); 32d4c: 0f 94 4f 96 call 0x32c9e ; 0x32c9e return CommandError; 32d50: 87 e0 ldi r24, 0x07 ; 7 32d52: e9 cf rjmp .-46 ; 0x32d26 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); 32d54: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 32d58: 80 93 d5 12 sts 0x12D5, r24 ; 0x8012d5 SendAndUpdateFilamentSensor(); 32d5c: 0f 94 4f 96 call 0x32c9e ; 0x32c9e return ButtonPushed; 32d60: 8b e0 ldi r24, 0x0B ; 11 32d62: e1 cf rjmp .-62 ; 0x32d26 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) { 32d64: 90 91 97 12 lds r25, 0x1297 ; 0x801297 32d68: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 32d6c: 98 13 cpse r25, r24 32d6e: 22 c0 rjmp .+68 ; 0x32db4 32d70: 90 91 98 12 lds r25, 0x1298 ; 0x801298 32d74: 80 91 a8 12 lds r24, 0x12A8 ; 0x8012a8 32d78: 98 13 cpse r25, r24 32d7a: 1c c0 rjmp .+56 ; 0x32db4 progressCode = ProgressCode::OK; 32d7c: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 errorCode = ErrorCode::OK; 32d80: 81 e0 ldi r24, 0x01 ; 1 32d82: 90 e0 ldi r25, 0x00 ; 0 32d84: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 32d88: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 scopeState = ScopeState::Ready; 32d8c: 82 e8 ldi r24, 0x82 ; 130 32d8e: 80 93 95 12 sts 0x1295, r24 ; 0x801295 rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 32d92: 40 e0 ldi r20, 0x00 ; 0 32d94: 60 e0 ldi r22, 0x00 ; 0 32d96: ce 01 movw r24, r28 32d98: 01 96 adiw r24, 0x01 ; 1 32d9a: 0f 94 2b 4e call 0x29c56 ; 0x29c56 32d9e: 85 e0 ldi r24, 0x05 ; 5 32da0: fe 01 movw r30, r28 32da2: 31 96 adiw r30, 0x01 ; 1 32da4: a7 e9 ldi r26, 0x97 ; 151 32da6: b2 e1 ldi r27, 0x12 ; 18 32da8: 01 90 ld r0, Z+ 32daa: 0d 92 st X+, r0 32dac: 8a 95 dec r24 32dae: e1 f7 brne .-8 ; 0x32da8 32db0: 82 e0 ldi r24, 0x02 ; 2 32db2: b9 cf rjmp .-142 ; 0x32d26 return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 32db4: 83 e0 ldi r24, 0x03 ; 3 32db6: b7 cf rjmp .-146 ; 0x32d26 00032db8 : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 32db8: 1f 93 push r17 32dba: cf 93 push r28 32dbc: df 93 push r29 32dbe: 00 d0 rcall .+0 ; 0x32dc0 32dc0: 1f 92 push r1 32dc2: 1f 92 push r1 32dc4: cd b7 in r28, 0x3d ; 61 32dc6: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 32dc8: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> 32dcc: 81 11 cpse r24, r1 32dce: 2a c0 rjmp .+84 ; 0x32e24 auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 32dd0: 10 91 fc 12 lds r17, 0x12FC ; 0x8012fc 32dd4: 1f 3f cpi r17, 0xFF ; 255 32dd6: 91 f5 brne .+100 ; 0x32e3c btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 32dd8: 80 91 fb 12 lds r24, 0x12FB ; 0x8012fb 32ddc: 81 11 cpse r24, r1 32dde: 60 c0 rjmp .+192 ; 0x32ea0 32de0: 1f 3f cpi r17, 0xFF ; 255 32de2: b9 f0 breq .+46 ; 0x32e12 inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 32de4: 81 e0 ldi r24, 0x01 ; 1 32de6: 90 e0 ldi r25, 0x00 ; 0 32de8: 90 93 93 12 sts 0x1293, r25 ; 0x801293 32dec: 80 93 92 12 sts 0x1292, r24 ; 0x801292 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 32df0: 90 93 fa 12 sts 0x12FA, r25 ; 0x8012fa 32df4: 80 93 f9 12 sts 0x12F9, r24 ; 0x8012f9 lastErrorSource = ErrorSource::ErrorSourceNone; 32df8: 8f ef ldi r24, 0xFF ; 255 32dfa: 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) { 32dfe: 13 30 cpi r17, 0x03 ; 3 32e00: 09 f4 brne .+2 ; 0x32e04 32e02: 82 c0 rjmp .+260 ; 0x32f08 32e04: f8 f0 brcs .+62 ; 0x32e44 32e06: 16 30 cpi r17, 0x06 ; 6 32e08: 08 f4 brcc .+2 ; 0x32e0c 32e0a: 7b c0 rjmp .+246 ; 0x32f02 32e0c: 17 30 cpi r17, 0x07 ; 7 32e0e: 09 f4 brne .+2 ; 0x32e12 32e10: 7f c0 rjmp .+254 ; 0x32f10 // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 32e12: 0f 90 pop r0 32e14: 0f 90 pop r0 32e16: 0f 90 pop r0 32e18: 0f 90 pop r0 32e1a: 0f 90 pop r0 32e1c: df 91 pop r29 32e1e: cf 91 pop r28 32e20: 1f 91 pop r17 32e22: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 32e24: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 32e28: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 32e2c: 0f 94 00 51 call 0x2a200 ; 0x2a200 32e30: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 32e32: 10 92 44 0d sts 0x0D44, r1 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.449> 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) { 32e36: 8f 3f cpi r24, 0xFF ; 255 32e38: 79 f6 brne .-98 ; 0x32dd8 32e3a: ca cf rjmp .-108 ; 0x32dd0 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 32e3c: 8f ef ldi r24, 0xFF ; 255 32e3e: 80 93 fc 12 sts 0x12FC, r24 ; 0x8012fc 32e42: ca cf rjmp .-108 ; 0x32dd8 switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 32e44: 87 e9 ldi r24, 0x97 ; 151 32e46: 90 ea ldi r25, 0xA0 ; 160 32e48: 0e 94 1f 7b call 0xf63e ; 0xf63e SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 32e4c: 81 2f mov r24, r17 32e4e: 90 e0 ldi r25, 0x00 ; 0 32e50: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 32e54: 0f 94 a6 9c call 0x3394c ; 0x3394c if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 32e58: 80 91 fb 12 lds r24, 0x12FB ; 0x8012fb 32e5c: 81 30 cpi r24, 0x01 ; 1 32e5e: 89 f4 brne .+34 ; 0x32e82 ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 32e60: 80 e9 ldi r24, 0x90 ; 144 32e62: 90 ea ldi r25, 0xA0 ; 160 32e64: 0f 94 5e 4e call 0x29cbc ; 0x29cbc void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 32e68: 41 2f mov r20, r17 32e6a: 62 e4 ldi r22, 0x42 ; 66 32e6c: ce 01 movw r24, r28 32e6e: 01 96 adiw r24, 0x01 ; 1 32e70: 0f 94 2b 4e call 0x29c56 ; 0x29c56 32e74: 49 81 ldd r20, Y+1 ; 0x01 32e76: 5a 81 ldd r21, Y+2 ; 0x02 32e78: 6b 81 ldd r22, Y+3 ; 0x03 32e7a: 7c 81 ldd r23, Y+4 ; 0x04 32e7c: 8d 81 ldd r24, Y+5 ; 0x05 32e7e: 0f 94 77 95 call 0x32aee ; 0x32aee } // 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) { 32e82: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 32e86: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 32e8a: 84 30 cpi r24, 0x04 ; 4 32e8c: 20 e8 ldi r18, 0x80 ; 128 32e8e: 92 07 cpc r25, r18 32e90: 21 f0 breq .+8 ; 0x32e9a 32e92: 89 30 cpi r24, 0x09 ; 9 32e94: 90 48 sbci r25, 0x80 ; 128 32e96: 09 f0 breq .+2 ; 0x32e9a 32e98: bc cf rjmp .-136 ; 0x32e12 case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 32e9a: 0f 94 7e 5a call 0x2b4fc ; 0x2b4fc 32e9e: b9 cf rjmp .-142 ; 0x32e12 // 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) { 32ea0: 19 30 cpi r17, 0x09 ; 9 32ea2: 08 f0 brcs .+2 ; 0x32ea6 32ea4: b6 cf rjmp .-148 ; 0x32e12 32ea6: e1 2f mov r30, r17 32ea8: f0 e0 ldi r31, 0x00 ; 0 32eaa: 88 27 eor r24, r24 32eac: e5 5a subi r30, 0xA5 ; 165 32eae: f8 46 sbci r31, 0x68 ; 104 32eb0: 8e 4f sbci r24, 0xFE ; 254 32eb2: 0d 94 4e a5 jmp 0x34a9c ; 0x34a9c <__tablejump2__> 32eb6: a6 37 cpi r26, 0x76 ; 118 32eb8: a6 37 cpi r26, 0x76 ; 118 32eba: a6 37 cpi r26, 0x76 ; 118 32ebc: 72 38 cpi r23, 0x82 ; 130 32ebe: b0 37 cpi r27, 0x70 ; 112 32ec0: b0 37 cpi r27, 0x70 ; 112 32ec2: 56 38 cpi r21, 0x86 ; 134 32ec4: 28 37 cpi r18, 0x78 ; 120 32ec6: ba 37 cpi r27, 0x7A ; 122 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 32ec8: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 32ecc: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 32ed0: 87 38 cpi r24, 0x87 ; 135 32ed2: 20 e8 ldi r18, 0x80 ; 128 32ed4: 92 07 cpc r25, r18 32ed6: 21 f0 breq .+8 ; 0x32ee0 32ed8: 87 30 cpi r24, 0x07 ; 7 32eda: 91 48 sbci r25, 0x81 ; 129 32edc: 09 f0 breq .+2 ; 0x32ee0 32ede: 99 cf rjmp .-206 ; 0x32e12 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 32ee0: 80 91 94 12 lds r24, 0x1294 ; 0x801294 32ee4: 84 30 cpi r24, 0x04 ; 4 32ee6: 21 f4 brne .+8 ; 0x32ef0 ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 32ee8: 80 91 97 12 lds r24, 0x1297 ; 0x801297 32eec: 81 11 cpse r24, r1 32eee: 91 cf rjmp .-222 ; 0x32e12 // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 32ef0: 81 e0 ldi r24, 0x01 ; 1 32ef2: 80 93 43 0d sts 0x0D43, r24 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.450> menu_submenu(tuneIdlerStallguardThresholdMenu); 32ef6: 60 e0 ldi r22, 0x00 ; 0 32ef8: 8e ef ldi r24, 0xFE ; 254 32efa: 97 e3 ldi r25, 0x37 ; 55 32efc: 0e 94 38 63 call 0xc670 ; 0xc670 32f00: 88 cf rjmp .-240 ; 0x32e12 } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 32f02: 10 93 ff 12 sts 0x12FF, r17 ; 0x8012ff 32f06: 85 cf rjmp .-246 ; 0x32e12 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 32f08: 80 e0 ldi r24, 0x00 ; 0 32f0a: 0f 94 a1 95 call 0x32b42 ; 0x32b42 32f0e: 81 cf rjmp .-254 ; 0x32e12 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 32f10: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 32f14: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 32f18: 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); 32f1c: 60 e0 ldi r22, 0x00 ; 0 32f1e: 8c ea ldi r24, 0xAC ; 172 32f20: 9c e0 ldi r25, 0x0C ; 12 32f22: 0f 94 62 a4 call 0x348c4 ; 0x348c4 } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 32f26: 0f 94 23 65 call 0x2ca46 ; 0x2ca46 32f2a: 73 cf rjmp .-282 ; 0x32e12 00032f2c : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 32f2c: 4f 92 push r4 32f2e: 5f 92 push r5 32f30: 6f 92 push r6 32f32: 7f 92 push r7 32f34: 8f 92 push r8 32f36: 9f 92 push r9 32f38: af 92 push r10 32f3a: bf 92 push r11 32f3c: cf 92 push r12 32f3e: df 92 push r13 32f40: ef 92 push r14 32f42: ff 92 push r15 32f44: 0f 93 push r16 32f46: 1f 93 push r17 32f48: cf 93 push r28 32f4a: df 93 push r29 32f4c: cd b7 in r28, 0x3d ; 61 32f4e: de b7 in r29, 0x3e ; 62 32f50: a0 97 sbiw r28, 0x20 ; 32 32f52: 0f b6 in r0, 0x3f ; 63 32f54: f8 94 cli 32f56: de bf out 0x3e, r29 ; 62 32f58: 0f be out 0x3f, r0 ; 63 32f5a: cd bf out 0x3d, r28 ; 61 32f5c: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 32f5e: 0f 94 dc 96 call 0x32db8 ; 0x32db8 DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 32f62: 80 91 95 12 lds r24, 0x1295 ; 0x801295 32f66: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 32f68: 0f 94 f2 94 call 0x329e4 ; 0x329e4 32f6c: 90 91 95 12 lds r25, 0x1295 ; 0x801295 } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 32f70: 97 ff sbrs r25, 7 32f72: 7d c0 rjmp .+250 ; 0x3306e // we are waiting for something switch (currentScope) { 32f74: 80 91 94 12 lds r24, 0x1294 ; 0x801294 32f78: 82 30 cpi r24, 0x02 ; 2 32f7a: b1 f0 breq .+44 ; 0x32fa8 32f7c: 08 f4 brcc .+2 ; 0x32f80 32f7e: 75 c0 rjmp .+234 ; 0x3306a 32f80: 83 30 cpi r24, 0x03 ; 3 32f82: e1 f1 breq .+120 ; 0x32ffc 32f84: 84 30 cpi r24, 0x04 ; 4 32f86: 09 f4 brne .+2 ; 0x32f8a 32f88: 54 c0 rjmp .+168 ; 0x33032 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 32f8a: 0f 94 f2 94 call 0x329e4 ; 0x329e4 32f8e: 81 11 cpse r24, r1 32f90: 6b c3 rjmp .+1750 ; 0x33668 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 32f92: 82 e0 ldi r24, 0x02 ; 2 32f94: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::Idle; 32f98: 83 e0 ldi r24, 0x03 ; 3 32f9a: 80 93 94 12 sts 0x1294, r24 ; 0x801294 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 32f9e: 82 e8 ldi r24, 0x82 ; 130 32fa0: 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()) { 32fa4: 12 e0 ldi r17, 0x02 ; 2 32fa6: db c2 rjmp .+1462 ; 0x3355e IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 32fa8: 0f 94 01 0b call 0x21602 ; 0x21602 32fac: ab 01 movw r20, r22 32fae: bc 01 movw r22, r24 32fb0: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 32fb4: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 32fb8: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 32fbc: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 32fc0: 88 51 subi r24, 0x18 ; 24 32fc2: 9c 4f sbci r25, 0xFC ; 252 32fc4: af 4f sbci r26, 0xFF ; 255 32fc6: 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 32fc8: 48 17 cp r20, r24 32fca: 59 07 cpc r21, r25 32fcc: 6a 07 cpc r22, r26 32fce: 7b 07 cpc r23, r27 32fd0: 08 f4 brcc .+2 ; 0x32fd4 32fd2: 4b c0 rjmp .+150 ; 0x3306a void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 32fd4: 84 e7 ldi r24, 0x74 ; 116 32fd6: 92 e1 ldi r25, 0x12 ; 18 32fd8: 0f 94 6a a2 call 0x344d4 ; 0x344d4 while (uart->read() != -1) 32fdc: 01 96 adiw r24, 0x01 ; 1 32fde: d1 f7 brne .-12 ; 0x32fd4 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 32fe0: 81 e0 ldi r24, 0x01 ; 1 32fe2: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::StartSeq; 32fe6: 80 93 94 12 sts 0x1294, r24 ; 0x801294 32fea: 10 92 b6 12 sts 0x12B6, r1 ; 0x8012b6 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 32fee: 86 e0 ldi r24, 0x06 ; 6 32ff0: 80 93 96 12 sts 0x1296, r24 ; 0x801296 SendVersion(0); 32ff4: 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); 32ff6: 0f 94 bd 95 call 0x32b7a ; 0x32b7a 32ffa: 37 c0 rjmp .+110 ; 0x3306a } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 32ffc: 92 38 cpi r25, 0x82 ; 130 32ffe: 29 f6 brne .-118 ; 0x32f8a IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 33000: 0f 94 01 0b call 0x21602 ; 0x21602 33004: ab 01 movw r20, r22 33006: bc 01 movw r22, r24 33008: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 3300c: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 33010: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 33014: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 33018: 88 51 subi r24, 0x18 ; 24 3301a: 9c 4f sbci r25, 0xFC ; 252 3301c: af 4f sbci r26, 0xFF ; 255 3301e: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 33020: 48 17 cp r20, r24 33022: 59 07 cpc r21, r25 33024: 6a 07 cpc r22, r26 33026: 7b 07 cpc r23, r27 33028: 08 f4 brcc .+2 ; 0x3302c 3302a: af cf rjmp .-162 ; 0x32f8a void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 3302c: 0f 94 30 96 call 0x32c60 ; 0x32c60 33030: 1c c0 rjmp .+56 ; 0x3306a } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 33032: 0f 94 01 0b call 0x21602 ; 0x21602 33036: ab 01 movw r20, r22 33038: bc 01 movw r22, r24 3303a: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 3303e: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 33042: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 33046: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 3304a: 88 51 subi r24, 0x18 ; 24 3304c: 9c 4f sbci r25, 0xFC ; 252 3304e: af 4f sbci r26, 0xFF ; 255 33050: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 33052: 48 17 cp r20, r24 33054: 59 07 cpc r21, r25 33056: 6a 07 cpc r22, r26 33058: 7b 07 cpc r23, r27 3305a: 40 f7 brcc .-48 ; 0x3302c }; 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(); 3305c: 0f 94 6e 4e call 0x29cdc ; 0x29cdc if (fs != lastFSensor) { 33060: 90 91 d6 12 lds r25, 0x12D6 ; 0x8012d6 33064: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 33066: 0f 94 4f 96 call 0x32c9e ; 0x32c9e // 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; 3306a: 10 e0 ldi r17, 0x00 ; 0 3306c: 78 c2 rjmp .+1264 ; 0x3355e StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 3306e: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 33070: d1 2c mov r13, r1 33072: 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; 33074: 99 24 eor r9, r9 33076: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 33078: 55 e0 ldi r21, 0x05 ; 5 3307a: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 3307c: 63 e0 ldi r22, 0x03 ; 3 3307e: 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; 33080: 74 e0 ldi r23, 0x04 ; 4 33082: 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; 33084: e2 e0 ldi r30, 0x02 ; 2 33086: 6e 2e mov r6, r30 33088: 66 c0 rjmp .+204 ; 0x33156 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 3308a: 23 30 cpi r18, 0x03 ; 3 3308c: 09 f4 brne .+2 ; 0x33090 3308e: e0 c0 rjmp .+448 ; 0x33250 33090: 24 30 cpi r18, 0x04 ; 4 33092: 09 f0 breq .+2 ; 0x33096 33094: 83 c0 rjmp .+262 ; 0x3319c } 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'); 33096: 20 ed ldi r18, 0xD0 ; 208 33098: 28 0f add r18, r24 3309a: 2a 30 cpi r18, 0x0A ; 10 3309c: 08 f4 brcc .+2 ; 0x330a0 3309e: f8 c0 rjmp .+496 ; 0x33290 330a0: 2f e9 ldi r18, 0x9F ; 159 330a2: 28 0f add r18, r24 330a4: 26 30 cpi r18, 0x06 ; 6 330a6: 08 f4 brcc .+2 ; 0x330aa 330a8: f3 c0 rjmp .+486 ; 0x33290 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 330aa: 8a 30 cpi r24, 0x0A ; 10 330ac: 09 f0 breq .+2 ; 0x330b0 330ae: fa c0 rjmp .+500 ; 0x332a4 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()) { 330b0: 40 90 bb 12 lds r4, 0x12BB ; 0x8012bb 330b4: 87 eb ldi r24, 0xB7 ; 183 330b6: 92 e1 ldi r25, 0x12 ; 18 330b8: 0f 94 1a 4e call 0x29c34 ; 0x29c34 330bc: 48 12 cpse r4, r24 330be: b8 c0 rjmp .+368 ; 0x33230 // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 330c0: 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; } 330c4: 88 e0 ldi r24, 0x08 ; 8 330c6: e7 eb ldi r30, 0xB7 ; 183 330c8: f2 e1 ldi r31, 0x12 ; 18 330ca: de 01 movw r26, r28 330cc: 51 96 adiw r26, 0x11 ; 17 330ce: 01 90 ld r0, Z+ 330d0: 0d 92 st X+, r0 330d2: 8a 95 dec r24 330d4: e1 f7 brne .-8 ; 0x330ce 330d6: 88 e0 ldi r24, 0x08 ; 8 330d8: fe 01 movw r30, r28 330da: 71 96 adiw r30, 0x11 ; 17 330dc: de 01 movw r26, r28 330de: 59 96 adiw r26, 0x19 ; 25 330e0: 01 90 ld r0, Z+ 330e2: 0d 92 st X+, r0 330e4: 8a 95 dec r24 330e6: e1 f7 brne .-8 ; 0x330e0 while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 330e8: 88 e0 ldi r24, 0x08 ; 8 330ea: fe 01 movw r30, r28 330ec: 79 96 adiw r30, 0x19 ; 25 330ee: a7 ea ldi r26, 0xA7 ; 167 330f0: b2 e1 ldi r27, 0x12 ; 18 330f2: 01 90 ld r0, Z+ 330f4: 0d 92 st X+, r0 330f6: 8a 95 dec r24 330f8: e1 f7 brne .-8 ; 0x330f2 } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 330fa: 8c e3 ldi r24, 0x3C ; 60 330fc: 89 83 std Y+1, r24 ; 0x01 330fe: fe 01 movw r30, r28 33100: 32 96 adiw r30, 0x02 ; 2 33102: af eb ldi r26, 0xBF ; 191 33104: b2 e1 ldi r27, 0x12 ; 18 for (uint8_t i = 0; i < lrb; ++i) { 33106: 20 e0 ldi r18, 0x00 ; 0 33108: cf 01 movw r24, r30 3310a: 52 16 cp r5, r18 3310c: 09 f4 brne .+2 ; 0x33110 3310e: cd c0 rjmp .+410 ; 0x332aa uint8_t b = lastReceivedBytes[i]; 33110: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 33112: 40 ee ldi r20, 0xE0 ; 224 33114: 43 0f add r20, r19 33116: 40 36 cpi r20, 0x60 ; 96 33118: 08 f0 brcs .+2 ; 0x3311c b = '.'; 3311a: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 3311c: 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) { 3311e: 2f 5f subi r18, 0xFF ; 255 33120: f4 cf rjmp .-24 ; 0x3310a } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 33122: 8e 34 cpi r24, 0x4E ; 78 33124: 08 f0 brcs .+2 ; 0x33128 33126: 56 c0 rjmp .+172 ; 0x331d4 33128: 8b 34 cpi r24, 0x4B ; 75 3312a: 08 f0 brcs .+2 ; 0x3312e 3312c: 46 c0 rjmp .+140 ; 0x331ba 3312e: 82 34 cpi r24, 0x42 ; 66 33130: 09 f4 brne .+2 ; 0x33134 33132: 43 c0 rjmp .+134 ; 0x331ba 33134: e0 f5 brcc .+120 ; 0x331ae 33136: 8a 30 cpi r24, 0x0A ; 10 33138: 59 f0 breq .+22 ; 0x33150 3313a: 8d 30 cpi r24, 0x0D ; 13 3313c: 49 f0 breq .+18 ; 0x33150 } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 3313e: 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') { 33142: a1 10 cpse r10, r1 33144: 05 c1 rjmp .+522 ; 0x33350 33146: 1f 36 cpi r17, 0x6F ; 111 33148: 09 f0 breq .+2 ; 0x3314c 3314a: fa c3 rjmp .+2036 ; 0x33940 ++ok; 3314c: aa 24 eor r10, r10 3314e: 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; 33150: 4f ef ldi r20, 0xFF ; 255 33152: c4 1a sub r12, r20 33154: d4 0a sbc r13, r20 33156: 84 e7 ldi r24, 0x74 ; 116 33158: 92 e1 ldi r25, 0x12 ; 18 3315a: 0f 94 6a a2 call 0x344d4 ; 0x344d4 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) { 3315e: 97 fd sbrc r25, 7 33160: 00 c1 rjmp .+512 ; 0x33362 ++bytesConsumed; RecordReceivedByte(c); 33162: 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]; 33164: 20 91 cf 12 lds r18, 0x12CF ; 0x8012cf 33168: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 3316a: f9 01 movw r30, r18 3316c: ee 56 subi r30, 0x6E ; 110 3316e: fd 4e sbci r31, 0xED ; 237 33170: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 33172: 79 01 movw r14, r18 33174: ef ef ldi r30, 0xFF ; 255 33176: ee 1a sub r14, r30 33178: fe 0a sbc r15, r30 3317a: ff e0 ldi r31, 0x0F ; 15 3317c: ef 22 and r14, r31 3317e: ff 24 eor r15, r15 33180: 5e 2c mov r5, r14 33182: e0 92 cf 12 sts 0x12CF, r14 ; 0x8012cf ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 33186: 20 91 b6 12 lds r18, 0x12B6 ; 0x8012b6 3318a: 22 30 cpi r18, 0x02 ; 2 3318c: 09 f4 brne .+2 ; 0x33190 3318e: 48 c0 rjmp .+144 ; 0x33220 33190: 08 f0 brcs .+2 ; 0x33194 33192: 7b cf rjmp .-266 ; 0x3308a 33194: 22 23 and r18, r18 33196: 29 f2 breq .-118 ; 0x33122 33198: 21 30 cpi r18, 0x01 ; 1 3319a: 51 f1 breq .+84 ; 0x331f0 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 3319c: 1a 30 cpi r17, 0x0A ; 10 3319e: 09 f4 brne .+2 ; 0x331a2 331a0: 8f cf rjmp .-226 ; 0x330c0 331a2: 1d 30 cpi r17, 0x0D ; 13 331a4: 09 f4 brne .+2 ; 0x331a8 331a6: 8c cf rjmp .-232 ; 0x330c0 default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 331a8: 10 92 bc 12 sts 0x12BC, r1 ; 0x8012bc 331ac: ca cf rjmp .-108 ; 0x33142 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 331ae: 85 34 cpi r24, 0x45 ; 69 331b0: 30 f2 brcs .-116 ; 0x3313e 331b2: 87 34 cpi r24, 0x47 ; 71 331b4: 10 f0 brcs .+4 ; 0x331ba 331b6: 88 34 cpi r24, 0x48 ; 72 331b8: 11 f6 brne .-124 ; 0x3313e case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 331ba: 80 93 b7 12 sts 0x12B7, r24 ; 0x8012b7 responseMsg.request.value = 0; 331be: 10 92 b8 12 sts 0x12B8, r1 ; 0x8012b8 responseMsg.request.value2 = 0; 331c2: 10 92 ba 12 sts 0x12BA, r1 ; 0x8012ba 331c6: 10 92 b9 12 sts 0x12B9, r1 ; 0x8012b9 responseMsg.request.crc8 = 0; 331ca: 10 92 bb 12 sts 0x12BB, r1 ; 0x8012bb rspState = ResponseStates::RequestValue; 331ce: 90 92 b6 12 sts 0x12B6, r9 ; 0x8012b6 331d2: be cf rjmp .-132 ; 0x33150 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 331d4: 89 35 cpi r24, 0x59 ; 89 331d6: 40 f4 brcc .+16 ; 0x331e8 331d8: 87 35 cpi r24, 0x57 ; 87 331da: 78 f7 brcc .-34 ; 0x331ba 331dc: 20 eb ldi r18, 0xB0 ; 176 331de: 28 0f add r18, r24 331e0: 26 30 cpi r18, 0x06 ; 6 331e2: 08 f0 brcs .+2 ; 0x331e6 331e4: ac cf rjmp .-168 ; 0x3313e 331e6: e9 cf rjmp .-46 ; 0x331ba 331e8: 86 36 cpi r24, 0x66 ; 102 331ea: 09 f0 breq .+2 ; 0x331ee 331ec: a8 cf rjmp .-176 ; 0x3313e 331ee: e5 cf rjmp .-54 ; 0x331ba } 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'); 331f0: 20 ed ldi r18, 0xD0 ; 208 331f2: 28 0f add r18, r24 331f4: 2a 30 cpi r18, 0x0A ; 10 331f6: 50 f0 brcs .+20 ; 0x3320c 331f8: 2f e9 ldi r18, 0x9F ; 159 331fa: 28 0f add r18, r24 331fc: 26 30 cpi r18, 0x06 ; 6 331fe: 30 f0 brcs .+12 ; 0x3320c case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 33200: 80 32 cpi r24, 0x20 ; 32 33202: 09 f0 breq .+2 ; 0x33206 33204: 9c cf rjmp .-200 ; 0x3313e rspState = ResponseStates::ParamCode; 33206: 60 92 b6 12 sts 0x12B6, r6 ; 0x8012b6 3320a: a2 cf rjmp .-188 ; 0x33150 return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 3320c: 0f 94 f9 4d call 0x29bf2 ; 0x29bf2 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 33210: 90 91 b8 12 lds r25, 0x12B8 ; 0x8012b8 33214: 92 95 swap r25 33216: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 33218: 89 0f add r24, r25 3321a: 80 93 b8 12 sts 0x12B8, r24 ; 0x8012b8 3321e: 98 cf rjmp .-208 ; 0x33150 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 33220: 87 34 cpi r24, 0x47 ; 71 33222: 48 f4 brcc .+18 ; 0x33236 33224: 85 34 cpi r24, 0x45 ; 69 33226: 58 f4 brcc .+22 ; 0x3323e 33228: 2f eb ldi r18, 0xBF ; 191 3322a: 28 0f add r18, r24 3322c: 22 30 cpi r18, 0x02 ; 2 3322e: 38 f0 brcs .+14 ; 0x3323e return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 33230: 10 92 bc 12 sts 0x12BC, r1 ; 0x8012bc 33234: 84 cf rjmp .-248 ; 0x3313e } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 33236: 80 35 cpi r24, 0x50 ; 80 33238: 11 f0 breq .+4 ; 0x3323e 3323a: 82 35 cpi r24, 0x52 ; 82 3323c: c9 f7 brne .-14 ; 0x33230 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 3323e: 80 92 b6 12 sts 0x12B6, r8 ; 0x8012b6 responseMsg.paramCode = (ResponseMsgParamCodes)c; 33242: 80 93 bc 12 sts 0x12BC, r24 ; 0x8012bc responseMsg.paramValue = 0; 33246: 10 92 be 12 sts 0x12BE, r1 ; 0x8012be 3324a: 10 92 bd 12 sts 0x12BD, r1 ; 0x8012bd 3324e: 80 cf rjmp .-256 ; 0x33150 33250: 20 ed ldi r18, 0xD0 ; 208 33252: 28 0f add r18, r24 33254: 2a 30 cpi r18, 0x0A ; 10 33256: 48 f0 brcs .+18 ; 0x3326a 33258: 2f e9 ldi r18, 0x9F ; 159 3325a: 28 0f add r18, r24 3325c: 26 30 cpi r18, 0x06 ; 6 3325e: 28 f0 brcs .+10 ; 0x3326a case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 33260: 8a 32 cpi r24, 0x2A ; 42 33262: 31 f7 brne .-52 ; 0x33230 rspState = ResponseStates::CRC; 33264: 70 92 b6 12 sts 0x12B6, r7 ; 0x8012b6 33268: 73 cf rjmp .-282 ; 0x33150 return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 3326a: 0f 94 f9 4d call 0x29bf2 ; 0x29bf2 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 3326e: 20 91 bd 12 lds r18, 0x12BD ; 0x8012bd 33272: 30 91 be 12 lds r19, 0x12BE ; 0x8012be 33276: 44 e0 ldi r20, 0x04 ; 4 33278: 22 0f add r18, r18 3327a: 33 1f adc r19, r19 3327c: 4a 95 dec r20 3327e: e1 f7 brne .-8 ; 0x33278 responseMsg.paramValue += Char2Nibble(c); 33280: 82 0f add r24, r18 33282: 93 2f mov r25, r19 33284: 91 1d adc r25, r1 33286: 90 93 be 12 sts 0x12BE, r25 ; 0x8012be 3328a: 80 93 bd 12 sts 0x12BD, r24 ; 0x8012bd 3328e: 60 cf rjmp .-320 ; 0x33150 return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 33290: 0f 94 f9 4d call 0x29bf2 ; 0x29bf2 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 33294: 90 91 bb 12 lds r25, 0x12BB ; 0x8012bb 33298: 92 95 swap r25 3329a: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 3329c: 89 0f add r24, r25 3329e: 80 93 bb 12 sts 0x12BB, r24 ; 0x8012bb 332a2: 56 cf rjmp .-340 ; 0x33150 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 332a4: 8d 30 cpi r24, 0x0D ; 13 332a6: 21 f6 brne .-120 ; 0x33230 332a8: 03 cf rjmp .-506 ; 0x330b0 if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 332aa: e8 0e add r14, r24 332ac: f9 1e adc r15, r25 332ae: f7 01 movw r30, r14 332b0: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 332b2: 10 92 cf 12 sts 0x12CF, r1 ; 0x8012cf } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 332b6: 84 ee ldi r24, 0xE4 ; 228 332b8: 92 ea ldi r25, 0xA2 ; 162 332ba: 0e 94 1f 7b call 0xf63e ; 0xf63e 332be: 8e ed ldi r24, 0xDE ; 222 332c0: 92 ea ldi r25, 0xA2 ; 162 332c2: 0e 94 1f 7b call 0xf63e ; 0xf63e 332c6: ce 01 movw r24, r28 332c8: 01 96 adiw r24, 0x01 ; 1 332ca: 0e 94 1d 86 call 0x10c3a ; 0x10c3a 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 332ce: 0f 94 c8 55 call 0x2ab90 ; 0x2ab90 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 332d2: 80 91 94 12 lds r24, 0x1294 ; 0x801294 332d6: 81 30 cpi r24, 0x01 ; 1 332d8: 09 f4 brne .+2 ; 0x332dc 332da: 74 c0 rjmp .+232 ; 0x333c4 332dc: 08 f4 brcc .+2 ; 0x332e0 332de: c5 ce rjmp .-630 ; 0x3306a 332e0: 83 30 cpi r24, 0x03 ; 3 332e2: 09 f4 brne .+2 ; 0x332e6 332e4: d1 c0 rjmp .+418 ; 0x33488 332e6: 84 30 cpi r24, 0x04 ; 4 332e8: 09 f0 breq .+2 ; 0x332ec 332ea: 4f ce rjmp .-866 ; 0x32f8a return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 332ec: 80 91 95 12 lds r24, 0x1295 ; 0x801295 332f0: 86 30 cpi r24, 0x06 ; 6 332f2: 09 f4 brne .+2 ; 0x332f6 332f4: 6c c1 rjmp .+728 ; 0x335ce 332f6: 08 f0 brcs .+2 ; 0x332fa 332f8: 93 c1 rjmp .+806 ; 0x33620 332fa: 84 30 cpi r24, 0x04 ; 4 332fc: 09 f4 brne .+2 ; 0x33300 332fe: 09 c1 rjmp .+530 ; 0x33512 33300: 85 30 cpi r24, 0x05 ; 5 33302: 09 f0 breq .+2 ; 0x33306 33304: cc c0 rjmp .+408 ; 0x3349e case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 33306: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 3330a: 81 34 cpi r24, 0x41 ; 65 3330c: 09 f4 brne .+2 ; 0x33310 3330e: 96 c1 rjmp .+812 ; 0x3363c 33310: 82 35 cpi r24, 0x52 ; 82 33312: 09 f0 breq .+2 ; 0x33316 33314: c4 c0 rjmp .+392 ; 0x3349e errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 33316: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 errorCode = ErrorCode::PROTOCOL_ERROR; 3331a: 8d e2 ldi r24, 0x2D ; 45 3331c: 90 e8 ldi r25, 0x80 ; 128 3331e: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 33322: 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")); 33326: 80 e0 ldi r24, 0x00 ; 0 33328: 90 ea ldi r25, 0xA0 ; 160 3332a: 0f 94 e5 55 call 0x2abca ; 0x2abca void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 3332e: 85 e0 ldi r24, 0x05 ; 5 33330: 80 93 95 12 sts 0x1295, r24 ; 0x801295 SendMsg(rq); 33334: 40 91 97 12 lds r20, 0x1297 ; 0x801297 33338: 50 91 98 12 lds r21, 0x1298 ; 0x801298 3333c: 60 91 99 12 lds r22, 0x1299 ; 0x801299 33340: 70 91 9a 12 lds r23, 0x129A ; 0x80129a 33344: 80 91 9b 12 lds r24, 0x129B ; 0x80129b 33348: 0f 94 ce 56 call 0x2ad9c ; 0x2ad9c 3334c: 16 e0 ldi r17, 0x06 ; 6 3334e: 07 c1 rjmp .+526 ; 0x3355e 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') { 33350: 1b 36 cpi r17, 0x6B ; 107 33352: 09 f0 breq .+2 ; 0x33356 33354: f5 c2 rjmp .+1514 ; 0x33940 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")); 33356: 81 ee ldi r24, 0xE1 ; 225 33358: 9f e9 ldi r25, 0x9F ; 159 3335a: 0f 94 e5 55 call 0x2abca ; 0x2abca 3335e: 18 e0 ldi r17, 0x08 ; 8 33360: fe c0 rjmp .+508 ; 0x3355e default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 33362: cd 28 or r12, r13 33364: 19 f0 breq .+6 ; 0x3336c RecordUARTActivity(); // something has happened on the UART, update the timeout record 33366: 0f 94 c8 55 call 0x2ab90 ; 0x2ab90 3336a: 7f ce rjmp .-770 ; 0x3306a IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 3336c: 0f 94 01 0b call 0x21602 ; 0x21602 33370: ab 01 movw r20, r22 33372: bc 01 movw r22, r24 33374: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 33378: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 3337c: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 33380: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 33384: 80 53 subi r24, 0x30 ; 48 33386: 98 4f sbci r25, 0xF8 ; 248 33388: af 4f sbci r26, 0xFF ; 255 3338a: 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) { 3338c: 48 17 cp r20, r24 3338e: 59 07 cpc r21, r25 33390: 6a 07 cpc r22, r26 33392: 7b 07 cpc r23, r27 33394: 08 f4 brcc .+2 ; 0x33398 33396: 69 ce rjmp .-814 ; 0x3306a 33398: 80 91 94 12 lds r24, 0x1294 ; 0x801294 3339c: 88 23 and r24, r24 3339e: 09 f4 brne .+2 ; 0x333a2 333a0: 64 ce rjmp .-824 ; 0x3306a rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 333a2: 10 92 b6 12 sts 0x12B6, r1 ; 0x8012b6 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 333a6: 81 e0 ldi r24, 0x01 ; 1 333a8: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::StartSeq; 333ac: 80 93 94 12 sts 0x1294, r24 ; 0x801294 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 333b0: 86 e0 ldi r24, 0x06 ; 6 333b2: 80 93 96 12 sts 0x1296, r24 ; 0x801296 SendVersion(0); 333b6: 80 e0 ldi r24, 0x00 ; 0 333b8: 0f 94 bd 95 call 0x32b7a ; 0x32b7a StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 333bc: 64 e0 ldi r22, 0x04 ; 4 333be: 89 eb ldi r24, 0xB9 ; 185 333c0: 9f e9 ldi r25, 0x9F ; 159 333c2: 79 c0 rjmp .+242 ; 0x334b6 return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 333c4: 10 91 95 12 lds r17, 0x1295 ; 0x801295 333c8: 13 30 cpi r17, 0x03 ; 3 333ca: b1 f1 breq .+108 ; 0x33438 333cc: 60 f0 brcs .+24 ; 0x333e6 333ce: 16 30 cpi r17, 0x06 ; 6 333d0: 09 f4 brne .+2 ; 0x333d4 333d2: 50 c0 rjmp .+160 ; 0x33474 333d4: 19 30 cpi r17, 0x09 ; 9 333d6: 09 f0 breq .+2 ; 0x333da 333d8: be cf rjmp .-132 ; 0x33356 // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 333da: 0f 94 f8 57 call 0x2aff0 ; 0x2aff0 333de: 88 23 and r24, r24 333e0: 09 f4 brne .+2 ; 0x333e4 333e2: 43 ce rjmp .-890 ; 0x3306a 333e4: 40 ce rjmp .-896 ; 0x33066 void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 333e6: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 333ea: 83 35 cpi r24, 0x53 ; 83 333ec: 21 f4 brne .+8 ; 0x333f6 333ee: 80 91 a8 12 lds r24, 0x12A8 ; 0x8012a8 333f2: 18 17 cp r17, r24 333f4: 11 f0 breq .+4 ; 0x333fa mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 333f6: 81 2f mov r24, r17 333f8: fe cd rjmp .-1028 ; 0x32ff6 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; 333fa: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 333fe: e1 2f mov r30, r17 33400: f0 e0 ldi r31, 0x00 ; 0 33402: df 01 movw r26, r30 33404: af 51 subi r26, 0x1F ; 31 33406: bd 4e sbci r27, 0xED ; 237 33408: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 3340a: e2 52 subi r30, 0x22 ; 34 3340c: f0 46 sbci r31, 0x60 ; 96 3340e: e4 91 lpm r30, Z 33410: 8e 17 cp r24, r30 33412: 41 f0 breq .+16 ; 0x33424 if (--retries == 0) { 33414: 80 91 96 12 lds r24, 0x1296 ; 0x801296 33418: 81 50 subi r24, 0x01 ; 1 3341a: 80 93 96 12 sts 0x1296, r24 ; 0x801296 3341e: 81 11 cpse r24, r1 33420: ea cf rjmp .-44 ; 0x333f6 33422: 99 cf rjmp .-206 ; 0x33356 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 33424: 87 e7 ldi r24, 0x77 ; 119 33426: 92 ea ldi r25, 0xA2 ; 162 33428: 0e 94 18 7d call 0xfa30 ; 0xfa30 /// @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; } 3342c: 8a e0 ldi r24, 0x0A ; 10 3342e: 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); 33432: 81 e0 ldi r24, 0x01 ; 1 33434: 81 0f add r24, r17 33436: df cd rjmp .-1090 ; 0x32ff6 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) { 33438: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 3343c: 83 35 cpi r24, 0x53 ; 83 3343e: 21 f4 brne .+8 ; 0x33448 33440: 80 91 a8 12 lds r24, 0x12A8 ; 0x8012a8 33444: 83 30 cpi r24, 0x03 ; 3 33446: 11 f0 breq .+4 ; 0x3344c // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 33448: 83 e0 ldi r24, 0x03 ; 3 3344a: d5 cd rjmp .-1110 ; 0x32ff6 } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 3344c: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 33450: 90 91 ae 12 lds r25, 0x12AE ; 0x8012ae 33454: 90 93 e5 12 sts 0x12E5, r25 ; 0x8012e5 33458: 80 93 e4 12 sts 0x12E4, r24 ; 0x8012e4 } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 3345c: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 33460: e5 e7 ldi r30, 0x75 ; 117 33462: f2 ea ldi r31, 0xA2 ; 162 33464: 84 91 lpm r24, Z 33466: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 3346a: 70 e0 ldi r23, 0x00 ; 0 3346c: 49 e0 ldi r20, 0x09 ; 9 3346e: 0f 94 39 57 call 0x2ae72 ; 0x2ae72 33472: fb cd rjmp .-1034 ; 0x3306a currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 33474: 82 e0 ldi r24, 0x02 ; 2 33476: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::Idle; 3347a: 83 e0 ldi r24, 0x03 ; 3 3347c: 80 93 94 12 sts 0x1294, r24 ; 0x801294 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 33480: 82 e8 ldi r24, 0x82 ; 130 33482: 80 93 95 12 sts 0x1295, r24 ; 0x801295 33486: d2 cd rjmp .-1116 ; 0x3302c } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 33488: 80 91 95 12 lds r24, 0x1295 ; 0x801295 3348c: 88 30 cpi r24, 0x08 ; 8 3348e: 09 f4 brne .+2 ; 0x33492 33490: b7 c0 rjmp .+366 ; 0x33600 33492: a8 f4 brcc .+42 ; 0x334be 33494: 84 30 cpi r24, 0x04 ; 4 33496: d9 f0 breq .+54 ; 0x334ce 33498: 87 30 cpi r24, 0x07 ; 7 3349a: 09 f4 brne .+2 ; 0x3349e 3349c: ae c0 rjmp .+348 ; 0x335fa return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 3349e: 81 e0 ldi r24, 0x01 ; 1 334a0: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::DelayedRestart; 334a4: 82 e0 ldi r24, 0x02 ; 2 334a6: 80 93 94 12 sts 0x1294, r24 ; 0x801294 retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 334aa: 83 e8 ldi r24, 0x83 ; 131 334ac: 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); 334b0: 65 e0 ldi r22, 0x05 ; 5 334b2: 8f ec ldi r24, 0xCF ; 207 334b4: 9f e9 ldi r25, 0x9F ; 159 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 334b6: 0f 94 56 56 call 0x2acac ; 0x2acac 334ba: 18 2f mov r17, r24 334bc: 50 c0 rjmp .+160 ; 0x3355e } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 334be: 8a 30 cpi r24, 0x0A ; 10 334c0: 09 f4 brne .+2 ; 0x334c4 334c2: a7 c0 rjmp .+334 ; 0x33612 334c4: 60 f3 brcs .-40 ; 0x3349e 334c6: 8d 30 cpi r24, 0x0D ; 13 334c8: 08 f4 brcc .+2 ; 0x334cc 334ca: 5f cd rjmp .-1346 ; 0x32f8a 334cc: e8 cf rjmp .-48 ; 0x3349e 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) { 334ce: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 334d2: 8e 34 cpi r24, 0x4E ; 78 334d4: 60 f5 brcc .+88 ; 0x3352e 334d6: 8b 34 cpi r24, 0x4B ; 75 334d8: 10 f4 brcc .+4 ; 0x334de 334da: 85 34 cpi r24, 0x45 ; 69 334dc: 01 f7 brne .-64 ; 0x3349e case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 334de: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 334e2: 86 34 cpi r24, 0x46 ; 70 334e4: 09 f4 brne .+2 ; 0x334e8 334e6: 73 c0 rjmp .+230 ; 0x335ce return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 334e8: 84 e0 ldi r24, 0x04 ; 4 334ea: 80 93 94 12 sts 0x1294, r24 ; 0x801294 334ee: 85 e0 ldi r24, 0x05 ; 5 334f0: e7 ea ldi r30, 0xA7 ; 167 334f2: f2 e1 ldi r31, 0x12 ; 18 334f4: de 01 movw r26, r28 334f6: 11 96 adiw r26, 0x01 ; 1 334f8: 01 90 ld r0, Z+ 334fa: 0d 92 st X+, r0 334fc: 8a 95 dec r24 334fe: e1 f7 brne .-8 ; 0x334f8 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 33500: 85 e0 ldi r24, 0x05 ; 5 33502: fe 01 movw r30, r28 33504: 31 96 adiw r30, 0x01 ; 1 33506: a7 e9 ldi r26, 0x97 ; 151 33508: b2 e1 ldi r27, 0x12 ; 18 3350a: 01 90 ld r0, Z+ 3350c: 0d 92 st X+, r0 3350e: 8a 95 dec r24 33510: e1 f7 brne .-8 ; 0x3350a default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 33512: 0f 94 72 96 call 0x32ce4 ; 0x32ce4 33516: 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) { 33518: 85 30 cpi r24, 0x05 ; 5 3351a: 09 f2 breq .-126 ; 0x3349e 3351c: 08 f0 brcs .+2 ; 0x33520 3351e: 9c c0 rjmp .+312 ; 0x33658 33520: 82 30 cpi r24, 0x02 ; 2 33522: 09 f4 brne .+2 ; 0x33526 33524: 32 cd rjmp .-1436 ; 0x32f8a 33526: 84 30 cpi r24, 0x04 ; 4 33528: 09 f4 brne .+2 ; 0x3352c 3352a: 3b cf rjmp .-394 ; 0x333a2 3352c: 18 c0 rjmp .+48 ; 0x3355e 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) { 3352e: 84 35 cpi r24, 0x54 ; 84 33530: 08 f4 brcc .+2 ; 0x33534 33532: b5 cf rjmp .-150 ; 0x3349e 33534: 86 35 cpi r24, 0x56 ; 86 33536: 98 f2 brcs .-90 ; 0x334de 33538: 88 35 cpi r24, 0x58 ; 88 3353a: 09 f0 breq .+2 ; 0x3353e 3353c: b0 cf rjmp .-160 ; 0x3349e 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) { 3353e: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 33542: 86 34 cpi r24, 0x46 ; 70 33544: 89 f1 breq .+98 ; 0x335a8 33546: 80 35 cpi r24, 0x50 ; 80 33548: c1 f1 breq .+112 ; 0x335ba 3354a: 82 34 cpi r24, 0x42 ; 66 3354c: 09 f0 breq .+2 ; 0x33550 3354e: 42 c0 rjmp .+132 ; 0x335d4 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); 33550: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 33554: 80 93 d5 12 sts 0x12D5, r24 ; 0x8012d5 StartReading8bitRegisters(); 33558: 0f 94 b2 94 call 0x32964 ; 0x32964 return ButtonPushed; 3355c: 1b e0 ldi r17, 0x0B ; 11 3355e: 80 91 92 12 lds r24, 0x1292 ; 0x801292 33562: 90 91 93 12 lds r25, 0x1293 ; 0x801293 break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 33566: 81 30 cpi r24, 0x01 ; 1 33568: 91 05 cpc r25, r1 3356a: 09 f0 breq .+2 ; 0x3356e 3356c: ec c1 rjmp .+984 ; 0x33946 const StepStatus ss = logic.Step(); switch (ss) { 3356e: 12 30 cpi r17, 0x02 ; 2 33570: 09 f4 brne .+2 ; 0x33574 33572: 90 c0 rjmp .+288 ; 0x33694 33574: 08 f0 brcs .+2 ; 0x33578 33576: 7d c0 rjmp .+250 ; 0x33672 33578: 11 23 and r17, r17 3357a: 09 f4 brne .+2 ; 0x3357e 3357c: 16 c1 rjmp .+556 ; 0x337aa case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 3357e: 00 23 and r16, r16 33580: 09 f4 brne .+2 ; 0x33584 33582: e2 c0 rjmp .+452 ; 0x33748 switch (ss) { 33584: 17 30 cpi r17, 0x07 ; 7 33586: 09 f4 brne .+2 ; 0x3358a 33588: c2 c1 rjmp .+900 ; 0x3390e 3358a: 08 f0 brcs .+2 ; 0x3358e 3358c: b6 c1 rjmp .+876 ; 0x338fa 3358e: 14 30 cpi r17, 0x04 ; 4 33590: 09 f4 brne .+2 ; 0x33594 33592: c5 c1 rjmp .+906 ; 0x3391e 33594: 15 30 cpi r17, 0x05 ; 5 33596: 09 f0 breq .+2 ; 0x3359a 33598: d7 c0 rjmp .+430 ; 0x33748 state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 3359a: 82 e0 ldi r24, 0x02 ; 2 3359c: 80 93 01 13 sts 0x1301, r24 ; 0x801301 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 335a0: 60 e0 ldi r22, 0x00 ; 0 335a2: 8d e2 ldi r24, 0x2D ; 45 335a4: 90 e8 ldi r25, 0x80 ; 128 335a6: b8 c1 rjmp .+880 ; 0x33918 // 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) { 335a8: 80 91 97 12 lds r24, 0x1297 ; 0x801297 335ac: 88 23 and r24, r24 335ae: 29 f0 breq .+10 ; 0x335ba scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 335b0: 82 e8 ldi r24, 0x82 ; 130 335b2: 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; 335b6: 13 e0 ldi r17, 0x03 ; 3 335b8: d2 cf rjmp .-92 ; 0x3355e } [[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); 335ba: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 335be: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = ErrorCode::OK; 335c2: 81 e0 ldi r24, 0x01 ; 1 335c4: 90 e0 ldi r25, 0x00 ; 0 335c6: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 335ca: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 335ce: 0f 94 b2 94 call 0x32964 ; 0x32964 335d2: 4b cd rjmp .-1386 ; 0x3306a // 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; 335d4: 8c e0 ldi r24, 0x0C ; 12 335d6: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = static_cast(rsp.paramValue); 335da: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 335de: 90 91 ae 12 lds r25, 0x12AE ; 0x8012ae 335e2: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 335e6: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 StartReading8bitRegisters(); // continue Idle state without restarting the communication 335ea: 0f 94 b2 94 call 0x32964 ; 0x32964 // @@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")); 335ee: 82 ef ldi r24, 0xF2 ; 242 335f0: 9f e9 ldi r25, 0x9F ; 159 335f2: 0f 94 e5 55 call 0x2abca ; 0x2abca 335f6: 17 e0 ldi r17, 0x07 ; 7 335f8: b2 cf rjmp .-156 ; 0x3355e return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 335fa: 0f 94 d6 94 call 0x329ac ; 0x329ac 335fe: 35 cd rjmp .-1430 ; 0x3306a return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 33600: 82 e8 ldi r24, 0x82 ; 130 33602: 0f 94 ba 94 call 0x32974 ; 0x32974 33606: 80 93 95 12 sts 0x1295, r24 ; 0x801295 return scopeState == ScopeState::Ready ? Finished : Processing; 3360a: 82 38 cpi r24, 0x82 ; 130 3360c: 09 f0 breq .+2 ; 0x33610 3360e: 2d cd rjmp .-1446 ; 0x3306a 33610: bc cc rjmp .-1672 ; 0x32f8a case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33612: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 33616: 81 34 cpi r24, 0x41 ; 65 33618: d1 f6 brne .-76 ; 0x335ce // Button was accepted, decrement the retry. DecrementRetryAttempts(); 3361a: 0f 94 d3 55 call 0x2aba6 ; 0x2aba6 3361e: d7 cf rjmp .-82 ; 0x335ce return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 33620: 88 30 cpi r24, 0x08 ; 8 33622: b1 f0 breq .+44 ; 0x33650 33624: 50 f3 brcs .-44 ; 0x335fa 33626: 8a 30 cpi r24, 0x0A ; 10 33628: 09 f0 breq .+2 ; 0x3362c 3362a: 39 cf rjmp .-398 ; 0x3349e return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 3362c: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 33630: 81 34 cpi r24, 0x41 ; 65 33632: 09 f0 breq .+2 ; 0x33636 33634: 18 cd rjmp .-1488 ; 0x33066 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 33636: 0f 94 d3 55 call 0x2aba6 ; 0x2aba6 3363a: 15 cd rjmp .-1494 ; 0x33066 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; 3363c: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 errorCode = ErrorCode::RUNNING; 33640: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 33644: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 scopeState = ScopeState::Wait; 33648: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 3364a: 80 93 95 12 sts 0x1295, r24 ; 0x801295 3364e: 0d cd rjmp .-1510 ; 0x3306a 33650: 81 e8 ldi r24, 0x81 ; 129 33652: 0f 94 ba 94 call 0x32974 ; 0x32974 33656: f9 cf rjmp .-14 ; 0x3364a StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 33658: 87 30 cpi r24, 0x07 ; 7 3365a: 49 f2 breq .-110 ; 0x335ee 3365c: 08 f4 brcc .+2 ; 0x33660 3365e: 63 ce rjmp .-826 ; 0x33326 33660: 88 30 cpi r24, 0x08 ; 8 33662: 09 f4 brne .+2 ; 0x33666 33664: 78 ce rjmp .-784 ; 0x33356 33666: 7b cf rjmp .-266 ; 0x3355e // 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()) { 33668: 80 91 95 12 lds r24, 0x1295 ; 0x801295 3366c: 87 fd sbrc r24, 7 3366e: 9a cc rjmp .-1740 ; 0x32fa4 33670: fc cc rjmp .-1544 ; 0x3306a StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 33672: 13 30 cpi r17, 0x03 ; 3 33674: 09 f4 brne .+2 ; 0x33678 33676: 68 c0 rjmp .+208 ; 0x33748 33678: 1b 30 cpi r17, 0x0B ; 11 3367a: 09 f0 breq .+2 ; 0x3367e 3367c: 80 cf rjmp .-256 ; 0x3357e case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 3367e: 80 91 d5 12 lds r24, 0x12D5 ; 0x8012d5 33682: 80 93 fc 12 sts 0x12FC, r24 ; 0x8012fc LogEchoEvent_P(PSTR("MMU Button pushed")); 33686: 81 e1 ldi r24, 0x11 ; 17 33688: 90 ea ldi r25, 0xA0 ; 160 3368a: 0f 94 5e 4e call 0x29cbc ; 0x29cbc CheckUserInput(); // Process the button immediately 3368e: 0f 94 dc 96 call 0x32db8 ; 0x32db8 33692: 5a c0 rjmp .+180 ; 0x33748 CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 33694: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 33698: 81 11 cpse r24, r1 3369a: 56 c0 rjmp .+172 ; 0x33748 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() 3369c: 0e 94 9b 66 call 0xcd36 ; 0xcd36 && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 336a0: 88 23 and r24, r24 336a2: 09 f4 brne .+2 ; 0x336a6 336a4: 51 c0 rjmp .+162 ; 0x33748 } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 336a6: 80 91 40 0d lds r24, 0x0D40 ; 0x800d40 <_ZL17mcode_in_progress.lto_priv.487> 336aa: 90 91 41 0d lds r25, 0x0D41 ; 0x800d41 <_ZL17mcode_in_progress.lto_priv.487+0x1> 336ae: 88 35 cpi r24, 0x58 ; 88 336b0: 92 40 sbci r25, 0x02 ; 2 336b2: 09 f4 brne .+2 ; 0x336b6 336b4: 49 c0 rjmp .+146 ; 0x33748 && !saved_printing 336b6: 80 91 73 12 lds r24, 0x1273 ; 0x801273 336ba: 81 11 cpse r24, r1 336bc: 45 c0 rjmp .+138 ; 0x33748 && !mesh_bed_leveling_flag 336be: 80 91 72 12 lds r24, 0x1272 ; 0x801272 336c2: 81 11 cpse r24, r1 336c4: 41 c0 rjmp .+130 ; 0x33748 && !homing_flag 336c6: 80 91 71 12 lds r24, 0x1271 ; 0x801271 336ca: 81 11 cpse r24, r1 336cc: 3d c0 rjmp .+122 ; 0x33748 bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 336ce: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 336d2: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 336d6: 98 17 cp r25, r24 336d8: b9 f1 breq .+110 ; 0x33748 { uint8_t block_index = block_buffer_tail; 336da: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f } #endif bool e_active() { unsigned char e_active = 0; 336de: 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++; 336e0: 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) 336e2: 30 91 3e 0d lds r19, 0x0D3E ; 0x800d3e 336e6: 38 17 cp r19, r24 336e8: 89 f0 breq .+34 ; 0x3370c { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 336ea: 28 9f mul r18, r24 336ec: f0 01 movw r30, r0 336ee: 11 24 eor r1, r1 336f0: e2 5a subi r30, 0xA2 ; 162 336f2: f9 4f sbci r31, 0xF9 ; 249 336f4: 44 85 ldd r20, Z+12 ; 0x0c 336f6: 55 85 ldd r21, Z+13 ; 0x0d 336f8: 66 85 ldd r22, Z+14 ; 0x0e 336fa: 77 85 ldd r23, Z+15 ; 0x0f 336fc: 45 2b or r20, r21 336fe: 46 2b or r20, r22 33700: 47 2b or r20, r23 33702: 09 f0 breq .+2 ; 0x33706 33704: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 33706: 8f 5f subi r24, 0xFF ; 255 33708: 8f 70 andi r24, 0x0F ; 15 3370a: eb cf rjmp .-42 ; 0x336e2 && e_active(); 3370c: 99 23 and r25, r25 3370e: e1 f0 breq .+56 ; 0x33748 SERIAL_ECHOLNPGM("FINDA filament runout!"); 33710: 82 ea ldi r24, 0xA2 ; 162 33712: 9f e9 ldi r25, 0x9F ; 159 33714: 0e 94 18 7d call 0xfa30 ; 0xfa30 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); 33718: 60 e0 ldi r22, 0x00 ; 0 3371a: 70 e0 ldi r23, 0x00 ; 0 3371c: cb 01 movw r24, r22 3371e: 0f 94 7c 65 call 0x2caf8 ; 0x2caf8 marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 33722: 60 e0 ldi r22, 0x00 ; 0 33724: 70 e0 ldi r23, 0x00 ; 0 33726: cb 01 movw r24, r22 33728: 0e 94 13 67 call 0xce26 ; 0xce26 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 3372c: 86 ed ldi r24, 0xD6 ; 214 3372e: 9e e0 ldi r25, 0x0E ; 14 33730: 0f 94 3e a4 call 0x3487c ; 0x3487c 33734: 81 30 cpi r24, 0x01 ; 1 33736: 21 f4 brne .+8 ; 0x33740 if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 33738: 0f 94 1d 65 call 0x2ca3a ; 0x2ca3a 3373c: 8f 3f cpi r24, 0xFF ; 255 3373e: 91 f5 brne .+100 ; 0x337a4 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 33740: 82 e0 ldi r24, 0x02 ; 2 33742: 9d e6 ldi r25, 0x6D ; 109 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 33744: 0f 94 e7 66 call 0x2cdce ; 0x2cdce break; } } } if (logic.Running()) { 33748: 80 91 af 12 lds r24, 0x12AF ; 0x8012af 3374c: 82 30 cpi r24, 0x02 ; 2 3374e: 19 f4 brne .+6 ; 0x33756 state = xState::Active; 33750: 81 e0 ldi r24, 0x01 ; 1 33752: 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 33756: 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) { 3375a: 80 91 5c 06 lds r24, 0x065C ; 0x80065c <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.446> 3375e: 88 23 and r24, r24 33760: 51 f0 breq .+20 ; 0x33776 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 33762: 80 91 43 0d lds r24, 0x0D43 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.450> 33766: 81 11 cpse r24, r1 33768: 06 c0 rjmp .+12 ; 0x33776 3376a: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 3376e: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 33772: 0f 94 c6 4f call 0x29f8c ; 0x29f8c CheckErrorScreenUserInput(); } 33776: a0 96 adiw r28, 0x20 ; 32 33778: 0f b6 in r0, 0x3f ; 63 3377a: f8 94 cli 3377c: de bf out 0x3e, r29 ; 62 3377e: 0f be out 0x3f, r0 ; 63 33780: cd bf out 0x3d, r28 ; 61 33782: df 91 pop r29 33784: cf 91 pop r28 33786: 1f 91 pop r17 33788: 0f 91 pop r16 3378a: ff 90 pop r15 3378c: ef 90 pop r14 3378e: df 90 pop r13 33790: cf 90 pop r12 33792: bf 90 pop r11 33794: af 90 pop r10 33796: 9f 90 pop r9 33798: 8f 90 pop r8 3379a: 7f 90 pop r7 3379c: 6f 90 pop r6 3379e: 5f 90 pop r5 337a0: 4f 90 pop r4 337a2: 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 337a4: 88 e9 ldi r24, 0x98 ; 152 337a6: 9f e9 ldi r25, 0x9F ; 159 337a8: cd cf rjmp .-102 ; 0x33744 337aa: 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) { 337ae: 80 91 f8 12 lds r24, 0x12F8 ; 0x8012f8 337b2: 08 17 cp r16, r24 337b4: 09 f4 brne .+2 ; 0x337b8 337b6: 49 c0 rjmp .+146 ; 0x3384a // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 337b8: 80 91 94 12 lds r24, 0x1294 ; 0x801294 337bc: 84 30 cpi r24, 0x04 ; 4 337be: b9 f4 brne .+46 ; 0x337ee break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 337c0: 80 91 97 12 lds r24, 0x1297 ; 0x801297 337c4: 88 23 and r24, r24 337c6: 99 f0 breq .+38 ; 0x337ee custom_message_type = CustomMsg::MMUProgress; 337c8: 89 e0 ldi r24, 0x09 ; 9 337ca: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d : static_cast(pgm_read_ptr(&progressTexts[0])); 337ce: ee e5 ldi r30, 0x5E ; 94 337d0: ff e9 ldi r31, 0x9F ; 159 }; 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])) 337d2: 0e 31 cpi r16, 0x1E ; 30 337d4: 30 f4 brcc .+12 ; 0x337e2 337d6: e0 2f mov r30, r16 337d8: f0 e0 ldi r31, 0x00 ; 0 337da: ee 0f add r30, r30 337dc: ff 1f adc r31, r31 337de: e2 5a subi r30, 0xA2 ; 162 337e0: f0 46 sbci r31, 0x60 ; 96 : static_cast(pgm_read_ptr(&progressTexts[0])); 337e2: 85 91 lpm r24, Z+ 337e4: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 337e6: 0e 94 95 75 call 0xeb2a ; 0xeb2a 337ea: 0e 94 7f dc call 0x1b8fe ; 0x1b8fe 337ee: ee e5 ldi r30, 0x5E ; 94 337f0: ff e9 ldi r31, 0x9F ; 159 }; 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])) 337f2: 0e 31 cpi r16, 0x1E ; 30 337f4: 30 f4 brcc .+12 ; 0x33802 337f6: e0 2f mov r30, r16 337f8: f0 e0 ldi r31, 0x00 ; 0 337fa: ee 0f add r30, r30 337fc: ff 1f adc r31, r31 337fe: e2 5a subi r30, 0xA2 ; 162 33800: f0 46 sbci r31, 0x60 ; 96 : static_cast(pgm_read_ptr(&progressTexts[0])); 33802: 85 91 lpm r24, Z+ 33804: 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))); 33806: 02 96 adiw r24, 0x02 ; 2 33808: 0f 94 5e 4e call 0x29cbc ; 0x29cbc } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 3380c: 00 93 f8 12 sts 0x12F8, r16 ; 0x8012f8 switch (pc) { 33810: 03 30 cpi r16, 0x03 ; 3 33812: 49 f0 breq .+18 ; 0x33826 33814: 0c 31 cpi r16, 0x1C ; 28 33816: 09 f0 breq .+2 ; 0x3381a 33818: 97 cf rjmp .-210 ; 0x33748 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 3381a: 0f 94 5b 18 call 0x230b6 ; 0x230b6 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 3381e: 81 e0 ldi r24, 0x01 ; 1 33820: 80 93 03 13 sts 0x1303, r24 ; 0x801303 33824: 91 cf rjmp .-222 ; 0x33748 33826: 80 91 94 12 lds r24, 0x1294 ; 0x801294 3382a: 84 30 cpi r24, 0x04 ; 4 3382c: 31 f4 brne .+12 ; 0x3383a ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 3382e: 80 91 97 12 lds r24, 0x1297 ; 0x801297 33832: 84 55 subi r24, 0x54 ; 84 33834: 82 30 cpi r24, 0x02 ; 2 33836: 08 f4 brcc .+2 ; 0x3383a 33838: 87 cf rjmp .-242 ; 0x33748 3383a: 0f 94 5b 18 call 0x230b6 ; 0x230b6 // 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; 3383e: 81 e0 ldi r24, 0x01 ; 1 33840: 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(); 33844: 0f 94 7e 5a call 0x2b4fc ; 0x2b4fc 33848: 7f cf rjmp .-258 ; 0x33748 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) { 3384a: 03 30 cpi r16, 0x03 ; 3 3384c: 71 f1 breq .+92 ; 0x338aa 3384e: 0c 31 cpi r16, 0x1C ; 28 33850: 09 f0 breq .+2 ; 0x33854 33852: 7a cf rjmp .-268 ; 0x33748 unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 33854: 80 91 03 13 lds r24, 0x1303 ; 0x801303 33858: 88 23 and r24, r24 3385a: 09 f4 brne .+2 ; 0x3385e 3385c: 75 cf rjmp .-278 ; 0x33748 switch (WhereIsFilament()) { 3385e: 0f 94 6e 4e call 0x29cdc ; 0x29cdc 33862: 88 23 and r24, r24 33864: b1 f1 breq .+108 ; 0x338d2 33866: 81 30 cpi r24, 0x01 ; 1 33868: 09 f0 breq .+2 ; 0x3386c 3386a: 6e cf rjmp .-292 ; 0x33748 case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 3386c: 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(); 33870: 0f 94 22 4c call 0x29844 ; 0x29844 // 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; 33874: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 33878: 60 91 df 12 lds r22, 0x12DF ; 0x8012df 3387c: 70 e0 ldi r23, 0x00 ; 0 3387e: 90 e0 ldi r25, 0x00 ; 0 33880: 80 e0 ldi r24, 0x00 ; 0 33882: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 33886: 6b 01 movw r12, r22 33888: 7c 01 movw r14, r24 3388a: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 3388e: 70 e0 ldi r23, 0x00 ; 0 33890: 6e 5f subi r22, 0xFE ; 254 33892: 7f 4f sbci r23, 0xFF ; 255 33894: 07 2e mov r0, r23 33896: 00 0c add r0, r0 33898: 88 0b sbc r24, r24 3389a: 99 0b sbc r25, r25 3389c: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 338a0: a7 01 movw r20, r14 338a2: 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()); 338a4: 0f 94 3a 4e call 0x29c74 ; 0x29c74 338a8: 4f cf rjmp .-354 ; 0x33748 } 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 338aa: 80 91 04 13 lds r24, 0x1304 ; 0x801304 338ae: 88 23 and r24, r24 338b0: 09 f4 brne .+2 ; 0x338b4 338b2: 4a cf rjmp .-364 ; 0x33748 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); 338b4: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 338b8: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 338bc: 98 13 cpse r25, r24 338be: 44 cf rjmp .-376 ; 0x33748 switch (WhereIsFilament()) { 338c0: 0f 94 6e 4e call 0x29cdc ; 0x29cdc 338c4: 81 50 subi r24, 0x01 ; 1 338c6: 83 30 cpi r24, 0x03 ; 3 338c8: 08 f4 brcc .+2 ; 0x338cc 338ca: bc cf rjmp .-136 ; 0x33844 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; 338cc: 10 92 04 13 sts 0x1304, r1 ; 0x801304 338d0: 3b cf rjmp .-394 ; 0x33748 338d2: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 338d6: 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 338da: 98 13 cpse r25, r24 338dc: 35 cf rjmp .-406 ; 0x33748 // 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()); 338de: 60 91 df 12 lds r22, 0x12DF ; 0x8012df 338e2: 70 e0 ldi r23, 0x00 ; 0 338e4: 90 e0 ldi r25, 0x00 ; 0 338e6: 80 e0 ldi r24, 0x00 ; 0 338e8: 0f 94 ca 9e call 0x33d94 ; 0x33d94 <__floatunsisf> 338ec: 9b 01 movw r18, r22 338ee: ac 01 movw r20, r24 338f0: 60 e0 ldi r22, 0x00 ; 0 338f2: 70 e0 ldi r23, 0x00 ; 0 338f4: 8f ea ldi r24, 0xAF ; 175 338f6: 93 e4 ldi r25, 0x43 ; 67 338f8: d5 cf rjmp .-86 ; 0x338a4 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 338fa: 18 30 cpi r17, 0x08 ; 8 338fc: b9 f0 breq .+46 ; 0x3392c 338fe: 19 30 cpi r17, 0x09 ; 9 33900: 09 f0 breq .+2 ; 0x33904 33902: 22 cf rjmp .-444 ; 0x33748 StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 33904: 60 e0 ldi r22, 0x00 ; 0 33906: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 3390a: 19 e0 ldi r17, 0x09 ; 9 3390c: 1d cf rjmp .-454 ; 0x33748 default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 3390e: 61 e0 ldi r22, 0x01 ; 1 33910: 80 91 d2 12 lds r24, 0x12D2 ; 0x8012d2 33914: 90 91 d3 12 lds r25, 0x12D3 ; 0x8012d3 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33918: 0f 94 f2 74 call 0x2e9e4 ; 0x2e9e4 3391c: 15 cf rjmp .-470 ; 0x33748 case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 3391e: 82 e0 ldi r24, 0x02 ; 2 33920: 80 93 01 13 sts 0x1301, r24 ; 0x801301 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 33924: 60 e0 ldi r22, 0x00 ; 0 33926: 8e e2 ldi r24, 0x2E ; 46 33928: 90 e8 ldi r25, 0x80 ; 128 3392a: f6 cf rjmp .-20 ; 0x33918 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 3392c: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 33930: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 33934: 10 92 94 12 sts 0x1294, r1 ; 0x801294 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33938: 60 e0 ldi r22, 0x00 ; 0 3393a: 8c e2 ldi r24, 0x2C ; 44 3393c: 90 e8 ldi r25, 0x80 ; 128 3393e: ec cf rjmp .-40 ; 0x33918 break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 33940: 0f 94 c8 55 call 0x2ab90 ; 0x2ab90 33944: ac cd rjmp .-1192 ; 0x3349e case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33946: 00 23 and r16, r16 33948: 01 f3 breq .-64 ; 0x3390a 3394a: dc cf rjmp .-72 ; 0x33904 0003394c : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 3394c: 80 91 02 13 lds r24, 0x1302 ; 0x801302 33950: 82 ff sbrs r24, 2 33952: 07 c0 rjmp .+14 ; 0x33962 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 33954: 8b 7f andi r24, 0xFB ; 251 33956: 80 93 02 13 sts 0x1302, r24 ; 0x801302 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 3395a: 8f ef ldi r24, 0xFF ; 255 3395c: 90 ea ldi r25, 0xA0 ; 160 3395e: 0f 94 5e 4e call 0x29cbc ; 0x29cbc } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 33962: 80 91 02 13 lds r24, 0x1302 ; 0x801302 33966: 81 ff sbrs r24, 1 33968: 52 c0 rjmp .+164 ; 0x33a0e 3396a: 80 91 f6 12 lds r24, 0x12F6 ; 0x8012f6 3396e: 90 91 f7 12 lds r25, 0x12F7 ; 0x8012f7 33972: 89 2b or r24, r25 33974: 09 f4 brne .+2 ; 0x33978 33976: 4b c0 rjmp .+150 ; 0x33a0e LogEchoEvent_P(PSTR("Resuming Temp")); 33978: 81 ef ldi r24, 0xF1 ; 241 3397a: 90 ea ldi r25, 0xA0 ; 160 3397c: 0f 94 5e 4e call 0x29cbc ; 0x29cbc // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 33980: 80 91 f6 12 lds r24, 0x12F6 ; 0x8012f6 33984: 90 91 f7 12 lds r25, 0x12F7 ; 0x8012f7 33988: 0f 94 35 65 call 0x2ca6a ; 0x2ca6a mmu_print_saved &= ~(SavedState::Cooldown); 3398c: 80 91 02 13 lds r24, 0x1302 ; 0x801302 33990: 8d 7f andi r24, 0xFD ; 253 33992: 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; 33996: 80 91 f6 12 lds r24, 0x12F6 ; 0x8012f6 3399a: 90 91 f7 12 lds r25, 0x12F7 ; 0x8012f7 3399e: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 339a2: 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)); 339a6: 82 ec ldi r24, 0xC2 ; 194 339a8: 92 e6 ldi r25, 0x62 ; 98 339aa: 0e 94 95 75 call 0xeb2a ; 0xeb2a 339ae: 0e 94 94 de call 0x1bd28 ; 0x1bd28 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)); 339b2: 41 ec ldi r20, 0xC1 ; 193 339b4: 50 ea ldi r21, 0xA0 ; 160 339b6: 62 e0 ldi r22, 0x02 ; 2 339b8: 80 e0 ldi r24, 0x00 ; 0 339ba: 0e 94 62 70 call 0xe0c4 ; 0xe0c4 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 339be: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 339c2: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 339c6: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 339ca: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 339ce: 0f 94 d7 a6 call 0x34dae ; 0x34dae <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 339d2: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 339d6: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 339da: c9 01 movw r24, r18 339dc: 86 1b sub r24, r22 339de: 97 0b sbc r25, r23 339e0: 06 97 sbiw r24, 0x06 ; 6 339e2: 6c f0 brlt .+26 ; 0x339fe void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 339e4: 81 e0 ldi r24, 0x01 ; 1 339e6: 0e 94 b0 8a call 0x11560 ; 0x11560 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); 339ea: 80 e0 ldi r24, 0x00 ; 0 339ec: 0f 94 96 97 call 0x32f2c ; 0x32f2c ReportErrorHookDynamicRender(); 339f0: 0f 94 94 4d call 0x29b28 ; 0x29b28 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 339f4: 84 e6 ldi r24, 0x64 ; 100 339f6: 90 e0 ldi r25, 0x00 ; 0 339f8: 0e 94 0a 8d call 0x11a14 ; 0x11a14 339fc: e0 cf rjmp .-64 ; 0x339be }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 339fe: 0f 94 6a 4d call 0x29ad4 ; 0x29ad4 LogEchoEvent_P(PSTR("Hotend temperature reached")); 33a02: 86 ed ldi r24, 0xD6 ; 214 33a04: 90 ea ldi r25, 0xA0 ; 160 33a06: 0f 94 5e 4e call 0x29cbc ; 0x29cbc void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 33a0a: 0c 94 81 70 jmp 0xe102 ; 0xe102 ScreenClear(); } } 33a0e: 08 95 ret 00033a10 : /// 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) { 33a10: 0f 93 push r16 33a12: 1f 93 push r17 33a14: cf 93 push r28 33a16: df 93 push r29 33a18: 00 d0 rcall .+0 ; 0x33a1a 33a1a: 1f 92 push r1 33a1c: 1f 92 push r1 33a1e: cd b7 in r28, 0x3d ; 61 33a20: de b7 in r29, 0x3e ; 62 33a22: 18 2f mov r17, r24 33a24: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 33a26: 10 92 02 13 sts 0x1302, r1 ; 0x801302 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 33a2a: 83 e0 ldi r24, 0x03 ; 3 33a2c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 LongTimer nozzleTimeout; 33a30: 19 82 std Y+1, r1 ; 0x01 33a32: 1a 82 std Y+2, r1 ; 0x02 33a34: 1b 82 std Y+3, r1 ; 0x03 33a36: 1c 82 std Y+4, r1 ; 0x04 33a38: 1d 82 std Y+5, r1 ; 0x05 33a3a: 90 e0 ldi r25, 0x00 ; 0 33a3c: 80 e0 ldi r24, 0x00 ; 0 33a3e: 0e 94 0a 8d call 0x11a14 ; 0x11a14 // - 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) { 33a42: 90 91 02 13 lds r25, 0x1302 ; 0x801302 33a46: 89 81 ldd r24, Y+1 ; 0x01 33a48: 92 ff sbrs r25, 2 33a4a: 37 c0 rjmp .+110 ; 0x33aba if (!nozzleTimeout.running()) { 33a4c: 81 11 cpse r24, r1 33a4e: 1e c0 rjmp .+60 ; 0x33a8c nozzleTimeout.start(); 33a50: ce 01 movw r24, r28 33a52: 01 96 adiw r24, 0x01 ; 1 33a54: 0f 94 2a 0d call 0x21a54 ; 0x21a54 ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 33a58: 83 ed ldi r24, 0xD3 ; 211 33a5a: 9e e9 ldi r25, 0x9E ; 158 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); } } else if (nozzleTimeout.running()) { nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 33a5c: 0f 94 5e 4e call 0x29cbc ; 0x29cbc } switch (logicStepLastStatus) { 33a60: e0 91 00 13 lds r30, 0x1300 ; 0x801300 33a64: e2 50 subi r30, 0x02 ; 2 33a66: ea 30 cpi r30, 0x0A ; 10 33a68: 40 f7 brcc .-48 ; 0x33a3a 33a6a: f0 e0 ldi r31, 0x00 ; 0 33a6c: 88 27 eor r24, r24 33a6e: e4 5c subi r30, 0xC4 ; 196 33a70: f2 46 sbci r31, 0x62 ; 98 33a72: 8e 4f sbci r24, 0xFE ; 254 33a74: 0d 94 4e a5 jmp 0x34a9c ; 0x34a9c <__tablejump2__> 33a78: 20 37 cpi r18, 0x70 ; 112 33a7a: 52 37 cpi r21, 0x72 ; 114 33a7c: 8c 37 cpi r24, 0x7C ; 124 33a7e: 8c 37 cpi r24, 0x7C ; 124 33a80: 14 38 cpi r17, 0x84 ; 132 33a82: 8c 37 cpi r24, 0x7C ; 124 33a84: 88 37 cpi r24, 0x78 ; 120 33a86: 18 38 cpi r17, 0x88 ; 136 33a88: 12 39 cpi r17, 0x92 ; 146 33a8a: 8c 37 cpi r24, 0x7C ; 124 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. 33a8c: 40 e4 ldi r20, 0x40 ; 64 33a8e: 57 e7 ldi r21, 0x77 ; 119 33a90: 6b e1 ldi r22, 0x1B ; 27 33a92: 70 e0 ldi r23, 0x00 ; 0 33a94: ce 01 movw r24, r28 33a96: 01 96 adiw r24, 0x01 ; 1 33a98: 0f 94 6b 0b call 0x216d6 ; 0x216d6 ::expired(unsigned long)> 33a9c: 88 23 and r24, r24 33a9e: 01 f3 breq .-64 ; 0x33a60 mmu_print_saved &= ~(SavedState::CooldownPending); 33aa0: 80 91 02 13 lds r24, 0x1302 ; 0x801302 33aa4: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 33aa6: 82 60 ori r24, 0x02 ; 2 33aa8: 80 93 02 13 sts 0x1302, r24 ; 0x801302 33aac: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 33ab0: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 33ab4: 83 ec ldi r24, 0xC3 ; 195 33ab6: 9e e9 ldi r25, 0x9E ; 158 33ab8: d1 cf rjmp .-94 ; 0x33a5c } } else if (nozzleTimeout.running()) { 33aba: 88 23 and r24, r24 33abc: 89 f2 breq .-94 ; 0x33a60 33abe: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 33ac0: 8d ea ldi r24, 0xAD ; 173 33ac2: 9e e9 ldi r25, 0x9E ; 158 33ac4: cb cf rjmp .-106 ; 0x33a5c 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(); 33ac6: 0f 94 a6 9c call 0x3394c ; 0x3394c ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 33aca: 0f 94 a4 5a call 0x2b548 ; 0x2b548 if (!TuneMenuEntered()) { 33ace: 80 91 43 0d lds r24, 0x0D43 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.450> 33ad2: 81 11 cpse r24, r1 33ad4: 07 c0 rjmp .+14 ; 0x33ae4 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 33ad6: 8e ea ldi r24, 0xAE ; 174 33ad8: 90 ea ldi r25, 0xA0 ; 160 33ada: 0e 94 18 7d call 0xfa30 ; 0xfa30 retryAttempts = MAX_RETRIES; 33ade: 83 e0 ldi r24, 0x03 ; 3 33ae0: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 33ae4: 0f 94 5b 18 call 0x230b6 ; 0x230b6 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; 33ae8: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 33aea: 0f 90 pop r0 33aec: 0f 90 pop r0 33aee: 0f 90 pop r0 33af0: 0f 90 pop r0 33af2: 0f 90 pop r0 33af4: df 91 pop r29 33af6: cf 91 pop r28 33af8: 1f 91 pop r17 33afa: 0f 91 pop r16 33afc: 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(); 33afe: 0f 94 dc 96 call 0x32db8 ; 0x32db8 33b02: f2 cf rjmp .-28 ; 0x33ae8 break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 33b04: 80 91 e7 12 lds r24, 0x12E7 ; 0x8012e7 33b08: 81 11 cpse r24, r1 33b0a: 97 cf rjmp .-210 ; 0x33a3a // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 33b0c: 81 2f mov r24, r17 33b0e: 0f 94 ee 5a call 0x2b5dc ; 0x2b5dc SaveHotendTemp(turn_off_nozzle); 33b12: 80 2f mov r24, r16 33b14: 0f 94 88 5a call 0x2b510 ; 0x2b510 CheckUserInput(); 33b18: 0f 94 dc 96 call 0x32db8 ; 0x32db8 33b1c: 8e cf rjmp .-228 ; 0x33a3a } 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(); 33b1e: 0f 94 a6 9c call 0x3394c ; 0x3394c ResumeUnpark(); 33b22: 0f 94 a4 5a call 0x2b548 ; 0x2b548 33b26: 89 cf rjmp .-238 ; 0x33a3a } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 33b28: 80 e0 ldi r24, 0x00 ; 0 33b2a: df cf rjmp .-66 ; 0x33aea 00033b2c : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 33b2c: cf 93 push r28 33b2e: df 93 push r29 33b30: 00 d0 rcall .+0 ; 0x33b32 33b32: 1f 92 push r1 33b34: 1f 92 push r1 33b36: cd b7 in r28, 0x3d ; 61 33b38: de b7 in r29, 0x3e ; 62 FSensorBlockRunout blockRunout; 33b3a: 0f 94 86 78 call 0x2f10c ; 0x2f10c return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 33b3e: 62 e1 ldi r22, 0x12 ; 18 33b40: 8d e1 ldi r24, 0x1D ; 29 33b42: 9e e9 ldi r25, 0x9E ; 158 33b44: 0f 94 db 79 call 0x2f3b6 ; 0x2f3b6 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(); 33b48: 0f 94 38 4e call 0x29c70 ; 0x29c70 void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 33b4c: 40 e0 ldi r20, 0x00 ; 0 33b4e: 65 e5 ldi r22, 0x55 ; 85 33b50: ce 01 movw r24, r28 33b52: 01 96 adiw r24, 0x01 ; 1 33b54: 0f 94 2b 4e call 0x29c56 ; 0x29c56 33b58: 49 81 ldd r20, Y+1 ; 0x01 33b5a: 5a 81 ldd r21, Y+2 ; 0x02 33b5c: 6b 81 ldd r22, Y+3 ; 0x03 33b5e: 7c 81 ldd r23, Y+4 ; 0x04 33b60: 8d 81 ldd r24, Y+5 ; 0x05 33b62: 0f 94 77 95 call 0x32aee ; 0x32aee logic.UnloadFilament(); if (manage_response(false, true)) { 33b66: 61 e0 ldi r22, 0x01 ; 1 33b68: 80 e0 ldi r24, 0x00 ; 0 33b6a: 0f 94 08 9d call 0x33a10 ; 0x33a10 33b6e: 81 11 cpse r24, r1 33b70: 03 c0 rjmp .+6 ; 0x33b78 break; } IncrementMMUFails(); 33b72: 0f 94 8c 4d call 0x29b18 ; 0x29b18 33b76: e8 cf rjmp .-48 ; 0x33b48 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); 33b78: 83 e0 ldi r24, 0x03 ; 3 33b7a: 0f 94 06 23 call 0x2460c ; 0x2460c } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 33b7e: 83 e6 ldi r24, 0x63 ; 99 33b80: 0f 94 3d 65 call 0x2ca7a ; 0x2ca7a tool_change_extruder = MMU2_NO_TOOL; 33b84: 83 e6 ldi r24, 0x63 ; 99 33b86: 80 93 e9 12 sts 0x12E9, r24 ; 0x8012e9 FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 33b8a: 0f 94 dd 6c call 0x2d9ba ; 0x2d9ba } 33b8e: 0f 90 pop r0 33b90: 0f 90 pop r0 33b92: 0f 90 pop r0 33b94: 0f 90 pop r0 33b96: 0f 90 pop r0 33b98: df 91 pop r29 33b9a: cf 91 pop r28 33b9c: 08 95 ret 00033b9e : bool MMU2::unload() { 33b9e: cf 93 push r28 if (!WaitForMMUReady()) { 33ba0: 0f 94 04 7a call 0x2f408 ; 0x2f408 33ba4: c8 2f mov r28, r24 33ba6: 88 23 and r24, r24 33ba8: 79 f0 breq .+30 ; 0x33bc8 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 33baa: 88 ec ldi r24, 0xC8 ; 200 33bac: 90 e0 ldi r25, 0x00 ; 0 33bae: 0f 94 bc 51 call 0x2a378 ; 0x2a378 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.373]> 33bb2: 82 e0 ldi r24, 0x02 ; 2 33bb4: 0f 94 06 23 call 0x2460c ; 0x2460c struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33bb8: 0f 94 d0 79 call 0x2f3a0 ; 0x2f3a0 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 33bbc: 0f 94 96 9d call 0x33b2c ; 0x33b2c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33bc0: 0f 94 f9 79 call 0x2f3f2 ; 0x2f3f2 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 33bc4: 0f 94 6a 4d call 0x29ad4 ; 0x29ad4 return true; } 33bc8: 8c 2f mov r24, r28 33bca: cf 91 pop r28 33bcc: 08 95 ret 00033bce : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 33bce: 0f 93 push r16 33bd0: 1f 93 push r17 33bd2: cf 93 push r28 33bd4: df 93 push r29 33bd6: 00 d0 rcall .+0 ; 0x33bd8 33bd8: 1f 92 push r1 33bda: 1f 92 push r1 33bdc: cd b7 in r28, 0x3d ; 61 33bde: de b7 in r29, 0x3e ; 62 33be0: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 33be2: 0f 94 04 7a call 0x2f408 ; 0x2f408 33be6: 18 2f mov r17, r24 33be8: 88 23 and r24, r24 33bea: 49 f1 breq .+82 ; 0x33c3e void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 33bec: 8f ea ldi r24, 0xAF ; 175 33bee: 92 e6 ldi r25, 0x62 ; 98 33bf0: 0e 94 95 75 call 0xeb2a ; 0xeb2a 33bf4: 60 2f mov r22, r16 33bf6: 0f 94 6d 4d call 0x29ada ; 0x29ada struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33bfa: 0f 94 d0 79 call 0x2f3a0 ; 0x2f3a0 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 33bfe: 0f 94 38 4e call 0x29c70 ; 0x29c70 } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 33c02: 40 2f mov r20, r16 33c04: 6c e4 ldi r22, 0x4C ; 76 33c06: ce 01 movw r24, r28 33c08: 01 96 adiw r24, 0x01 ; 1 33c0a: 0f 94 2b 4e call 0x29c56 ; 0x29c56 33c0e: 49 81 ldd r20, Y+1 ; 0x01 33c10: 5a 81 ldd r21, Y+2 ; 0x02 33c12: 6b 81 ldd r22, Y+3 ; 0x03 33c14: 7c 81 ldd r23, Y+4 ; 0x04 33c16: 8d 81 ldd r24, Y+5 ; 0x05 33c18: 0f 94 77 95 call 0x32aee ; 0x32aee logic.LoadFilament(slot); if (manage_response(false, false)) { 33c1c: 60 e0 ldi r22, 0x00 ; 0 33c1e: 80 e0 ldi r24, 0x00 ; 0 33c20: 0f 94 08 9d call 0x33a10 ; 0x33a10 33c24: 18 2f mov r17, r24 33c26: 81 11 cpse r24, r1 33c28: 03 c0 rjmp .+6 ; 0x33c30 break; } IncrementMMUFails(); 33c2a: 0f 94 8c 4d call 0x29b18 ; 0x29b18 33c2e: e7 cf rjmp .-50 ; 0x33bfe 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); 33c30: 83 e0 ldi r24, 0x03 ; 3 33c32: 0f 94 06 23 call 0x2460c ; 0x2460c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33c36: 0f 94 f9 79 call 0x2f3f2 ; 0x2f3f2 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 33c3a: 0f 94 6a 4d call 0x29ad4 ; 0x29ad4 return true; } 33c3e: 81 2f mov r24, r17 33c40: 0f 90 pop r0 33c42: 0f 90 pop r0 33c44: 0f 90 pop r0 33c46: 0f 90 pop r0 33c48: 0f 90 pop r0 33c4a: df 91 pop r29 33c4c: cf 91 pop r28 33c4e: 1f 91 pop r17 33c50: 0f 91 pop r16 33c52: 08 95 ret 00033c54 : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 33c54: ff 92 push r15 33c56: 0f 93 push r16 33c58: 1f 93 push r17 33c5a: cf 93 push r28 33c5c: df 93 push r29 33c5e: 00 d0 rcall .+0 ; 0x33c60 33c60: 1f 92 push r1 33c62: 1f 92 push r1 33c64: cd b7 in r28, 0x3d ; 61 33c66: de b7 in r29, 0x3e ; 62 33c68: 08 2f mov r16, r24 33c6a: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 33c6c: 0f 94 04 7a call 0x2f408 ; 0x2f408 33c70: 18 2f mov r17, r24 33c72: 88 23 and r24, r24 33c74: b1 f1 breq .+108 ; 0x33ce2 return false; } if (enableFullScreenMsg) { 33c76: ff 20 and r15, r15 33c78: 39 f0 breq .+14 ; 0x33c88 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 33c7a: 8e e9 ldi r24, 0x9E ; 158 33c7c: 92 e6 ldi r25, 0x62 ; 98 33c7e: 0e 94 95 75 call 0xeb2a ; 0xeb2a 33c82: 60 2f mov r22, r16 33c84: 0f 94 6d 4d call 0x29ada ; 0x29ada FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 33c88: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 33c8c: 81 11 cpse r24, r1 unload(); 33c8e: 0f 94 cf 9d call 0x33b9e ; 0x33b9e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33c92: 0f 94 d0 79 call 0x2f3a0 ; 0x2f3a0 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 33c96: 0f 94 38 4e call 0x29c70 ; 0x29c70 } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 33c9a: 40 2f mov r20, r16 33c9c: 65 e4 ldi r22, 0x45 ; 69 33c9e: ce 01 movw r24, r28 33ca0: 01 96 adiw r24, 0x01 ; 1 33ca2: 0f 94 2b 4e call 0x29c56 ; 0x29c56 33ca6: 49 81 ldd r20, Y+1 ; 0x01 33ca8: 5a 81 ldd r21, Y+2 ; 0x02 33caa: 6b 81 ldd r22, Y+3 ; 0x03 33cac: 7c 81 ldd r23, Y+4 ; 0x04 33cae: 8d 81 ldd r24, Y+5 ; 0x05 33cb0: 0f 94 77 95 call 0x32aee ; 0x32aee logic.EjectFilament(slot); if (manage_response(false, true)) { 33cb4: 61 e0 ldi r22, 0x01 ; 1 33cb6: 80 e0 ldi r24, 0x00 ; 0 33cb8: 0f 94 08 9d call 0x33a10 ; 0x33a10 33cbc: 18 2f mov r17, r24 33cbe: 81 11 cpse r24, r1 33cc0: 03 c0 rjmp .+6 ; 0x33cc8 break; } IncrementMMUFails(); 33cc2: 0f 94 8c 4d call 0x29b18 ; 0x29b18 33cc6: e7 cf rjmp .-50 ; 0x33c96 } SetCurrentTool(MMU2_NO_TOOL); 33cc8: 83 e6 ldi r24, 0x63 ; 99 33cca: 0f 94 3d 65 call 0x2ca7a ; 0x2ca7a tool_change_extruder = MMU2_NO_TOOL; 33cce: 83 e6 ldi r24, 0x63 ; 99 33cd0: 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); 33cd4: 83 e0 ldi r24, 0x03 ; 3 33cd6: 0f 94 06 23 call 0x2460c ; 0x2460c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33cda: 0f 94 f9 79 call 0x2f3f2 ; 0x2f3f2 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 33cde: 0f 94 6a 4d call 0x29ad4 ; 0x29ad4 return true; } 33ce2: 81 2f mov r24, r17 33ce4: 0f 90 pop r0 33ce6: 0f 90 pop r0 33ce8: 0f 90 pop r0 33cea: 0f 90 pop r0 33cec: 0f 90 pop r0 33cee: df 91 pop r29 33cf0: cf 91 pop r28 33cf2: 1f 91 pop r17 33cf4: 0f 91 pop r16 33cf6: ff 90 pop r15 33cf8: 08 95 ret 00033cfa : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 33cfa: 1f 93 push r17 33cfc: cf 93 push r28 33cfe: df 93 push r29 33d00: 00 d0 rcall .+0 ; 0x33d02 33d02: 1f 92 push r1 33d04: 1f 92 push r1 33d06: cd b7 in r28, 0x3d ; 61 33d08: de b7 in r29, 0x3e ; 62 33d0a: 18 2f mov r17, r24 for (;;) { Disable_E0(); 33d0c: 0f 94 38 4e call 0x29c70 ; 0x29c70 } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 33d10: 41 2f mov r20, r17 33d12: 6b e4 ldi r22, 0x4B ; 75 33d14: ce 01 movw r24, r28 33d16: 01 96 adiw r24, 0x01 ; 1 33d18: 0f 94 2b 4e call 0x29c56 ; 0x29c56 33d1c: 49 81 ldd r20, Y+1 ; 0x01 33d1e: 5a 81 ldd r21, Y+2 ; 0x02 33d20: 6b 81 ldd r22, Y+3 ; 0x03 33d22: 7c 81 ldd r23, Y+4 ; 0x04 33d24: 8d 81 ldd r24, Y+5 ; 0x05 33d26: 0f 94 77 95 call 0x32aee ; 0x32aee logic.CutFilament(slot); if (manage_response(false, true)) { 33d2a: 61 e0 ldi r22, 0x01 ; 1 33d2c: 80 e0 ldi r24, 0x00 ; 0 33d2e: 0f 94 08 9d call 0x33a10 ; 0x33a10 33d32: 81 11 cpse r24, r1 33d34: 03 c0 rjmp .+6 ; 0x33d3c break; } IncrementMMUFails(); 33d36: 0f 94 8c 4d call 0x29b18 ; 0x29b18 33d3a: e8 cf rjmp .-48 ; 0x33d0c } } 33d3c: 0f 90 pop r0 33d3e: 0f 90 pop r0 33d40: 0f 90 pop r0 33d42: 0f 90 pop r0 33d44: 0f 90 pop r0 33d46: df 91 pop r29 33d48: cf 91 pop r28 33d4a: 1f 91 pop r17 33d4c: 08 95 ret 00033d4e : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 33d4e: cf 93 push r28 33d50: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 33d52: 8f e8 ldi r24, 0x8F ; 143 33d54: 92 e6 ldi r25, 0x62 ; 98 33d56: 0e 94 95 75 call 0xeb2a ; 0xeb2a 33d5a: 6c 2f mov r22, r28 33d5c: 0f 94 6d 4d call 0x29ada ; 0x29ada if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 33d60: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 33d64: 81 11 cpse r24, r1 unload(); 33d66: 0f 94 cf 9d call 0x33b9e ; 0x33b9e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33d6a: 0f 94 d0 79 call 0x2f3a0 ; 0x2f3a0 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 33d6e: 8c 2f mov r24, r28 33d70: 0f 94 7d 9e call 0x33cfa ; 0x33cfa SetCurrentTool(MMU2_NO_TOOL); 33d74: 83 e6 ldi r24, 0x63 ; 99 33d76: 0f 94 3d 65 call 0x2ca7a ; 0x2ca7a tool_change_extruder = MMU2_NO_TOOL; 33d7a: 83 e6 ldi r24, 0x63 ; 99 33d7c: 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); 33d80: 83 e0 ldi r24, 0x03 ; 3 33d82: 0f 94 06 23 call 0x2460c ; 0x2460c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33d86: 0f 94 f9 79 call 0x2f3f2 ; 0x2f3f2 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 33d8a: 0f 94 6a 4d call 0x29ad4 ; 0x29ad4 return true; } 33d8e: 81 e0 ldi r24, 0x01 ; 1 33d90: cf 91 pop r28 33d92: 08 95 ret 00033d94 <__floatunsisf>: 33d94: e8 94 clt 33d96: 09 c0 rjmp .+18 ; 0x33daa <__floatsisf+0x12> 00033d98 <__floatsisf>: 33d98: 97 fb bst r25, 7 33d9a: 3e f4 brtc .+14 ; 0x33daa <__floatsisf+0x12> 33d9c: 90 95 com r25 33d9e: 80 95 com r24 33da0: 70 95 com r23 33da2: 61 95 neg r22 33da4: 7f 4f sbci r23, 0xFF ; 255 33da6: 8f 4f sbci r24, 0xFF ; 255 33da8: 9f 4f sbci r25, 0xFF ; 255 33daa: 99 23 and r25, r25 33dac: a9 f0 breq .+42 ; 0x33dd8 <__floatsisf+0x40> 33dae: f9 2f mov r31, r25 33db0: 96 e9 ldi r25, 0x96 ; 150 33db2: bb 27 eor r27, r27 33db4: 93 95 inc r25 33db6: f6 95 lsr r31 33db8: 87 95 ror r24 33dba: 77 95 ror r23 33dbc: 67 95 ror r22 33dbe: b7 95 ror r27 33dc0: f1 11 cpse r31, r1 33dc2: f8 cf rjmp .-16 ; 0x33db4 <__floatsisf+0x1c> 33dc4: fa f4 brpl .+62 ; 0x33e04 <__floatsisf+0x6c> 33dc6: bb 0f add r27, r27 33dc8: 11 f4 brne .+4 ; 0x33dce <__floatsisf+0x36> 33dca: 60 ff sbrs r22, 0 33dcc: 1b c0 rjmp .+54 ; 0x33e04 <__floatsisf+0x6c> 33dce: 6f 5f subi r22, 0xFF ; 255 33dd0: 7f 4f sbci r23, 0xFF ; 255 33dd2: 8f 4f sbci r24, 0xFF ; 255 33dd4: 9f 4f sbci r25, 0xFF ; 255 33dd6: 16 c0 rjmp .+44 ; 0x33e04 <__floatsisf+0x6c> 33dd8: 88 23 and r24, r24 33dda: 11 f0 breq .+4 ; 0x33de0 <__floatsisf+0x48> 33ddc: 96 e9 ldi r25, 0x96 ; 150 33dde: 11 c0 rjmp .+34 ; 0x33e02 <__floatsisf+0x6a> 33de0: 77 23 and r23, r23 33de2: 21 f0 breq .+8 ; 0x33dec <__floatsisf+0x54> 33de4: 9e e8 ldi r25, 0x8E ; 142 33de6: 87 2f mov r24, r23 33de8: 76 2f mov r23, r22 33dea: 05 c0 rjmp .+10 ; 0x33df6 <__floatsisf+0x5e> 33dec: 66 23 and r22, r22 33dee: 71 f0 breq .+28 ; 0x33e0c <__floatsisf+0x74> 33df0: 96 e8 ldi r25, 0x86 ; 134 33df2: 86 2f mov r24, r22 33df4: 70 e0 ldi r23, 0x00 ; 0 33df6: 60 e0 ldi r22, 0x00 ; 0 33df8: 2a f0 brmi .+10 ; 0x33e04 <__floatsisf+0x6c> 33dfa: 9a 95 dec r25 33dfc: 66 0f add r22, r22 33dfe: 77 1f adc r23, r23 33e00: 88 1f adc r24, r24 33e02: da f7 brpl .-10 ; 0x33dfa <__floatsisf+0x62> 33e04: 88 0f add r24, r24 33e06: 96 95 lsr r25 33e08: 87 95 ror r24 33e0a: 97 f9 bld r25, 7 33e0c: 08 95 ret 00033e0e : 33e0e: 9b 01 movw r18, r22 33e10: ac 01 movw r20, r24 33e12: 0d 94 0b 9f jmp 0x33e16 ; 0x33e16 <__mulsf3> 00033e16 <__mulsf3>: 33e16: 0f 94 1e 9f call 0x33e3c ; 0x33e3c <__mulsf3x> 33e1a: 0d 94 8f 9f jmp 0x33f1e ; 0x33f1e <__fp_round> 33e1e: 0f 94 81 9f call 0x33f02 ; 0x33f02 <__fp_pscA> 33e22: 38 f0 brcs .+14 ; 0x33e32 <__mulsf3+0x1c> 33e24: 0f 94 88 9f call 0x33f10 ; 0x33f10 <__fp_pscB> 33e28: 20 f0 brcs .+8 ; 0x33e32 <__mulsf3+0x1c> 33e2a: 95 23 and r25, r21 33e2c: 11 f0 breq .+4 ; 0x33e32 <__mulsf3+0x1c> 33e2e: 0d 94 78 9f jmp 0x33ef0 ; 0x33ef0 <__fp_inf> 33e32: 0d 94 7e 9f jmp 0x33efc ; 0x33efc <__fp_nan> 33e36: 11 24 eor r1, r1 33e38: 0d 94 c3 9f jmp 0x33f86 ; 0x33f86 <__fp_szero> 00033e3c <__mulsf3x>: 33e3c: 0f 94 a0 9f call 0x33f40 ; 0x33f40 <__fp_split3> 33e40: 70 f3 brcs .-36 ; 0x33e1e <__mulsf3+0x8> 00033e42 <__mulsf3_pse>: 33e42: 95 9f mul r25, r21 33e44: c1 f3 breq .-16 ; 0x33e36 <__mulsf3+0x20> 33e46: 95 0f add r25, r21 33e48: 50 e0 ldi r21, 0x00 ; 0 33e4a: 55 1f adc r21, r21 33e4c: 62 9f mul r22, r18 33e4e: f0 01 movw r30, r0 33e50: 72 9f mul r23, r18 33e52: bb 27 eor r27, r27 33e54: f0 0d add r31, r0 33e56: b1 1d adc r27, r1 33e58: 63 9f mul r22, r19 33e5a: aa 27 eor r26, r26 33e5c: f0 0d add r31, r0 33e5e: b1 1d adc r27, r1 33e60: aa 1f adc r26, r26 33e62: 64 9f mul r22, r20 33e64: 66 27 eor r22, r22 33e66: b0 0d add r27, r0 33e68: a1 1d adc r26, r1 33e6a: 66 1f adc r22, r22 33e6c: 82 9f mul r24, r18 33e6e: 22 27 eor r18, r18 33e70: b0 0d add r27, r0 33e72: a1 1d adc r26, r1 33e74: 62 1f adc r22, r18 33e76: 73 9f mul r23, r19 33e78: b0 0d add r27, r0 33e7a: a1 1d adc r26, r1 33e7c: 62 1f adc r22, r18 33e7e: 83 9f mul r24, r19 33e80: a0 0d add r26, r0 33e82: 61 1d adc r22, r1 33e84: 22 1f adc r18, r18 33e86: 74 9f mul r23, r20 33e88: 33 27 eor r19, r19 33e8a: a0 0d add r26, r0 33e8c: 61 1d adc r22, r1 33e8e: 23 1f adc r18, r19 33e90: 84 9f mul r24, r20 33e92: 60 0d add r22, r0 33e94: 21 1d adc r18, r1 33e96: 82 2f mov r24, r18 33e98: 76 2f mov r23, r22 33e9a: 6a 2f mov r22, r26 33e9c: 11 24 eor r1, r1 33e9e: 9f 57 subi r25, 0x7F ; 127 33ea0: 50 40 sbci r21, 0x00 ; 0 33ea2: 9a f0 brmi .+38 ; 0x33eca <__mulsf3_pse+0x88> 33ea4: f1 f0 breq .+60 ; 0x33ee2 <__mulsf3_pse+0xa0> 33ea6: 88 23 and r24, r24 33ea8: 4a f0 brmi .+18 ; 0x33ebc <__mulsf3_pse+0x7a> 33eaa: ee 0f add r30, r30 33eac: ff 1f adc r31, r31 33eae: bb 1f adc r27, r27 33eb0: 66 1f adc r22, r22 33eb2: 77 1f adc r23, r23 33eb4: 88 1f adc r24, r24 33eb6: 91 50 subi r25, 0x01 ; 1 33eb8: 50 40 sbci r21, 0x00 ; 0 33eba: a9 f7 brne .-22 ; 0x33ea6 <__mulsf3_pse+0x64> 33ebc: 9e 3f cpi r25, 0xFE ; 254 33ebe: 51 05 cpc r21, r1 33ec0: 80 f0 brcs .+32 ; 0x33ee2 <__mulsf3_pse+0xa0> 33ec2: 0d 94 78 9f jmp 0x33ef0 ; 0x33ef0 <__fp_inf> 33ec6: 0d 94 c3 9f jmp 0x33f86 ; 0x33f86 <__fp_szero> 33eca: 5f 3f cpi r21, 0xFF ; 255 33ecc: e4 f3 brlt .-8 ; 0x33ec6 <__mulsf3_pse+0x84> 33ece: 98 3e cpi r25, 0xE8 ; 232 33ed0: d4 f3 brlt .-12 ; 0x33ec6 <__mulsf3_pse+0x84> 33ed2: 86 95 lsr r24 33ed4: 77 95 ror r23 33ed6: 67 95 ror r22 33ed8: b7 95 ror r27 33eda: f7 95 ror r31 33edc: e7 95 ror r30 33ede: 9f 5f subi r25, 0xFF ; 255 33ee0: c1 f7 brne .-16 ; 0x33ed2 <__mulsf3_pse+0x90> 33ee2: fe 2b or r31, r30 33ee4: 88 0f add r24, r24 33ee6: 91 1d adc r25, r1 33ee8: 96 95 lsr r25 33eea: 87 95 ror r24 33eec: 97 f9 bld r25, 7 33eee: 08 95 ret 00033ef0 <__fp_inf>: 33ef0: 97 f9 bld r25, 7 33ef2: 9f 67 ori r25, 0x7F ; 127 33ef4: 80 e8 ldi r24, 0x80 ; 128 33ef6: 70 e0 ldi r23, 0x00 ; 0 33ef8: 60 e0 ldi r22, 0x00 ; 0 33efa: 08 95 ret 00033efc <__fp_nan>: 33efc: 9f ef ldi r25, 0xFF ; 255 33efe: 80 ec ldi r24, 0xC0 ; 192 33f00: 08 95 ret 00033f02 <__fp_pscA>: 33f02: 00 24 eor r0, r0 33f04: 0a 94 dec r0 33f06: 16 16 cp r1, r22 33f08: 17 06 cpc r1, r23 33f0a: 18 06 cpc r1, r24 33f0c: 09 06 cpc r0, r25 33f0e: 08 95 ret 00033f10 <__fp_pscB>: 33f10: 00 24 eor r0, r0 33f12: 0a 94 dec r0 33f14: 12 16 cp r1, r18 33f16: 13 06 cpc r1, r19 33f18: 14 06 cpc r1, r20 33f1a: 05 06 cpc r0, r21 33f1c: 08 95 ret 00033f1e <__fp_round>: 33f1e: 09 2e mov r0, r25 33f20: 03 94 inc r0 33f22: 00 0c add r0, r0 33f24: 11 f4 brne .+4 ; 0x33f2a <__fp_round+0xc> 33f26: 88 23 and r24, r24 33f28: 52 f0 brmi .+20 ; 0x33f3e <__fp_round+0x20> 33f2a: bb 0f add r27, r27 33f2c: 40 f4 brcc .+16 ; 0x33f3e <__fp_round+0x20> 33f2e: bf 2b or r27, r31 33f30: 11 f4 brne .+4 ; 0x33f36 <__fp_round+0x18> 33f32: 60 ff sbrs r22, 0 33f34: 04 c0 rjmp .+8 ; 0x33f3e <__fp_round+0x20> 33f36: 6f 5f subi r22, 0xFF ; 255 33f38: 7f 4f sbci r23, 0xFF ; 255 33f3a: 8f 4f sbci r24, 0xFF ; 255 33f3c: 9f 4f sbci r25, 0xFF ; 255 33f3e: 08 95 ret 00033f40 <__fp_split3>: 33f40: 57 fd sbrc r21, 7 33f42: 90 58 subi r25, 0x80 ; 128 33f44: 44 0f add r20, r20 33f46: 55 1f adc r21, r21 33f48: 59 f0 breq .+22 ; 0x33f60 <__fp_splitA+0x10> 33f4a: 5f 3f cpi r21, 0xFF ; 255 33f4c: 71 f0 breq .+28 ; 0x33f6a <__fp_splitA+0x1a> 33f4e: 47 95 ror r20 00033f50 <__fp_splitA>: 33f50: 88 0f add r24, r24 33f52: 97 fb bst r25, 7 33f54: 99 1f adc r25, r25 33f56: 61 f0 breq .+24 ; 0x33f70 <__fp_splitA+0x20> 33f58: 9f 3f cpi r25, 0xFF ; 255 33f5a: 79 f0 breq .+30 ; 0x33f7a <__fp_splitA+0x2a> 33f5c: 87 95 ror r24 33f5e: 08 95 ret 33f60: 12 16 cp r1, r18 33f62: 13 06 cpc r1, r19 33f64: 14 06 cpc r1, r20 33f66: 55 1f adc r21, r21 33f68: f2 cf rjmp .-28 ; 0x33f4e <__fp_split3+0xe> 33f6a: 46 95 lsr r20 33f6c: f1 df rcall .-30 ; 0x33f50 <__fp_splitA> 33f6e: 08 c0 rjmp .+16 ; 0x33f80 <__fp_splitA+0x30> 33f70: 16 16 cp r1, r22 33f72: 17 06 cpc r1, r23 33f74: 18 06 cpc r1, r24 33f76: 99 1f adc r25, r25 33f78: f1 cf rjmp .-30 ; 0x33f5c <__fp_splitA+0xc> 33f7a: 86 95 lsr r24 33f7c: 71 05 cpc r23, r1 33f7e: 61 05 cpc r22, r1 33f80: 08 94 sec 33f82: 08 95 ret 00033f84 <__fp_zero>: 33f84: e8 94 clt 00033f86 <__fp_szero>: 33f86: bb 27 eor r27, r27 33f88: 66 27 eor r22, r22 33f8a: 77 27 eor r23, r23 33f8c: cb 01 movw r24, r22 33f8e: 97 f9 bld r25, 7 33f90: 08 95 ret 00033f92 : 33f92: 3f 92 push r3 33f94: 4f 92 push r4 33f96: 5f 92 push r5 33f98: 6f 92 push r6 33f9a: 7f 92 push r7 33f9c: 8f 92 push r8 33f9e: 9f 92 push r9 33fa0: af 92 push r10 33fa2: bf 92 push r11 33fa4: cf 92 push r12 33fa6: df 92 push r13 33fa8: ef 92 push r14 33faa: ff 92 push r15 33fac: 0f 93 push r16 33fae: 1f 93 push r17 33fb0: cf 93 push r28 33fb2: df 93 push r29 33fb4: 5c 01 movw r10, r24 33fb6: 6b 01 movw r12, r22 33fb8: 7a 01 movw r14, r20 33fba: 61 15 cp r22, r1 33fbc: 71 05 cpc r23, r1 33fbe: 19 f0 breq .+6 ; 0x33fc6 33fc0: fb 01 movw r30, r22 33fc2: 91 83 std Z+1, r25 ; 0x01 33fc4: 80 83 st Z, r24 33fc6: e1 14 cp r14, r1 33fc8: f1 04 cpc r15, r1 33fca: 51 f0 breq .+20 ; 0x33fe0 33fcc: c7 01 movw r24, r14 33fce: 02 97 sbiw r24, 0x02 ; 2 33fd0: 83 97 sbiw r24, 0x23 ; 35 33fd2: 30 f0 brcs .+12 ; 0x33fe0 33fd4: 40 e0 ldi r20, 0x00 ; 0 33fd6: 30 e0 ldi r19, 0x00 ; 0 33fd8: 20 e0 ldi r18, 0x00 ; 0 33fda: 90 e0 ldi r25, 0x00 ; 0 33fdc: 6b c0 rjmp .+214 ; 0x340b4 33fde: 5e 01 movw r10, r28 33fe0: e5 01 movw r28, r10 33fe2: 21 96 adiw r28, 0x01 ; 1 33fe4: f5 01 movw r30, r10 33fe6: 10 81 ld r17, Z 33fe8: 81 2f mov r24, r17 33fea: 90 e0 ldi r25, 0x00 ; 0 33fec: 0f 94 cf a1 call 0x3439e ; 0x3439e 33ff0: 89 2b or r24, r25 33ff2: a9 f7 brne .-22 ; 0x33fde 33ff4: 1d 32 cpi r17, 0x2D ; 45 33ff6: 01 f5 brne .+64 ; 0x34038 33ff8: 21 96 adiw r28, 0x01 ; 1 33ffa: f5 01 movw r30, r10 33ffc: 11 81 ldd r17, Z+1 ; 0x01 33ffe: 01 e0 ldi r16, 0x01 ; 1 34000: e1 14 cp r14, r1 34002: f1 04 cpc r15, r1 34004: 09 f4 brne .+2 ; 0x34008 34006: e6 c0 rjmp .+460 ; 0x341d4 34008: f0 e1 ldi r31, 0x10 ; 16 3400a: ef 16 cp r14, r31 3400c: f1 04 cpc r15, r1 3400e: 09 f0 breq .+2 ; 0x34012 34010: 88 c0 rjmp .+272 ; 0x34122 34012: 10 33 cpi r17, 0x30 ; 48 34014: 59 f4 brne .+22 ; 0x3402c 34016: 88 81 ld r24, Y 34018: 8f 7d andi r24, 0xDF ; 223 3401a: 88 35 cpi r24, 0x58 ; 88 3401c: 09 f0 breq .+2 ; 0x34020 3401e: 7c c0 rjmp .+248 ; 0x34118 34020: 19 81 ldd r17, Y+1 ; 0x01 34022: 22 96 adiw r28, 0x02 ; 2 34024: 02 60 ori r16, 0x02 ; 2 34026: f0 e1 ldi r31, 0x10 ; 16 34028: ef 2e mov r14, r31 3402a: f1 2c mov r15, r1 3402c: 81 2c mov r8, r1 3402e: 91 2c mov r9, r1 34030: a1 2c mov r10, r1 34032: 88 e0 ldi r24, 0x08 ; 8 34034: b8 2e mov r11, r24 34036: 92 c0 rjmp .+292 ; 0x3415c 34038: 1b 32 cpi r17, 0x2B ; 43 3403a: 21 f4 brne .+8 ; 0x34044 3403c: e5 01 movw r28, r10 3403e: 22 96 adiw r28, 0x02 ; 2 34040: f5 01 movw r30, r10 34042: 11 81 ldd r17, Z+1 ; 0x01 34044: 00 e0 ldi r16, 0x00 ; 0 34046: dc cf rjmp .-72 ; 0x34000 34048: ea e0 ldi r30, 0x0A ; 10 3404a: ee 16 cp r14, r30 3404c: f1 04 cpc r15, r1 3404e: 09 f4 brne .+2 ; 0x34052 34050: c7 c0 rjmp .+398 ; 0x341e0 34052: f0 e1 ldi r31, 0x10 ; 16 34054: ef 16 cp r14, r31 34056: f1 04 cpc r15, r1 34058: 09 f0 breq .+2 ; 0x3405c 3405a: 73 c0 rjmp .+230 ; 0x34142 3405c: e7 cf rjmp .-50 ; 0x3402c 3405e: 78 e0 ldi r23, 0x08 ; 8 34060: e7 2e mov r14, r23 34062: f1 2c mov r15, r1 34064: 81 2c mov r8, r1 34066: 91 2c mov r9, r1 34068: a1 2c mov r10, r1 3406a: 60 e1 ldi r22, 0x10 ; 16 3406c: b6 2e mov r11, r22 3406e: 76 c0 rjmp .+236 ; 0x3415c 34070: 21 e0 ldi r18, 0x01 ; 1 34072: ad c0 rjmp .+346 ; 0x341ce 34074: 30 2f mov r19, r16 34076: 31 70 andi r19, 0x01 ; 1 34078: c1 14 cp r12, r1 3407a: d1 04 cpc r13, r1 3407c: 31 f0 breq .+12 ; 0x3408a 3407e: 22 23 and r18, r18 34080: 71 f1 breq .+92 ; 0x340de 34082: 21 97 sbiw r28, 0x01 ; 1 34084: f6 01 movw r30, r12 34086: d1 83 std Z+1, r29 ; 0x01 34088: c0 83 st Z, r28 3408a: 27 ff sbrs r18, 7 3408c: 2e c0 rjmp .+92 ; 0x340ea 3408e: 60 e0 ldi r22, 0x00 ; 0 34090: 70 e0 ldi r23, 0x00 ; 0 34092: 80 e0 ldi r24, 0x00 ; 0 34094: 90 e8 ldi r25, 0x80 ; 128 34096: 31 11 cpse r19, r1 34098: 04 c0 rjmp .+8 ; 0x340a2 3409a: 6f ef ldi r22, 0xFF ; 255 3409c: 7f ef ldi r23, 0xFF ; 255 3409e: 8f ef ldi r24, 0xFF ; 255 340a0: 9f e7 ldi r25, 0x7F ; 127 340a2: 22 e2 ldi r18, 0x22 ; 34 340a4: 30 e0 ldi r19, 0x00 ; 0 340a6: 30 93 0c 17 sts 0x170C, r19 ; 0x80170c 340aa: 20 93 0b 17 sts 0x170B, r18 ; 0x80170b 340ae: 46 2f mov r20, r22 340b0: 37 2f mov r19, r23 340b2: 28 2f mov r18, r24 340b4: 64 2f mov r22, r20 340b6: 73 2f mov r23, r19 340b8: 82 2f mov r24, r18 340ba: df 91 pop r29 340bc: cf 91 pop r28 340be: 1f 91 pop r17 340c0: 0f 91 pop r16 340c2: ff 90 pop r15 340c4: ef 90 pop r14 340c6: df 90 pop r13 340c8: cf 90 pop r12 340ca: bf 90 pop r11 340cc: af 90 pop r10 340ce: 9f 90 pop r9 340d0: 8f 90 pop r8 340d2: 7f 90 pop r7 340d4: 6f 90 pop r6 340d6: 5f 90 pop r5 340d8: 4f 90 pop r4 340da: 3f 90 pop r3 340dc: 08 95 ret 340de: 01 ff sbrs r16, 1 340e0: 04 c0 rjmp .+8 ; 0x340ea 340e2: 22 97 sbiw r28, 0x02 ; 2 340e4: f6 01 movw r30, r12 340e6: d1 83 std Z+1, r29 ; 0x01 340e8: c0 83 st Z, r28 340ea: 33 23 and r19, r19 340ec: 41 f0 breq .+16 ; 0x340fe 340ee: 90 95 com r25 340f0: 80 95 com r24 340f2: 70 95 com r23 340f4: 61 95 neg r22 340f6: 7f 4f sbci r23, 0xFF ; 255 340f8: 8f 4f sbci r24, 0xFF ; 255 340fa: 9f 4f sbci r25, 0xFF ; 255 340fc: d8 cf rjmp .-80 ; 0x340ae 340fe: 97 ff sbrs r25, 7 34100: d6 cf rjmp .-84 ; 0x340ae 34102: 82 e2 ldi r24, 0x22 ; 34 34104: 90 e0 ldi r25, 0x00 ; 0 34106: 90 93 0c 17 sts 0x170C, r25 ; 0x80170c 3410a: 80 93 0b 17 sts 0x170B, r24 ; 0x80170b 3410e: 6f ef ldi r22, 0xFF ; 255 34110: 7f ef ldi r23, 0xFF ; 255 34112: 8f ef ldi r24, 0xFF ; 255 34114: 9f e7 ldi r25, 0x7F ; 127 34116: cb cf rjmp .-106 ; 0x340ae 34118: 10 e3 ldi r17, 0x30 ; 48 3411a: e1 14 cp r14, r1 3411c: f1 04 cpc r15, r1 3411e: 09 f4 brne .+2 ; 0x34122 34120: 9e cf rjmp .-196 ; 0x3405e 34122: 28 e0 ldi r18, 0x08 ; 8 34124: e2 16 cp r14, r18 34126: f1 04 cpc r15, r1 34128: 09 f4 brne .+2 ; 0x3412c 3412a: 9c cf rjmp .-200 ; 0x34064 3412c: 0c f0 brlt .+2 ; 0x34130 3412e: 8c cf rjmp .-232 ; 0x34048 34130: 81 2c mov r8, r1 34132: 91 2c mov r9, r1 34134: a1 2c mov r10, r1 34136: e0 e4 ldi r30, 0x40 ; 64 34138: be 2e mov r11, r30 3413a: 82 e0 ldi r24, 0x02 ; 2 3413c: e8 16 cp r14, r24 3413e: f1 04 cpc r15, r1 34140: 69 f0 breq .+26 ; 0x3415c 34142: 60 e0 ldi r22, 0x00 ; 0 34144: 70 e0 ldi r23, 0x00 ; 0 34146: 80 e0 ldi r24, 0x00 ; 0 34148: 90 e8 ldi r25, 0x80 ; 128 3414a: 97 01 movw r18, r14 3414c: 0f 2c mov r0, r15 3414e: 00 0c add r0, r0 34150: 44 0b sbc r20, r20 34152: 55 0b sbc r21, r21 34154: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 34158: 49 01 movw r8, r18 3415a: 5a 01 movw r10, r20 3415c: 20 e0 ldi r18, 0x00 ; 0 3415e: 60 e0 ldi r22, 0x00 ; 0 34160: 70 e0 ldi r23, 0x00 ; 0 34162: cb 01 movw r24, r22 34164: 27 01 movw r4, r14 34166: 0f 2c mov r0, r15 34168: 00 0c add r0, r0 3416a: 66 08 sbc r6, r6 3416c: 77 08 sbc r7, r7 3416e: fe 01 movw r30, r28 34170: 50 ed ldi r21, 0xD0 ; 208 34172: 35 2e mov r3, r21 34174: 31 0e add r3, r17 34176: 39 e0 ldi r19, 0x09 ; 9 34178: 33 15 cp r19, r3 3417a: 70 f4 brcc .+28 ; 0x34198 3417c: 3f eb ldi r19, 0xBF ; 191 3417e: 31 0f add r19, r17 34180: 49 ec ldi r20, 0xC9 ; 201 34182: 34 2e mov r3, r20 34184: 3a 31 cpi r19, 0x1A ; 26 34186: 38 f0 brcs .+14 ; 0x34196 34188: 3f e9 ldi r19, 0x9F ; 159 3418a: 31 0f add r19, r17 3418c: 3a 31 cpi r19, 0x1A ; 26 3418e: 08 f0 brcs .+2 ; 0x34192 34190: 71 cf rjmp .-286 ; 0x34074 34192: 39 ea ldi r19, 0xA9 ; 169 34194: 33 2e mov r3, r19 34196: 31 0e add r3, r17 34198: 3e 14 cp r3, r14 3419a: 1f 04 cpc r1, r15 3419c: 0c f0 brlt .+2 ; 0x341a0 3419e: 6a cf rjmp .-300 ; 0x34074 341a0: 27 fd sbrc r18, 7 341a2: 15 c0 rjmp .+42 ; 0x341ce 341a4: 86 16 cp r8, r22 341a6: 97 06 cpc r9, r23 341a8: a8 06 cpc r10, r24 341aa: b9 06 cpc r11, r25 341ac: 78 f0 brcs .+30 ; 0x341cc 341ae: a3 01 movw r20, r6 341b0: 92 01 movw r18, r4 341b2: 0f 94 a1 a4 call 0x34942 ; 0x34942 <__mulsi3> 341b6: 63 0d add r22, r3 341b8: 71 1d adc r23, r1 341ba: 81 1d adc r24, r1 341bc: 91 1d adc r25, r1 341be: 61 30 cpi r22, 0x01 ; 1 341c0: 71 05 cpc r23, r1 341c2: 81 05 cpc r24, r1 341c4: 20 e8 ldi r18, 0x80 ; 128 341c6: 92 07 cpc r25, r18 341c8: 08 f4 brcc .+2 ; 0x341cc 341ca: 52 cf rjmp .-348 ; 0x34070 341cc: 2f ef ldi r18, 0xFF ; 255 341ce: 21 96 adiw r28, 0x01 ; 1 341d0: 10 81 ld r17, Z 341d2: cd cf rjmp .-102 ; 0x3416e 341d4: 10 33 cpi r17, 0x30 ; 48 341d6: 09 f4 brne .+2 ; 0x341da 341d8: 1e cf rjmp .-452 ; 0x34016 341da: 2a e0 ldi r18, 0x0A ; 10 341dc: e2 2e mov r14, r18 341de: f1 2c mov r15, r1 341e0: 9c ec ldi r25, 0xCC ; 204 341e2: 89 2e mov r8, r25 341e4: 98 2c mov r9, r8 341e6: a8 2c mov r10, r8 341e8: 9c e0 ldi r25, 0x0C ; 12 341ea: b9 2e mov r11, r25 341ec: b7 cf rjmp .-146 ; 0x3415c 000341ee <__ftoa_engine>: 341ee: 28 30 cpi r18, 0x08 ; 8 341f0: 08 f0 brcs .+2 ; 0x341f4 <__ftoa_engine+0x6> 341f2: 27 e0 ldi r18, 0x07 ; 7 341f4: 33 27 eor r19, r19 341f6: da 01 movw r26, r20 341f8: 99 0f add r25, r25 341fa: 31 1d adc r19, r1 341fc: 87 fd sbrc r24, 7 341fe: 91 60 ori r25, 0x01 ; 1 34200: 00 96 adiw r24, 0x00 ; 0 34202: 61 05 cpc r22, r1 34204: 71 05 cpc r23, r1 34206: 39 f4 brne .+14 ; 0x34216 <__ftoa_engine+0x28> 34208: 32 60 ori r19, 0x02 ; 2 3420a: 2e 5f subi r18, 0xFE ; 254 3420c: 3d 93 st X+, r19 3420e: 30 e3 ldi r19, 0x30 ; 48 34210: 2a 95 dec r18 34212: e1 f7 brne .-8 ; 0x3420c <__ftoa_engine+0x1e> 34214: 08 95 ret 34216: 9f 3f cpi r25, 0xFF ; 255 34218: 30 f0 brcs .+12 ; 0x34226 <__ftoa_engine+0x38> 3421a: 80 38 cpi r24, 0x80 ; 128 3421c: 71 05 cpc r23, r1 3421e: 61 05 cpc r22, r1 34220: 09 f0 breq .+2 ; 0x34224 <__ftoa_engine+0x36> 34222: 3c 5f subi r19, 0xFC ; 252 34224: 3c 5f subi r19, 0xFC ; 252 34226: 3d 93 st X+, r19 34228: 91 30 cpi r25, 0x01 ; 1 3422a: 08 f0 brcs .+2 ; 0x3422e <__ftoa_engine+0x40> 3422c: 80 68 ori r24, 0x80 ; 128 3422e: 91 1d adc r25, r1 34230: df 93 push r29 34232: cf 93 push r28 34234: 1f 93 push r17 34236: 0f 93 push r16 34238: ff 92 push r15 3423a: ef 92 push r14 3423c: 19 2f mov r17, r25 3423e: 98 7f andi r25, 0xF8 ; 248 34240: 96 95 lsr r25 34242: e9 2f mov r30, r25 34244: 96 95 lsr r25 34246: 96 95 lsr r25 34248: e9 0f add r30, r25 3424a: ff 27 eor r31, r31 3424c: e6 57 subi r30, 0x76 ; 118 3424e: fd 48 sbci r31, 0x8D ; 141 34250: 99 27 eor r25, r25 34252: 33 27 eor r19, r19 34254: ee 24 eor r14, r14 34256: ff 24 eor r15, r15 34258: a7 01 movw r20, r14 3425a: e7 01 movw r28, r14 3425c: 05 90 lpm r0, Z+ 3425e: 08 94 sec 34260: 07 94 ror r0 34262: 28 f4 brcc .+10 ; 0x3426e <__ftoa_engine+0x80> 34264: 36 0f add r19, r22 34266: e7 1e adc r14, r23 34268: f8 1e adc r15, r24 3426a: 49 1f adc r20, r25 3426c: 51 1d adc r21, r1 3426e: 66 0f add r22, r22 34270: 77 1f adc r23, r23 34272: 88 1f adc r24, r24 34274: 99 1f adc r25, r25 34276: 06 94 lsr r0 34278: a1 f7 brne .-24 ; 0x34262 <__ftoa_engine+0x74> 3427a: 05 90 lpm r0, Z+ 3427c: 07 94 ror r0 3427e: 28 f4 brcc .+10 ; 0x3428a <__ftoa_engine+0x9c> 34280: e7 0e add r14, r23 34282: f8 1e adc r15, r24 34284: 49 1f adc r20, r25 34286: 56 1f adc r21, r22 34288: c1 1d adc r28, r1 3428a: 77 0f add r23, r23 3428c: 88 1f adc r24, r24 3428e: 99 1f adc r25, r25 34290: 66 1f adc r22, r22 34292: 06 94 lsr r0 34294: a1 f7 brne .-24 ; 0x3427e <__ftoa_engine+0x90> 34296: 05 90 lpm r0, Z+ 34298: 07 94 ror r0 3429a: 28 f4 brcc .+10 ; 0x342a6 <__ftoa_engine+0xb8> 3429c: f8 0e add r15, r24 3429e: 49 1f adc r20, r25 342a0: 56 1f adc r21, r22 342a2: c7 1f adc r28, r23 342a4: d1 1d adc r29, r1 342a6: 88 0f add r24, r24 342a8: 99 1f adc r25, r25 342aa: 66 1f adc r22, r22 342ac: 77 1f adc r23, r23 342ae: 06 94 lsr r0 342b0: a1 f7 brne .-24 ; 0x3429a <__ftoa_engine+0xac> 342b2: 05 90 lpm r0, Z+ 342b4: 07 94 ror r0 342b6: 20 f4 brcc .+8 ; 0x342c0 <__ftoa_engine+0xd2> 342b8: 49 0f add r20, r25 342ba: 56 1f adc r21, r22 342bc: c7 1f adc r28, r23 342be: d8 1f adc r29, r24 342c0: 99 0f add r25, r25 342c2: 66 1f adc r22, r22 342c4: 77 1f adc r23, r23 342c6: 88 1f adc r24, r24 342c8: 06 94 lsr r0 342ca: a9 f7 brne .-22 ; 0x342b6 <__ftoa_engine+0xc8> 342cc: 84 91 lpm r24, Z 342ce: 10 95 com r17 342d0: 17 70 andi r17, 0x07 ; 7 342d2: 41 f0 breq .+16 ; 0x342e4 <__ftoa_engine+0xf6> 342d4: d6 95 lsr r29 342d6: c7 95 ror r28 342d8: 57 95 ror r21 342da: 47 95 ror r20 342dc: f7 94 ror r15 342de: e7 94 ror r14 342e0: 1a 95 dec r17 342e2: c1 f7 brne .-16 ; 0x342d4 <__ftoa_engine+0xe6> 342e4: e0 e3 ldi r30, 0x30 ; 48 342e6: f2 e7 ldi r31, 0x72 ; 114 342e8: 68 94 set 342ea: 15 90 lpm r1, Z+ 342ec: 15 91 lpm r17, Z+ 342ee: 35 91 lpm r19, Z+ 342f0: 65 91 lpm r22, Z+ 342f2: 95 91 lpm r25, Z+ 342f4: 05 90 lpm r0, Z+ 342f6: 7f e2 ldi r23, 0x2F ; 47 342f8: 73 95 inc r23 342fa: e1 18 sub r14, r1 342fc: f1 0a sbc r15, r17 342fe: 43 0b sbc r20, r19 34300: 56 0b sbc r21, r22 34302: c9 0b sbc r28, r25 34304: d0 09 sbc r29, r0 34306: c0 f7 brcc .-16 ; 0x342f8 <__ftoa_engine+0x10a> 34308: e1 0c add r14, r1 3430a: f1 1e adc r15, r17 3430c: 43 1f adc r20, r19 3430e: 56 1f adc r21, r22 34310: c9 1f adc r28, r25 34312: d0 1d adc r29, r0 34314: 7e f4 brtc .+30 ; 0x34334 <__ftoa_engine+0x146> 34316: 70 33 cpi r23, 0x30 ; 48 34318: 11 f4 brne .+4 ; 0x3431e <__ftoa_engine+0x130> 3431a: 8a 95 dec r24 3431c: e6 cf rjmp .-52 ; 0x342ea <__ftoa_engine+0xfc> 3431e: e8 94 clt 34320: 01 50 subi r16, 0x01 ; 1 34322: 30 f0 brcs .+12 ; 0x34330 <__ftoa_engine+0x142> 34324: 08 0f add r16, r24 34326: 0a f4 brpl .+2 ; 0x3432a <__ftoa_engine+0x13c> 34328: 00 27 eor r16, r16 3432a: 02 17 cp r16, r18 3432c: 08 f4 brcc .+2 ; 0x34330 <__ftoa_engine+0x142> 3432e: 20 2f mov r18, r16 34330: 23 95 inc r18 34332: 02 2f mov r16, r18 34334: 7a 33 cpi r23, 0x3A ; 58 34336: 28 f0 brcs .+10 ; 0x34342 <__ftoa_engine+0x154> 34338: 79 e3 ldi r23, 0x39 ; 57 3433a: 7d 93 st X+, r23 3433c: 2a 95 dec r18 3433e: e9 f7 brne .-6 ; 0x3433a <__ftoa_engine+0x14c> 34340: 10 c0 rjmp .+32 ; 0x34362 <__ftoa_engine+0x174> 34342: 7d 93 st X+, r23 34344: 2a 95 dec r18 34346: 89 f6 brne .-94 ; 0x342ea <__ftoa_engine+0xfc> 34348: 06 94 lsr r0 3434a: 97 95 ror r25 3434c: 67 95 ror r22 3434e: 37 95 ror r19 34350: 17 95 ror r17 34352: 17 94 ror r1 34354: e1 18 sub r14, r1 34356: f1 0a sbc r15, r17 34358: 43 0b sbc r20, r19 3435a: 56 0b sbc r21, r22 3435c: c9 0b sbc r28, r25 3435e: d0 09 sbc r29, r0 34360: 98 f0 brcs .+38 ; 0x34388 <__ftoa_engine+0x19a> 34362: 23 95 inc r18 34364: 7e 91 ld r23, -X 34366: 73 95 inc r23 34368: 7a 33 cpi r23, 0x3A ; 58 3436a: 08 f0 brcs .+2 ; 0x3436e <__ftoa_engine+0x180> 3436c: 70 e3 ldi r23, 0x30 ; 48 3436e: 7c 93 st X, r23 34370: 20 13 cpse r18, r16 34372: b8 f7 brcc .-18 ; 0x34362 <__ftoa_engine+0x174> 34374: 7e 91 ld r23, -X 34376: 70 61 ori r23, 0x10 ; 16 34378: 7d 93 st X+, r23 3437a: 30 f0 brcs .+12 ; 0x34388 <__ftoa_engine+0x19a> 3437c: 83 95 inc r24 3437e: 71 e3 ldi r23, 0x31 ; 49 34380: 7d 93 st X+, r23 34382: 70 e3 ldi r23, 0x30 ; 48 34384: 2a 95 dec r18 34386: e1 f7 brne .-8 ; 0x34380 <__ftoa_engine+0x192> 34388: 11 24 eor r1, r1 3438a: ef 90 pop r14 3438c: ff 90 pop r15 3438e: 0f 91 pop r16 34390: 1f 91 pop r17 34392: cf 91 pop r28 34394: df 91 pop r29 34396: 99 27 eor r25, r25 34398: 87 fd sbrc r24, 7 3439a: 90 95 com r25 3439c: 08 95 ret 0003439e : 3439e: 91 11 cpse r25, r1 343a0: 0d 94 2b a4 jmp 0x34856 ; 0x34856 <__ctype_isfalse> 343a4: 80 32 cpi r24, 0x20 ; 32 343a6: 19 f0 breq .+6 ; 0x343ae 343a8: 89 50 subi r24, 0x09 ; 9 343aa: 85 50 subi r24, 0x05 ; 5 343ac: c8 f7 brcc .-14 ; 0x343a0 343ae: 08 95 ret 000343b0 : 343b0: fb 01 movw r30, r22 343b2: dc 01 movw r26, r24 343b4: 02 c0 rjmp .+4 ; 0x343ba 343b6: 05 90 lpm r0, Z+ 343b8: 0d 92 st X+, r0 343ba: 41 50 subi r20, 0x01 ; 1 343bc: 50 40 sbci r21, 0x00 ; 0 343be: d8 f7 brcc .-10 ; 0x343b6 343c0: 08 95 ret 000343c2 : 343c2: fb 01 movw r30, r22 343c4: dc 01 movw r26, r24 343c6: 0d 90 ld r0, X+ 343c8: 00 20 and r0, r0 343ca: e9 f7 brne .-6 ; 0x343c6 343cc: 11 97 sbiw r26, 0x01 ; 1 343ce: 05 90 lpm r0, Z+ 343d0: 0d 92 st X+, r0 343d2: 00 20 and r0, r0 343d4: e1 f7 brne .-8 ; 0x343ce 343d6: 08 95 ret 000343d8 : 343d8: fb 01 movw r30, r22 343da: dc 01 movw r26, r24 343dc: 8d 91 ld r24, X+ 343de: 05 90 lpm r0, Z+ 343e0: 80 19 sub r24, r0 343e2: 01 10 cpse r0, r1 343e4: d9 f3 breq .-10 ; 0x343dc 343e6: 99 0b sbc r25, r25 343e8: 08 95 ret 000343ea : 343ea: fb 01 movw r30, r22 343ec: dc 01 movw r26, r24 343ee: 05 90 lpm r0, Z+ 343f0: 0d 92 st X+, r0 343f2: 00 20 and r0, r0 343f4: e1 f7 brne .-8 ; 0x343ee 343f6: 08 95 ret 000343f8 <__strlen_P>: 343f8: fc 01 movw r30, r24 343fa: 05 90 lpm r0, Z+ 343fc: 00 20 and r0, r0 343fe: e9 f7 brne .-6 ; 0x343fa <__strlen_P+0x2> 34400: 80 95 com r24 34402: 90 95 com r25 34404: 8e 0f add r24, r30 34406: 9f 1f adc r25, r31 34408: 08 95 ret 0003440a : 3440a: fb 01 movw r30, r22 3440c: dc 01 movw r26, r24 3440e: 41 50 subi r20, 0x01 ; 1 34410: 50 40 sbci r21, 0x00 ; 0 34412: 88 f0 brcs .+34 ; 0x34436 34414: 8d 91 ld r24, X+ 34416: 81 34 cpi r24, 0x41 ; 65 34418: 1c f0 brlt .+6 ; 0x34420 3441a: 8b 35 cpi r24, 0x5B ; 91 3441c: 0c f4 brge .+2 ; 0x34420 3441e: 80 5e subi r24, 0xE0 ; 224 34420: 65 91 lpm r22, Z+ 34422: 61 34 cpi r22, 0x41 ; 65 34424: 1c f0 brlt .+6 ; 0x3442c 34426: 6b 35 cpi r22, 0x5B ; 91 34428: 0c f4 brge .+2 ; 0x3442c 3442a: 60 5e subi r22, 0xE0 ; 224 3442c: 86 1b sub r24, r22 3442e: 61 11 cpse r22, r1 34430: 71 f3 breq .-36 ; 0x3440e 34432: 99 0b sbc r25, r25 34434: 08 95 ret 34436: 88 1b sub r24, r24 34438: fc cf rjmp .-8 ; 0x34432 0003443a : 3443a: fb 01 movw r30, r22 3443c: dc 01 movw r26, r24 3443e: 41 50 subi r20, 0x01 ; 1 34440: 50 40 sbci r21, 0x00 ; 0 34442: 30 f0 brcs .+12 ; 0x34450 34444: 8d 91 ld r24, X+ 34446: 05 90 lpm r0, Z+ 34448: 80 19 sub r24, r0 3444a: 19 f4 brne .+6 ; 0x34452 3444c: 00 20 and r0, r0 3444e: b9 f7 brne .-18 ; 0x3443e 34450: 88 1b sub r24, r24 34452: 99 0b sbc r25, r25 34454: 08 95 ret 00034456 : 34456: fb 01 movw r30, r22 34458: dc 01 movw r26, r24 3445a: 41 50 subi r20, 0x01 ; 1 3445c: 50 40 sbci r21, 0x00 ; 0 3445e: 48 f0 brcs .+18 ; 0x34472 34460: 05 90 lpm r0, Z+ 34462: 0d 92 st X+, r0 34464: 00 20 and r0, r0 34466: c9 f7 brne .-14 ; 0x3445a 34468: 01 c0 rjmp .+2 ; 0x3446c 3446a: 1d 92 st X+, r1 3446c: 41 50 subi r20, 0x01 ; 1 3446e: 50 40 sbci r21, 0x00 ; 0 34470: e0 f7 brcc .-8 ; 0x3446a 34472: 08 95 ret 00034474 : 34474: fc 01 movw r30, r24 34476: 05 90 lpm r0, Z+ 34478: 61 50 subi r22, 0x01 ; 1 3447a: 70 40 sbci r23, 0x00 ; 0 3447c: 01 10 cpse r0, r1 3447e: d8 f7 brcc .-10 ; 0x34476 34480: 80 95 com r24 34482: 90 95 com r25 34484: 8e 0f add r24, r30 34486: 9f 1f adc r25, r31 34488: 08 95 ret 0003448a : 3448a: fb 01 movw r30, r22 3448c: 55 91 lpm r21, Z+ 3448e: 55 23 and r21, r21 34490: a9 f0 breq .+42 ; 0x344bc 34492: bf 01 movw r22, r30 34494: dc 01 movw r26, r24 34496: 4d 91 ld r20, X+ 34498: 45 17 cp r20, r21 3449a: 41 11 cpse r20, r1 3449c: e1 f7 brne .-8 ; 0x34496 3449e: 59 f4 brne .+22 ; 0x344b6 344a0: cd 01 movw r24, r26 344a2: 05 90 lpm r0, Z+ 344a4: 00 20 and r0, r0 344a6: 49 f0 breq .+18 ; 0x344ba 344a8: 4d 91 ld r20, X+ 344aa: 40 15 cp r20, r0 344ac: 41 11 cpse r20, r1 344ae: c9 f3 breq .-14 ; 0x344a2 344b0: fb 01 movw r30, r22 344b2: 41 11 cpse r20, r1 344b4: ef cf rjmp .-34 ; 0x34494 344b6: 81 e0 ldi r24, 0x01 ; 1 344b8: 90 e0 ldi r25, 0x00 ; 0 344ba: 01 97 sbiw r24, 0x01 ; 1 344bc: 08 95 ret 000344be : 344be: fc 01 movw r30, r24 344c0: 61 50 subi r22, 0x01 ; 1 344c2: 70 40 sbci r23, 0x00 ; 0 344c4: 01 90 ld r0, Z+ 344c6: 01 10 cpse r0, r1 344c8: d8 f7 brcc .-10 ; 0x344c0 344ca: 80 95 com r24 344cc: 90 95 com r25 344ce: 8e 0f add r24, r30 344d0: 9f 1f adc r25, r31 344d2: 08 95 ret 000344d4 : 344d4: cf 93 push r28 344d6: df 93 push r29 344d8: ec 01 movw r28, r24 344da: 2b 81 ldd r18, Y+3 ; 0x03 344dc: 20 ff sbrs r18, 0 344de: 1a c0 rjmp .+52 ; 0x34514 344e0: 26 ff sbrs r18, 6 344e2: 0c c0 rjmp .+24 ; 0x344fc 344e4: 2f 7b andi r18, 0xBF ; 191 344e6: 2b 83 std Y+3, r18 ; 0x03 344e8: 8e 81 ldd r24, Y+6 ; 0x06 344ea: 9f 81 ldd r25, Y+7 ; 0x07 344ec: 01 96 adiw r24, 0x01 ; 1 344ee: 9f 83 std Y+7, r25 ; 0x07 344f0: 8e 83 std Y+6, r24 ; 0x06 344f2: 8a 81 ldd r24, Y+2 ; 0x02 344f4: 90 e0 ldi r25, 0x00 ; 0 344f6: df 91 pop r29 344f8: cf 91 pop r28 344fa: 08 95 ret 344fc: 22 ff sbrs r18, 2 344fe: 18 c0 rjmp .+48 ; 0x34530 34500: e8 81 ld r30, Y 34502: f9 81 ldd r31, Y+1 ; 0x01 34504: 80 81 ld r24, Z 34506: 08 2e mov r0, r24 34508: 00 0c add r0, r0 3450a: 99 0b sbc r25, r25 3450c: 00 97 sbiw r24, 0x00 ; 0 3450e: 29 f4 brne .+10 ; 0x3451a 34510: 20 62 ori r18, 0x20 ; 32 34512: 2b 83 std Y+3, r18 ; 0x03 34514: 8f ef ldi r24, 0xFF ; 255 34516: 9f ef ldi r25, 0xFF ; 255 34518: ee cf rjmp .-36 ; 0x344f6 3451a: 31 96 adiw r30, 0x01 ; 1 3451c: f9 83 std Y+1, r31 ; 0x01 3451e: e8 83 st Y, r30 34520: 2e 81 ldd r18, Y+6 ; 0x06 34522: 3f 81 ldd r19, Y+7 ; 0x07 34524: 2f 5f subi r18, 0xFF ; 255 34526: 3f 4f sbci r19, 0xFF ; 255 34528: 3f 83 std Y+7, r19 ; 0x07 3452a: 2e 83 std Y+6, r18 ; 0x06 3452c: 99 27 eor r25, r25 3452e: e3 cf rjmp .-58 ; 0x344f6 34530: ea 85 ldd r30, Y+10 ; 0x0a 34532: fb 85 ldd r31, Y+11 ; 0x0b 34534: 19 95 eicall 34536: 97 ff sbrs r25, 7 34538: f3 cf rjmp .-26 ; 0x34520 3453a: 2b 81 ldd r18, Y+3 ; 0x03 3453c: 01 96 adiw r24, 0x01 ; 1 3453e: 21 f0 breq .+8 ; 0x34548 34540: 80 e2 ldi r24, 0x20 ; 32 34542: 82 2b or r24, r18 34544: 8b 83 std Y+3, r24 ; 0x03 34546: e6 cf rjmp .-52 ; 0x34514 34548: 80 e1 ldi r24, 0x10 ; 16 3454a: fb cf rjmp .-10 ; 0x34542 0003454c : 3454c: 0f 93 push r16 3454e: 1f 93 push r17 34550: cf 93 push r28 34552: df 93 push r29 34554: 18 2f mov r17, r24 34556: 09 2f mov r16, r25 34558: eb 01 movw r28, r22 3455a: 8b 81 ldd r24, Y+3 ; 0x03 3455c: 81 fd sbrc r24, 1 3455e: 09 c0 rjmp .+18 ; 0x34572 34560: 1f ef ldi r17, 0xFF ; 255 34562: 0f ef ldi r16, 0xFF ; 255 34564: 81 2f mov r24, r17 34566: 90 2f mov r25, r16 34568: df 91 pop r29 3456a: cf 91 pop r28 3456c: 1f 91 pop r17 3456e: 0f 91 pop r16 34570: 08 95 ret 34572: 82 ff sbrs r24, 2 34574: 14 c0 rjmp .+40 ; 0x3459e 34576: 2e 81 ldd r18, Y+6 ; 0x06 34578: 3f 81 ldd r19, Y+7 ; 0x07 3457a: 8c 81 ldd r24, Y+4 ; 0x04 3457c: 9d 81 ldd r25, Y+5 ; 0x05 3457e: 28 17 cp r18, r24 34580: 39 07 cpc r19, r25 34582: 3c f4 brge .+14 ; 0x34592 34584: e8 81 ld r30, Y 34586: f9 81 ldd r31, Y+1 ; 0x01 34588: cf 01 movw r24, r30 3458a: 01 96 adiw r24, 0x01 ; 1 3458c: 99 83 std Y+1, r25 ; 0x01 3458e: 88 83 st Y, r24 34590: 10 83 st Z, r17 34592: 8e 81 ldd r24, Y+6 ; 0x06 34594: 9f 81 ldd r25, Y+7 ; 0x07 34596: 01 96 adiw r24, 0x01 ; 1 34598: 9f 83 std Y+7, r25 ; 0x07 3459a: 8e 83 std Y+6, r24 ; 0x06 3459c: e3 cf rjmp .-58 ; 0x34564 3459e: e8 85 ldd r30, Y+8 ; 0x08 345a0: f9 85 ldd r31, Y+9 ; 0x09 345a2: 81 2f mov r24, r17 345a4: 19 95 eicall 345a6: 89 2b or r24, r25 345a8: a1 f3 breq .-24 ; 0x34592 345aa: da cf rjmp .-76 ; 0x34560 000345ac : 345ac: ef 92 push r14 345ae: ff 92 push r15 345b0: 0f 93 push r16 345b2: 1f 93 push r17 345b4: cf 93 push r28 345b6: df 93 push r29 345b8: 8c 01 movw r16, r24 345ba: 7b 01 movw r14, r22 345bc: db 01 movw r26, r22 345be: 13 96 adiw r26, 0x03 ; 3 345c0: 8c 91 ld r24, X 345c2: d0 e0 ldi r29, 0x00 ; 0 345c4: c0 e0 ldi r28, 0x00 ; 0 345c6: 81 fd sbrc r24, 1 345c8: 0f c0 rjmp .+30 ; 0x345e8 345ca: cf ef ldi r28, 0xFF ; 255 345cc: df ef ldi r29, 0xFF ; 255 345ce: 10 c0 rjmp .+32 ; 0x345f0 345d0: d7 01 movw r26, r14 345d2: 18 96 adiw r26, 0x08 ; 8 345d4: ed 91 ld r30, X+ 345d6: fc 91 ld r31, X 345d8: b7 01 movw r22, r14 345da: 19 95 eicall 345dc: 89 2b or r24, r25 345de: 11 f0 breq .+4 ; 0x345e4 345e0: cf ef ldi r28, 0xFF ; 255 345e2: df ef ldi r29, 0xFF ; 255 345e4: 0f 5f subi r16, 0xFF ; 255 345e6: 1f 4f sbci r17, 0xFF ; 255 345e8: f8 01 movw r30, r16 345ea: 84 91 lpm r24, Z 345ec: 81 11 cpse r24, r1 345ee: f0 cf rjmp .-32 ; 0x345d0 345f0: ce 01 movw r24, r28 345f2: df 91 pop r29 345f4: cf 91 pop r28 345f6: 1f 91 pop r17 345f8: 0f 91 pop r16 345fa: ff 90 pop r15 345fc: ef 90 pop r14 345fe: 08 95 ret 00034600 : 34600: 0f 93 push r16 34602: 1f 93 push r17 34604: cf 93 push r28 34606: df 93 push r29 34608: cd b7 in r28, 0x3d ; 61 3460a: de b7 in r29, 0x3e ; 62 3460c: ae 01 movw r20, r28 3460e: 48 5f subi r20, 0xF8 ; 248 34610: 5f 4f sbci r21, 0xFF ; 255 34612: da 01 movw r26, r20 34614: 6d 91 ld r22, X+ 34616: 7d 91 ld r23, X+ 34618: ad 01 movw r20, r26 3461a: 01 e1 ldi r16, 0x11 ; 17 3461c: 17 e1 ldi r17, 0x17 ; 23 3461e: f8 01 movw r30, r16 34620: 82 81 ldd r24, Z+2 ; 0x02 34622: 93 81 ldd r25, Z+3 ; 0x03 34624: dc 01 movw r26, r24 34626: 13 96 adiw r26, 0x03 ; 3 34628: 2c 91 ld r18, X 3462a: 13 97 sbiw r26, 0x03 ; 3 3462c: 28 60 ori r18, 0x08 ; 8 3462e: 13 96 adiw r26, 0x03 ; 3 34630: 2c 93 st X, r18 34632: 0e 94 b2 51 call 0xa364 ; 0xa364 34636: d8 01 movw r26, r16 34638: 12 96 adiw r26, 0x02 ; 2 3463a: ed 91 ld r30, X+ 3463c: fc 91 ld r31, X 3463e: 23 81 ldd r18, Z+3 ; 0x03 34640: 27 7f andi r18, 0xF7 ; 247 34642: 23 83 std Z+3, r18 ; 0x03 34644: df 91 pop r29 34646: cf 91 pop r28 34648: 1f 91 pop r17 3464a: 0f 91 pop r16 3464c: 08 95 ret 0003464e : 3464e: 0f 93 push r16 34650: 1f 93 push r17 34652: cf 93 push r28 34654: df 93 push r29 34656: 8c 01 movw r16, r24 34658: e0 91 13 17 lds r30, 0x1713 ; 0x801713 <__iob+0x2> 3465c: f0 91 14 17 lds r31, 0x1714 ; 0x801714 <__iob+0x3> 34660: 83 81 ldd r24, Z+3 ; 0x03 34662: d0 e0 ldi r29, 0x00 ; 0 34664: c0 e0 ldi r28, 0x00 ; 0 34666: 81 fd sbrc r24, 1 34668: 0a c0 rjmp .+20 ; 0x3467e 3466a: cf ef ldi r28, 0xFF ; 255 3466c: df ef ldi r29, 0xFF ; 255 3466e: 17 c0 rjmp .+46 ; 0x3469e 34670: 19 95 eicall 34672: 89 2b or r24, r25 34674: 11 f0 breq .+4 ; 0x3467a 34676: cf ef ldi r28, 0xFF ; 255 34678: df ef ldi r29, 0xFF ; 255 3467a: 0f 5f subi r16, 0xFF ; 255 3467c: 1f 4f sbci r17, 0xFF ; 255 3467e: f8 01 movw r30, r16 34680: 84 91 lpm r24, Z 34682: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 34686: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 3468a: db 01 movw r26, r22 3468c: 18 96 adiw r26, 0x08 ; 8 3468e: ed 91 ld r30, X+ 34690: fc 91 ld r31, X 34692: 81 11 cpse r24, r1 34694: ed cf rjmp .-38 ; 0x34670 34696: 8a e0 ldi r24, 0x0A ; 10 34698: 19 95 eicall 3469a: 89 2b or r24, r25 3469c: 31 f7 brne .-52 ; 0x3466a 3469e: ce 01 movw r24, r28 346a0: df 91 pop r29 346a2: cf 91 pop r28 346a4: 1f 91 pop r17 346a6: 0f 91 pop r16 346a8: 08 95 ret 000346aa : 346aa: 0f 93 push r16 346ac: 1f 93 push r17 346ae: cf 93 push r28 346b0: df 93 push r29 346b2: cd b7 in r28, 0x3d ; 61 346b4: de b7 in r29, 0x3e ; 62 346b6: 2e 97 sbiw r28, 0x0e ; 14 346b8: 0f b6 in r0, 0x3f ; 63 346ba: f8 94 cli 346bc: de bf out 0x3e, r29 ; 62 346be: 0f be out 0x3f, r0 ; 63 346c0: cd bf out 0x3d, r28 ; 61 346c2: 0e 89 ldd r16, Y+22 ; 0x16 346c4: 1f 89 ldd r17, Y+23 ; 0x17 346c6: 8e e0 ldi r24, 0x0E ; 14 346c8: 8c 83 std Y+4, r24 ; 0x04 346ca: 1a 83 std Y+2, r17 ; 0x02 346cc: 09 83 std Y+1, r16 ; 0x01 346ce: 8f ef ldi r24, 0xFF ; 255 346d0: 9f e7 ldi r25, 0x7F ; 127 346d2: 9e 83 std Y+6, r25 ; 0x06 346d4: 8d 83 std Y+5, r24 ; 0x05 346d6: ae 01 movw r20, r28 346d8: 46 5e subi r20, 0xE6 ; 230 346da: 5f 4f sbci r21, 0xFF ; 255 346dc: 68 8d ldd r22, Y+24 ; 0x18 346de: 79 8d ldd r23, Y+25 ; 0x19 346e0: ce 01 movw r24, r28 346e2: 01 96 adiw r24, 0x01 ; 1 346e4: 0e 94 b2 51 call 0xa364 ; 0xa364 346e8: 2f 81 ldd r18, Y+7 ; 0x07 346ea: 38 85 ldd r19, Y+8 ; 0x08 346ec: 02 0f add r16, r18 346ee: 13 1f adc r17, r19 346f0: f8 01 movw r30, r16 346f2: 10 82 st Z, r1 346f4: 2e 96 adiw r28, 0x0e ; 14 346f6: 0f b6 in r0, 0x3f ; 63 346f8: f8 94 cli 346fa: de bf out 0x3e, r29 ; 62 346fc: 0f be out 0x3f, r0 ; 63 346fe: cd bf out 0x3d, r28 ; 61 34700: df 91 pop r29 34702: cf 91 pop r28 34704: 1f 91 pop r17 34706: 0f 91 pop r16 34708: 08 95 ret 0003470a : 3470a: cf 93 push r28 3470c: df 93 push r29 3470e: ec 01 movw r28, r24 34710: 8b 81 ldd r24, Y+3 ; 0x03 34712: 88 60 ori r24, 0x08 ; 8 34714: 8b 83 std Y+3, r24 ; 0x03 34716: ce 01 movw r24, r28 34718: 0e 94 b2 51 call 0xa364 ; 0xa364 3471c: 2b 81 ldd r18, Y+3 ; 0x03 3471e: 27 7f andi r18, 0xF7 ; 247 34720: 2b 83 std Y+3, r18 ; 0x03 34722: df 91 pop r29 34724: cf 91 pop r28 34726: 08 95 ret 00034728 : 34728: 0f 93 push r16 3472a: 1f 93 push r17 3472c: cf 93 push r28 3472e: df 93 push r29 34730: cd b7 in r28, 0x3d ; 61 34732: de b7 in r29, 0x3e ; 62 34734: 2e 97 sbiw r28, 0x0e ; 14 34736: 0f b6 in r0, 0x3f ; 63 34738: f8 94 cli 3473a: de bf out 0x3e, r29 ; 62 3473c: 0f be out 0x3f, r0 ; 63 3473e: cd bf out 0x3d, r28 ; 61 34740: 8c 01 movw r16, r24 34742: fa 01 movw r30, r20 34744: 8e e0 ldi r24, 0x0E ; 14 34746: 8c 83 std Y+4, r24 ; 0x04 34748: 1a 83 std Y+2, r17 ; 0x02 3474a: 09 83 std Y+1, r16 ; 0x01 3474c: 77 ff sbrs r23, 7 3474e: 02 c0 rjmp .+4 ; 0x34754 34750: 60 e0 ldi r22, 0x00 ; 0 34752: 70 e8 ldi r23, 0x80 ; 128 34754: 61 50 subi r22, 0x01 ; 1 34756: 71 09 sbc r23, r1 34758: 7e 83 std Y+6, r23 ; 0x06 3475a: 6d 83 std Y+5, r22 ; 0x05 3475c: a9 01 movw r20, r18 3475e: bf 01 movw r22, r30 34760: ce 01 movw r24, r28 34762: 01 96 adiw r24, 0x01 ; 1 34764: 0e 94 b2 51 call 0xa364 ; 0xa364 34768: 4d 81 ldd r20, Y+5 ; 0x05 3476a: 5e 81 ldd r21, Y+6 ; 0x06 3476c: 57 fd sbrc r21, 7 3476e: 0a c0 rjmp .+20 ; 0x34784 34770: 2f 81 ldd r18, Y+7 ; 0x07 34772: 38 85 ldd r19, Y+8 ; 0x08 34774: 42 17 cp r20, r18 34776: 53 07 cpc r21, r19 34778: 0c f4 brge .+2 ; 0x3477c 3477a: 9a 01 movw r18, r20 3477c: 02 0f add r16, r18 3477e: 13 1f adc r17, r19 34780: f8 01 movw r30, r16 34782: 10 82 st Z, r1 34784: 2e 96 adiw r28, 0x0e ; 14 34786: 0f b6 in r0, 0x3f ; 63 34788: f8 94 cli 3478a: de bf out 0x3e, r29 ; 62 3478c: 0f be out 0x3f, r0 ; 63 3478e: cd bf out 0x3d, r28 ; 61 34790: df 91 pop r29 34792: cf 91 pop r28 34794: 1f 91 pop r17 34796: 0f 91 pop r16 34798: 08 95 ret 0003479a <__ultoa_invert>: 3479a: fa 01 movw r30, r20 3479c: aa 27 eor r26, r26 3479e: 28 30 cpi r18, 0x08 ; 8 347a0: 51 f1 breq .+84 ; 0x347f6 <__ultoa_invert+0x5c> 347a2: 20 31 cpi r18, 0x10 ; 16 347a4: 81 f1 breq .+96 ; 0x34806 <__ultoa_invert+0x6c> 347a6: e8 94 clt 347a8: 6f 93 push r22 347aa: 6e 7f andi r22, 0xFE ; 254 347ac: 6e 5f subi r22, 0xFE ; 254 347ae: 7f 4f sbci r23, 0xFF ; 255 347b0: 8f 4f sbci r24, 0xFF ; 255 347b2: 9f 4f sbci r25, 0xFF ; 255 347b4: af 4f sbci r26, 0xFF ; 255 347b6: b1 e0 ldi r27, 0x01 ; 1 347b8: 3e d0 rcall .+124 ; 0x34836 <__ultoa_invert+0x9c> 347ba: b4 e0 ldi r27, 0x04 ; 4 347bc: 3c d0 rcall .+120 ; 0x34836 <__ultoa_invert+0x9c> 347be: 67 0f add r22, r23 347c0: 78 1f adc r23, r24 347c2: 89 1f adc r24, r25 347c4: 9a 1f adc r25, r26 347c6: a1 1d adc r26, r1 347c8: 68 0f add r22, r24 347ca: 79 1f adc r23, r25 347cc: 8a 1f adc r24, r26 347ce: 91 1d adc r25, r1 347d0: a1 1d adc r26, r1 347d2: 6a 0f add r22, r26 347d4: 71 1d adc r23, r1 347d6: 81 1d adc r24, r1 347d8: 91 1d adc r25, r1 347da: a1 1d adc r26, r1 347dc: 20 d0 rcall .+64 ; 0x3481e <__ultoa_invert+0x84> 347de: 09 f4 brne .+2 ; 0x347e2 <__ultoa_invert+0x48> 347e0: 68 94 set 347e2: 3f 91 pop r19 347e4: 2a e0 ldi r18, 0x0A ; 10 347e6: 26 9f mul r18, r22 347e8: 11 24 eor r1, r1 347ea: 30 19 sub r19, r0 347ec: 30 5d subi r19, 0xD0 ; 208 347ee: 31 93 st Z+, r19 347f0: de f6 brtc .-74 ; 0x347a8 <__ultoa_invert+0xe> 347f2: cf 01 movw r24, r30 347f4: 08 95 ret 347f6: 46 2f mov r20, r22 347f8: 47 70 andi r20, 0x07 ; 7 347fa: 40 5d subi r20, 0xD0 ; 208 347fc: 41 93 st Z+, r20 347fe: b3 e0 ldi r27, 0x03 ; 3 34800: 0f d0 rcall .+30 ; 0x34820 <__ultoa_invert+0x86> 34802: c9 f7 brne .-14 ; 0x347f6 <__ultoa_invert+0x5c> 34804: f6 cf rjmp .-20 ; 0x347f2 <__ultoa_invert+0x58> 34806: 46 2f mov r20, r22 34808: 4f 70 andi r20, 0x0F ; 15 3480a: 40 5d subi r20, 0xD0 ; 208 3480c: 4a 33 cpi r20, 0x3A ; 58 3480e: 18 f0 brcs .+6 ; 0x34816 <__ultoa_invert+0x7c> 34810: 49 5d subi r20, 0xD9 ; 217 34812: 31 fd sbrc r19, 1 34814: 40 52 subi r20, 0x20 ; 32 34816: 41 93 st Z+, r20 34818: 02 d0 rcall .+4 ; 0x3481e <__ultoa_invert+0x84> 3481a: a9 f7 brne .-22 ; 0x34806 <__ultoa_invert+0x6c> 3481c: ea cf rjmp .-44 ; 0x347f2 <__ultoa_invert+0x58> 3481e: b4 e0 ldi r27, 0x04 ; 4 34820: a6 95 lsr r26 34822: 97 95 ror r25 34824: 87 95 ror r24 34826: 77 95 ror r23 34828: 67 95 ror r22 3482a: ba 95 dec r27 3482c: c9 f7 brne .-14 ; 0x34820 <__ultoa_invert+0x86> 3482e: 00 97 sbiw r24, 0x00 ; 0 34830: 61 05 cpc r22, r1 34832: 71 05 cpc r23, r1 34834: 08 95 ret 34836: 9b 01 movw r18, r22 34838: ac 01 movw r20, r24 3483a: 0a 2e mov r0, r26 3483c: 06 94 lsr r0 3483e: 57 95 ror r21 34840: 47 95 ror r20 34842: 37 95 ror r19 34844: 27 95 ror r18 34846: ba 95 dec r27 34848: c9 f7 brne .-14 ; 0x3483c <__ultoa_invert+0xa2> 3484a: 62 0f add r22, r18 3484c: 73 1f adc r23, r19 3484e: 84 1f adc r24, r20 34850: 95 1f adc r25, r21 34852: a0 1d adc r26, r0 34854: 08 95 ret 00034856 <__ctype_isfalse>: 34856: 99 27 eor r25, r25 34858: 88 27 eor r24, r24 0003485a <__ctype_istrue>: 3485a: 08 95 ret 0003485c : 3485c: dc 01 movw r26, r24 3485e: cb 01 movw r24, r22 00034860 : 34860: fc 01 movw r30, r24 34862: f9 99 sbic 0x1f, 1 ; 31 34864: fe cf rjmp .-4 ; 0x34862 34866: 06 c0 rjmp .+12 ; 0x34874 34868: f2 bd out 0x22, r31 ; 34 3486a: e1 bd out 0x21, r30 ; 33 3486c: f8 9a sbi 0x1f, 0 ; 31 3486e: 31 96 adiw r30, 0x01 ; 1 34870: 00 b4 in r0, 0x20 ; 32 34872: 0d 92 st X+, r0 34874: 41 50 subi r20, 0x01 ; 1 34876: 50 40 sbci r21, 0x00 ; 0 34878: b8 f7 brcc .-18 ; 0x34868 3487a: 08 95 ret 0003487c : 3487c: f9 99 sbic 0x1f, 1 ; 31 3487e: fe cf rjmp .-4 ; 0x3487c 34880: 92 bd out 0x22, r25 ; 34 34882: 81 bd out 0x21, r24 ; 33 34884: f8 9a sbi 0x1f, 0 ; 31 34886: 99 27 eor r25, r25 34888: 80 b5 in r24, 0x20 ; 32 3488a: 08 95 ret 0003488c : 3488c: a6 e1 ldi r26, 0x16 ; 22 3488e: b0 e0 ldi r27, 0x00 ; 0 34890: 44 e0 ldi r20, 0x04 ; 4 34892: 50 e0 ldi r21, 0x00 ; 0 34894: 0d 94 30 a4 jmp 0x34860 ; 0x34860 00034898 : 34898: a8 e1 ldi r26, 0x18 ; 24 3489a: b0 e0 ldi r27, 0x00 ; 0 3489c: 42 e0 ldi r20, 0x02 ; 2 3489e: 50 e0 ldi r21, 0x00 ; 0 348a0: 0d 94 30 a4 jmp 0x34860 ; 0x34860 000348a4 : 348a4: dc 01 movw r26, r24 348a6: a4 0f add r26, r20 348a8: b5 1f adc r27, r21 348aa: 41 50 subi r20, 0x01 ; 1 348ac: 50 40 sbci r21, 0x00 ; 0 348ae: 48 f0 brcs .+18 ; 0x348c2 348b0: cb 01 movw r24, r22 348b2: 84 0f add r24, r20 348b4: 95 1f adc r25, r21 348b6: 2e 91 ld r18, -X 348b8: 0f 94 63 a4 call 0x348c6 ; 0x348c6 348bc: 41 50 subi r20, 0x01 ; 1 348be: 50 40 sbci r21, 0x00 ; 0 348c0: d0 f7 brcc .-12 ; 0x348b6 348c2: 08 95 ret 000348c4 : 348c4: 26 2f mov r18, r22 000348c6 : 348c6: f9 99 sbic 0x1f, 1 ; 31 348c8: fe cf rjmp .-4 ; 0x348c6 348ca: 92 bd out 0x22, r25 ; 34 348cc: 81 bd out 0x21, r24 ; 33 348ce: f8 9a sbi 0x1f, 0 ; 31 348d0: 01 97 sbiw r24, 0x01 ; 1 348d2: 00 b4 in r0, 0x20 ; 32 348d4: 02 16 cp r0, r18 348d6: 39 f0 breq .+14 ; 0x348e6 348d8: 1f ba out 0x1f, r1 ; 31 348da: 20 bd out 0x20, r18 ; 32 348dc: 0f b6 in r0, 0x3f ; 63 348de: f8 94 cli 348e0: fa 9a sbi 0x1f, 2 ; 31 348e2: f9 9a sbi 0x1f, 1 ; 31 348e4: 0f be out 0x3f, r0 ; 63 348e6: 08 95 ret 000348e8 : 348e8: 03 96 adiw r24, 0x03 ; 3 348ea: 27 2f mov r18, r23 348ec: 0f 94 63 a4 call 0x348c6 ; 0x348c6 348f0: 0f 94 62 a4 call 0x348c4 ; 0x348c4 348f4: 25 2f mov r18, r21 348f6: 0f 94 63 a4 call 0x348c6 ; 0x348c6 348fa: 24 2f mov r18, r20 348fc: 0d 94 63 a4 jmp 0x348c6 ; 0x348c6 00034900 : 34900: 01 96 adiw r24, 0x01 ; 1 34902: 27 2f mov r18, r23 34904: 0f 94 63 a4 call 0x348c6 ; 0x348c6 34908: 0d 94 62 a4 jmp 0x348c4 ; 0x348c4 0003490c : 3490c: 26 2f mov r18, r22 0003490e : 3490e: f9 99 sbic 0x1f, 1 ; 31 34910: fe cf rjmp .-4 ; 0x3490e 34912: 1f ba out 0x1f, r1 ; 31 34914: 92 bd out 0x22, r25 ; 34 34916: 81 bd out 0x21, r24 ; 33 34918: 20 bd out 0x20, r18 ; 32 3491a: 0f b6 in r0, 0x3f ; 63 3491c: f8 94 cli 3491e: fa 9a sbi 0x1f, 2 ; 31 34920: f9 9a sbi 0x1f, 1 ; 31 34922: 0f be out 0x3f, r0 ; 63 34924: 01 96 adiw r24, 0x01 ; 1 34926: 08 95 ret 00034928 : 34928: 24 2f mov r18, r20 3492a: 0f 94 87 a4 call 0x3490e ; 0x3490e 3492e: 25 2f mov r18, r21 34930: 0f 94 87 a4 call 0x3490e ; 0x3490e 34934: 0d 94 9c a4 jmp 0x34938 ; 0x34938 00034938 : 34938: 0f 94 86 a4 call 0x3490c ; 0x3490c 3493c: 27 2f mov r18, r23 3493e: 0d 94 87 a4 jmp 0x3490e ; 0x3490e 00034942 <__mulsi3>: 34942: db 01 movw r26, r22 34944: 8f 93 push r24 34946: 9f 93 push r25 34948: 0f 94 d3 a4 call 0x349a6 ; 0x349a6 <__muluhisi3> 3494c: bf 91 pop r27 3494e: af 91 pop r26 34950: a2 9f mul r26, r18 34952: 80 0d add r24, r0 34954: 91 1d adc r25, r1 34956: a3 9f mul r26, r19 34958: 90 0d add r25, r0 3495a: b2 9f mul r27, r18 3495c: 90 0d add r25, r0 3495e: 11 24 eor r1, r1 34960: 08 95 ret 00034962 <__udivmodsi4>: 34962: a1 e2 ldi r26, 0x21 ; 33 34964: 1a 2e mov r1, r26 34966: aa 1b sub r26, r26 34968: bb 1b sub r27, r27 3496a: fd 01 movw r30, r26 3496c: 0d c0 rjmp .+26 ; 0x34988 <__udivmodsi4_ep> 0003496e <__udivmodsi4_loop>: 3496e: aa 1f adc r26, r26 34970: bb 1f adc r27, r27 34972: ee 1f adc r30, r30 34974: ff 1f adc r31, r31 34976: a2 17 cp r26, r18 34978: b3 07 cpc r27, r19 3497a: e4 07 cpc r30, r20 3497c: f5 07 cpc r31, r21 3497e: 20 f0 brcs .+8 ; 0x34988 <__udivmodsi4_ep> 34980: a2 1b sub r26, r18 34982: b3 0b sbc r27, r19 34984: e4 0b sbc r30, r20 34986: f5 0b sbc r31, r21 00034988 <__udivmodsi4_ep>: 34988: 66 1f adc r22, r22 3498a: 77 1f adc r23, r23 3498c: 88 1f adc r24, r24 3498e: 99 1f adc r25, r25 34990: 1a 94 dec r1 34992: 69 f7 brne .-38 ; 0x3496e <__udivmodsi4_loop> 34994: 60 95 com r22 34996: 70 95 com r23 34998: 80 95 com r24 3499a: 90 95 com r25 3499c: 9b 01 movw r18, r22 3499e: ac 01 movw r20, r24 349a0: bd 01 movw r22, r26 349a2: cf 01 movw r24, r30 349a4: 08 95 ret 000349a6 <__muluhisi3>: 349a6: 0f 94 de a4 call 0x349bc ; 0x349bc <__umulhisi3> 349aa: a5 9f mul r26, r21 349ac: 90 0d add r25, r0 349ae: b4 9f mul r27, r20 349b0: 90 0d add r25, r0 349b2: a4 9f mul r26, r20 349b4: 80 0d add r24, r0 349b6: 91 1d adc r25, r1 349b8: 11 24 eor r1, r1 349ba: 08 95 ret 000349bc <__umulhisi3>: 349bc: a2 9f mul r26, r18 349be: b0 01 movw r22, r0 349c0: b3 9f mul r27, r19 349c2: c0 01 movw r24, r0 349c4: a3 9f mul r26, r19 349c6: 70 0d add r23, r0 349c8: 81 1d adc r24, r1 349ca: 11 24 eor r1, r1 349cc: 91 1d adc r25, r1 349ce: b2 9f mul r27, r18 349d0: 70 0d add r23, r0 349d2: 81 1d adc r24, r1 349d4: 11 24 eor r1, r1 349d6: 91 1d adc r25, r1 349d8: 08 95 ret 000349da <__udivmodqi4>: 349da: 99 1b sub r25, r25 349dc: 79 e0 ldi r23, 0x09 ; 9 349de: 04 c0 rjmp .+8 ; 0x349e8 <__udivmodqi4_ep> 000349e0 <__udivmodqi4_loop>: 349e0: 99 1f adc r25, r25 349e2: 96 17 cp r25, r22 349e4: 08 f0 brcs .+2 ; 0x349e8 <__udivmodqi4_ep> 349e6: 96 1b sub r25, r22 000349e8 <__udivmodqi4_ep>: 349e8: 88 1f adc r24, r24 349ea: 7a 95 dec r23 349ec: c9 f7 brne .-14 ; 0x349e0 <__udivmodqi4_loop> 349ee: 80 95 com r24 349f0: 08 95 ret 000349f2 <__divmodqi4>: 349f2: 87 fb bst r24, 7 349f4: 08 2e mov r0, r24 349f6: 06 26 eor r0, r22 349f8: 87 fd sbrc r24, 7 349fa: 81 95 neg r24 349fc: 67 fd sbrc r22, 7 349fe: 61 95 neg r22 34a00: 0f 94 ed a4 call 0x349da ; 0x349da <__udivmodqi4> 34a04: 0e f4 brtc .+2 ; 0x34a08 <__divmodqi4_1> 34a06: 91 95 neg r25 00034a08 <__divmodqi4_1>: 34a08: 07 fc sbrc r0, 7 34a0a: 81 95 neg r24 00034a0c <__divmodqi4_exit>: 34a0c: 08 95 ret 00034a0e <__udivmodhi4>: 34a0e: aa 1b sub r26, r26 34a10: bb 1b sub r27, r27 34a12: 51 e1 ldi r21, 0x11 ; 17 34a14: 07 c0 rjmp .+14 ; 0x34a24 <__udivmodhi4_ep> 00034a16 <__udivmodhi4_loop>: 34a16: aa 1f adc r26, r26 34a18: bb 1f adc r27, r27 34a1a: a6 17 cp r26, r22 34a1c: b7 07 cpc r27, r23 34a1e: 10 f0 brcs .+4 ; 0x34a24 <__udivmodhi4_ep> 34a20: a6 1b sub r26, r22 34a22: b7 0b sbc r27, r23 00034a24 <__udivmodhi4_ep>: 34a24: 88 1f adc r24, r24 34a26: 99 1f adc r25, r25 34a28: 5a 95 dec r21 34a2a: a9 f7 brne .-22 ; 0x34a16 <__udivmodhi4_loop> 34a2c: 80 95 com r24 34a2e: 90 95 com r25 34a30: bc 01 movw r22, r24 34a32: cd 01 movw r24, r26 34a34: 08 95 ret 00034a36 <__divmodhi4>: 34a36: 97 fb bst r25, 7 34a38: 07 2e mov r0, r23 34a3a: 16 f4 brtc .+4 ; 0x34a40 <__divmodhi4+0xa> 34a3c: 00 94 com r0 34a3e: 07 d0 rcall .+14 ; 0x34a4e <__divmodhi4_neg1> 34a40: 77 fd sbrc r23, 7 34a42: 09 d0 rcall .+18 ; 0x34a56 <__divmodhi4_neg2> 34a44: 0f 94 07 a5 call 0x34a0e ; 0x34a0e <__udivmodhi4> 34a48: 07 fc sbrc r0, 7 34a4a: 05 d0 rcall .+10 ; 0x34a56 <__divmodhi4_neg2> 34a4c: 3e f4 brtc .+14 ; 0x34a5c <__divmodhi4_exit> 00034a4e <__divmodhi4_neg1>: 34a4e: 90 95 com r25 34a50: 81 95 neg r24 34a52: 9f 4f sbci r25, 0xFF ; 255 34a54: 08 95 ret 00034a56 <__divmodhi4_neg2>: 34a56: 70 95 com r23 34a58: 61 95 neg r22 34a5a: 7f 4f sbci r23, 0xFF ; 255 00034a5c <__divmodhi4_exit>: 34a5c: 08 95 ret 00034a5e <__divmodsi4>: 34a5e: 05 2e mov r0, r21 34a60: 97 fb bst r25, 7 34a62: 1e f4 brtc .+6 ; 0x34a6a <__divmodsi4+0xc> 34a64: 00 94 com r0 34a66: 0f 94 46 a5 call 0x34a8c ; 0x34a8c <__negsi2> 34a6a: 57 fd sbrc r21, 7 34a6c: 07 d0 rcall .+14 ; 0x34a7c <__divmodsi4_neg2> 34a6e: 0f 94 b1 a4 call 0x34962 ; 0x34962 <__udivmodsi4> 34a72: 07 fc sbrc r0, 7 34a74: 03 d0 rcall .+6 ; 0x34a7c <__divmodsi4_neg2> 34a76: 4e f4 brtc .+18 ; 0x34a8a <__divmodsi4_exit> 34a78: 0d 94 46 a5 jmp 0x34a8c ; 0x34a8c <__negsi2> 00034a7c <__divmodsi4_neg2>: 34a7c: 50 95 com r21 34a7e: 40 95 com r20 34a80: 30 95 com r19 34a82: 21 95 neg r18 34a84: 3f 4f sbci r19, 0xFF ; 255 34a86: 4f 4f sbci r20, 0xFF ; 255 34a88: 5f 4f sbci r21, 0xFF ; 255 00034a8a <__divmodsi4_exit>: 34a8a: 08 95 ret 00034a8c <__negsi2>: 34a8c: 90 95 com r25 34a8e: 80 95 com r24 34a90: 70 95 com r23 34a92: 61 95 neg r22 34a94: 7f 4f sbci r23, 0xFF ; 255 34a96: 8f 4f sbci r24, 0xFF ; 255 34a98: 9f 4f sbci r25, 0xFF ; 255 34a9a: 08 95 ret 00034a9c <__tablejump2__>: 34a9c: ee 0f add r30, r30 34a9e: ff 1f adc r31, r31 34aa0: 88 1f adc r24, r24 34aa2: 8b bf out 0x3b, r24 ; 59 34aa4: 07 90 elpm r0, Z+ 34aa6: f6 91 elpm r31, Z 34aa8: e0 2d mov r30, r0 34aaa: 19 94 eijmp 00034aac <__mulhisi3>: 34aac: 0f 94 de a4 call 0x349bc ; 0x349bc <__umulhisi3> 34ab0: 33 23 and r19, r19 34ab2: 12 f4 brpl .+4 ; 0x34ab8 <__mulhisi3+0xc> 34ab4: 8a 1b sub r24, r26 34ab6: 9b 0b sbc r25, r27 34ab8: 0d 94 60 a5 jmp 0x34ac0 ; 0x34ac0 <__usmulhisi3_tail> 00034abc <__usmulhisi3>: 34abc: 0f 94 de a4 call 0x349bc ; 0x349bc <__umulhisi3> 00034ac0 <__usmulhisi3_tail>: 34ac0: b7 ff sbrs r27, 7 34ac2: 08 95 ret 34ac4: 82 1b sub r24, r18 34ac6: 93 0b sbc r25, r19 34ac8: 08 95 ret 00034aca <__subsf3>: 34aca: 50 58 subi r21, 0x80 ; 128 00034acc <__addsf3>: 34acc: bb 27 eor r27, r27 34ace: aa 27 eor r26, r26 34ad0: 0f 94 7d a5 call 0x34afa ; 0x34afa <__addsf3x> 34ad4: 0d 94 8f 9f jmp 0x33f1e ; 0x33f1e <__fp_round> 34ad8: 0f 94 81 9f call 0x33f02 ; 0x33f02 <__fp_pscA> 34adc: 38 f0 brcs .+14 ; 0x34aec <__addsf3+0x20> 34ade: 0f 94 88 9f call 0x33f10 ; 0x33f10 <__fp_pscB> 34ae2: 20 f0 brcs .+8 ; 0x34aec <__addsf3+0x20> 34ae4: 39 f4 brne .+14 ; 0x34af4 <__addsf3+0x28> 34ae6: 9f 3f cpi r25, 0xFF ; 255 34ae8: 19 f4 brne .+6 ; 0x34af0 <__addsf3+0x24> 34aea: 26 f4 brtc .+8 ; 0x34af4 <__addsf3+0x28> 34aec: 0d 94 7e 9f jmp 0x33efc ; 0x33efc <__fp_nan> 34af0: 0e f4 brtc .+2 ; 0x34af4 <__addsf3+0x28> 34af2: e0 95 com r30 34af4: e7 fb bst r30, 7 34af6: 0d 94 78 9f jmp 0x33ef0 ; 0x33ef0 <__fp_inf> 00034afa <__addsf3x>: 34afa: e9 2f mov r30, r25 34afc: 0f 94 a0 9f call 0x33f40 ; 0x33f40 <__fp_split3> 34b00: 58 f3 brcs .-42 ; 0x34ad8 <__addsf3+0xc> 34b02: ba 17 cp r27, r26 34b04: 62 07 cpc r22, r18 34b06: 73 07 cpc r23, r19 34b08: 84 07 cpc r24, r20 34b0a: 95 07 cpc r25, r21 34b0c: 20 f0 brcs .+8 ; 0x34b16 <__addsf3x+0x1c> 34b0e: 79 f4 brne .+30 ; 0x34b2e <__addsf3x+0x34> 34b10: a6 f5 brtc .+104 ; 0x34b7a <__addsf3x+0x80> 34b12: 0d 94 c2 9f jmp 0x33f84 ; 0x33f84 <__fp_zero> 34b16: 0e f4 brtc .+2 ; 0x34b1a <__addsf3x+0x20> 34b18: e0 95 com r30 34b1a: 0b 2e mov r0, r27 34b1c: ba 2f mov r27, r26 34b1e: a0 2d mov r26, r0 34b20: 0b 01 movw r0, r22 34b22: b9 01 movw r22, r18 34b24: 90 01 movw r18, r0 34b26: 0c 01 movw r0, r24 34b28: ca 01 movw r24, r20 34b2a: a0 01 movw r20, r0 34b2c: 11 24 eor r1, r1 34b2e: ff 27 eor r31, r31 34b30: 59 1b sub r21, r25 34b32: 99 f0 breq .+38 ; 0x34b5a <__addsf3x+0x60> 34b34: 59 3f cpi r21, 0xF9 ; 249 34b36: 50 f4 brcc .+20 ; 0x34b4c <__addsf3x+0x52> 34b38: 50 3e cpi r21, 0xE0 ; 224 34b3a: 68 f1 brcs .+90 ; 0x34b96 <__addsf3x+0x9c> 34b3c: 1a 16 cp r1, r26 34b3e: f0 40 sbci r31, 0x00 ; 0 34b40: a2 2f mov r26, r18 34b42: 23 2f mov r18, r19 34b44: 34 2f mov r19, r20 34b46: 44 27 eor r20, r20 34b48: 58 5f subi r21, 0xF8 ; 248 34b4a: f3 cf rjmp .-26 ; 0x34b32 <__addsf3x+0x38> 34b4c: 46 95 lsr r20 34b4e: 37 95 ror r19 34b50: 27 95 ror r18 34b52: a7 95 ror r26 34b54: f0 40 sbci r31, 0x00 ; 0 34b56: 53 95 inc r21 34b58: c9 f7 brne .-14 ; 0x34b4c <__addsf3x+0x52> 34b5a: 7e f4 brtc .+30 ; 0x34b7a <__addsf3x+0x80> 34b5c: 1f 16 cp r1, r31 34b5e: ba 0b sbc r27, r26 34b60: 62 0b sbc r22, r18 34b62: 73 0b sbc r23, r19 34b64: 84 0b sbc r24, r20 34b66: ba f0 brmi .+46 ; 0x34b96 <__addsf3x+0x9c> 34b68: 91 50 subi r25, 0x01 ; 1 34b6a: a1 f0 breq .+40 ; 0x34b94 <__addsf3x+0x9a> 34b6c: ff 0f add r31, r31 34b6e: bb 1f adc r27, r27 34b70: 66 1f adc r22, r22 34b72: 77 1f adc r23, r23 34b74: 88 1f adc r24, r24 34b76: c2 f7 brpl .-16 ; 0x34b68 <__addsf3x+0x6e> 34b78: 0e c0 rjmp .+28 ; 0x34b96 <__addsf3x+0x9c> 34b7a: ba 0f add r27, r26 34b7c: 62 1f adc r22, r18 34b7e: 73 1f adc r23, r19 34b80: 84 1f adc r24, r20 34b82: 48 f4 brcc .+18 ; 0x34b96 <__addsf3x+0x9c> 34b84: 87 95 ror r24 34b86: 77 95 ror r23 34b88: 67 95 ror r22 34b8a: b7 95 ror r27 34b8c: f7 95 ror r31 34b8e: 9e 3f cpi r25, 0xFE ; 254 34b90: 08 f0 brcs .+2 ; 0x34b94 <__addsf3x+0x9a> 34b92: b0 cf rjmp .-160 ; 0x34af4 <__addsf3+0x28> 34b94: 93 95 inc r25 34b96: 88 0f add r24, r24 34b98: 08 f0 brcs .+2 ; 0x34b9c <__addsf3x+0xa2> 34b9a: 99 27 eor r25, r25 34b9c: ee 0f add r30, r30 34b9e: 97 95 ror r25 34ba0: 87 95 ror r24 34ba2: 08 95 ret 34ba4: 0f 94 81 9f call 0x33f02 ; 0x33f02 <__fp_pscA> 34ba8: 60 f0 brcs .+24 ; 0x34bc2 <__addsf3x+0xc8> 34baa: 80 e8 ldi r24, 0x80 ; 128 34bac: 91 e0 ldi r25, 0x01 ; 1 34bae: 09 f4 brne .+2 ; 0x34bb2 <__addsf3x+0xb8> 34bb0: 9e ef ldi r25, 0xFE ; 254 34bb2: 0f 94 88 9f call 0x33f10 ; 0x33f10 <__fp_pscB> 34bb6: 28 f0 brcs .+10 ; 0x34bc2 <__addsf3x+0xc8> 34bb8: 40 e8 ldi r20, 0x80 ; 128 34bba: 51 e0 ldi r21, 0x01 ; 1 34bbc: 71 f4 brne .+28 ; 0x34bda 34bbe: 5e ef ldi r21, 0xFE ; 254 34bc0: 0c c0 rjmp .+24 ; 0x34bda 34bc2: 0d 94 7e 9f jmp 0x33efc ; 0x33efc <__fp_nan> 34bc6: 0d 94 c2 9f jmp 0x33f84 ; 0x33f84 <__fp_zero> 00034bca : 34bca: e9 2f mov r30, r25 34bcc: e0 78 andi r30, 0x80 ; 128 34bce: 0f 94 a0 9f call 0x33f40 ; 0x33f40 <__fp_split3> 34bd2: 40 f3 brcs .-48 ; 0x34ba4 <__addsf3x+0xaa> 34bd4: 09 2e mov r0, r25 34bd6: 05 2a or r0, r21 34bd8: b1 f3 breq .-20 ; 0x34bc6 <__addsf3x+0xcc> 34bda: 26 17 cp r18, r22 34bdc: 37 07 cpc r19, r23 34bde: 48 07 cpc r20, r24 34be0: 59 07 cpc r21, r25 34be2: 38 f0 brcs .+14 ; 0x34bf2 34be4: 0e 2e mov r0, r30 34be6: 07 f8 bld r0, 7 34be8: e0 25 eor r30, r0 34bea: 69 f0 breq .+26 ; 0x34c06 34bec: e0 25 eor r30, r0 34bee: e0 64 ori r30, 0x40 ; 64 34bf0: 0a c0 rjmp .+20 ; 0x34c06 34bf2: ef 63 ori r30, 0x3F ; 63 34bf4: 07 f8 bld r0, 7 34bf6: 00 94 com r0 34bf8: 07 fa bst r0, 7 34bfa: db 01 movw r26, r22 34bfc: b9 01 movw r22, r18 34bfe: 9d 01 movw r18, r26 34c00: dc 01 movw r26, r24 34c02: ca 01 movw r24, r20 34c04: ad 01 movw r20, r26 34c06: ef 93 push r30 34c08: 0f 94 7c a6 call 0x34cf8 ; 0x34cf8 <__divsf3_pse> 34c0c: 0f 94 8f 9f call 0x33f1e ; 0x33f1e <__fp_round> 34c10: 0f 94 15 a6 call 0x34c2a ; 0x34c2a 34c14: 5f 91 pop r21 34c16: 55 23 and r21, r21 34c18: 39 f0 breq .+14 ; 0x34c28 34c1a: 2b ed ldi r18, 0xDB ; 219 34c1c: 3f e0 ldi r19, 0x0F ; 15 34c1e: 49 e4 ldi r20, 0x49 ; 73 34c20: 50 fd sbrc r21, 0 34c22: 49 ec ldi r20, 0xC9 ; 201 34c24: 0d 94 66 a5 jmp 0x34acc ; 0x34acc <__addsf3> 34c28: 08 95 ret 00034c2a : 34c2a: df 93 push r29 34c2c: dd 27 eor r29, r29 34c2e: b9 2f mov r27, r25 34c30: bf 77 andi r27, 0x7F ; 127 34c32: 40 e8 ldi r20, 0x80 ; 128 34c34: 5f e3 ldi r21, 0x3F ; 63 34c36: 16 16 cp r1, r22 34c38: 17 06 cpc r1, r23 34c3a: 48 07 cpc r20, r24 34c3c: 5b 07 cpc r21, r27 34c3e: 18 f4 brcc .+6 ; 0x34c46 34c40: d9 2f mov r29, r25 34c42: 0f 94 61 a8 call 0x350c2 ; 0x350c2 34c46: 9f 93 push r25 34c48: 8f 93 push r24 34c4a: 7f 93 push r23 34c4c: 6f 93 push r22 34c4e: 0f 94 07 9f call 0x33e0e ; 0x33e0e 34c52: eb e5 ldi r30, 0x5B ; 91 34c54: fd e6 ldi r31, 0x6D ; 109 34c56: 0f 94 71 a7 call 0x34ee2 ; 0x34ee2 <__fp_powser> 34c5a: 0f 94 8f 9f call 0x33f1e ; 0x33f1e <__fp_round> 34c5e: 2f 91 pop r18 34c60: 3f 91 pop r19 34c62: 4f 91 pop r20 34c64: 5f 91 pop r21 34c66: 0f 94 1e 9f call 0x33e3c ; 0x33e3c <__mulsf3x> 34c6a: dd 23 and r29, r29 34c6c: 51 f0 breq .+20 ; 0x34c82 34c6e: 90 58 subi r25, 0x80 ; 128 34c70: a2 ea ldi r26, 0xA2 ; 162 34c72: 2a ed ldi r18, 0xDA ; 218 34c74: 3f e0 ldi r19, 0x0F ; 15 34c76: 49 ec ldi r20, 0xC9 ; 201 34c78: 5f e3 ldi r21, 0x3F ; 63 34c7a: d0 78 andi r29, 0x80 ; 128 34c7c: 5d 27 eor r21, r29 34c7e: 0f 94 7d a5 call 0x34afa ; 0x34afa <__addsf3x> 34c82: df 91 pop r29 34c84: 0d 94 8f 9f jmp 0x33f1e ; 0x33f1e <__fp_round> 00034c88 : 34c88: 0f 94 d7 a7 call 0x34fae ; 0x34fae <__fp_trunc> 34c8c: 90 f0 brcs .+36 ; 0x34cb2 34c8e: 9f 37 cpi r25, 0x7F ; 127 34c90: 48 f4 brcc .+18 ; 0x34ca4 34c92: 91 11 cpse r25, r1 34c94: 16 f4 brtc .+4 ; 0x34c9a 34c96: 0d 94 c3 9f jmp 0x33f86 ; 0x33f86 <__fp_szero> 34c9a: 60 e0 ldi r22, 0x00 ; 0 34c9c: 70 e0 ldi r23, 0x00 ; 0 34c9e: 80 e8 ldi r24, 0x80 ; 128 34ca0: 9f e3 ldi r25, 0x3F ; 63 34ca2: 08 95 ret 34ca4: 26 f0 brts .+8 ; 0x34cae 34ca6: 1b 16 cp r1, r27 34ca8: 61 1d adc r22, r1 34caa: 71 1d adc r23, r1 34cac: 81 1d adc r24, r1 34cae: 0d 94 48 a7 jmp 0x34e90 ; 0x34e90 <__fp_mintl> 34cb2: 0d 94 63 a7 jmp 0x34ec6 ; 0x34ec6 <__fp_mpack> 00034cb6 <__cmpsf2>: 34cb6: 0f 94 24 a7 call 0x34e48 ; 0x34e48 <__fp_cmp> 34cba: 08 f4 brcc .+2 ; 0x34cbe <__cmpsf2+0x8> 34cbc: 81 e0 ldi r24, 0x01 ; 1 34cbe: 08 95 ret 00034cc0 : 34cc0: 0f 94 9a a7 call 0x34f34 ; 0x34f34 <__fp_rempio2> 34cc4: e3 95 inc r30 34cc6: 0d 94 c3 a7 jmp 0x34f86 ; 0x34f86 <__fp_sinus> 00034cca <__divsf3>: 34cca: 0f 94 79 a6 call 0x34cf2 ; 0x34cf2 <__divsf3x> 34cce: 0d 94 8f 9f jmp 0x33f1e ; 0x33f1e <__fp_round> 34cd2: 0f 94 88 9f call 0x33f10 ; 0x33f10 <__fp_pscB> 34cd6: 58 f0 brcs .+22 ; 0x34cee <__divsf3+0x24> 34cd8: 0f 94 81 9f call 0x33f02 ; 0x33f02 <__fp_pscA> 34cdc: 40 f0 brcs .+16 ; 0x34cee <__divsf3+0x24> 34cde: 29 f4 brne .+10 ; 0x34cea <__divsf3+0x20> 34ce0: 5f 3f cpi r21, 0xFF ; 255 34ce2: 29 f0 breq .+10 ; 0x34cee <__divsf3+0x24> 34ce4: 0d 94 78 9f jmp 0x33ef0 ; 0x33ef0 <__fp_inf> 34ce8: 51 11 cpse r21, r1 34cea: 0d 94 c3 9f jmp 0x33f86 ; 0x33f86 <__fp_szero> 34cee: 0d 94 7e 9f jmp 0x33efc ; 0x33efc <__fp_nan> 00034cf2 <__divsf3x>: 34cf2: 0f 94 a0 9f call 0x33f40 ; 0x33f40 <__fp_split3> 34cf6: 68 f3 brcs .-38 ; 0x34cd2 <__divsf3+0x8> 00034cf8 <__divsf3_pse>: 34cf8: 99 23 and r25, r25 34cfa: b1 f3 breq .-20 ; 0x34ce8 <__divsf3+0x1e> 34cfc: 55 23 and r21, r21 34cfe: 91 f3 breq .-28 ; 0x34ce4 <__divsf3+0x1a> 34d00: 95 1b sub r25, r21 34d02: 55 0b sbc r21, r21 34d04: bb 27 eor r27, r27 34d06: aa 27 eor r26, r26 34d08: 62 17 cp r22, r18 34d0a: 73 07 cpc r23, r19 34d0c: 84 07 cpc r24, r20 34d0e: 38 f0 brcs .+14 ; 0x34d1e <__divsf3_pse+0x26> 34d10: 9f 5f subi r25, 0xFF ; 255 34d12: 5f 4f sbci r21, 0xFF ; 255 34d14: 22 0f add r18, r18 34d16: 33 1f adc r19, r19 34d18: 44 1f adc r20, r20 34d1a: aa 1f adc r26, r26 34d1c: a9 f3 breq .-22 ; 0x34d08 <__divsf3_pse+0x10> 34d1e: 35 d0 rcall .+106 ; 0x34d8a <__divsf3_pse+0x92> 34d20: 0e 2e mov r0, r30 34d22: 3a f0 brmi .+14 ; 0x34d32 <__divsf3_pse+0x3a> 34d24: e0 e8 ldi r30, 0x80 ; 128 34d26: 32 d0 rcall .+100 ; 0x34d8c <__divsf3_pse+0x94> 34d28: 91 50 subi r25, 0x01 ; 1 34d2a: 50 40 sbci r21, 0x00 ; 0 34d2c: e6 95 lsr r30 34d2e: 00 1c adc r0, r0 34d30: ca f7 brpl .-14 ; 0x34d24 <__divsf3_pse+0x2c> 34d32: 2b d0 rcall .+86 ; 0x34d8a <__divsf3_pse+0x92> 34d34: fe 2f mov r31, r30 34d36: 29 d0 rcall .+82 ; 0x34d8a <__divsf3_pse+0x92> 34d38: 66 0f add r22, r22 34d3a: 77 1f adc r23, r23 34d3c: 88 1f adc r24, r24 34d3e: bb 1f adc r27, r27 34d40: 26 17 cp r18, r22 34d42: 37 07 cpc r19, r23 34d44: 48 07 cpc r20, r24 34d46: ab 07 cpc r26, r27 34d48: b0 e8 ldi r27, 0x80 ; 128 34d4a: 09 f0 breq .+2 ; 0x34d4e <__divsf3_pse+0x56> 34d4c: bb 0b sbc r27, r27 34d4e: 80 2d mov r24, r0 34d50: bf 01 movw r22, r30 34d52: ff 27 eor r31, r31 34d54: 93 58 subi r25, 0x83 ; 131 34d56: 5f 4f sbci r21, 0xFF ; 255 34d58: 3a f0 brmi .+14 ; 0x34d68 <__divsf3_pse+0x70> 34d5a: 9e 3f cpi r25, 0xFE ; 254 34d5c: 51 05 cpc r21, r1 34d5e: 78 f0 brcs .+30 ; 0x34d7e <__divsf3_pse+0x86> 34d60: 0d 94 78 9f jmp 0x33ef0 ; 0x33ef0 <__fp_inf> 34d64: 0d 94 c3 9f jmp 0x33f86 ; 0x33f86 <__fp_szero> 34d68: 5f 3f cpi r21, 0xFF ; 255 34d6a: e4 f3 brlt .-8 ; 0x34d64 <__divsf3_pse+0x6c> 34d6c: 98 3e cpi r25, 0xE8 ; 232 34d6e: d4 f3 brlt .-12 ; 0x34d64 <__divsf3_pse+0x6c> 34d70: 86 95 lsr r24 34d72: 77 95 ror r23 34d74: 67 95 ror r22 34d76: b7 95 ror r27 34d78: f7 95 ror r31 34d7a: 9f 5f subi r25, 0xFF ; 255 34d7c: c9 f7 brne .-14 ; 0x34d70 <__divsf3_pse+0x78> 34d7e: 88 0f add r24, r24 34d80: 91 1d adc r25, r1 34d82: 96 95 lsr r25 34d84: 87 95 ror r24 34d86: 97 f9 bld r25, 7 34d88: 08 95 ret 34d8a: e1 e0 ldi r30, 0x01 ; 1 34d8c: 66 0f add r22, r22 34d8e: 77 1f adc r23, r23 34d90: 88 1f adc r24, r24 34d92: bb 1f adc r27, r27 34d94: 62 17 cp r22, r18 34d96: 73 07 cpc r23, r19 34d98: 84 07 cpc r24, r20 34d9a: ba 07 cpc r27, r26 34d9c: 20 f0 brcs .+8 ; 0x34da6 <__divsf3_pse+0xae> 34d9e: 62 1b sub r22, r18 34da0: 73 0b sbc r23, r19 34da2: 84 0b sbc r24, r20 34da4: ba 0b sbc r27, r26 34da6: ee 1f adc r30, r30 34da8: 88 f7 brcc .-30 ; 0x34d8c <__divsf3_pse+0x94> 34daa: e0 95 com r30 34dac: 08 95 ret 00034dae <__fixsfsi>: 34dae: 0f 94 de a6 call 0x34dbc ; 0x34dbc <__fixunssfsi> 34db2: 68 94 set 34db4: b1 11 cpse r27, r1 34db6: 0d 94 c3 9f jmp 0x33f86 ; 0x33f86 <__fp_szero> 34dba: 08 95 ret 00034dbc <__fixunssfsi>: 34dbc: 0f 94 a8 9f call 0x33f50 ; 0x33f50 <__fp_splitA> 34dc0: 88 f0 brcs .+34 ; 0x34de4 <__fixunssfsi+0x28> 34dc2: 9f 57 subi r25, 0x7F ; 127 34dc4: 98 f0 brcs .+38 ; 0x34dec <__fixunssfsi+0x30> 34dc6: b9 2f mov r27, r25 34dc8: 99 27 eor r25, r25 34dca: b7 51 subi r27, 0x17 ; 23 34dcc: b0 f0 brcs .+44 ; 0x34dfa <__fixunssfsi+0x3e> 34dce: e1 f0 breq .+56 ; 0x34e08 <__fixunssfsi+0x4c> 34dd0: 66 0f add r22, r22 34dd2: 77 1f adc r23, r23 34dd4: 88 1f adc r24, r24 34dd6: 99 1f adc r25, r25 34dd8: 1a f0 brmi .+6 ; 0x34de0 <__fixunssfsi+0x24> 34dda: ba 95 dec r27 34ddc: c9 f7 brne .-14 ; 0x34dd0 <__fixunssfsi+0x14> 34dde: 14 c0 rjmp .+40 ; 0x34e08 <__fixunssfsi+0x4c> 34de0: b1 30 cpi r27, 0x01 ; 1 34de2: 91 f0 breq .+36 ; 0x34e08 <__fixunssfsi+0x4c> 34de4: 0f 94 c2 9f call 0x33f84 ; 0x33f84 <__fp_zero> 34de8: b1 e0 ldi r27, 0x01 ; 1 34dea: 08 95 ret 34dec: 0d 94 c2 9f jmp 0x33f84 ; 0x33f84 <__fp_zero> 34df0: 67 2f mov r22, r23 34df2: 78 2f mov r23, r24 34df4: 88 27 eor r24, r24 34df6: b8 5f subi r27, 0xF8 ; 248 34df8: 39 f0 breq .+14 ; 0x34e08 <__fixunssfsi+0x4c> 34dfa: b9 3f cpi r27, 0xF9 ; 249 34dfc: cc f3 brlt .-14 ; 0x34df0 <__fixunssfsi+0x34> 34dfe: 86 95 lsr r24 34e00: 77 95 ror r23 34e02: 67 95 ror r22 34e04: b3 95 inc r27 34e06: d9 f7 brne .-10 ; 0x34dfe <__fixunssfsi+0x42> 34e08: 3e f4 brtc .+14 ; 0x34e18 <__fixunssfsi+0x5c> 34e0a: 90 95 com r25 34e0c: 80 95 com r24 34e0e: 70 95 com r23 34e10: 61 95 neg r22 34e12: 7f 4f sbci r23, 0xFF ; 255 34e14: 8f 4f sbci r24, 0xFF ; 255 34e16: 9f 4f sbci r25, 0xFF ; 255 34e18: 08 95 ret 00034e1a : 34e1a: 0f 94 d7 a7 call 0x34fae ; 0x34fae <__fp_trunc> 34e1e: 90 f0 brcs .+36 ; 0x34e44 34e20: 9f 37 cpi r25, 0x7F ; 127 34e22: 48 f4 brcc .+18 ; 0x34e36 34e24: 91 11 cpse r25, r1 34e26: 16 f0 brts .+4 ; 0x34e2c 34e28: 0d 94 c3 9f jmp 0x33f86 ; 0x33f86 <__fp_szero> 34e2c: 60 e0 ldi r22, 0x00 ; 0 34e2e: 70 e0 ldi r23, 0x00 ; 0 34e30: 80 e8 ldi r24, 0x80 ; 128 34e32: 9f eb ldi r25, 0xBF ; 191 34e34: 08 95 ret 34e36: 26 f4 brtc .+8 ; 0x34e40 34e38: 1b 16 cp r1, r27 34e3a: 61 1d adc r22, r1 34e3c: 71 1d adc r23, r1 34e3e: 81 1d adc r24, r1 34e40: 0d 94 48 a7 jmp 0x34e90 ; 0x34e90 <__fp_mintl> 34e44: 0d 94 63 a7 jmp 0x34ec6 ; 0x34ec6 <__fp_mpack> 00034e48 <__fp_cmp>: 34e48: 99 0f add r25, r25 34e4a: 00 08 sbc r0, r0 34e4c: 55 0f add r21, r21 34e4e: aa 0b sbc r26, r26 34e50: e0 e8 ldi r30, 0x80 ; 128 34e52: fe ef ldi r31, 0xFE ; 254 34e54: 16 16 cp r1, r22 34e56: 17 06 cpc r1, r23 34e58: e8 07 cpc r30, r24 34e5a: f9 07 cpc r31, r25 34e5c: c0 f0 brcs .+48 ; 0x34e8e <__fp_cmp+0x46> 34e5e: 12 16 cp r1, r18 34e60: 13 06 cpc r1, r19 34e62: e4 07 cpc r30, r20 34e64: f5 07 cpc r31, r21 34e66: 98 f0 brcs .+38 ; 0x34e8e <__fp_cmp+0x46> 34e68: 62 1b sub r22, r18 34e6a: 73 0b sbc r23, r19 34e6c: 84 0b sbc r24, r20 34e6e: 95 0b sbc r25, r21 34e70: 39 f4 brne .+14 ; 0x34e80 <__fp_cmp+0x38> 34e72: 0a 26 eor r0, r26 34e74: 61 f0 breq .+24 ; 0x34e8e <__fp_cmp+0x46> 34e76: 23 2b or r18, r19 34e78: 24 2b or r18, r20 34e7a: 25 2b or r18, r21 34e7c: 21 f4 brne .+8 ; 0x34e86 <__fp_cmp+0x3e> 34e7e: 08 95 ret 34e80: 0a 26 eor r0, r26 34e82: 09 f4 brne .+2 ; 0x34e86 <__fp_cmp+0x3e> 34e84: a1 40 sbci r26, 0x01 ; 1 34e86: a6 95 lsr r26 34e88: 8f ef ldi r24, 0xFF ; 255 34e8a: 81 1d adc r24, r1 34e8c: 81 1d adc r24, r1 34e8e: 08 95 ret 00034e90 <__fp_mintl>: 34e90: 88 23 and r24, r24 34e92: 71 f4 brne .+28 ; 0x34eb0 <__fp_mintl+0x20> 34e94: 77 23 and r23, r23 34e96: 21 f0 breq .+8 ; 0x34ea0 <__fp_mintl+0x10> 34e98: 98 50 subi r25, 0x08 ; 8 34e9a: 87 2b or r24, r23 34e9c: 76 2f mov r23, r22 34e9e: 07 c0 rjmp .+14 ; 0x34eae <__fp_mintl+0x1e> 34ea0: 66 23 and r22, r22 34ea2: 11 f4 brne .+4 ; 0x34ea8 <__fp_mintl+0x18> 34ea4: 99 27 eor r25, r25 34ea6: 0d c0 rjmp .+26 ; 0x34ec2 <__fp_mintl+0x32> 34ea8: 90 51 subi r25, 0x10 ; 16 34eaa: 86 2b or r24, r22 34eac: 70 e0 ldi r23, 0x00 ; 0 34eae: 60 e0 ldi r22, 0x00 ; 0 34eb0: 2a f0 brmi .+10 ; 0x34ebc <__fp_mintl+0x2c> 34eb2: 9a 95 dec r25 34eb4: 66 0f add r22, r22 34eb6: 77 1f adc r23, r23 34eb8: 88 1f adc r24, r24 34eba: da f7 brpl .-10 ; 0x34eb2 <__fp_mintl+0x22> 34ebc: 88 0f add r24, r24 34ebe: 96 95 lsr r25 34ec0: 87 95 ror r24 34ec2: 97 f9 bld r25, 7 34ec4: 08 95 ret 00034ec6 <__fp_mpack>: 34ec6: 9f 3f cpi r25, 0xFF ; 255 34ec8: 31 f0 breq .+12 ; 0x34ed6 <__fp_mpack_finite+0xc> 00034eca <__fp_mpack_finite>: 34eca: 91 50 subi r25, 0x01 ; 1 34ecc: 20 f4 brcc .+8 ; 0x34ed6 <__fp_mpack_finite+0xc> 34ece: 87 95 ror r24 34ed0: 77 95 ror r23 34ed2: 67 95 ror r22 34ed4: b7 95 ror r27 34ed6: 88 0f add r24, r24 34ed8: 91 1d adc r25, r1 34eda: 96 95 lsr r25 34edc: 87 95 ror r24 34ede: 97 f9 bld r25, 7 34ee0: 08 95 ret 00034ee2 <__fp_powser>: 34ee2: df 93 push r29 34ee4: cf 93 push r28 34ee6: 1f 93 push r17 34ee8: 0f 93 push r16 34eea: ff 92 push r15 34eec: ef 92 push r14 34eee: df 92 push r13 34ef0: 7b 01 movw r14, r22 34ef2: 8c 01 movw r16, r24 34ef4: 68 94 set 34ef6: 06 c0 rjmp .+12 ; 0x34f04 <__fp_powser+0x22> 34ef8: da 2e mov r13, r26 34efa: ef 01 movw r28, r30 34efc: 0f 94 1e 9f call 0x33e3c ; 0x33e3c <__mulsf3x> 34f00: fe 01 movw r30, r28 34f02: e8 94 clt 34f04: a5 91 lpm r26, Z+ 34f06: 25 91 lpm r18, Z+ 34f08: 35 91 lpm r19, Z+ 34f0a: 45 91 lpm r20, Z+ 34f0c: 55 91 lpm r21, Z+ 34f0e: a6 f3 brts .-24 ; 0x34ef8 <__fp_powser+0x16> 34f10: ef 01 movw r28, r30 34f12: 0f 94 7d a5 call 0x34afa ; 0x34afa <__addsf3x> 34f16: fe 01 movw r30, r28 34f18: 97 01 movw r18, r14 34f1a: a8 01 movw r20, r16 34f1c: da 94 dec r13 34f1e: 69 f7 brne .-38 ; 0x34efa <__fp_powser+0x18> 34f20: df 90 pop r13 34f22: ef 90 pop r14 34f24: ff 90 pop r15 34f26: 0f 91 pop r16 34f28: 1f 91 pop r17 34f2a: cf 91 pop r28 34f2c: df 91 pop r29 34f2e: 08 95 ret 34f30: 0d 94 7e 9f jmp 0x33efc ; 0x33efc <__fp_nan> 00034f34 <__fp_rempio2>: 34f34: 0f 94 a8 9f call 0x33f50 ; 0x33f50 <__fp_splitA> 34f38: d8 f3 brcs .-10 ; 0x34f30 <__fp_powser+0x4e> 34f3a: e8 94 clt 34f3c: e0 e0 ldi r30, 0x00 ; 0 34f3e: bb 27 eor r27, r27 34f40: 9f 57 subi r25, 0x7F ; 127 34f42: f0 f0 brcs .+60 ; 0x34f80 <__fp_rempio2+0x4c> 34f44: 2a ed ldi r18, 0xDA ; 218 34f46: 3f e0 ldi r19, 0x0F ; 15 34f48: 49 ec ldi r20, 0xC9 ; 201 34f4a: 06 c0 rjmp .+12 ; 0x34f58 <__fp_rempio2+0x24> 34f4c: ee 0f add r30, r30 34f4e: bb 0f add r27, r27 34f50: 66 1f adc r22, r22 34f52: 77 1f adc r23, r23 34f54: 88 1f adc r24, r24 34f56: 28 f0 brcs .+10 ; 0x34f62 <__fp_rempio2+0x2e> 34f58: b2 3a cpi r27, 0xA2 ; 162 34f5a: 62 07 cpc r22, r18 34f5c: 73 07 cpc r23, r19 34f5e: 84 07 cpc r24, r20 34f60: 28 f0 brcs .+10 ; 0x34f6c <__fp_rempio2+0x38> 34f62: b2 5a subi r27, 0xA2 ; 162 34f64: 62 0b sbc r22, r18 34f66: 73 0b sbc r23, r19 34f68: 84 0b sbc r24, r20 34f6a: e3 95 inc r30 34f6c: 9a 95 dec r25 34f6e: 72 f7 brpl .-36 ; 0x34f4c <__fp_rempio2+0x18> 34f70: 80 38 cpi r24, 0x80 ; 128 34f72: 30 f4 brcc .+12 ; 0x34f80 <__fp_rempio2+0x4c> 34f74: 9a 95 dec r25 34f76: bb 0f add r27, r27 34f78: 66 1f adc r22, r22 34f7a: 77 1f adc r23, r23 34f7c: 88 1f adc r24, r24 34f7e: d2 f7 brpl .-12 ; 0x34f74 <__fp_rempio2+0x40> 34f80: 90 48 sbci r25, 0x80 ; 128 34f82: 0d 94 65 a7 jmp 0x34eca ; 0x34eca <__fp_mpack_finite> 00034f86 <__fp_sinus>: 34f86: ef 93 push r30 34f88: e0 ff sbrs r30, 0 34f8a: 07 c0 rjmp .+14 ; 0x34f9a <__fp_sinus+0x14> 34f8c: a2 ea ldi r26, 0xA2 ; 162 34f8e: 2a ed ldi r18, 0xDA ; 218 34f90: 3f e0 ldi r19, 0x0F ; 15 34f92: 49 ec ldi r20, 0xC9 ; 201 34f94: 5f eb ldi r21, 0xBF ; 191 34f96: 0f 94 7d a5 call 0x34afa ; 0x34afa <__addsf3x> 34f9a: 0f 94 8f 9f call 0x33f1e ; 0x33f1e <__fp_round> 34f9e: 0f 90 pop r0 34fa0: 03 94 inc r0 34fa2: 01 fc sbrc r0, 1 34fa4: 90 58 subi r25, 0x80 ; 128 34fa6: e8 e8 ldi r30, 0x88 ; 136 34fa8: fd e6 ldi r31, 0x6D ; 109 34faa: 0d 94 ba a9 jmp 0x35374 ; 0x35374 <__fp_powsodd> 00034fae <__fp_trunc>: 34fae: 0f 94 a8 9f call 0x33f50 ; 0x33f50 <__fp_splitA> 34fb2: a0 f0 brcs .+40 ; 0x34fdc <__fp_trunc+0x2e> 34fb4: be e7 ldi r27, 0x7E ; 126 34fb6: b9 17 cp r27, r25 34fb8: 88 f4 brcc .+34 ; 0x34fdc <__fp_trunc+0x2e> 34fba: bb 27 eor r27, r27 34fbc: 9f 38 cpi r25, 0x8F ; 143 34fbe: 60 f4 brcc .+24 ; 0x34fd8 <__fp_trunc+0x2a> 34fc0: 16 16 cp r1, r22 34fc2: b1 1d adc r27, r1 34fc4: 67 2f mov r22, r23 34fc6: 78 2f mov r23, r24 34fc8: 88 27 eor r24, r24 34fca: 98 5f subi r25, 0xF8 ; 248 34fcc: f7 cf rjmp .-18 ; 0x34fbc <__fp_trunc+0xe> 34fce: 86 95 lsr r24 34fd0: 77 95 ror r23 34fd2: 67 95 ror r22 34fd4: b1 1d adc r27, r1 34fd6: 93 95 inc r25 34fd8: 96 39 cpi r25, 0x96 ; 150 34fda: c8 f3 brcs .-14 ; 0x34fce <__fp_trunc+0x20> 34fdc: 08 95 ret 00034fde <__gesf2>: 34fde: 0f 94 24 a7 call 0x34e48 ; 0x34e48 <__fp_cmp> 34fe2: 08 f4 brcc .+2 ; 0x34fe6 <__gesf2+0x8> 34fe4: 8f ef ldi r24, 0xFF ; 255 34fe6: 08 95 ret 34fe8: 0f 94 81 9f call 0x33f02 ; 0x33f02 <__fp_pscA> 34fec: 29 f0 breq .+10 ; 0x34ff8 <__gesf2+0x1a> 34fee: 0f 94 88 9f call 0x33f10 ; 0x33f10 <__fp_pscB> 34ff2: 11 f0 breq .+4 ; 0x34ff8 <__gesf2+0x1a> 34ff4: 0d 94 7e 9f jmp 0x33efc ; 0x33efc <__fp_nan> 34ff8: 0d 94 78 9f jmp 0x33ef0 ; 0x33ef0 <__fp_inf> 34ffc: b9 01 movw r22, r18 34ffe: ca 01 movw r24, r20 35000: 0d 94 63 a7 jmp 0x34ec6 ; 0x34ec6 <__fp_mpack> 00035004 : 35004: 9f 77 andi r25, 0x7F ; 127 35006: 5f 77 andi r21, 0x7F ; 127 35008: 0f 94 a0 9f call 0x33f40 ; 0x33f40 <__fp_split3> 3500c: 68 f3 brcs .-38 ; 0x34fe8 <__gesf2+0xa> 3500e: 99 23 and r25, r25 35010: a9 f3 breq .-22 ; 0x34ffc <__gesf2+0x1e> 35012: 55 23 and r21, r21 35014: a9 f3 breq .-22 ; 0x35000 <__gesf2+0x22> 35016: ff 27 eor r31, r31 35018: 95 17 cp r25, r21 3501a: 58 f4 brcc .+22 ; 0x35032 3501c: e5 2f mov r30, r21 3501e: e9 1b sub r30, r25 35020: ed 30 cpi r30, 0x0D ; 13 35022: 60 f7 brcc .-40 ; 0x34ffc <__gesf2+0x1e> 35024: 5e 3b cpi r21, 0xBE ; 190 35026: 10 f0 brcs .+4 ; 0x3502c 35028: f1 e4 ldi r31, 0x41 ; 65 3502a: 1c c0 rjmp .+56 ; 0x35064 3502c: 90 34 cpi r25, 0x40 ; 64 3502e: e0 f4 brcc .+56 ; 0x35068 35030: 0a c0 rjmp .+20 ; 0x35046 35032: e9 2f mov r30, r25 35034: e5 1b sub r30, r21 35036: ed 30 cpi r30, 0x0D ; 13 35038: 18 f7 brcc .-58 ; 0x35000 <__gesf2+0x22> 3503a: 9e 3b cpi r25, 0xBE ; 190 3503c: 10 f0 brcs .+4 ; 0x35042 3503e: f1 e4 ldi r31, 0x41 ; 65 35040: 11 c0 rjmp .+34 ; 0x35064 35042: 50 34 cpi r21, 0x40 ; 64 35044: 88 f4 brcc .+34 ; 0x35068 35046: f9 ea ldi r31, 0xA9 ; 169 35048: 88 23 and r24, r24 3504a: 2a f0 brmi .+10 ; 0x35056 3504c: 9a 95 dec r25 3504e: 66 0f add r22, r22 35050: 77 1f adc r23, r23 35052: 88 1f adc r24, r24 35054: da f7 brpl .-10 ; 0x3504c 35056: 44 23 and r20, r20 35058: 2a f0 brmi .+10 ; 0x35064 3505a: 5a 95 dec r21 3505c: 22 0f add r18, r18 3505e: 33 1f adc r19, r19 35060: 44 1f adc r20, r20 35062: da f7 brpl .-10 ; 0x3505a 35064: 9f 1b sub r25, r31 35066: 5f 1b sub r21, r31 35068: ff 93 push r31 3506a: 1f 93 push r17 3506c: 0f 93 push r16 3506e: ff 92 push r15 35070: ef 92 push r14 35072: 79 01 movw r14, r18 35074: 8a 01 movw r16, r20 35076: bb 27 eor r27, r27 35078: ab 2f mov r26, r27 3507a: 9b 01 movw r18, r22 3507c: ac 01 movw r20, r24 3507e: 0f 94 21 9f call 0x33e42 ; 0x33e42 <__mulsf3_pse> 35082: 97 01 movw r18, r14 35084: a8 01 movw r20, r16 35086: bf 93 push r27 35088: 7b 01 movw r14, r22 3508a: 8c 01 movw r16, r24 3508c: aa 27 eor r26, r26 3508e: ba 2f mov r27, r26 35090: b9 01 movw r22, r18 35092: ca 01 movw r24, r20 35094: 0f 94 21 9f call 0x33e42 ; 0x33e42 <__mulsf3_pse> 35098: af 91 pop r26 3509a: 97 01 movw r18, r14 3509c: a8 01 movw r20, r16 3509e: ef 90 pop r14 350a0: ff 90 pop r15 350a2: 0f 91 pop r16 350a4: 1f 91 pop r17 350a6: 0f 94 7d a5 call 0x34afa ; 0x34afa <__addsf3x> 350aa: 0f 94 8f 9f call 0x33f1e ; 0x33f1e <__fp_round> 350ae: 0f 94 34 a9 call 0x35268 ; 0x35268 350b2: 4f 91 pop r20 350b4: 40 ff sbrs r20, 0 350b6: 08 95 ret 350b8: 55 27 eor r21, r21 350ba: 47 fd sbrc r20, 7 350bc: 50 95 com r21 350be: 0d 94 6d a8 jmp 0x350da ; 0x350da 000350c2 : 350c2: 9b 01 movw r18, r22 350c4: ac 01 movw r20, r24 350c6: 60 e0 ldi r22, 0x00 ; 0 350c8: 70 e0 ldi r23, 0x00 ; 0 350ca: 80 e8 ldi r24, 0x80 ; 128 350cc: 9f e3 ldi r25, 0x3F ; 63 350ce: 0d 94 65 a6 jmp 0x34cca ; 0x34cca <__divsf3> 350d2: 0d 94 78 9f jmp 0x33ef0 ; 0x33ef0 <__fp_inf> 350d6: 0d 94 63 a7 jmp 0x34ec6 ; 0x34ec6 <__fp_mpack> 000350da : 350da: 0f 94 a8 9f call 0x33f50 ; 0x33f50 <__fp_splitA> 350de: d8 f3 brcs .-10 ; 0x350d6 350e0: 99 23 and r25, r25 350e2: c9 f3 breq .-14 ; 0x350d6 350e4: 94 0f add r25, r20 350e6: 51 1d adc r21, r1 350e8: a3 f3 brvs .-24 ; 0x350d2 350ea: 91 50 subi r25, 0x01 ; 1 350ec: 50 40 sbci r21, 0x00 ; 0 350ee: 94 f0 brlt .+36 ; 0x35114 350f0: 59 f0 breq .+22 ; 0x35108 350f2: 88 23 and r24, r24 350f4: 32 f0 brmi .+12 ; 0x35102 350f6: 66 0f add r22, r22 350f8: 77 1f adc r23, r23 350fa: 88 1f adc r24, r24 350fc: 91 50 subi r25, 0x01 ; 1 350fe: 50 40 sbci r21, 0x00 ; 0 35100: c1 f7 brne .-16 ; 0x350f2 35102: 9e 3f cpi r25, 0xFE ; 254 35104: 51 05 cpc r21, r1 35106: 2c f7 brge .-54 ; 0x350d2 35108: 88 0f add r24, r24 3510a: 91 1d adc r25, r1 3510c: 96 95 lsr r25 3510e: 87 95 ror r24 35110: 97 f9 bld r25, 7 35112: 08 95 ret 35114: 5f 3f cpi r21, 0xFF ; 255 35116: ac f0 brlt .+42 ; 0x35142 35118: 98 3e cpi r25, 0xE8 ; 232 3511a: 9c f0 brlt .+38 ; 0x35142 3511c: bb 27 eor r27, r27 3511e: 86 95 lsr r24 35120: 77 95 ror r23 35122: 67 95 ror r22 35124: b7 95 ror r27 35126: 08 f4 brcc .+2 ; 0x3512a 35128: b1 60 ori r27, 0x01 ; 1 3512a: 93 95 inc r25 3512c: c1 f7 brne .-16 ; 0x3511e 3512e: bb 0f add r27, r27 35130: 58 f7 brcc .-42 ; 0x35108 35132: 11 f4 brne .+4 ; 0x35138 35134: 60 ff sbrs r22, 0 35136: e8 cf rjmp .-48 ; 0x35108 35138: 6f 5f subi r22, 0xFF ; 255 3513a: 7f 4f sbci r23, 0xFF ; 255 3513c: 8f 4f sbci r24, 0xFF ; 255 3513e: 9f 4f sbci r25, 0xFF ; 255 35140: e3 cf rjmp .-58 ; 0x35108 35142: 0d 94 c3 9f jmp 0x33f86 ; 0x33f86 <__fp_szero> 00035146 : 35146: 0f 94 a8 9f call 0x33f50 ; 0x33f50 <__fp_splitA> 3514a: 58 f1 brcs .+86 ; 0x351a2 3514c: 9e 57 subi r25, 0x7E ; 126 3514e: 60 f1 brcs .+88 ; 0x351a8 35150: 98 51 subi r25, 0x18 ; 24 35152: a0 f0 brcs .+40 ; 0x3517c 35154: e9 f0 breq .+58 ; 0x35190 35156: 98 30 cpi r25, 0x08 ; 8 35158: 20 f5 brcc .+72 ; 0x351a2 3515a: 09 2e mov r0, r25 3515c: 99 27 eor r25, r25 3515e: 66 0f add r22, r22 35160: 77 1f adc r23, r23 35162: 88 1f adc r24, r24 35164: 99 1f adc r25, r25 35166: 0a 94 dec r0 35168: d1 f7 brne .-12 ; 0x3515e 3516a: 12 c0 rjmp .+36 ; 0x35190 3516c: 06 2e mov r0, r22 3516e: 67 2f mov r22, r23 35170: 78 2f mov r23, r24 35172: 88 27 eor r24, r24 35174: 98 5f subi r25, 0xF8 ; 248 35176: 11 f4 brne .+4 ; 0x3517c 35178: 00 0c add r0, r0 3517a: 07 c0 rjmp .+14 ; 0x3518a 3517c: 99 3f cpi r25, 0xF9 ; 249 3517e: b4 f3 brlt .-20 ; 0x3516c 35180: 86 95 lsr r24 35182: 77 95 ror r23 35184: 67 95 ror r22 35186: 93 95 inc r25 35188: d9 f7 brne .-10 ; 0x35180 3518a: 61 1d adc r22, r1 3518c: 71 1d adc r23, r1 3518e: 81 1d adc r24, r1 35190: 3e f4 brtc .+14 ; 0x351a0 35192: 90 95 com r25 35194: 80 95 com r24 35196: 70 95 com r23 35198: 61 95 neg r22 3519a: 7f 4f sbci r23, 0xFF ; 255 3519c: 8f 4f sbci r24, 0xFF ; 255 3519e: 9f 4f sbci r25, 0xFF ; 255 351a0: 08 95 ret 351a2: 68 94 set 351a4: 0d 94 c3 9f jmp 0x33f86 ; 0x33f86 <__fp_szero> 351a8: 0d 94 c2 9f jmp 0x33f84 ; 0x33f84 <__fp_zero> 000351ac : 351ac: fa 01 movw r30, r20 351ae: ee 0f add r30, r30 351b0: ff 1f adc r31, r31 351b2: 30 96 adiw r30, 0x00 ; 0 351b4: 21 05 cpc r18, r1 351b6: 31 05 cpc r19, r1 351b8: a1 f1 breq .+104 ; 0x35222 351ba: 61 15 cp r22, r1 351bc: 71 05 cpc r23, r1 351be: 61 f4 brne .+24 ; 0x351d8 351c0: 80 38 cpi r24, 0x80 ; 128 351c2: bf e3 ldi r27, 0x3F ; 63 351c4: 9b 07 cpc r25, r27 351c6: 49 f1 breq .+82 ; 0x3521a 351c8: 68 94 set 351ca: 90 38 cpi r25, 0x80 ; 128 351cc: 81 05 cpc r24, r1 351ce: 61 f0 breq .+24 ; 0x351e8 351d0: 80 38 cpi r24, 0x80 ; 128 351d2: bf ef ldi r27, 0xFF ; 255 351d4: 9b 07 cpc r25, r27 351d6: 41 f0 breq .+16 ; 0x351e8 351d8: 99 23 and r25, r25 351da: 4a f5 brpl .+82 ; 0x3522e 351dc: ff 3f cpi r31, 0xFF ; 255 351de: e1 05 cpc r30, r1 351e0: 31 05 cpc r19, r1 351e2: 21 05 cpc r18, r1 351e4: 19 f1 breq .+70 ; 0x3522c 351e6: e8 94 clt 351e8: 08 94 sec 351ea: e7 95 ror r30 351ec: d9 01 movw r26, r18 351ee: aa 23 and r26, r26 351f0: 29 f4 brne .+10 ; 0x351fc 351f2: ab 2f mov r26, r27 351f4: be 2f mov r27, r30 351f6: f8 5f subi r31, 0xF8 ; 248 351f8: d0 f3 brcs .-12 ; 0x351ee 351fa: 10 c0 rjmp .+32 ; 0x3521c 351fc: ff 5f subi r31, 0xFF ; 255 351fe: 70 f4 brcc .+28 ; 0x3521c 35200: a6 95 lsr r26 35202: e0 f7 brcc .-8 ; 0x351fc 35204: f7 39 cpi r31, 0x97 ; 151 35206: 50 f0 brcs .+20 ; 0x3521c 35208: 19 f0 breq .+6 ; 0x35210 3520a: ff 3a cpi r31, 0xAF ; 175 3520c: 38 f4 brcc .+14 ; 0x3521c 3520e: 9f 77 andi r25, 0x7F ; 127 35210: 9f 93 push r25 35212: 0d d0 rcall .+26 ; 0x3522e 35214: 0f 90 pop r0 35216: 07 fc sbrc r0, 7 35218: 90 58 subi r25, 0x80 ; 128 3521a: 08 95 ret 3521c: 46 f0 brts .+16 ; 0x3522e 3521e: 0d 94 7e 9f jmp 0x33efc ; 0x33efc <__fp_nan> 35222: 60 e0 ldi r22, 0x00 ; 0 35224: 70 e0 ldi r23, 0x00 ; 0 35226: 80 e8 ldi r24, 0x80 ; 128 35228: 9f e3 ldi r25, 0x3F ; 63 3522a: 08 95 ret 3522c: 4f e7 ldi r20, 0x7F ; 127 3522e: 9f 77 andi r25, 0x7F ; 127 35230: 5f 93 push r21 35232: 4f 93 push r20 35234: 3f 93 push r19 35236: 2f 93 push r18 35238: 0f 94 d6 a9 call 0x353ac ; 0x353ac 3523c: 2f 91 pop r18 3523e: 3f 91 pop r19 35240: 4f 91 pop r20 35242: 5f 91 pop r21 35244: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 35248: 0d 94 81 a9 jmp 0x35302 ; 0x35302 0003524c : 3524c: 9f 93 push r25 3524e: 0f 94 9a a7 call 0x34f34 ; 0x34f34 <__fp_rempio2> 35252: 0f 90 pop r0 35254: 07 fc sbrc r0, 7 35256: ee 5f subi r30, 0xFE ; 254 35258: 0d 94 c3 a7 jmp 0x34f86 ; 0x34f86 <__fp_sinus> 3525c: 19 f4 brne .+6 ; 0x35264 3525e: 16 f4 brtc .+4 ; 0x35264 35260: 0d 94 7e 9f jmp 0x33efc ; 0x33efc <__fp_nan> 35264: 0d 94 63 a7 jmp 0x34ec6 ; 0x34ec6 <__fp_mpack> 00035268 : 35268: 0f 94 a8 9f call 0x33f50 ; 0x33f50 <__fp_splitA> 3526c: b8 f3 brcs .-18 ; 0x3525c 3526e: 99 23 and r25, r25 35270: c9 f3 breq .-14 ; 0x35264 35272: b6 f3 brts .-20 ; 0x35260 35274: 9f 57 subi r25, 0x7F ; 127 35276: 55 0b sbc r21, r21 35278: 87 ff sbrs r24, 7 3527a: 0f 94 b3 a9 call 0x35366 ; 0x35366 <__fp_norm2> 3527e: 00 24 eor r0, r0 35280: a0 e6 ldi r26, 0x60 ; 96 35282: 40 ea ldi r20, 0xA0 ; 160 35284: 90 01 movw r18, r0 35286: 80 58 subi r24, 0x80 ; 128 35288: 56 95 lsr r21 3528a: 97 95 ror r25 3528c: 28 f4 brcc .+10 ; 0x35298 3528e: 80 5c subi r24, 0xC0 ; 192 35290: 66 0f add r22, r22 35292: 77 1f adc r23, r23 35294: 88 1f adc r24, r24 35296: 20 f0 brcs .+8 ; 0x352a0 35298: 26 17 cp r18, r22 3529a: 37 07 cpc r19, r23 3529c: 48 07 cpc r20, r24 3529e: 30 f4 brcc .+12 ; 0x352ac 352a0: 62 1b sub r22, r18 352a2: 73 0b sbc r23, r19 352a4: 84 0b sbc r24, r20 352a6: 20 29 or r18, r0 352a8: 31 29 or r19, r1 352aa: 4a 2b or r20, r26 352ac: a6 95 lsr r26 352ae: 17 94 ror r1 352b0: 07 94 ror r0 352b2: 20 25 eor r18, r0 352b4: 31 25 eor r19, r1 352b6: 4a 27 eor r20, r26 352b8: 58 f7 brcc .-42 ; 0x35290 352ba: 66 0f add r22, r22 352bc: 77 1f adc r23, r23 352be: 88 1f adc r24, r24 352c0: 20 f0 brcs .+8 ; 0x352ca 352c2: 26 17 cp r18, r22 352c4: 37 07 cpc r19, r23 352c6: 48 07 cpc r20, r24 352c8: 30 f4 brcc .+12 ; 0x352d6 352ca: 62 0b sbc r22, r18 352cc: 73 0b sbc r23, r19 352ce: 84 0b sbc r24, r20 352d0: 20 0d add r18, r0 352d2: 31 1d adc r19, r1 352d4: 41 1d adc r20, r1 352d6: a0 95 com r26 352d8: 81 f7 brne .-32 ; 0x352ba 352da: b9 01 movw r22, r18 352dc: 84 2f mov r24, r20 352de: 91 58 subi r25, 0x81 ; 129 352e0: 88 0f add r24, r24 352e2: 96 95 lsr r25 352e4: 87 95 ror r24 352e6: 08 95 ret 000352e8 <__unordsf2>: 352e8: 0f 94 24 a7 call 0x34e48 ; 0x34e48 <__fp_cmp> 352ec: 88 0b sbc r24, r24 352ee: 99 0b sbc r25, r25 352f0: 08 95 ret 352f2: 29 f4 brne .+10 ; 0x352fe <__unordsf2+0x16> 352f4: 16 f0 brts .+4 ; 0x352fa <__unordsf2+0x12> 352f6: 0d 94 78 9f jmp 0x33ef0 ; 0x33ef0 <__fp_inf> 352fa: 0d 94 c2 9f jmp 0x33f84 ; 0x33f84 <__fp_zero> 352fe: 0d 94 7e 9f jmp 0x33efc ; 0x33efc <__fp_nan> 00035302 : 35302: 0f 94 a8 9f call 0x33f50 ; 0x33f50 <__fp_splitA> 35306: a8 f3 brcs .-22 ; 0x352f2 <__unordsf2+0xa> 35308: 96 38 cpi r25, 0x86 ; 134 3530a: a0 f7 brcc .-24 ; 0x352f4 <__unordsf2+0xc> 3530c: 07 f8 bld r0, 7 3530e: 0f 92 push r0 35310: e8 94 clt 35312: 2b e3 ldi r18, 0x3B ; 59 35314: 3a ea ldi r19, 0xAA ; 170 35316: 48 eb ldi r20, 0xB8 ; 184 35318: 5f e7 ldi r21, 0x7F ; 127 3531a: 0f 94 21 9f call 0x33e42 ; 0x33e42 <__mulsf3_pse> 3531e: 0f 92 push r0 35320: 0f 92 push r0 35322: 0f 92 push r0 35324: 4d b7 in r20, 0x3d ; 61 35326: 5e b7 in r21, 0x3e ; 62 35328: 0f 92 push r0 3532a: 0f 94 1e aa call 0x3543c ; 0x3543c 3532e: e6 ea ldi r30, 0xA6 ; 166 35330: fd e6 ldi r31, 0x6D ; 109 35332: 0f 94 71 a7 call 0x34ee2 ; 0x34ee2 <__fp_powser> 35336: 4f 91 pop r20 35338: 5f 91 pop r21 3533a: ef 91 pop r30 3533c: ff 91 pop r31 3533e: e5 95 asr r30 35340: ee 1f adc r30, r30 35342: ff 1f adc r31, r31 35344: 49 f0 breq .+18 ; 0x35358 35346: fe 57 subi r31, 0x7E ; 126 35348: e0 68 ori r30, 0x80 ; 128 3534a: 44 27 eor r20, r20 3534c: ee 0f add r30, r30 3534e: 44 1f adc r20, r20 35350: fa 95 dec r31 35352: e1 f7 brne .-8 ; 0x3534c 35354: 41 95 neg r20 35356: 55 0b sbc r21, r21 35358: 0f 94 6d a8 call 0x350da ; 0x350da 3535c: 0f 90 pop r0 3535e: 07 fe sbrs r0, 7 35360: 0d 94 61 a8 jmp 0x350c2 ; 0x350c2 35364: 08 95 ret 00035366 <__fp_norm2>: 35366: 91 50 subi r25, 0x01 ; 1 35368: 50 40 sbci r21, 0x00 ; 0 3536a: 66 0f add r22, r22 3536c: 77 1f adc r23, r23 3536e: 88 1f adc r24, r24 35370: d2 f7 brpl .-12 ; 0x35366 <__fp_norm2> 35372: 08 95 ret 00035374 <__fp_powsodd>: 35374: 9f 93 push r25 35376: 8f 93 push r24 35378: 7f 93 push r23 3537a: 6f 93 push r22 3537c: ff 93 push r31 3537e: ef 93 push r30 35380: 9b 01 movw r18, r22 35382: ac 01 movw r20, r24 35384: 0f 94 0b 9f call 0x33e16 ; 0x33e16 <__mulsf3> 35388: ef 91 pop r30 3538a: ff 91 pop r31 3538c: 0f 94 71 a7 call 0x34ee2 ; 0x34ee2 <__fp_powser> 35390: 2f 91 pop r18 35392: 3f 91 pop r19 35394: 4f 91 pop r20 35396: 5f 91 pop r21 35398: 0d 94 0b 9f jmp 0x33e16 ; 0x33e16 <__mulsf3> 3539c: 16 f0 brts .+4 ; 0x353a2 <__fp_powsodd+0x2e> 3539e: 0d 94 63 a7 jmp 0x34ec6 ; 0x34ec6 <__fp_mpack> 353a2: 0d 94 7e 9f jmp 0x33efc ; 0x33efc <__fp_nan> 353a6: 68 94 set 353a8: 0d 94 78 9f jmp 0x33ef0 ; 0x33ef0 <__fp_inf> 000353ac : 353ac: 0f 94 a8 9f call 0x33f50 ; 0x33f50 <__fp_splitA> 353b0: a8 f3 brcs .-22 ; 0x3539c <__fp_powsodd+0x28> 353b2: 99 23 and r25, r25 353b4: c1 f3 breq .-16 ; 0x353a6 <__fp_powsodd+0x32> 353b6: ae f3 brts .-22 ; 0x353a2 <__fp_powsodd+0x2e> 353b8: df 93 push r29 353ba: cf 93 push r28 353bc: 1f 93 push r17 353be: 0f 93 push r16 353c0: ff 92 push r15 353c2: c9 2f mov r28, r25 353c4: dd 27 eor r29, r29 353c6: 88 23 and r24, r24 353c8: 2a f0 brmi .+10 ; 0x353d4 353ca: 21 97 sbiw r28, 0x01 ; 1 353cc: 66 0f add r22, r22 353ce: 77 1f adc r23, r23 353d0: 88 1f adc r24, r24 353d2: da f7 brpl .-10 ; 0x353ca 353d4: 20 e0 ldi r18, 0x00 ; 0 353d6: 30 e0 ldi r19, 0x00 ; 0 353d8: 40 e8 ldi r20, 0x80 ; 128 353da: 5f eb ldi r21, 0xBF ; 191 353dc: 9f e3 ldi r25, 0x3F ; 63 353de: 88 39 cpi r24, 0x98 ; 152 353e0: 20 f0 brcs .+8 ; 0x353ea 353e2: 80 3e cpi r24, 0xE0 ; 224 353e4: 38 f0 brcs .+14 ; 0x353f4 353e6: 21 96 adiw r28, 0x01 ; 1 353e8: 8f 77 andi r24, 0x7F ; 127 353ea: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 353ee: ee ec ldi r30, 0xCE ; 206 353f0: fd e6 ldi r31, 0x6D ; 109 353f2: 04 c0 rjmp .+8 ; 0x353fc 353f4: 0f 94 66 a5 call 0x34acc ; 0x34acc <__addsf3> 353f8: eb ef ldi r30, 0xFB ; 251 353fa: fd e6 ldi r31, 0x6D ; 109 353fc: 0f 94 71 a7 call 0x34ee2 ; 0x34ee2 <__fp_powser> 35400: 8b 01 movw r16, r22 35402: be 01 movw r22, r28 35404: ec 01 movw r28, r24 35406: fb 2e mov r15, r27 35408: 6f 57 subi r22, 0x7F ; 127 3540a: 71 09 sbc r23, r1 3540c: 75 95 asr r23 3540e: 77 1f adc r23, r23 35410: 88 0b sbc r24, r24 35412: 99 0b sbc r25, r25 35414: 0f 94 cc 9e call 0x33d98 ; 0x33d98 <__floatsisf> 35418: 28 e1 ldi r18, 0x18 ; 24 3541a: 32 e7 ldi r19, 0x72 ; 114 3541c: 41 e3 ldi r20, 0x31 ; 49 3541e: 5f e3 ldi r21, 0x3F ; 63 35420: 0f 94 1e 9f call 0x33e3c ; 0x33e3c <__mulsf3x> 35424: af 2d mov r26, r15 35426: 98 01 movw r18, r16 35428: ae 01 movw r20, r28 3542a: ff 90 pop r15 3542c: 0f 91 pop r16 3542e: 1f 91 pop r17 35430: cf 91 pop r28 35432: df 91 pop r29 35434: 0f 94 7d a5 call 0x34afa ; 0x34afa <__addsf3x> 35438: 0d 94 8f 9f jmp 0x33f1e ; 0x33f1e <__fp_round> 0003543c : 3543c: fa 01 movw r30, r20 3543e: dc 01 movw r26, r24 35440: aa 0f add r26, r26 35442: bb 1f adc r27, r27 35444: 9b 01 movw r18, r22 35446: ac 01 movw r20, r24 35448: bf 57 subi r27, 0x7F ; 127 3544a: 28 f4 brcc .+10 ; 0x35456 3544c: 22 27 eor r18, r18 3544e: 33 27 eor r19, r19 35450: 44 27 eor r20, r20 35452: 50 78 andi r21, 0x80 ; 128 35454: 20 c0 rjmp .+64 ; 0x35496 35456: b7 51 subi r27, 0x17 ; 23 35458: 90 f4 brcc .+36 ; 0x3547e 3545a: ab 2f mov r26, r27 3545c: 00 24 eor r0, r0 3545e: 46 95 lsr r20 35460: 37 95 ror r19 35462: 27 95 ror r18 35464: 01 1c adc r0, r1 35466: a3 95 inc r26 35468: d2 f3 brmi .-12 ; 0x3545e 3546a: 00 20 and r0, r0 3546c: 71 f0 breq .+28 ; 0x3548a 3546e: 22 0f add r18, r18 35470: 33 1f adc r19, r19 35472: 44 1f adc r20, r20 35474: b3 95 inc r27 35476: da f3 brmi .-10 ; 0x3546e 35478: 0e d0 rcall .+28 ; 0x35496 3547a: 0d 94 65 a5 jmp 0x34aca ; 0x34aca <__subsf3> 3547e: 61 30 cpi r22, 0x01 ; 1 35480: 71 05 cpc r23, r1 35482: a0 e8 ldi r26, 0x80 ; 128 35484: 8a 07 cpc r24, r26 35486: b9 46 sbci r27, 0x69 ; 105 35488: 30 f4 brcc .+12 ; 0x35496 3548a: 9b 01 movw r18, r22 3548c: ac 01 movw r20, r24 3548e: 66 27 eor r22, r22 35490: 77 27 eor r23, r23 35492: 88 27 eor r24, r24 35494: 90 78 andi r25, 0x80 ; 128 35496: 30 96 adiw r30, 0x00 ; 0 35498: 21 f0 breq .+8 ; 0x354a2 3549a: 20 83 st Z, r18 3549c: 31 83 std Z+1, r19 ; 0x01 3549e: 42 83 std Z+2, r20 ; 0x02 354a0: 53 83 std Z+3, r21 ; 0x03 354a2: 08 95 ret 000354a4 : 354a4: 91 11 cpse r25, r1 354a6: 08 95 ret 354a8: 81 54 subi r24, 0x41 ; 65 354aa: 8a 51 subi r24, 0x1A ; 26 354ac: 08 f4 brcc .+2 ; 0x354b0 354ae: 80 5e subi r24, 0xE0 ; 224 354b0: 85 5a subi r24, 0xA5 ; 165 354b2: 08 95 ret 000354b4 : 354b4: fb 01 movw r30, r22 354b6: dc 01 movw r26, r24 354b8: 04 c0 rjmp .+8 ; 0x354c2 354ba: 8d 91 ld r24, X+ 354bc: 01 90 ld r0, Z+ 354be: 80 19 sub r24, r0 354c0: 21 f4 brne .+8 ; 0x354ca 354c2: 41 50 subi r20, 0x01 ; 1 354c4: 50 40 sbci r21, 0x00 ; 0 354c6: c8 f7 brcc .-14 ; 0x354ba 354c8: 88 1b sub r24, r24 354ca: 99 0b sbc r25, r25 354cc: 08 95 ret 000354ce : 354ce: fb 01 movw r30, r22 354d0: dc 01 movw r26, r24 354d2: 02 c0 rjmp .+4 ; 0x354d8 354d4: 01 90 ld r0, Z+ 354d6: 0d 92 st X+, r0 354d8: 41 50 subi r20, 0x01 ; 1 354da: 50 40 sbci r21, 0x00 ; 0 354dc: d8 f7 brcc .-10 ; 0x354d4 354de: 08 95 ret 000354e0 : 354e0: dc 01 movw r26, r24 354e2: 01 c0 rjmp .+2 ; 0x354e6 354e4: 6d 93 st X+, r22 354e6: 41 50 subi r20, 0x01 ; 1 354e8: 50 40 sbci r21, 0x00 ; 0 354ea: e0 f7 brcc .-8 ; 0x354e4 354ec: 08 95 ret 000354ee : 354ee: fb 01 movw r30, r22 354f0: dc 01 movw r26, r24 354f2: 8d 91 ld r24, X+ 354f4: 81 34 cpi r24, 0x41 ; 65 354f6: 1c f0 brlt .+6 ; 0x354fe 354f8: 8b 35 cpi r24, 0x5B ; 91 354fa: 0c f4 brge .+2 ; 0x354fe 354fc: 80 5e subi r24, 0xE0 ; 224 354fe: 61 91 ld r22, Z+ 35500: 61 34 cpi r22, 0x41 ; 65 35502: 1c f0 brlt .+6 ; 0x3550a 35504: 6b 35 cpi r22, 0x5B ; 91 35506: 0c f4 brge .+2 ; 0x3550a 35508: 60 5e subi r22, 0xE0 ; 224 3550a: 86 1b sub r24, r22 3550c: 61 11 cpse r22, r1 3550e: 89 f3 breq .-30 ; 0x354f2 35510: 99 0b sbc r25, r25 35512: 08 95 ret 00035514 : 35514: fb 01 movw r30, r22 35516: dc 01 movw r26, r24 35518: 0d 90 ld r0, X+ 3551a: 00 20 and r0, r0 3551c: e9 f7 brne .-6 ; 0x35518 3551e: 11 97 sbiw r26, 0x01 ; 1 35520: 01 90 ld r0, Z+ 35522: 0d 92 st X+, r0 35524: 00 20 and r0, r0 35526: e1 f7 brne .-8 ; 0x35520 35528: 08 95 ret 0003552a : 3552a: fc 01 movw r30, r24 3552c: 81 91 ld r24, Z+ 3552e: 86 17 cp r24, r22 35530: 21 f0 breq .+8 ; 0x3553a 35532: 88 23 and r24, r24 35534: d9 f7 brne .-10 ; 0x3552c 35536: 99 27 eor r25, r25 35538: 08 95 ret 3553a: 31 97 sbiw r30, 0x01 ; 1 3553c: cf 01 movw r24, r30 3553e: 08 95 ret 00035540 : 35540: fb 01 movw r30, r22 35542: dc 01 movw r26, r24 35544: 8d 91 ld r24, X+ 35546: 01 90 ld r0, Z+ 35548: 80 19 sub r24, r0 3554a: 01 10 cpse r0, r1 3554c: d9 f3 breq .-10 ; 0x35544 3554e: 99 0b sbc r25, r25 35550: 08 95 ret 00035552 : 35552: fb 01 movw r30, r22 35554: dc 01 movw r26, r24 35556: 01 90 ld r0, Z+ 35558: 0d 92 st X+, r0 3555a: 00 20 and r0, r0 3555c: e1 f7 brne .-8 ; 0x35556 3555e: 08 95 ret 00035560 : 35560: fb 01 movw r30, r22 35562: dc 01 movw r26, r24 35564: 41 50 subi r20, 0x01 ; 1 35566: 50 40 sbci r21, 0x00 ; 0 35568: 30 f0 brcs .+12 ; 0x35576 3556a: 8d 91 ld r24, X+ 3556c: 01 90 ld r0, Z+ 3556e: 80 19 sub r24, r0 35570: 19 f4 brne .+6 ; 0x35578 35572: 00 20 and r0, r0 35574: b9 f7 brne .-18 ; 0x35564 35576: 88 1b sub r24, r24 35578: 99 0b sbc r25, r25 3557a: 08 95 ret 0003557c : 3557c: fb 01 movw r30, r22 3557e: dc 01 movw r26, r24 35580: 41 50 subi r20, 0x01 ; 1 35582: 50 40 sbci r21, 0x00 ; 0 35584: 48 f0 brcs .+18 ; 0x35598 35586: 01 90 ld r0, Z+ 35588: 0d 92 st X+, r0 3558a: 00 20 and r0, r0 3558c: c9 f7 brne .-14 ; 0x35580 3558e: 01 c0 rjmp .+2 ; 0x35592 35590: 1d 92 st X+, r1 35592: 41 50 subi r20, 0x01 ; 1 35594: 50 40 sbci r21, 0x00 ; 0 35596: e0 f7 brcc .-8 ; 0x35590 35598: 08 95 ret 0003559a : 3559a: 0f 93 push r16 3559c: 1f 93 push r17 3559e: cf 93 push r28 355a0: df 93 push r29 355a2: e0 91 13 17 lds r30, 0x1713 ; 0x801713 <__iob+0x2> 355a6: f0 91 14 17 lds r31, 0x1714 ; 0x801714 <__iob+0x3> 355aa: 23 81 ldd r18, Z+3 ; 0x03 355ac: ec 01 movw r28, r24 355ae: 10 e0 ldi r17, 0x00 ; 0 355b0: 00 e0 ldi r16, 0x00 ; 0 355b2: 21 fd sbrc r18, 1 355b4: 08 c0 rjmp .+16 ; 0x355c6 355b6: 0f ef ldi r16, 0xFF ; 255 355b8: 1f ef ldi r17, 0xFF ; 255 355ba: 14 c0 rjmp .+40 ; 0x355e4 355bc: 19 95 eicall 355be: 89 2b or r24, r25 355c0: 11 f0 breq .+4 ; 0x355c6 355c2: 0f ef ldi r16, 0xFF ; 255 355c4: 1f ef ldi r17, 0xFF ; 255 355c6: 89 91 ld r24, Y+ 355c8: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 355cc: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 355d0: db 01 movw r26, r22 355d2: 18 96 adiw r26, 0x08 ; 8 355d4: ed 91 ld r30, X+ 355d6: fc 91 ld r31, X 355d8: 81 11 cpse r24, r1 355da: f0 cf rjmp .-32 ; 0x355bc 355dc: 8a e0 ldi r24, 0x0A ; 10 355de: 19 95 eicall 355e0: 89 2b or r24, r25 355e2: 49 f7 brne .-46 ; 0x355b6 355e4: c8 01 movw r24, r16 355e6: df 91 pop r29 355e8: cf 91 pop r28 355ea: 1f 91 pop r17 355ec: 0f 91 pop r16 355ee: 08 95 ret 000355f0 <__do_global_dtors>: 355f0: 11 e5 ldi r17, 0x51 ; 81 355f2: ce e7 ldi r28, 0x7E ; 126 355f4: d1 e5 ldi r29, 0x51 ; 81 355f6: 00 e0 ldi r16, 0x00 ; 0 355f8: 06 c0 rjmp .+12 ; 0x35606 <__do_global_dtors+0x16> 355fa: 80 2f mov r24, r16 355fc: fe 01 movw r30, r28 355fe: 0f 94 4e a5 call 0x34a9c ; 0x34a9c <__tablejump2__> 35602: 21 96 adiw r28, 0x01 ; 1 35604: 01 1d adc r16, r1 35606: cf 37 cpi r28, 0x7F ; 127 35608: d1 07 cpc r29, r17 3560a: 80 e0 ldi r24, 0x00 ; 0 3560c: 08 07 cpc r16, r24 3560e: a9 f7 brne .-22 ; 0x355fa <__do_global_dtors+0xa> 35610: f8 94 cli 00035612 <__stop_program>: 35612: ff cf rjmp .-2 ; 0x35612 <__stop_program>